initial commit

This change makes the memory manager work again for detecting leaks, the built in one kept coming into de-ref and other bugs so this is the start of a refactor to get it working.
This commit is contained in:
marauder2k7 2025-05-04 10:16:49 +01:00
parent 13bf126418
commit 8c812cb448
11 changed files with 258 additions and 1665 deletions

View file

@ -205,6 +205,7 @@ int main(int argc, const char **argv)
#include "platform/platform.h"
#include "app/mainLoop.h"
#include "T3D/gameFunctions.h"
#include "platform/platformMemory.h"
#if defined(WIN32) || defined(_WIN32)
//tell switchable graphics supported systems that they need to use the beefier GPU
@ -230,8 +231,9 @@ S32 TorqueMain(S32 argc, const char **argv)
// argv = argvFake;
// }
// Memory::enableLogging("testMem.log");
// Memory::setBreakAlloc(104717);
#if !defined(TORQUE_DISABLE_MEMORY_MANAGER)
Memory::init();
#endif
// Initialize the subsystems.
StandardMainLoop::init();
@ -254,6 +256,11 @@ S32 TorqueMain(S32 argc, const char **argv)
if( StandardMainLoop::requiresRestart() )
Platform::restartInstance();
#if defined( TORQUE_DEBUG ) && !defined( TORQUE_DISABLE_MEMORY_MANAGER )
Memory::shutdown();
#endif
// Return.
return StandardMainLoop::getReturnStatus();
}