C++?????м??????????????????
???????????? ???????[ 2012/7/19 10:17:48 ] ????????
????2.2 ????C?????????????й?
????VC++??C???п?CRT??????????????????????????й???CRT????_CrtMemCheckPoint??_CrtDump MemoryLeaks??_CrtSetDbgFlag??????????????????й???
?????????MFC?????? ???????Ч?????й????湦??? ????????????????
??????1????StdAfx.h???????????′????????????/Yu ???
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK?? THIS_FILE?? __LINE__)
??????2??????????.cpp?????????????????????
#include "stdafx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
??????3??????????????????????й???????
????_CrtSetDbgFlag??_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF????
????????MFC????? MFC???????????????? ????????????.cpp???????????????????2??????????
???????Щ????£??????????????й????????е??????????????????????????????????????????????????????????????????????????????_CLIENT_ BLOCK????????棬??????_CrtSetDumpClient????????????????????????????????????????CObject??е????????
??????1????????/?????????????????????ο?crtdbg.h????
??????2???????????????????????new?????void* __cdecl operator new??size_t nSize?? int nType?? LPCSTR lpszFileName?? int nLine?????ο?MFC????? afxmem.cpp????????nType???????????????
??????3?????????????????????????????????????????????????д???????????dbgint.h????
??????4??????_CrtSetDumpClient?????????????????????????ο?MFC?????dumpinit.cpp????
?????????CObject?????????MFC ?????????????????????????????ο?MFC????? afxmem.cpp??dumpinit.cpp???????Ч?????CObject??е???????????1?????????CObject??е????????麯??Dump????2???????????????? ??????? afxDump.SetDepth??1????????????????
????2.3 ????Purify??Insure++???????????????
????Rational Purify??Parasoft Insure++ ??????????????????????Purify?????????????????/д?????δ?????????棬?????????????ж?/д?????й????Insure++??????????????????????????????????????????????????????????????????????к???й???????????????????98???и??????????C++????????????????Σ???Insure++ 6.1?????????
??????
![](/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