<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 06/05/2012 08:29 AM, Mattias Gaertner wrote:
    <blockquote cite="mid:20120605082906.02256a19@limapholos"
      type="cite">
      yes it is relevant.
      If you have two memory managers you can not exchange strings and
      classes.<br>
    </blockquote>
    Is cmem "the way to go" to unify the memory managers of a dynamic
    library and the calling application ? (There seem more advanced free
    alternatives written for Delphi, that might be usable with FPC.)<br>
    <br>
    Will just "using" cmem both in the main program and in the library
    automatically unify the memory managers ? <br>
    <br>
    <br>
    <br>
    <a class="moz-txt-link-freetext" href="http://wiki.freepascal.org/Multithreaded_Application_Tutorial">http://wiki.freepascal.org/Multithreaded_Application_Tutorial</a>
    states: <br>
    <pre dir="ltr" class="mw-geshi mw-content-ltr"><pre class="de1">
  cmem<span class="sy1">,</span> <span class="co1">// the c memory manager is on some systems much faster for multi-threading

and 
</span>
You can not use the -gh switch with the <i>cmem</i> unit. The -gh switch uses the heaptrc unit, 
which extends the heap manager. Therefore the <b>heaptrc</b> unit must be used <b>after</b> the <b>cmem</b> unit.

</pre>
Should the FPC memory manager not be more optimized for FPC code then cmem ? 

-Michael
</pre>
  </body>
</html>