From 097c2758fc7353c4b31f7794c6b6fff49a4e78e5 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 25 Sep 2009 14:12:31 +0800 Subject: [PATCH] Added return address to malloc's debug --- Kernel/heap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Kernel/heap.c b/Kernel/heap.c index 68239187..30c812e4 100644 --- a/Kernel/heap.c +++ b/Kernel/heap.c @@ -175,7 +175,7 @@ void *malloc(size_t Bytes) if(head->Size == Bytes) { head->Magic = MAGIC_USED; RELEASE(&giHeapSpinlock); // Release spinlock - LOG("RETURN %p", best->Data); + LOG("RETURN %p, to %p", best->Data, __builtin_return_address(0)); return best->Data; } @@ -205,7 +205,7 @@ void *malloc(size_t Bytes) // Check size if(best->Size == Bytes) { RELEASE(&giHeapSpinlock); // Release spinlock - LOG("RETURN %p", best->Data); + LOG("RETURN %p, to %p", best->Data, __builtin_return_address(0)); return best->Data; } } @@ -224,7 +224,7 @@ void *malloc(size_t Bytes) best->Magic = MAGIC_USED; // Mark block as used RELEASE(&giHeapSpinlock); // Release spinlock - LOG("RETURN %p", best->Data); + LOG("RETURN %p, to %p", best->Data, __builtin_return_address(0)); return best->Data; } -- 2.20.1