怎样安装使用fastmm?

本文详细介绍了如何在C++Builder 2009中安装并配置FastMM内存管理库来检测内存泄漏。包括下载FastMM,将所需文件复制到项目目录,调整编译设置,以及启用全调试模式的方法。

怎样安装使用fastmm?一篇英文说得很清楚。

 

Had to go to FastMM page to get FastMM4: http://sourceforge.net/projects/fastmm/

Copy FastMM4BCB.cpp, FastMM4.pas, FastMM4Message.pas, and FastMM4Options.inc to your project directory.

Add FastMM4Messages.pas first, then FastMM4.pas, then FastMM4BCB.cpp. On compiling the .pas files, .hpp files are created and imported by the subsequent files.

Then, you must add USEOBJ("FastMM4BCB.cpp") to your project file, BEFORE any other USEFORM directives. This apparently is the (completely undocumented) equivalent to the "uses" directive in Delphi.

Before compiling, you must add the following line at the beginning of FastMM4BCB.cpp, so that the _TEXT("string") macros used in that .cpp (but not defined in that file) work as intended:

if you are using UNICODE (Project/Options/Directories and Conditionals/TCHAR maps to wchar_t):
#define _TEXT(a) L##a

if you are not using UNICODE (Project/Options/Directories and Conditionals/TCHAR maps to char)
#define _TEXT(a) a

Finally, as per the instructions in FastMM4BCB.cpp, you must set Project/Options/C++ Linker/Dynamic RTL to False.

If you either fail to set Dynamic RTL to false or use the USEOBJ directive, you will get the infamous:
FastMM4 cannot be installed since another third party memory manager has already installed itself.
If you want to use FastMM4, please make sure that FastMM4.pas is the very first unit in the "uses"
section of your project's .dpr file.

You can now compile and run your program with FastMM4. You will find some memory leaks in Embarcadero's code, as indicated in the message box
shown when your application terminates.

As suggested in the message box, you can enable FullDebugMode by removing the "." in {.FullDebugMode} in FastMM4Options.inc. However, then FastMM4.pas does not compile, with
an error at line 1351 in the definition of StandardVirtualMethodNames. Googling that does not give any clue as to how to fix that problem.
So, does anyone know how to enable FastMM4 FullDebugMode in C++ Builder 2009 so we can get the leak reporting mentioned above?


Thus, the full set of instructions for getting memory leak detection working under C++ Builder 2009:

Go to FastMM page to get FastMM4: http://sourceforge.net/projects/fastmm/

Copy FastMM4BCB.cpp, FastMM4.pas, FastMM4Message.pas, FastMM4Options.inc, and FastMM_FullDebugMode.lib to your project directory.

Copy FastMM_FullDebugMode.dll to your application's .exe's directory

To your project, add FastMM4Messages.pas first, then FastMM4.pas, then FastMM4BCB.cpp to the project. On compiling the .pas files, .hpp files are created and imported by the subsequent files.

Then, you must add USEOBJ("FastMM4BCB.cpp") to your project file, BEFORE any other USEFORM directives. This apparently is the (completely undocumented) equivalent to the "uses" directive in Delphi.

Before compiling, you must add the following line at the beginning of FastMM4BCB.cpp, so that the _TEXT("string") macros used in that .cpp (but not defined in that file) work as intended:
#include <tchar.h>

Before compiling, you must comment out the check for the Delphi version (since you are not compiling with Delphi). Find the line
{$ifdef Delphi6AndUp} at about line 1337 and the matching {$endif} at about line 1343 (NOT the {$ifend} that matches {$if RTLVersion >= 20}) and comment both of those lines by adding a period:
{.$ifdef Delphi6AndUp}
{.$endif}

Finally, as per the instructions in FastMM4BCB.cpp, you must set Project/Options/C++ Linker/Dynamic RTL to False.

If you either fail to set Dynamic RTL to false or to use the USEOBJ directive, you will get the infamous:
FastMM4 cannot be installed since another third party memory manager has already installed itself.
If you want to use FastMM4, please make sure that FastMM4.pas is the very first unit in the "uses"
section of your project's .dpr file.

You can now compile and run your program with FastMM4. You will find some memory leaks in Embarcadero's code, as indicated in the message box
shown when your application terminates.

As suggested in that message box, you can enable FullDebugMode by removing the "." in {.FullDebugMode} in FastMM4Options.inc to get a text file that reports the leaks in detail
No, the Embcarcadero version has Pierre postings as of 5/23/2009.
I was suggesting you ask there as that is where he tends to hang out.
Other fastcode programmers and FastMM users also monitor the group.

Thank you for pointing me to the newsgroup. For others, this is a newsgroup on newsgroups.codegear.com with the full name embarcadero.public.delphi.language.basm

源码来自:https://pan.quark.cn/s/41b9d28f0d6d 在信息技术领域中,jQuery作为一个广受欢迎的JavaScript框架,显著简化了诸多操作,包括对HTML文档的遍历、事件的管理、动画的设计以及Ajax通信等。 本篇文档将深入阐释如何运用jQuery达成一个图片自动播放的功能,这种效果常用于网站的轮播展示或幻灯片演示,有助于优化用户与页面的互动,使网页呈现更加动态的视觉体验。 为了有效实施这一功能,首先需掌握jQuery的核心操作。 通过$符号作为接口,jQuery能够迅速选取DOM组件,例如$("#id")用于选取具有特定ID的元素,而$(".class")则能选取所有应用了某类class的元素。 在选定元素之后,可以执行多种行为,诸如事件监听、样式的变更、内容的更新以及动画的制作等。 关于“一个基于jQuery的图片自动播放功能”,首要任务是准备一组图片素材,这些素材将被整合至一个容器元素之中。 例如,可以构建一个div元素,将其宽度设定为单张图片的尺寸,再借助CSS实现溢出内容的隐藏,从而构建出水平滚动的初始框架。 ```html<div id="slider"> <img src="image1.jpg" alt="Image 1"> <img src="image2.jpg" alt="Image 2"> <!-- 更多图片内容... --></div>```接着,需要编写jQuery脚本以实现图片的自动切换。 这通常涉及到定时器的运用,以设定周期性间隔自动更换当前显示的图片。 通过使用`.fadeOut()`和`.fadeIn()`方法,能够实现图片间的平滑过渡,增强视觉效果。 ```javascript$(document).re...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值