Board index » delphi » FastMM problem with runtime packages

FastMM problem with runtime packages


2005-08-16 07:15:01 PM
delphi236
I'm trying to use FastMM in my application, which consists of a main exe
and a couple of dynamically loaded dlls, all of which are built with
runtime packages.
I put the FastMM4.pas unit in all projects' uses clauses and took care
to set the correct patching order for madExcept, which is used in the
exe, but not in the dlls.
I enabled the AssumeMultiThreaded, ShareMM and AttemptToUseSharedMM
conditional defines for all projects involved.
The problem is that main exe loads and runs fine, but the dlls refuse to
hook to shared FastMM. When main exe calls LoadLibrary, each of the dlls
complains with the message "Cannot install FastMM4 - Another memory
manager is already installed".
What did I miss?
TIA,
Aleksander Oven
 
 

Re:FastMM problem with runtime packages

Hi Aleksander,
Quote
complains with the message "Cannot install FastMM4 - Another memory
manager is already installed".
And that memory manager is FastMM itself - the RTL runtime package is shared
between all the DLLs, so the first DLL (or main exe) to install FastMM will
change the MM and the others will fail. I will think about a suitable
solution to the problem, in the meantime I suggest you just disable this
check in CheckCanInstallMemoryManager.
Thanks for the feedback.
Regards,
Pierre
 

Re:FastMM problem with runtime packages

Quote
And that memory manager is FastMM itself - the RTL runtime package is shared
between all the DLLs, so the first DLL (or main exe) to install FastMM will
change the MM and the others will fail.
I figured something like this must be going on.
Quote
I will think about a suitable
solution to the problem, in the meantime I suggest you just disable this
check in CheckCanInstallMemoryManager.

Thanks for the feedback.
Ok, no problem.
Regards,
Aleksander Oven
 

Re:FastMM problem with runtime packages

Hi Aleksander,
Quote
The problem is that main exe loads and runs fine, but the dlls refuse to
hook to shared FastMM. When main exe calls LoadLibrary, each of the dlls
I have uploaded FastMM 4.26 that adds a "UseRuntimePackages" option that
fixes this issue. Thanks for reporting the problem.
Best Regards,
Pierre
 

Re:FastMM problem with runtime packages

Quote
I have uploaded FastMM 4.26 that adds a "UseRuntimePackages" option that
fixes this issue. Thanks for reporting the problem.
Great! I will check it right away.
Regards,
Aleksander Oven