[Gc] gc on windows

Boehm, Hans hans.boehm at hp.com
Fri Aug 14 13:01:38 PDT 2009


Adding to Ivan's answer:

There are a handful of platforms on which it actually matters that GC_INIT is called from the main program because it expands into something that includes symbol references that won't have the right definition in a dynamic library.  I believe that this currently only matters for Cygwin and AIX.

On other platforms it's fine to call it from a dll or equivalent.  But that means that maximally portable code should call it from the main program.

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Jack Andrews
> Sent: Thursday, August 13, 2009 10:12 PM
> To: gc at napali.hpl.hp.com
> Subject: Re: [Gc] gc on windows
> 
> i just read 
> (http://www.hpl.hp.com/personal/Hans_Boehm/gc/simple_example.html)
> '''
> On some other platforms it is necessary to call GC_INIT() 
> from the main program, which is presumed to be part of the 
> main executable, not a dynamic library. This can never hurt, 
> and is thus generally good practice.
> '''
> 
> so my dll shouldn't call GC_INIT()?  can't i have an ini() 
> function that the main program calls and in the ini() 
> function, i call GC_INIT()?  the host is C#/.NET and my dll is in c.
> 
> ta, jack
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 


More information about the Gc mailing list