#include <afx.h>
#define _COMMON_CPP
#include "common.h"
#ifdef _FALSE_
#ifdef _DEBUG
void* __cdecl operator new(size_t nSize, LPCSTR lpszFileName, int nLine)
{
return ::operator new(nSize, _NORMAL_BLOCK, lpszFileName, nLine);
}
void* __cdecl operator new(size_t nSize)
{
void* pResult;
pResult = _malloc_dbg(nSize, _NORMAL_BLOCK, NULL, 0);
if (pResult != NULL)
return pResult;
_asm int 3;
return NULL;
}
void __cdecl operator delete(void* p)
{
#if defined(_DEBUG)
_free_dbg(p, _NORMAL_BLOCK);
#else
free(p);
#endif
}
#if _MSC_VER >= 1200
void __cdecl operator delete(void* pData, LPCSTR /* lpszFileName */,
int /* nLine */)
{
::operator delete(pData);
}
#endif
void* __cdecl operator new(size_t nSize, int nType, LPCSTR lpszFileName, int nLine)
{
void* pResult;
pResult = _malloc_dbg(nSize, nType, lpszFileName, nLine);
if (pResult != NULL)
return pResult;
_asm int 3;
return NULL;
}
_CrtMemState s0;
class _dbg
{
public:
_dbg()
{
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_DEBUG );
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG );
_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_DEBUG );
_CrtMemCheckpoint(&s0);
};
~_dbg()
{
_CrtMemDumpAllObjectsSince( &s0 );
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_DEBUG );
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG );
_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_DEBUG );
};
} __dbg;
#endif
#endif