level 6
inline void EnableMemLeakCheck(){ _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);}
#ifdef _DEBUG#
define new new(_NORMAL_BLOCK, __FILE__, __LINE__)#endifvoid main(){ EnableMemLeakCheck(); _CrtSetBreakAlloc(52); int* leak = new int[10];}
2007年12月17日 07点12分
1
level 6
Sets a breakpoint on a specified object allocation order number (debug version only). long _CrtSetBreakAlloc( long lBreakAlloc ); ParameterslBreakAllocAllocation order number, for which to set the breakpoint.Return ValueReturns the previous object allocation order number that had a breakpoint set.
2007年12月17日 07点12分
2
level 6
Retrieves or modifies the state of the _crtDbgFlag flag to control the allocation behavior of the debug heap manager (debug version only). int _CrtSetDbgFlag( int newFlag ); ParametersnewFlagNew state for _crtDbgFlag.Return ValueReturns the previous state of _crtDbgFlag.
2007年12月17日 07点12分
3