This commit is contained in:
IlushaShurupov 2023-07-16 18:28:24 +03:00 committed by Ilya Shurupov
parent f91b45643d
commit 53aa0e34a8
24 changed files with 116 additions and 110 deletions

View file

@ -118,8 +118,15 @@ void HeapAllocGlobal::deallocate(void* aPtr) {
}
// 3) Check the wrap
ASSERT(!memCompareVal(wrap_top, WRAP_SIZE, WRAP_VAL) && "Allocated Block Wrap Corrupted!")
ASSERT(!memCompareVal(wrap_bottom, WRAP_SIZE, WRAP_VAL) && "Allocated Block Wrap Corrupted!")
if (memCompareVal(wrap_top, WRAP_SIZE, WRAP_VAL)) {
CallStackCapture::printSnapshot(head->mCallStack);
ASSERT(!"Allocated Block Wrap Corrupted!")
}
if (memCompareVal(wrap_bottom, WRAP_SIZE, WRAP_VAL)) {
CallStackCapture::printSnapshot(head->mCallStack);
ASSERT(!"Allocated Block Wrap Corrupted!")
}
// 4) clear data
#ifdef MEM_CLEAR_ON_ALLOC
@ -135,10 +142,12 @@ bool HeapAllocGlobal::checkLeaks() {
if (mNumAllocations) {
#ifdef MEM_STACK_TRACE
gCSCapture->logLeaks();
for (auto iter = mEntry; iter; iter = iter->mPrev) {
CallStackCapture::printSnapshot(iter->mCallStack);
}
#endif
DEBUG_BREAK("Destruction of not freed Allocator")
ASSERT(!"Destruction of not freed Allocator")
return true;
}
return false;