diff options
author | Ian Moffett <ian@osmora.org> | 2025-08-20 22:46:17 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-08-20 22:46:17 -0400 |
commit | 8fe8b0798f40786c156e245ce89749acda401273 (patch) | |
tree | 35a5bcbaddb1ed9dff8d7c3f74ef99ab3caadf87 /sys/vm | |
parent | 6f0266b77d44edd22ca19adb5cb56ef79d33d94f (diff) |
kernel: physmem: Panic when out of memory
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_physmem.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/vm/vm_physmem.c b/sys/vm/vm_physmem.c index f8caf9a..0bd2d54 100644 --- a/sys/vm/vm_physmem.c +++ b/sys/vm/vm_physmem.c @@ -32,6 +32,7 @@ #include <sys/limine.h> #include <sys/syslog.h> #include <sys/spinlock.h> +#include <sys/panic.h> #include <vm/physmem.h> #include <vm/vm.h> #include <string.h> @@ -194,6 +195,10 @@ vm_alloc_frame(size_t count) ret = __vm_alloc_frame(count); } + if (ret == 0) { + panic("out of memory\n"); + } + pages_used += count; pages_free -= count; spinlock_release(&lock); |