Re: [Gc] gc on windows

Ivan Maidanski ivmai at mail.ru
Thu Aug 13 05:06:03 PDT 2009


Hi!

Jack Andrews <effbiae at gmail.com> wrote:
> hi,
> 
> been a member of this list for a little while and
> i'm a bit nervous about using gc in my project.
> 
> i'm using windows, writing a dll in C.  the
> dll also spawns a thread to manage a logging
> window.
> 
> should the latest cvs version work ok?
If you asking whether it's safe to use the current cvs for Windows then, I say, yes.

> what sort of things shouldn't i do if i want
> reliable gc'ing?

BoehmGC is conservative so you can't expect an unreferenced object would be reliably gc'ed.

Or if you mean reliable memory management by gc then:
- call GC_INIT() at start-up;
- don't hide pointers (including in thread-local storage);
- use redirected _beginthreadex/_endthread (or use manual [un]register thread registering (and call GC_allow_register_threads before first spawn)).

> 
> what if i want to mmap files or use virtual
> alloc?

Nothing special, I think.

For speed (in case of large mmap'ed areas), you may want to manually GC_exclude_static_roots (not sure for Windows).

> 
> ta, jack.

Bye.


More information about the Gc mailing list