Made memory management optional
This commit is contained in:
parent
baef3362ed
commit
3d0e25a8ef
|
@ -2681,6 +2681,8 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
|
||||
/************* MEMORY *************/
|
||||
// undef all defined macros
|
||||
#undef new
|
||||
|
@ -2852,6 +2854,8 @@ void operator delete[](void *reportedAddress)
|
|||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||
}
|
||||
|
||||
#endif //MEMORY_TEST
|
||||
|
||||
/************* stuff from dlls/util.cpp *************/
|
||||
// must come here because cbase.h declares it's own operator new
|
||||
|
||||
|
|
|
@ -2122,6 +2122,8 @@ void MF_Log(const char *fmt, ...);
|
|||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
|
||||
/*** Memory ***/
|
||||
void *operator new(size_t reportedSize);
|
||||
void *operator new[](size_t reportedSize);
|
||||
|
@ -2165,5 +2167,6 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||
|
||||
#endif //MEMORY_TEST
|
||||
|
||||
#endif // #ifndef __AMXXMODULE_H__
|
||||
|
|
Loading…
Reference in New Issue
Block a user