Questions tagged «fastmm»

1
有没有办法以编程方式判断FastMM是否未释放特定的内存块?
我试图检测是否没有释放一块内存。当然,管理器通过对话框或日志文件告诉我,但是如果我想将结果存储在数据库中怎么办?例如,我想在数据库表中有分配给定块的例程名称。 阅读FastMM的文档后,我知道自版本4.98以来,我们可能会在发生内存分配,释放和重新分配时被管理员通知。例如,OnDebugFreeMemFinish事件正在传递给我们,PFullDebugBlockHeader其中包含有用的信息。PFullDebugBlockHeader缺少一件事-如果应用程序释放了给定的块,则该信息。 除非OnDebugFreeMemFinish仅针对未释放的块调用?这是我不知道并且想找出的。 问题在于,即使挂入OnDebugFreeMemFinish事件,我也无法确定是否释放了该块。 这是一个例子: program MemLeakTest; {$APPTYPE CONSOLE} uses FastMM4, ExceptionLog, SysUtils; procedure MemFreeEvent(APHeaderFreedBlock: PFullDebugBlockHeader; AResult: Integer); begin //This is executed at the end, but how should I know that this block should be freed //by application? Unless this is executed ONLY for not freed blocks. end; procedure Leak; …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.