Since 6.3: - Merge gcconfig.h changes from gcc tree. - Unconditionally include gc_priv.h in solaris_pthreads.c, win32_threads.h, aix_irix_threads.c, and solaris_threads.c to get thread definitions. - Start marker threads in GC_thr_init, so that they get started even if no other threads are ever started. (Oddly enough, the parallel collector worked correctly, though not well, with no helper threads.) - Go ahead and split large blocks in GC_allochblk_nth if GC_dont_gc is set. (Thanks to Alexander Petrossian.) - GC_PRINT_BACK_HEIGHT would deadlock with thread support. - Let in_progress_space in backgraph.s grow dynamically. - Fix README.solaris2. The GC_thr_init() hack doesn't work anymore. - Convert GC_finalizer_mem_freed to bytes in allchblk.c. - Add missing declaration for GC_generic_malloc_words_small_inner. Without it, s390x breaks. (Thanks to Ulrich Weigand.) - Applied several MacOSX patches to support older tool chains. (Thanks to Stefan Ring.) - Bug fix for NetBSD/amd64. (Thanks to Marc Recht.) Add NetBSD/sh3 support. (Thanks to Uchiyama Yasushi.) - Fixed an uninitialized variable in cordprnt.c. (Thanks to gcc for providing the warning.) - Eliminated some, but not all, gcc -Wall warnings. - Changed some old style casts to reinterpret_cast in new_gc_alloc.h. (Thanks to Dan Grayson.) - GC_extend_size_map shouldn't adjust for GC_all_interior_pointers if GC_DONT_ADD_BYTE_AT_END is set. - Changed some (long) casts to (word) in preparation for win64. (Thanks to Peter Colson.) - Changed "int stack_size" declaration in pthread_support.c to use size_t. (Only mattered with GC_ASSERTIONS enabled.) - Added CRIS (etrax) support. (Thanks to Simon Posnjak and Hans-Peter Nilsson.) - Removed GC_IGNORE_FB frame buffer recognition, and replaced it with a check that the mapping type is MEM_IMAGE. In theory, this should work much better, but it is a high risk change for win32. (Thanks to Ashley Bone for the crucial experimental data behind this, and to Rutger Ovidus for some further experiments.) - Fixed print_block_list to print the correct kind number for STUBBORN. (Thanks to Rutger Ovidus.) - GC_allochblk_nth incremented GC_words_wasted by bytes rather than words. - Consider GC_words_wasted in GC_adj_words_allocd only if it is within reason. (A hack to avoid some extremely unlikely scenarios in which we manage to allocate only "wasted" space. 7.0 has a better fix.) - Changed PowerPC GC_clear implementation to use lwsync instead of eieio, since the documentation recommends against eieio, and it seems to be incorrect if the preceding memory op is a load. - Fixed print_block_list to print the correct kind number for STUBBORN. (Thanks to Rutger Ovidus.) - Have configure.in generate an error if it is asked to support pthreads, but doesn't know how to. - Added Kazuhiro Inaoka's patch for Renesas M32R support. - Have the GNU build mechanism link with -ldl. Rename THREADLIBS to THREADDLLIBS to reflect this. (Thanks to Sven Verdoolaege.) - Added Hannes Mehnert's patch for FreeBSD/SPARC support. - Merged some FreeBSD specific patches to threadlibs.c and dyn_load.c. (Thanks tp John Merryweather Cooper.) - Define MPROTECT_VDB on MACOSX only if threads are being used, since the dirty page tracking mechanism uses threads. (This avoids an undefined reference to _GC_darwin_register_mach_handler_thread.) - By popular demand, use __libc symbols only if we are built with USE_LIBC_PRIVATES, which is off by default, and not otherwise documented. - Ignore GC_enable_incremental() requests when KEEP_BACK_PTRS is set. The GC itself will dirty lots of pages in this cases, probably making it counterproductive on all platforms. And the DARWIN port crashes. Since GC6.4: - Integrated Paolo Molaro's patch to deal with EINTR in sem_wait. - Make GC_approx_sp() write to dummy location to ensure that stack is grown here, when sp looks reasonable, rather than later, when it might look like a bad memory reference. (Problem was never observed that I know of. But on rereading the code it seemed dubious.) - Separate out GC_with_callee_saves_pushed and sometimes call it from GC_suspend_handler in pthread_stop_world.c. Callee-save register values sometimes failed to get traced under HP/UX on PA-RISC. Linux/IA64 had the same problem, though non-stacked callee-save registers seem to be so rarely used there that nobody ever noticed. - Integrated an ancient Darwin powerpc_darwin_machine_dep.s patch from Andreas Tobler, which I had lost. - Fix compare_and_exchange implementation for gcc/IA64 to deal with pickier compiler versions. - Fixed Itanium 32-bit ABI support (HP/UX). In particular, the compare_and_exchange implementation didn't consider that possibility. - Undefine GC_pthread_detach in win32_threads.c. (Thanks to Tagliapietra Tommaso.) - Fixed inclusion of frame.h for NETBSD in os_dep.c. - Applied Dan Bonachea's patch to use mmap on AIX. - Several fixes to resurrect the Irix port on recent OS versions. - Change ALPHA to use LINUX_STACKBOTTOM. - Change SPARC64/LINUX to also use LINUX_STACKBOTTOM. Deal with potential bad values of __libc_stack_end on that platform. (Thanks to David Miller.) - Relax gctest to allow larger heap if ALIGN_DOUBLE isn't set. (Unnecessary in 7.0) - Force a define of __STDC__=0 for the IBM compiler on AIX, so that we get prototypes. (Unnecessary in 7.0) - GC_INIT definition for AIX and CYGWIN referred to DATASTART and DATAEND which are only defined in private include files. - Integrated some small gcconfig.h patches from Dan Bonachea. Also relaxed assertion about FreeBSD stack size in pthread_support.c. - Integrated Andrew Begel's darwin_stop_world.c patch for 64-bit support. This may need additional work. - Avoided potentially infinite recursion in GC_save_callers if the system backtrace calls malloc. The workaround currently requires __thread support if this code is used with threads. - Avoided another similar infinite recursion by conditionally invoking GC_save_callers in alloc.c. (Thanks to Matthias Andree for helping to track down both of these.) - Removed all traces of aix_irix_threads.c. AIX and Irix now use pthread_support.c and pthread_stop_world.c. The old code appeared to be unreliable for AIX, and was not regularly maintained. - On Irix, ignore segments with MA_FETCHOP or MA_NOTCACHED attributed; they're not always safe to read. - Fixed a previously vacuous assertion (diagnosed by the SGI compiler) in GC_remove_from_fl. - Fix stack_size assertion in GC_pthread_create. - Fix assertion in GC_steal_mark_stack. Since 6.5 - Fix CPU count detection for Irix and FreeBSD. (Thanks to Dan Bonachea.) - Integrate Dan Bonachea's patch for the IBM XLC compiler on Darwin. - Integrated Andreas Tobler's FreeBSD/PowerPC patch. - Don't access the GC thread structure from the restart handler. It's unsafe, since the handler may run too late. (Thanks to Ben Maurer for tracking this down.) - Applied Christian Thalinger's patch to change comment syntax in alpha_mach_dep.S. - Added test for GC_no_dls in GC_dyld_image_add for DARWIN. (Thanks to Juan Jose Garcia Ripoli). - Use LINUX_STACKBOTTOM for Linux/SH and LINUX/ARM. (Thanks to Sugioka Toshinobu and Christian Thalinger.) - Rewrote GC_parse_map_entry. This assumed a fixed column layout of /proc/self/maps on Linux. This ceased to be true about 2 years ago. The old code is probably quite problemetic with -DREDIRECT_MALLOC. It is also used by default for IA64, though I haven't seen actual failures there. - More consistently define HBLKSIZE to 4096 on 64 bit architectures with 4K pages. (Thanks to Andrew Haley.) - With win32 threads, GC_stop_world needs to acquire GC_write_cs. (Thanks to Ben Hutchings for the observation and patch.) - Move up struct callinfo declaration to make gcc 4.0.2. happy. Since 6.6: - Add "int" to Solaris "end" and "etext" declaration in gc.h. Declared the symbols with underscores and as arrays, since that's what's actually used. Perhaps this could all just be removed? (Thanks to John Bowman.) - Fixed ARM GC_test_and_set code. (Thanks to Kazu Hirata and Paul Brook.) - Added casts for assignments to hb_last_reclaimed, which truncate the value. Added a cast to GC_adj_words_allocd. Use GetModuleHandleA when retrieving a handle to kernel32.dll under win32. (Thanks to the Visual Prolog developers.) - Added Tandem S-Series support. (Thanks to Craig McDaniel. A modified version of his patch was applied, and hence breakage is probably not his fault.) - Remove spurious gc:: qualifier for operator delete[] in gc_cpp.h. (Thanks to Hanno Boeck.) - Changed a test for LINUX in config_macros.h to one for __linux__. - Fix ppc 64 test_and_set code by removing it. (Thanks to Christian Thalinger.) - Add prototypes for GC_finalizer_notifier and GC_thr_init. (Thanks to David Ayers.) - Use ld instead of nonexistent ldz instruction in Darwin FindTopOfStack. (Thanks to Andreas Tobler.) - Add support for Darwin/X86. (Thanks to Geoff Norton and the Mono developers.) - Merge in some recent gcc fixes. Add ppc64 asm code. (Thanks to Bryce McKinley and other gcj developers.) - Scan MEM_PRIVATE sections under Windows ME and predecessors. - Interior pointers with some largish offsets into large objects could be ignored, if GC_all_interior_pointers was set. (Oddly this worked correctly for stack references if it was not set. Otherwise it failed for both stack and heap references.) Thanks to Andrew McKinlay for the critical test case. - Integrated Tatsuya Bizenn's NETBSD threads support, with some minimally tested changes. - Added GC_strdup and friends to make leak detection work correctly for strdup clients. (Thanks to Jon Moore.) Fixed the existing strdup with malloc redirection to handle a null malloc return correctly. - Fix Makefile.am, so it handles exe extensions under Cygwin correctly for gctest. Since 6.7: - Added some support for Dragonfly BSD. (Thanks to Joerg Sonnenberger and Thomas Klausner.) - Improvements to the HP/UX section of configure.in. (Thanks to Andreas Tobler.) - GC_unix_get_mem could neglect to release the malloc lock on Irix, under extremely unlikely circumstances. Thanks to Jean-Baptiste Nivois for some careful code reading. - Added support for kFreeBSD + glibc (Thanks to Petr Salinger) - Fix more MacOS threads memory leaks (Thanks to Allan Hsu) - Added initial Solaris/X86-64 support (Thanks to Rainer Orth) - Applied a long-lost MINGW patch from Gerard Allan for malloc redirection with threads. This one probably makes no sense for 7.0, and was not applied there. - The Solaris/SPARC definition of GC_INIT() in gc.h wasn't C++-compilable. To do: - The USE_MUNMAP code should really use a separate data structure indexed by physical page to keep track of time since last use of a page. Using hblk headers means we lose track of ages when blocks are merged, and we can't unmap pages that have been allocated and dropped by the blacklisting code. I suspect both of these matter. - A dynamic libgc.so references dlopen unconditionally, but doesn't link against libdl. - GC_proc_fd for Solaris is not correctly updated in response to a fork() call. Thus incremental collection in the child won't work correctly. (Thanks to Ben Cottrell for pointing this out.) - --enable-redirect-malloc is mostly untested and known not to work on some platforms. - There seem to be outstanding issues on Solaris/X86, possibly with finding the data segment starting address. Information/patches would be appreciated. - Very large root set sizes (> 16 MB or so) could cause the collector to abort with an unexpected mark stack overflow. (Thanks again to Peter Chubb.) NOT YET FIXED. Workaround is to increase the initial size. - The SGI version of the collector marks from mmapped pages, even if they are not part of dynamic library static data areas. This causes performance problems with some SGI libraries that use mmap as a bitmap allocator. NOT YET FIXED. It may be possible to turn off DYNAMIC_LOADING in the collector as a workaround. It may also be possible to conditionally intercept mmap and use GC_exclude_static_roots. The real fix is to walk rld data structures, which looks possible. - Incremental collector should handle large objects better. Currently, it looks like the whole object is treated as dirty if any part of it is. Major 7.0 changes: - Change C code to require at least C89. Clean up code in various outher respects. - Win64 port. - Always count how much live data there is in the heap. Add more robust heap expansion heuristic which relies on this. - Remove old-style Solaris threads support and some other obsolete platform support. - Restructure mark code, hopefull resulting in some performance improvements. - Change the GC code to traffic mostly in either bytes or allocation granules, not words, internally. - Provide for fast inline allocation that requires less frequent client recompilations. (Needs more testing.) - Removed SILENT configuration macro and PRINTSTATS and GATHERSTATS macros. Control is now via GC_PRINT_STATS and GC_PRINT_VERBOSE_STATS encironment variables. - Thread local allocation is now performed without needing to call special allocation functions. The configuration macro THREAD_LOCAL_ALLOC continues to determine whether this is supported. - Thread local allocation is supported on more platforms. - Win32 threads code was rewritten and is hopefully more sane. - Allocation routines now decide whether to lock dynamically, based on whether a second thread has been created. - Mostly untested support for a compiler write barrier. - Use libatomic_ops for atomic operations. - Limited support for malloc redirection with Linux threads (& NPTL ). - Various bug fixes and some new platform support.