From e401231d25c24d05e2e42cdc714e0ed6c6d0410b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 18 Aug 2005 06:40:24 +0000 Subject: [PATCH] *** empty log message *** --- dlls/cstrike/amxxmodule.cpp | 22 ++++++++++++++++++++++ dlls/engine/amxxmodule.cpp | 22 ++++++++++++++++++++++ dlls/fun/amxxmodule.cpp | 2 +- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/dlls/cstrike/amxxmodule.cpp b/dlls/cstrike/amxxmodule.cpp index 9dfe57be..e374e441 100755 --- a/dlls/cstrike/amxxmodule.cpp +++ b/dlls/cstrike/amxxmodule.cpp @@ -2909,6 +2909,28 @@ void operator delete[](void *reportedAddress) Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); } +#else + +#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 +void * ::operator new(size_t size) { + return(calloc(1, size)); +} + +void * ::operator new[](size_t size) { + return(calloc(1, size)); +} + +void ::operator delete(void * ptr) { + if(ptr) + free(ptr); +} + +void ::operator delete[](void * ptr) { + if(ptr) + free(ptr); +} +#endif + #endif //MEMORY_TEST /************* stuff from dlls/util.cpp *************/ diff --git a/dlls/engine/amxxmodule.cpp b/dlls/engine/amxxmodule.cpp index 9dfe57be..e374e441 100755 --- a/dlls/engine/amxxmodule.cpp +++ b/dlls/engine/amxxmodule.cpp @@ -2909,6 +2909,28 @@ void operator delete[](void *reportedAddress) Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); } +#else + +#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 +void * ::operator new(size_t size) { + return(calloc(1, size)); +} + +void * ::operator new[](size_t size) { + return(calloc(1, size)); +} + +void ::operator delete(void * ptr) { + if(ptr) + free(ptr); +} + +void ::operator delete[](void * ptr) { + if(ptr) + free(ptr); +} +#endif + #endif //MEMORY_TEST /************* stuff from dlls/util.cpp *************/ diff --git a/dlls/fun/amxxmodule.cpp b/dlls/fun/amxxmodule.cpp index 43ded3bf..e374e441 100755 --- a/dlls/fun/amxxmodule.cpp +++ b/dlls/fun/amxxmodule.cpp @@ -2911,7 +2911,7 @@ void operator delete[](void *reportedAddress) #else -#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST +#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST && !defined WIN32 void * ::operator new(size_t size) { return(calloc(1, size)); }