vs 检测内存泄漏
2015-08-10 14:51
375 查看
网上有很多这个的说明,我只是总结了一下
#include <assert.h> #include <iostream> #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 //此部分用于使_CrtDumpMemoryLeaks输出内存泄漏文件名和行号信息默认不会输出相关信息 using namespace std; int main(int argc, char* argv[]) { int* p = new int; _CrtDumpMemoryLeaks(); system("pause"); return 0; }
相关文章推荐
- memcached安装及java应用使用memcached
- solaris 10u11 安装vim7.4
- 主机命令执行
- REM
- 九度OJ 题目1437:To Fill or Not to Fill
- [洛谷U871]building
- 写博客的理由
- 更改maven使用的java版本(Mac)
- 本地IP获取
- PHP 两个等号 和 三个等号的区别
- 从输入网址到显示网页的全过程分析
- java线程研究---(5)暂停Thread:yield
- SQL判断某列是否为外键
- ubuntu chmod命令的使用
- linux上安装配置vsftpd
- 我的Android进阶之旅------>Android的ListView数据更新后,如何使最新的条目可以自动滚动到可视范围内?
- Solr 缓存配置
- 如何用Spring将Service注入到Servlet中(注解模式)
- Mac Pro 提高效率 快捷键 程序员
- 逆序数 & 逆序对