I have been using FastMM4 version 4.92 in my Delphi 6 Pro application smoothly. I now want to use it in a package I created (BPL). I tried putting the units in the Contains section and then moving them to the top of the list but I still get the error from FastMM4 complaining that it is not the first unit to be initialized. To fix this I want to put FastMM4 in the Requires section but I can't find a DCP file for FastMM4 anywhere (runtime library). Does anyone know how to make this happen?
How to use FastMM4 in a Delphi 6 package?
Asked Answered
Memory manager is global for the entire application. You can't use it selectable in only one BPL. Either you use it in the entrire app or don't use it at all. However, you can place MM's code in exe or bpl. –
Geber
@Alexander: or don't use it at all? maybe you mean don't use a custom memory manager but the default one... AFAIK there's no way to not use a memory manager. –
Agenda
@Robert : Can you provide me pointers to include FastMM into a Delphi 6 application. I am not able to see the Memory Leak log file. Thanks –
Moulton
Probably, the reason you've got this error is that you should include FastMM4 unit not in your package, but in project where you are testing(using) your newcreated package(ofcourse on the first place in 'uses' section).
Not enough to do this. If you want your application which uses runtime packages to use FastMM you must build the fastMM shared componentry (fastmm.dll and/or fastmm_fulldebugmode.dll) and use the modified borlandmm.dll. –
Barnabas
Did you set UseRuntimePackages in the FastMM4Options.inc file? Otherwise you could try to use ShareMem and the BorlndMM.dll replacement that comes with FastMM. Although ShareMem is designed for DLLs, its use should route all memory management routines to those in the BorlndMM.dll, allowing both the standard packages and yours to use FastMM code.
I think your answer is probably more accurate than mine. –
Barnabas
I'm not using runtime packages in my project. Do the units that reside in static packages that are linked into the main project go through FastMM4? I assumed they didn't so that is why I am trying to force the use of FastMM4 into my packages (DPK). Is my assumption wrong? –
Incubate
© 2022 - 2024 — McMap. All rights reserved.