[Gc] Cygwin with threads and GC_DLL now works
ivmai at mail.ru
Fri May 1 03:23:39 PDT 2009
The proposed patch makes Cygwin usable with GC_DLL and GC_THREADS (including THREAD_LOCAL_ALLOC and PARALLEL_MARK). But, DllMain-based thread registration is still not supported.
The patch does:
- define GC_API for Cygwin the same as for VC++ in gc_config_macros.h (in fact, gc.dll could be built and/or used without -DGC_DLL using cygwin auto-export/import but -DGC_BUILD -DGC_DLL shrinks gc.dll size by 10-15%);
- add GC_API decl modifier (without GC_CALL) for the wrapped GC_pthread_create/join/detach/sigmask() in win32_threads.c;
- remove "#error" for Cygwin with GC_DLL in win32_threads.c;
- "GC_win32_dll_threads" is defined as "0" macro for Cygwin pthreads and thread-local allocation too in win32_threads.c (for compiler optimization);
- make GC_use_DllMain() signal error if called when GC is built for Cygwin in win32_threads.c;
- use "word" instead of "size_t" as an intermediate type for ptr-to-int and vice verse casts in some funcs in win32_threads.c.
Note: GC_THREADS with GC_MMAP and/or GC_MUNMAP doesn't work on Cygwin.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4528 bytes
Desc: not available
Url : https://napali.hpl.hp.com/pipermail/gc/attachments/20090501/c3e021b4/diff76-0001.obj
More information about the Gc