???????????Щ???????

??????1??#define _CRTDBG_MAP_ALLOC ??????

?????????????????? C?????mallocй??????????????

??????2??????{108} {107}??????

???????????η??? ????????_CrtSetBreakAlloc???????е??????????????????

int _tmain(int argc?? _TCHAR* argv[])
{
    _CrtSetBreakAlloc(108);

    char* p = new char();
    char* pp = new char[10];
    char* ppp = (char*)malloc(10);

    _CrtDumpMemoryLeaks();

    return 0;
}

??????3??????????ж????????????漰?????????????????_CrtSetDbgFlag ???????ó?????????????й???????

int _tmain(int argc?? _TCHAR* argv[])
{
    _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );

    char* p = new char();
    char* pp = new char[10];
    char* ppp = (char*)malloc(10);

    return 0;
}

??????4?????????????????????????????????????new????????????Cpp?????????????????????У??????MFC??????????

#ifdef _DEBUG
#define new DEBUG_CLIENTBLOCK
#endif

??????5???????operator new????????????new???????operator new?????????????????????????????????????????С???????????placement new???????????????????????????????????????????CPP?????????new?????????new????????

#include <new>

#ifdef _DEBUG
#define DEBUG_CLIENTBLOCK   new( _CLIENT_BLOCK?? __FILE__?? __LINE__)
#else
#define DEBUG_CLIENTBLOCK
#endif
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#ifdef _DEBUG
#define new DEBUG_CLIENTBLOCK
#endif


int _tmain(int argc?? _TCHAR* argv[])
{
    _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );

    char* p = new char();
    char* pp = new char[10];
    char* ppp = (char*)malloc(10);

    char d;
    char* p1 = new(&d) char('a');

    return 0;
}