Re: [Gc] gc on windows
ivmai at mail.ru
Thu Aug 13 23:06:05 PDT 2009
Jack Andrews <effbiae at gmail.com> wrote:
> 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
This is a bit outdated documentation - now it is preferred (for new code) to always call GC_INIT(). Also, DLLMain-based thread registration is NOT preferred (i.e. don't call GC_use_DllMain()).
> 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.
> > GC is GREAT!!! I used it as a lib with threads in windows C++.
> > And it works well.
> great! now i'm wondering what the best configuration is. i'm
> writing a dll and so i wonder if i should build a dll (gc.dll) that
> my dll loads, or whether it's better to create a static lib and
> have my dll link to that?
Both static and dll variants of GC will fit.
> ta, jack
More information about the Gc