位置: IT常识 - 正文

Using Visual Leak Detector

编辑:rootadmin
Visual Leak Detector for Visual C++ 2008/2010/2012Using Visual Leak DetectorThis section briefly des Using Visual Leak Detector

推荐整理分享Using Visual Leak Detector,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

This section briefly describes the basics of using Visual Leak Detector (VLD).

Important! : Before using VLD with any Visual C++ project, you must first add the Visual Leak Detector include and library directories to the Visual C++ include and library directory search paths:For all compiler versions take care to ensure that no junk characters get added when you add the include and library paths. If you browse to the "Program Files(x86) folder using the dialog box provided by Visual Studio and select it you could end up seeing the "%" replacing the "(".

And remember to close and open the Visual Studio IDE once you have modified the default include and library paths which the compiler and linker would always look at.

Visual C++ 2010: Go to View ->Property Manager, select Microsoft.Cpp.Win32.user. Select VC++ Directories and then "Include files" from the tree. Add the include subdirectory from the Visual Leak Detector installation directory. Move it to the bottom of the list. Then select "Library files" from the drop-down menu and add the lib\Win32 subdirectory from the Visual Leak Detector installation directory. Again, move it to the bottom of the list. Repeat for Microsoft.Cpp.x64.user, but select lib\Win64 subdirectory instead.Visual C++ 2005 and 2008: Go to Tools -> Options -> Projects and Solutions -> VC++ Directories. Select "Include files" from the "Show Directories For" drop-down menu. Add the include subdirectory from the Visual Leak Detector installation directory. Move it to the bottom of the list. Then select "Library files" from the drop-down menu and add the lib\Win32 subdirectory from the Visual Leak Detector installation directory. Again, move it to the bottom of the list. Visual C++ 2003: Go to Project Properties -> C/C++ -> General -> Additional Include Directories and add the include subdirectory from the Visual Leak Detector installation directory. Move it to the bottom of the list. Then select Additional Library Directories and add the lib\Win32 subdirectory from the Visual Leak Detector installation directory. Again, move it to the bottom of the list. Visual C++ 6: Go to Tools -> Options -> Directories. Select "Include files" from the "Show Directories For" drop-down menu. Add the include subdirectory from the Visual Leak Detector installation directory. Move it to the bottom of the list. Then select "Library files" from the drop-down menu and add the lib\Win32 subdirectory from the Visual Leak Detector installation directory. Again, move it to the bottom of the list. Using Visual Leak Detector

To use VLD with your project, follow these simple steps:

In at least one C/C++ source file from your program, include the vld.h header file. It should not matter which file you add the include statement to. It also should not matter in what order the header is included in relation to other headers. The only exception is stdafx.h (or any other precompiled header). A precompiled header, such as stdafx.h, must always be the first header included in a source file, so vld.h must be included after any precompiled headers. If your program contains one or more DLLs that you would also like to check for memory leaks, then also include vld.h in at least one source file from each DLL to be included in leak detection. Build the debug version of your program.

Note: Unlike earlier (pre-1.9) versions of VLD, it is now acceptable to include vld.h in every source file, or to include it in a common header that is included by many or all source files. Only one copy of the VLD code will be loaded into the process, regardless of how many source files include vld.h.

VLD will detect memory leaks in your program whenever you run the debug version. When you run the program under the Visual C++ debugger, a report of all the memory leaks detected will be displayed in the debugger's output window when your program exits (the report can optionally be saved to a file instead, see ReportFile under Configuration Options). Double-clicking on a source file's line number in the memory leak report will take you to that file and line in the editor window, allowing easy navigation of the code path leading up to the allocation that resulted in the memory leak.

Note: When you build release versions of your program, VLD will not be linked into the executable. So it is safe to leave vld.h included in your source files when doing release builds. Doing so will not result in any performance degradation or any other undesirable overhead.

Last edited Oct 29 2011 at 5:18 PM by pramis, version 5

Note: Unlike earlier (pre-1.9) versions of VLD, it is now acceptable to include vld.h in every source file, or to include it in a common header that is included by many or all source files. Only one copy of the VLD code will be loaded into the process, regardless of how many source files include vld.h.Note: When you build release versions of your program, VLD will not be linked into the executable. So it is safe to leave vld.h included in your source files when doing release builds. Doing so will not result in any performance degradation or any other undesirable overhead.

本文链接地址:https://www.jiuchutong.com/zhishi/303683.html 转载请保留说明!

上一篇:最强MacBook苹果笔记本macos电脑应用Sublime Text 4代码编辑器傻瓜汉化教程(哪一款macbook)

下一篇:CSS设置背景图片不显示的解决方法(css设置背景图片填充)

  • 担任多家公司办事处主任
  • 应交消费税的税目
  • 个人是否可以申请精神司法鉴定
  • 分支机构设立当年是否需要就地预缴企业所得税?
  • 实用9%税率的
  • 固定资产出售账户处理
  • 企业经营活动所需的资金的来源渠道有
  • 支付买方佣金
  • 减免的所得税额怎么入账
  • 一般纳税人初次购入税控系统的分录怎么做
  • 股东入股资本公司的条件
  • 增资需要登报吗
  • 增值税发票三个点
  • 跨月发票作废怎么操作流程
  • 做内账有风险还是做外账有风险
  • 在固定资产中
  • 税收筹划的定义,有哪些筹划的方法
  • 房地产企业综合税率是多少
  • 2021年保险营销员
  • 存货跌价准备转销
  • 社保已申报未缴费可以减员吗
  • win10 kb5005611
  • 白内障手术费用大概几天出院
  • 水土保持补偿费是一次性征收吗
  • 负债类科目的分类
  • 上个月多计提的费用怎么调整
  • win10版本激活码
  • 土地房屋转让协议书
  • 收到银行退回余款
  • 年终奖是多发一个月工资吗
  • 小规模纳税人清卡是每月一次吗
  • 税收筹划的原则包括
  • nginx加php
  • 存货销售收入
  • iframe vh
  • 国家公园好玩吗
  • 劳务费可以抵扣进项吗
  • 新政府会计制度固定资产核算
  • 增值税密码锁定怎么办
  • 创造未来这首歌是谁
  • phpstorm创建php文件
  • lvm命令详解
  • discuz关闭电脑版
  • 出售一台设备,收到价款20万
  • 民间非营利组织包括哪些单位
  • 建筑业综合税率13.8%
  • 个人所得税可以取出来用吗
  • SqlServer中用exec处理sql字符串中含有变量的小例子
  • 个人增值税发票税率
  • 报关金额必须和实收一样吗
  • 以旧换新价格怎么确认
  • 委托加工以受托方核定的数量为计税依据
  • 投标保证金会计科目
  • 民间非盈利组织会计制度核算的基础
  • 人民币报关退税流程
  • 今年成立的公司需要申报残疾人保障金吗
  • 企业的职工福利费
  • 代扣代缴完税凭证只能次月抵扣吗
  • 公司向股东借款多久必须归还
  • 怎么做好出纳帐
  • windows下mysql 5.7版本中修改编码为utf-8的方法步骤
  • 在windows七中
  • Win7系统打印机共享无法保存打印机设置0x000006d9
  • 怎么给ubuntu扩容
  • winpe怎么弄
  • Win10装不上是什么原因
  • 代理服务器只能代理客户端http的请求
  • win7系统无法创建分区也无法定位
  • 深入理解中国式现代化
  • vue 瀑布流
  • html用div来写表格
  • 深入python3
  • 学node.js需要什么基础
  • Linux中的host命令应用实例详解
  • python如何发送http请求
  • JavaScript事件类型中UI事件详解
  • listview属性设置
  • 国家企业税务总局
  • 通用机油防伪查询
  • 个人股权转让是否增值了怎么判断
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设