Fixed memory allocation

This commit is contained in:
David Anderson
2004-09-12 00:14:34 +00:00
parent f2faf990a0
commit ac59f75523
2 changed files with 4 additions and 12 deletions

View File

@ -2689,8 +2689,6 @@ void ValidateMacros_DontCallThis_Smiley()
}
#endif
#ifdef MEMORY_TEST
/************* MEMORY *************/
// undef all defined macros
#undef new
@ -2804,7 +2802,7 @@ void *operator new(size_t reportedSize)
return ptr;
// allocation failed
throw std::bad_alloc();
}
void *operator new[](size_t reportedSize)
@ -2817,7 +2815,7 @@ void *operator new[](size_t reportedSize)
return ptr;
// allocation failed
throw std::bad_alloc();
}
// Microsoft memory tracking operators
@ -2831,7 +2829,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
return ptr;
// allocation failed
throw std::bad_alloc();
}
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
{
@ -2843,7 +2841,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
return ptr;
// allocation failed
throw std::bad_alloc();
}
void operator delete(void *reportedAddress)
@ -2862,8 +2860,6 @@ void operator delete[](void *reportedAddress)
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
}
#endif
/************* stuff from dlls/util.cpp *************/
// must come here because cbase.h declares it's own operator new