|
//#if defined(_DEBUG) && defined(WIN32) && defined(DETECT_LEAKS)
#if defined(WIN32) && defined(DETECT_LEAKS)
#include "MemLeakFindDll.h"
// Take over global new and delete
void* operator new(size_t s)
{
return TraceAlloc(s);
}
void* operator new[](size_t s)
{
return TraceAlloc(s);
}
void operator delete(void* pMem)
{
TraceDealloc(pMem);
}
void operator delete[] (void* pMem)
{
TraceDealloc(pMem);
}
// And then some crap for taking over MFC allocations.
void* __cdecl operator new(size_t s, LPCSTR lpszFileName, int nLine)
{
return TraceAlloc(s);
}
void* __cdecl operator new[](size_t s, LPCSTR lpszFileName, int nLine)
{
return TraceAlloc(s);
}
void __cdecl operator delete(void* pMem, LPCSTR /* lpszFileName */, int /* nLine */)
{
TraceDealloc(pMem);
}
void __cdecl operator delete[](void* pMem, LPCSTR /* lpszFileName */, int /* nLine */)
{
TraceDealloc(pMem);
}
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.