summaryrefslogtreecommitdiff
path: root/kernel/memory/physalloc.c
diff options
context:
space:
mode:
authorIan McFarlane <i.mcfarlane2002@gmail.com>2025-04-25 12:16:00 -0400
committerIan McFarlane <i.mcfarlane2002@gmail.com>2025-04-25 12:16:00 -0400
commit85450e3bf3e93a5bbd523993f7ad60b331545e3c (patch)
treee90cfaaa9fcd0b6fadfbe909da259341d003c1f0 /kernel/memory/physalloc.c
parentfixed segfault caused by mapping the wrong virtual address in mem_alloc_pages_at (diff)
downloadcomus-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 '')
-rw-r--r--kernel/memory/physalloc.c1
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;
}