VS 2008 中内存泄露检查
文章分类:C++编程
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#ifdef _DEBUG
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
#endif
本文介绍如何在Visual Studio 2008中使用预编译指令进行内存泄露检查,通过定义特殊的new操作符来跟踪内存分配,适用于C++项目的调试阶段。
文章分类:C++编程
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#ifdef _DEBUG
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
#endif

被折叠的 条评论
为什么被折叠?