Memory Manager/Logging questions
by Feral · in Torque Game Engine · 11/12/2002 (2:25 am) · 2 replies
Hello all,
I am wondering how the memory logging (to a text file) of the memory manager (with DEBUG_GUARD defined) is supposed to be properly activated.
From my initial looking at this bit I concluded that the code to turn on logging was lost somewhere.
My attempt to get memory (alloc/free/leak/etc.) logging working (described below) resulted in an unfortunate crash on exit (destructor of an audio profile I think it was causing an assertfatal to be thrown; (trying to free a non allocated block).
This is pertaining to HEAD cvs as of Nov 6 2002.
In platformmemory.cc around line 706 I added two functions to the Memory namespace; One to Initialize the logging and one to shut it off:
static void initLog();
static void shutdown();
void feral_Init_MemoryLoging(void)
{
gEnableLogging = true;
gNeverLogLeaks = false;
gAlwaysLogLeaks = true;
dStrcpy(gLogFilename, "memory.log");
initLog();
}
void feral_Exit_MemoryLoging(void)
{
shutdown();
}
In main.cc near the top (before the call to initLibraries()) of DemoGame::main() I call feral_Init_MemoryLoging(); and just after the shutdownLibraries(); call I call feral_Exit_MemoryLoging();
This gives me copious amounts of logging and memory leaks(some 600+ due (I believe) to the assertfatal mentioned above).
Comments and such like welcome :)
-Feral
I am wondering how the memory logging (to a text file) of the memory manager (with DEBUG_GUARD defined) is supposed to be properly activated.
From my initial looking at this bit I concluded that the code to turn on logging was lost somewhere.
My attempt to get memory (alloc/free/leak/etc.) logging working (described below) resulted in an unfortunate crash on exit (destructor of an audio profile I think it was causing an assertfatal to be thrown; (trying to free a non allocated block).
This is pertaining to HEAD cvs as of Nov 6 2002.
In platformmemory.cc around line 706 I added two functions to the Memory namespace; One to Initialize the logging and one to shut it off:
static void initLog();
static void shutdown();
void feral_Init_MemoryLoging(void)
{
gEnableLogging = true;
gNeverLogLeaks = false;
gAlwaysLogLeaks = true;
dStrcpy(gLogFilename, "memory.log");
initLog();
}
void feral_Exit_MemoryLoging(void)
{
shutdown();
}
In main.cc near the top (before the call to initLibraries()) of DemoGame::main() I call feral_Init_MemoryLoging(); and just after the shutdownLibraries(); call I call feral_Exit_MemoryLoging();
This gives me copious amounts of logging and memory leaks(some 600+ due (I believe) to the assertfatal mentioned above).
Comments and such like welcome :)
-Feral
#2
Has anyone tried to get the built in logging working?
03/31/2003 (11:48 pm)
The silence is deafening. :PHas anyone tried to get the built in logging working?
Torque Owner Feral
Just wondering if anyone could provide any input on this..
Just how does one go about getting the built in logging to work?
Thanks,
-Feral