C++?л???Crt?????й????
???????????? ???????[ 2013/3/6 13:07:08 ] ????????
??????6?????STL??map???tree?????placement 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
#include <map>
????????e? #include <map>??????????檔
??????7?????????? #define new DEBUG_CLIENTBLOCK ????????????? operator new????????????????????????????
??????STL??xdebug???????????operator new???????????????new??????????????include????????????????STL????????檔
//MyClass.cpp
#include "myclass.h"
#include <map>
#include <algorithm>
#ifdef _DEBUG
#define new DEBUG_CLIENTBLOCK
#endif
MyClass::MyClass()
{
char* p = new char('a');
}
??????8???????????????????new????????????CPP????鷳????????е?????????????????????ο????漲???????
//MemLeakChecker.h
#include <map>
#include <algorithm>
//other STL file
#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
??????
![](/images/ad-banner/ad-banner.png)
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11