diff options
author | Ian McFarlane <i.mcfarlane2002@gmail.com> | 2025-04-25 12:16:00 -0400 |
---|---|---|
committer | Ian McFarlane <i.mcfarlane2002@gmail.com> | 2025-04-25 12:16:00 -0400 |
commit | 85450e3bf3e93a5bbd523993f7ad60b331545e3c (patch) | |
tree | e90cfaaa9fcd0b6fadfbe909da259341d003c1f0 /kernel/memory/physalloc.c | |
parent | fixed segfault caused by mapping the wrong virtual address in mem_alloc_pages_at (diff) | |
download | comus-85450e3bf3e93a5bbd523993f7ad60b331545e3c.tar.gz comus-85450e3bf3e93a5bbd523993f7ad60b331545e3c.tar.bz2 comus-85450e3bf3e93a5bbd523993f7ad60b331545e3c.zip |
added assert that bump allocator is only being asked for one page at a time
Diffstat (limited to 'kernel/memory/physalloc.c')
-rw-r--r-- | kernel/memory/physalloc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/memory/physalloc.c b/kernel/memory/physalloc.c index 9fcbe8f..01464ee 100644 --- a/kernel/memory/physalloc.c +++ b/kernel/memory/physalloc.c @@ -88,6 +88,7 @@ void *alloc_phys_pages_exact(size_t pages) if (bitmap == NULL || page_start == NULL) { // temporary bump allocator void *addr = (void *)memory_start; + assert(pages == 1, "caller expects more pages, but is only getting one"); memory_start += PAGE_SIZE; return addr; } |