// jnewquist: Add a signature to avoid misinterpreting an early allocation
m = (debugMemory_t *) ( ( (byte *) p ) - sizeof( debugMemory_t ) );
if ( !mem_heap || m->signature != 0xf00d ) {
#ifdef CRASH_ON_STATIC_ALLOCATION
*((int*)0x0) = 1;
#endif
// NOTE: set a breakpoint here to find memory being freed before mem_heap is initialized
// jnewquist: send all allocations through one place on the Xenon
local_free( p );
return;
}
// RAVEN END
if ( m->size < 0 ) {
idLib::common->FatalError( "memory freed twice, first from %s, now from %s", idLib::sys->GetCallStackStr( m->callStack, MAX_CALLSTACK_DEPTH ), idLib::sys->GetCallStackCurStr( MAX_CALLSTACK_DEPTH ) );