Delphi:FastMM 使您的可执行文件更大?

发布于 2024-09-29 15:44:06 字数 194 浏览 5 评论 0原文

FastMM 会使您的可执行文件更大吗?我注意到我的应用程序增长了大约 300-500kb,这对我来说相当大了。我已经关闭了delphi编译器选项以排除调试信息,但大小没有改变。

我使用 FastMM 的 FullDebugMode 来打开,这会影响大小吗?但是当我尝试关闭它时,它会查找 libc,但我找不到。

请帮忙...我正在使用 D5

Does FastMM makes your executables bigger? I notice my app grows about 300-500kb, which is rather big for me. I already turn off the delphi compiler option to exclude the debug info, but the size doesn't change.

I use the FastMM's FullDebugMode to on, is this affecting the size? But when I try to turn it off, it looks for libc, which I couldn't find.

Help please... I'm using D5

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

失与倦" 2024-10-06 15:44:06

首先,这并不重要。使用该选项编译的程序不适用于一般分发。它们旨在帮助您找到问题,以便您可以修复它,然后在不启用调试选项的情况下发布程序的正确版本。

其次,只有当您仍然在软盘上分发时,半兆字节才算大。这是否真的有多大空间取决于您的程序之前有多大。当您分发程序时对其进行压缩,您可能几乎不会注意到其中的差异。

最后,对于您问题的关键,是的,完整调试模式会使您的程序变得更大。很明显,启用该模式会添加更多代码。它添加了执行所有调试检查的代码,例如检查堆损坏、生成堆栈跟踪、捕获已释放接口的使用、将错误记录到文件以及记录内存泄漏。它还添加了加载和使用完全调试模式 DLL 的代码,并且将任何汇编器函数更改为用纯 Delphi 编写。

有关调试信息的编译器选项应该不起作用。它控制DCU文件中是否包含调试信息;该信息始终从 EXE 文件中排除(除非您正在谈论 TD32 调试信息,但无论如何您都不应该启用该信息,因为您没有使用 Turbo Debugger)。

如果您的程序正在寻找 Libc 单元,那么您所做的不仅仅是打开完整调试模式。您以某种方式打开了 Linux 模式。您没有使用 Linux,所以不要打开该模式。如果您遇到困难,请将 FastMM4Options.inc 的副本替换为原始版本,然后重新开始。

First of all, it doesn't really matter. Programs compiled with that option aren't meant for general distribution. They're meant to help you find the problem so you can fix it and then ship a correct version of your program without the debugging options enabled.

Second, half a megabyte is only big if you still distribute on floppy disks. Whether that's truly much space depends on how big your program was beforehand. Compress your program when you distribute it, and you'll probably hardly notice the difference.

Finally, to the crux of your question, yes, full debug mode makes your program bigger. It should be obvious that enabling that mode adds more code. It adds the code that does all the debug checking, such as checking for heap corruption, generating stack traces, catching the use of freed interfaces, logging errors to a file, and logging memory leaks. It also adds code to load and use the full-debug-mode DLL, and it changes any assembler functions to be written in plain Delphi instead.

The compiler option about debug information should have no effect. It controls whether debug information is included in the DCU files; that information is always excluded from the EXE files (unless you're talking about TD32 debug information, but you shouldn't enable that anyway since you're not using Turbo Debugger).

If your program is looking for the Libc unit, then you did more than turn of full debug mode. You somehow turned on Linux mode. You're not using Linux, so don't turn on that mode. If you're stuck, replace your copy of FastMM4Options.inc with the original version and start over.

妥活 2024-10-06 15:44:06

FullDebugMode 使用 FastMM4 堆管理器的纯 pascal 版本。

此版本标记了块,以便跟踪和报告任何内存泄漏。

但在所有情况下,它都不会向您的可执行文件添加 300-500 KB。

由于编码的 pascal 版本(不如 asm 优化)以及执行的额外检查(例如块标记),它会比“正常”FastMM4 模式慢。

但可执行文件大小增加 300-500 KB 与 FullDebugMode 无关。它只有几十 KB 的大小(在最坏的情况下),因为大部分使用的代码都保留在外部 FastMM_FullDebugMode.dll 库中。

您应该手动更改一些项目选项,例如 TD32 信息或远程调试信息。但据我了解,FastMM4 在完全调试模式下不需要这些信息。

The FullDebugMode use a pure pascal version of the FastMM4 heap manager.

This version marks blocks, so that any memory leak will be tracked and reported.

But in all cases, it won't NEVER add 300-500 KB to your executable.

It will be slower than "normal" FastMM4 mode, because of the pascal version of the coding (less optimized than asm) and because of the extra checks performed (e.g. the blocks marking).

But the 300-500 KB executable size increase is NOT related to FullDebugMode. It's only a matter of some dozen KB (in worst case), because most of the used code stays in the external FastMM_FullDebugMode.dll library.

You should have changed by hand some Project Options, like the TD32 info or the remote debugging info. But these info are not required with FastMM4 in full debug mode, as far as I understand.

小…楫夜泊 2024-10-06 15:44:06

FastMM 应使用 D5 进行编译,并且不应查找 libc(Linux 库)。在D5下编译时最新版本存在问题(像这样),尝试源存储库中的最新源代码?

FastMM should compile with D5 and it shouldn't look for libc, which is Linux library. There's problem with latest versions when compiling under D5 (like this), try the latest source code from source repository?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文