diff options
author | Zachary Yedidia <zyedidia@gmail.com> | 2022-05-12 18:25:11 -0700 |
---|---|---|
committer | Zachary Yedidia <zyedidia@gmail.com> | 2022-05-12 18:25:11 -0700 |
commit | cfd1b10ac0a2568bfa354d25ccbf700d391ecc90 (patch) | |
tree | 252713b085e69902d3255345d9a356a6902a859a | |
parent | b361528d63f3e0d1fbdebe6bdc472c6884492e04 (diff) |
Coalesce pages before heap
-rw-r--r-- | kern/kmalloc.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/kern/kmalloc.c b/kern/kmalloc.c index ceff068..3e27cb9 100644 --- a/kern/kmalloc.c +++ b/kern/kmalloc.c @@ -83,11 +83,7 @@ void kmalloc_init() { uintptr_t heap_start = ka2pa((uintptr_t) &_kheap_start); for (uintptr_t pa = 0; pa < MEMSIZE_PHYSICAL; pa += PAGESIZE) { uintptr_t pn = pagenum(pa); - if (pa < heap_start) { - pages[pn].order = MIN_ORDER; - continue; - } - pages[pn].free = true; + pages[pn].free = pa >= heap_start; pages[pn].order = MIN_ORDER; unsigned order = pages[pn].order; |