diff --git a/ref/gl/gl_context.c b/ref/gl/gl_context.c index f1f926e1..906b8f40 100644 --- a/ref/gl/gl_context.c +++ b/ref/gl/gl_context.c @@ -27,6 +27,16 @@ ref_globals_t *gpGlobals; ref_client_t *gp_cl; ref_host_t *gp_host; +void _Mem_Free( void *data, const char *filename, int fileline ) +{ + gEngfuncs._Mem_Free( data, filename, fileline ); +} + +void *_Mem_Alloc( poolhandle_t poolptr, size_t size, qboolean clear, const char *filename, int fileline ) +{ + return gEngfuncs._Mem_Alloc( poolptr, size, clear, filename, fileline ); +} + static void R_ClearScreen( void ) { pglClearColor( 0.0f, 0.0f, 0.0f, 0.0f ); diff --git a/ref/gl/gl_local.h b/ref/gl/gl_local.h index 2bcf9e74..54615606 100644 --- a/ref/gl/gl_local.h +++ b/ref/gl/gl_local.h @@ -782,10 +782,14 @@ DECLARE_ENGINE_SHARED_CVAR_LIST() // #include "crtlib.h" -#define Mem_Malloc( pool, size ) gEngfuncs._Mem_Alloc( pool, size, false, __FILE__, __LINE__ ) -#define Mem_Calloc( pool, size ) gEngfuncs._Mem_Alloc( pool, size, true, __FILE__, __LINE__ ) +void _Mem_Free( void *data, const char *filename, int fileline ); +void *_Mem_Alloc( poolhandle_t poolptr, size_t size, qboolean clear, const char *filename, int fileline ) + ALLOC_CHECK( 2 ) MALLOC_LIKE( _Mem_Free, 1 ) WARN_UNUSED_RESULT; + +#define Mem_Malloc( pool, size ) _Mem_Alloc( pool, size, false, __FILE__, __LINE__ ) +#define Mem_Calloc( pool, size ) _Mem_Alloc( pool, size, true, __FILE__, __LINE__ ) #define Mem_Realloc( pool, ptr, size ) gEngfuncs._Mem_Realloc( pool, ptr, size, true, __FILE__, __LINE__ ) -#define Mem_Free( mem ) gEngfuncs._Mem_Free( mem, __FILE__, __LINE__ ) +#define Mem_Free( mem ) _Mem_Free( mem, __FILE__, __LINE__ ) #define Mem_AllocPool( name ) gEngfuncs._Mem_AllocPool( name, __FILE__, __LINE__ ) #define Mem_FreePool( pool ) gEngfuncs._Mem_FreePool( pool, __FILE__, __LINE__ ) #define Mem_EmptyPool( pool ) gEngfuncs._Mem_EmptyPool( pool, __FILE__, __LINE__ )