summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Yedidia <zyedidia@gmail.com>2022-05-12 18:25:11 -0700
committerZachary Yedidia <zyedidia@gmail.com>2022-05-12 18:25:11 -0700
commitcfd1b10ac0a2568bfa354d25ccbf700d391ecc90 (patch)
tree252713b085e69902d3255345d9a356a6902a859a
parentb361528d63f3e0d1fbdebe6bdc472c6884492e04 (diff)
Coalesce pages before heap
-rw-r--r--kern/kmalloc.c6
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;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback