MCPcopy Create free account
hub / github.com/beefytech/Beef / DbgHeapCheck

Function DbgHeapCheck

BeefySysLib/util/AllocDebug.cpp:337–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335#ifdef DEF_BF_ALLOCDEBUG
336
337void DbgHeapCheck()
338{
339 for (int i = 0; i < (int) gDbgHeapRecords.size(); i++)
340 {
341 auto& allocRecord = gDbgHeapRecords[i];
342
343 for (int i = 0; i < ALLOC_PADDING; i++)
344 {
345 assert(allocRecord.mPtr[i] == ALLOC_MAGIC);
346 assert(allocRecord.mPtr[ALLOC_PADDING + allocRecord.mSize + ALLOC_PADDING - i - 1] == ALLOC_MAGIC);
347 }
348
349 if (allocRecord.mFreeTransactionIdx != 0)
350 {
351 int curHash = DbgHeapHashMemory(allocRecord.mPtr + ALLOC_PADDING, allocRecord.mSize);
352 assert(allocRecord.mHashAtFree == curHash);
353 }
354 }
355
356#ifndef BF_MINGW
357 _CrtCheckMemory();
358#endif
359}
360
361void DbgHeapCheckLeaks()
362{

Callers

nothing calls this directly

Calls 2

DbgHeapHashMemoryFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected