From 27ce0bfc1541e3a2b976c89174e1443a099f3215 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 6 Jun 2011 00:20:33 +0800 Subject: [PATCH] Kernel - Fixed heap debug issue with valid side not being set --- Kernel/heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kernel/heap.c b/Kernel/heap.c index ea32436a..262053b0 100644 --- a/Kernel/heap.c +++ b/Kernel/heap.c @@ -211,6 +211,7 @@ void *Heap_Allocate(const char *File, int Line, size_t __Bytes) head->Magic = MAGIC_USED; head->File = File; head->Line = Line; + head->ValidSize = __Bytes; Mutex_Release(&glHeap); // Release spinlock #if DEBUG_TRACE Log("[Heap ] Malloc'd %p (%i bytes), returning to %p", head->Data, head->Size, __builtin_return_address(0)); @@ -246,6 +247,7 @@ void *Heap_Allocate(const char *File, int Line, size_t __Bytes) best->Magic = MAGIC_USED; // Mark block as used best->File = File; best->Line = Line; + head->ValidSize = __Bytes; Mutex_Release(&glHeap); // Release spinlock #if DEBUG_TRACE Log("[Heap ] Malloc'd %p (%i bytes), returning to %p", best->Data, best->Size, __builtin_return_address(0)); -- 2.20.1