From 13eb79ca26609c900e2de1910f2989c316f7f088 Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Wed, 12 Feb 2025 17:31:10 -0500 Subject: [PATCH] umalloc: switch to per-process umalloc trees --- mem/slab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mem/slab.c b/mem/slab.c index af61500..550cfdb 100644 --- a/mem/slab.c +++ b/mem/slab.c @@ -303,7 +303,7 @@ void kfree(void *ptr) void ufree(struct proc *proc, void *addr) { - struct rbnode *n = rbt_search(&umalloc_tree, (uint64_t)addr); + struct rbnode *n = rbt_search(&proc->umalloc_tree, (uint64_t)addr); if (n == NULL) { kprintf(LOG_ERROR "umalloc: invalid free: %X\n", addr); panic(); @@ -432,7 +432,7 @@ void *umalloc(struct proc *proc, size_t size, uint64_t opts) } } - struct rbnode *n = rbt_insert(&umalloc_tree, (uint64_t)vaddr); + struct rbnode *n = rbt_insert(&proc->umalloc_tree, (uint64_t)vaddr); n->value = (uint64_t)a; return (void *)vaddr;