diff options
author | Anton Kling <anton@kling.gg> | 2024-10-14 21:43:20 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-10-14 21:43:20 +0200 |
commit | 8913568be10385abdba07285162506a36827e16e (patch) | |
tree | 50ab2114680baf0395d6682e72a595c6d9aa9587 /kernel/kmalloc.c | |
parent | 87af93c7521be331a5794c6a53f31d13b3a24baa (diff) |
kernel: small bug fixes
Diffstat (limited to 'kernel/kmalloc.c')
-rw-r--r-- | kernel/kmalloc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/kmalloc.c b/kernel/kmalloc.c index f5188cc..19ed252 100644 --- a/kernel/kmalloc.c +++ b/kernel/kmalloc.c @@ -242,8 +242,7 @@ void kfree(void *p) { if (!p) { return; } - // FIXME: This assumes that p is at the start of a allocated area. - // Could this be avoided in a simple way? + MallocHeader *h = (MallocHeader *)((uintptr_t)p - sizeof(MallocHeader)); assert(h->magic == 0xdde51ab9410268b1); assert(!(h->flags & IS_FREE)); |