MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / validate

Function validate

Engine/source/platform/platformMemory.cpp:437–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437void validate()
438{
439#ifdef TORQUE_MULTITHREAD
440 if(!gMemMutex)
441 gMemMutex = Mutex::createMutex();
442
443 Mutex::lockMutex(gMemMutex);
444#endif
445
446
447 // first validate the free tree:
448 validateTree();
449 // now validate all blocks:
450 for(PageRecord *list = gPageList; list; list = list->prevPage)
451 {
452 Header *prev = NULL;
453 for(Header *walk = list->headerList; walk; walk = walk->next)
454 {
455#ifdef TORQUE_DEBUG_GUARD
456 checkGuard(walk, walk->flags & Allocated);
457#endif
458 if(walk->prev != prev)
459 Platform::debugBreak();
460 prev = walk;
461 if(walk->next && ((const char *)(walk->next) != (const char *)(walk) + sizeof(Header) + walk->size))
462 Platform::debugBreak();
463 }
464 }
465
466#ifdef TORQUE_MULTITHREAD
467 Mutex::unlockMutex(gMemMutex);
468#endif
469}
470
471#if !defined(TORQUE_DISABLE_MEMORY_MANAGER)
472static void rotateLeft(TreeNode *hdr)

Callers 15

setMethod · 0.85
parseMethod · 0.85
pushFrameMethod · 0.85
popFrameMethod · 0.85
pushFrameRefMethod · 0.85
writeBitsMethod · 0.85
writeFlagMethod · 0.85
onAddMethod · 0.85
inspectPostApplyMethod · 0.85
preloadMethod · 0.85
inspectPostApplyMethod · 0.85
preloadMethod · 0.85

Calls 2

validateTreeFunction · 0.85
checkGuardFunction · 0.85

Tested by

no test coverage detected