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));
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));
// Print the block info?
#if 1
- Log_Debug("Heap", "%p (0x%x) - 0x%x (%i) Owned by %s:%i",
- head->Data, MM_GetPhysAddr((tVAddr)&head->Data), head->Size, head->ValidSize, head->File, head->Line);
+ if( head->Magic == MAGIC_FREE )
+ Log_Debug("Heap", "%p (0x%llx) - 0x%x free",
+ head->Data, MM_GetPhysAddr((tVAddr)&head->Data), head->Size);
+ else
+ Log_Debug("Heap", "%p (0x%llx) - 0x%x (%i) Owned by %s:%i",
+ head->Data, MM_GetPhysAddr((tVAddr)&head->Data), head->Size, head->ValidSize, head->File, head->Line);
#endif
}