内存泄露检测工具--VisualC++ debugger 和 CRT 库
生活随笔
收集整理的這篇文章主要介紹了
内存泄露检测工具--VisualC++ debugger 和 CRT 库
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
文章目錄
- 1 VisualC++ debugger 和 CRT 庫(kù)
1 VisualC++ debugger 和 CRT 庫(kù)
第一步: 包含以下頭文件。
#define _CRTDBG_MAP_ALLOC #include <stdlib.h> #include <crtdbg.h>第二步: 接管 new 操作符。
#ifdef _DEBUG #ifndef DBG_NEW #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ ,__LINE__) #define new DBG_NEW #endif #endif第三步: 在代碼結(jié)束出輸出內(nèi)存泄漏信息。
_CrtDumpMemoryLeaks();接管new操作符那里是沒(méi)看明白,日后再看!
總結(jié)
以上是生活随笔為你收集整理的内存泄露检测工具--VisualC++ debugger 和 CRT 库的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 动态规划--编辑距离问题
- 下一篇: which和whereis