DEBUG_NEW
来源:互联网 发布:json改成txt 编辑:程序博客网 时间:2024/04/30 14:58
在 MFC 中,可以使用 DEBUG_NEW 宏代替 new 运算符来帮助定位内存泄漏。
在程序的“Debug”版本中,DEBUG_NEW 将为所分配的每个对象跟踪文件名和行号。
当编译程序的“Release”版本时,DEBUG_NEW 将解析为不包含文件名和行号信息的简单 new 操作。
因此,在程序的“Release”版本中不会造成任何速度损失。
如果不想重写整个程序来使用 DEBUG_NEW 代替 new,则可以在源文件中定义下面的宏:
#define new DEBUG_NEW
当进行对象转储时,用 DEBUG_NEW 分配的每个对象均将显示被分配到的文件和行号,使您可以查明内存泄漏源。MFC 框架的“Debug”版本自动使用 DEBUG_NEW,但代码不自动使用它。如果希望利用 DEBUG_NEW 的好处,则必须显式使用 DEBUG_NEW 或 #define new,如上面的定义。
- DEBUG_NEW
- DEBUG_NEW
- debug_new
- DEBUG_NEW
- DEBUG_NEW
- 关于 DEBUG_NEW
- 关于 DEBUG_NEW
- DEBUG_NEW,_DEBUG
- #define new DEBUG_NEW
- 关于#define new DEBUG_NEW
- #define new DEBUG_NEW...
- #define new DEBUG_NEW
- new和DEBUG_NEW
- #define new DEBUG_NEW
- #define new DEBUG_NEW
- #define new DEBUG_NEW 作用
- #define new DEBUG_NEW
- #define new DEBUG_NEW解释
- 在Flex中对XML添加属性
- Eclipse下配置liferay
- PHP ignore_user_abort() 函数
- 我就不明白了,我是真不明白。
- Oracle开发专题之:行列转换
- DEBUG_NEW
- 再散列--开放定址散列表(线性探测法)加强版可再散列经优化头文件C语言
- Unhandled Exception thrown: class java.lang.NullPointerException
- vim命令桌面
- 本程序采用Keil MDK 410
- 本程序采用Keil MDK 410
- C#winform模拟post提交
- 如何修改S60默认SDK?
- 本程序采用Keil MDK 410