From: John Hodge Date: Sun, 5 Jun 2011 16:20:33 +0000 (+0800) Subject: Kernel - Fixed heap debug issue with valid side not being set X-Git-Tag: rel0.10~78 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=27ce0bfc1541e3a2b976c89174e1443a099f3215;p=tpg%2Facess2.git Kernel - Fixed heap debug issue with valid side not being set --- 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));