Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FastMM questions

363 views
Skip to first unread message

Dmitriy Popkov

unread,
Mar 1, 2006, 11:13:52 AM3/1/06
to
Hello!

We develop plugins with Delphi (D2006).
Host application built with default memory manager (borlndmm.dll).
We cannot replace borlndmm.dll.
We haven't sources for host application.

But we want to use FastMM4 in our plugins to trace memory leaks e t.c.
(MemCheck don't work with D2006 RTL)

Currently, I do this:
====================
-- cut application.inc --
{$DEFINE USE_FASTMM4}
{$DEFINE IS_DLL}
-- /cut application.inc --

-- cut application.dpr --
uses
{$IFDEF USE_FASTMM4}
FastMM4,
{$ELSE}
ShareMem,
{$ENDIF}
-- /cut application.dpr --

FullDebugMode is on
EnableMemoryLeakReporting is on
EnableSharingWithDefaultMM is on
====================

Unfortunately, application hands on (access violation) on exit (after
messagebox with leak report).

HOW can I use FastMM4 for such plugin?
Help, please.


--
Sincerely, Dmitriy

Pierre le Riche

unread,
Mar 1, 2006, 11:53:24 AM3/1/06
to
Hi Dmitriy,

> uses
> {$IFDEF USE_FASTMM4}
> FastMM4,
> {$ELSE}
> ShareMem,
> {$ENDIF}

> HOW can I use FastMM4 for such plugin?
> Help, please.

FastMM4's default sharing mechanism is not compatible with ShareMem.
ShareMem uses the borlndmm.dll library (which you can replace with the
FastMM4 version if you want, by the way). FastMM4's default sharing
mechanism *is* compatible with SimpleShareMem.pas (which doesn't use
borlandmm.dll).

In effect what you're trying to do here is to mix two sharing mechanisms
which won't work. Either use
(a) SimpleShareMem.pas/FastMM4.pas, or use
(b) ShareMem.pas (i.e. borlndmm.dll)
You cannot mix the two different sharing methods.

Regards,
Pierre


Dmitriy Popkov

unread,
Mar 1, 2006, 12:07:57 PM3/1/06
to

Thank for your feedback, Pierre.

--
Sincerely, Dmitriy

0 new messages