VS 2013内存泄露检测的方法
来源:互联网 发布:向数据库中添加数据 编辑:程序博客网 时间:2024/05/16 13:02
实例:
#include "stdafx.h"
#ifdef _DEBUG
#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
#else
#define DEBUG_CLIENTBLOCK
#endif // _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#ifdef _DEBUG
#define new DEBUG_CLIENTBLOCK
#endif // _DEBUG
/*
#include <stdlib.h>
#include <crtdbg.h>
#ifdef _DEBUG
#ifndef DBG_NEW
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
#define new DBG_NEW
#endif
#endif // _DEBUG
*/
int _tmain(int argc, _TCHAR* argv[])
{
int *b = new int[10];
for (int i = 0; i < 10; ++i)
{
b[i] = i;
printf("%d\n", b[i]);
}
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
return 0;
}
然后启动调试,输出栏就会提示内存泄露的具体位置。
0 0
- VS 2013内存泄露检测的方法
- vs内存泄露检测方法
- vs内存泄露检测方法
- VS内存泄露检测方法
- 【Windows】vs内存泄露检测方法
- 检测内存泄露的方法:
- 内存泄露的检测方法
- 检测内存泄露的方法
- VS下内存泄露的检测
- 内存泄露检测方法
- 内存泄露检测方法
- 内存泄露检测方法
- VC++检测内存泄露的方法
- C++内存泄露的检测识别方法
- 内存泄露的检测
- 内存泄露的检测
- Qt在VS中的内存泄露检测
- C/C++ 、VS、linux 内存泄露检测
- Makefile中命令前的@和-符号
- 使用百度地图 显示自己的位置
- iOS面试题12- RunLoop是什么?
- 软件开发流程
- JavaScript 中 关于 this 的学习笔记
- VS 2013内存泄露检测的方法
- NAL全称Network Abstract Layer
- <LeetCode OJ> 203. Remove Linked List Elements
- 如何编写一个JSON解析器
- Perl 脚本执行错误/usr/bin/perl^M: bad interpreter: No such file or directory
- wxpython创建简单的图片浏览器
- 下拉刷新功能实现
- 使用Web Audio API实现基于浏览器的Web端录音
- java I/O 流总结学习