怎样安装使用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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值