我正在尝试在 XE7 C++ 构建器中使用 FastMM 完整调试模式,特别是对于 FireMonkey。我下载了源代码并按照“FastMM4BCB.cpp”中的步骤概述。为了让 FastMM 编译,我做了以下更改:
- 注释掉'FastMM4BCB.cpp'中的第63行,即: #pragma option -k- -d -vi- -O2 -b- -3 -a8 -pc -RT- -x -xd -r -AT -vG- -vG0- -vG1- -vG2- -vG3- -vGc- -vGt- -vGd-
- 在我的项目文件中,添加一行: #pragma link "FastMM4BCB" 而不是(如 'FastMM4BCB.cpp' 中所述)USEOBJ("FastMM4BCB.cpp")
通过这些更改,FastMM 编译并成功运行。但是,即使是空白项目(我尝试了 FireMonkey 和 VCL),它也会报告内存泄漏,如下所示:
- 13-20 字节:未知 x 8
- 61-68 字节:未知 x 1
- 189 - 204 字节:未知 x 1
通过 VCL 项目,我能够使用完整的调试模式并获得有关这些内存泄漏的一些详细信息(例如):
--------------------------------2014/10/23 16:58:26--------------------------------
A memory block has been leaked. The size is: 20
This block was allocated by thread 0x628, and the stack trace (return addresses) at the time was:
41C897
41C591
415A2D
40E4B1
40E4BB
40EE45
76F73C5A [Unknown function at RtlImageNtHeader]
76FCB19C [Unknown function at RtlUlonglongByteSwap]
76F957CE [RtlLoadString]
76F73CD3 [Unknown function at RtlImageNtHeader]
76F73CD3 [Unknown function at RtlImageNtHeader]
The block is currently used for an object of class: Unknown
The allocation number is: 12
Current memory dump of 256 bytes starting at pointer address 7EF1A160:
80 80 80 80 80 80 80 80 E0 9B F3 7E 80 80 80 80 C3 7E 6A 2C 80 80 80 80 00 00 00 00 80 9F F1 7E
00 00 00 00 00 00 00 00 A8 7A 40 00 00 00 00 00 15 00 00 00 97 C8 41 00 91 C5 41 00 2D 5A 41 00
23 B1 40 00 B1 E4 40 00 BB E4 40 00 6C 60 42 00 F7 F1 40 00 5A 3C F7 76 9C B1 FC 76 CE 57 F9 76
28 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 80 1D 2A E6
80 80 80 80 80 80 80 80 E0 9B F3 7E 80 80 80 80 7F E2 D5 19 80 80 80 80 00 00 00 00 21 AC F1 7E
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 00 00 00 97 C8 41 00 91 C5 41 00 2D 5A 41 00
6C 60 42 00 4A F6 40 00 5A 3C F7 76 9C B1 FC 76 CE 57 F9 76 D3 3C F7 76 D3 3C F7 76 FE 3C F7 76
€ € € € € € € € à › ó ~ € € € € Ã ~ j , € € € € . . . . € Ÿ ñ ~
. . . . . . . . ¨ z @ . . . . . . . . . — È A . ‘ Å A . - Z A .
# ± @ . ± ä @ . » ä @ . l ` B . ÷ ñ @ . Z < ÷ v œ ± ü v Î W ù v
( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . € . * æ
€ € € € € € € € à › ó ~ € € € € â Õ . € € € € . . . . ! ¬ ñ ~
. . . . . . . . . . . . . . . . . . . . — È A . ‘ Å A . - Z A .
l ` B . J ö @ . Z < ÷ v œ ± ü v Î W ù v Ó < ÷ v Ó < ÷ v þ < ÷
对于空白的 FireMonkey 项目,当应用程序以 FastMM 标记的地址 0x80 模式关闭时,它会引发(在完全调试模式下)访问冲突错误。知道如何使它适用于 FireMonkey 并在空白项目中删除这些误报吗?谢谢