umalloc: switch to per-process umalloc trees
This commit is contained in:
parent
f4b8c78d06
commit
13eb79ca26
1 changed files with 2 additions and 2 deletions
|
|
@ -303,7 +303,7 @@ void kfree(void *ptr)
|
||||||
|
|
||||||
void ufree(struct proc *proc, void *addr)
|
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) {
|
if (n == NULL) {
|
||||||
kprintf(LOG_ERROR "umalloc: invalid free: %X\n", addr);
|
kprintf(LOG_ERROR "umalloc: invalid free: %X\n", addr);
|
||||||
panic();
|
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;
|
n->value = (uint64_t)a;
|
||||||
|
|
||||||
return (void *)vaddr;
|
return (void *)vaddr;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue