summaryrefslogtreecommitdiff
path: root/kernel/kmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kmalloc.c')
-rw-r--r--kernel/kmalloc.c3
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));