logog
logger optimized for games
Implementing a custom memory manager

All memory allocated by logog, by default, goes through the system malloc() and free() routines. However, many games prefer to implement their own memory management systems in order to track memory usage in detail.

In this case, logog can be made to allocate memory via a callback into your own custom code. In order to implement this callback, allocate an INIT_PARAMS structure on the stack, and then replace the m_pfMalloc and m_pfFree pointers to pointers to your own custom allocation and free routines. (It's fine to allocate an INIT_PARAMS structure on the stack.) Then, when calling the LOGOG_INITIALIZE() macro, provide the address of the INIT_PARAMS structure as a parameter. The INIT_PARAMS structure may then be freed.

struct INIT_PARAMS
{
void *( *m_pfMalloc )( size_t );
void ( *m_pfFree )( void * );
};