== [8.1.0] (development) == * Add API for accessing incremental GC time limit with nanosecond precision * Add API function to force start of incremental collection * Add GC_ prefix to scan_ptr and some other static variables (refactoring) * Add GC_get/set_disable_automatic_collection API * Add I_HOLD_LOCK assertion to expand_hp_inner and related functions * Add assertion on free-list argument and result of GC_new_kind * Add assertion that GC is initialized to base incremental_protection_needs * Add assertions that GC_page_size is initialized * Add cordtest, staticrootstest, test_cpp, tracetest, disclaim tests (CMake) * Add debug messages on thread suspend/resume (Win32) * Add dummy testing of GC_incr_bytes_allocd/freed * Add table of contents in gcdescr.md * Add testing of GC_CALLOC/MALLOC_EXPLICITLY_TYPED (gctest) * Adjust formatting of numbered lists in README.md to match other .md files * Adjust highlighting of API prototypes in gcinterface.md * Adjust macro def/usage for AVR32, CRIS, NETBSD, OPENBSD, SH4 in gcconfig.h * Adjust printf calls in gctest check_heap_stats so that each has new-line * Allow incremental GC on Cygwin * Allow memory unmapping in case of MPROTECT_VDB * Allow to disable __builtin_return_address(1) usage (x86 and x64) * Always abort on failure to access /proc/self/maps (Linux) * Always define default_push_other_roots (code refactoring) * Avoid gcc stringop-overflow warning for intended overflow in smashtest * Avoid initial 3ms pause on world stop/start with GC_retry_signals (Linux) * Build cord.lib by Makefile.direct, NT_MAKEFILE, OS2_MAKEFILE, WCC_MAKEFILE * Build gc as a shared multi-threaded library by default (CMake) * Build gccpp library by Makefile.direct, NT_MAKEFILE and WCC_MAKEFILE * Build gctba library * Build shared libraries by default (WCC_MAKEFILE) * Change CLOCK_TYPE to timespec for Nintendo Switch (code refactoring) * Change log_size fields of finalizer to unsigned type (code refactoring) * Change type of toggleref_array_size/capacity to size_t (code refactoring) * Check leak of objects allocated by CRT malloc in gctest (MS VC) * Check real-symbols are already initialized in pthread_join/detach * Collapse multiple includes of windows.h (code refactoring) * Comments reformatting in mark.c to properly delimit sentences * Compile de test GUI app with resources (CMake) * Compile gc.c unless building static libraries (NT_MAKEFILE, WCC_MAKEFILE) * Compile msvc_dbg.c by CMake script (MS VC) * Define GC_win32_free_heap API function for all Windows targets * Define STATIC macro to static by default * Depend number of fork_a_thread calls on NTHREADS (gctest) * Detect dladdr() presence in CMake script * Detect presence of execinfo.h system header in CMake script * Detect presence of getcontext and dl_iterate_phdr in CMake script * Detect sigsetjmp() availability in CMake script * Disable Clang/GCC aliasing optimization in CMake script by default * Do not build tests by default (Makefile.direct and other Makefiles) * Do not build the tests by default (CMake) * Do not compile pthread_*.c files in Cygwin or MSYS (CMake) * Do not define GC_write_cs for Xbox One target * Do not hard-code CMAKE_DL_LIBS value and install paths (CMake) * Do not hard-code finalizable objects limit which triggers GC * Document GC_incr_bytes_allocd/freed API function * Eliminate '(long)size<=0 is always false' cppcheck FP * Eliminate 'Consecutive return is unnecessary' cppcheck style warning * Eliminate 'accessing GC_dont_gc without lock' in GC_init code defect FP * Eliminate 'bytes_freed access w/o lock in incr_bytes_free' code defect FP * Eliminate 'checking if unsigned i < 0' cppcheck FP in is_heap_base * Eliminate 'hash_val value is never used' cppcheck false positive * Eliminate 'passing tainted var maps_buf to tainted sink' code defect FP * Eliminate 'stop variable is always 0' compiler warning in print_callers * Eliminate 'struct member os_callback is never used' cppcheck warning * Eliminate 't->flags not atomically updated' code defect FP * Eliminate 'tmpl might be accessed at non-zero index' cppcheck error * Eliminate GCC warning of unsafe __builtin_return_address(1) * Eliminate code duplication in reclaim_clear and disclaim_and_reclaim * Eliminate double lock code defect false positive in generic_lock * Eliminate memory leak reported in add_current_malloc_heap at exit (Win32) * Emscripten single-threaded support (detect stack base, push registers) * Enable CMake-based build for Borland and Watcom compilers * Enable compilation without C runtime (Win32) * Enable mprotect-based incremental GC for Linux/arm and Linux/aarch64 * Enable true incremental collection even if parallel marker is on * Ensure ELFSIZE is defined in dyn_load.c for OpenBSD (code refactoring) * Ensure all getters and setters are run at least once by gctest (pthreads) * Export CMake targets with namespace BDWgc * Fix 'const obj must be initialized if not extern' error in gc_alloc_ptrs.h * Fix ./libgc.la dependency on FreeBSD (Automake) * Fix HOST determination in CMake script * Fix copyright message in de_win.rc, gc_cpp.cc, ec.h and specific.h * Fix missing OS_TYPE definition for some targets * Generate cordtest and de executable files in GC base folder * Generate pkg-config metadata file (CMake) * Get rid of some non-ELF ifdefs (code refactoring) * Handle potential incomplete buffer read in GC_linux_main_stack_base * Implement GET_TIME for Nintendo Switch * Increase NTHREADS value in tests if code coverage analysis * Install docs and man page if enable_docs (CMake) * Install gc_gcj.h and gc_pthread_redirects.h only if appropriate * Mark buffer returned by get_maps as const (code refactoring) * Move C++ GC_ATTR_EXPLICIT and GC_NOEXCEPT definition to gc_config_macros.h * Move GC state non-pointer variables into GC_arrays (code refactoring) * Move GC state pointer variables into GC_arrays * Move GC_throw_bad_alloc definition to new C++ file * Move QNX and Emscripten macro definitions to proper place in gcconfig.h * Move definition of GC_n_mark_procs and GC_n_kinds from mark.c to misc.c * New API (GC_set_markers_count) to control number of parallel markers * New API function to clear GC exclusion table * New API function to get size of object debug header * New API standalone functions to acquire and release the allocator lock * New CMake option (disable_gc_debug) to remove debugging code * New CMake option (disable_handle_fork) to disable fork handling completely * New macro (CONSOLE_LOG) to enable logging to console on Win32 * New macro (GCTEST_PRINT_VERBOSE) to enable verbose logging in test.c only * New macro (NO_MSGBOX_ON_ERROR) to avoid message box on GC abort (Win32) * OpenBSD does not use ELF_CLASS (code refactoring) * Pass -D GC_DLL -fvisibility=hidden if default configure build is requested * Pass -no-undefined linker flag if building shared libraries (CMake) * Print pid of child processes if verbose logging (gctest) * Read environment variables from a file on WinCE (CMake script) * Reduce stack-allocated buffer in get_nprocs from 4KB to 1.7KB * Refine flags field comment in pthread_support.h * Reformat code of GC_push_roots * Reformat gc.man (wrap long lines) * Reformatting and code refactoring of CMake script * Remove 'current users' section from overview.md * Remove 'distributed ports', 'scalable versions' sections from overview.md * Remove AC_MSG_RESULT for THREADDLLIBS (dgux386) * Remove Borland-specific Makefile and gc.mak script * Remove GC_eobjfreelist variable in typd_mlc.c (code refactoring) * Remove GC_gcj_malloc_initialized variable (code refactoring) * Remove Linux-specific commands for building cord/de from Makefile.direct * Remove Win32 main_thread static variable if threads discovery is disabled * Remove commented out assignment of gc_use_mmap in configure (refactoring) * Remove dash characters comprising prefix of some verbose logs (gctest) * Remove dependency on user32.dll import library from static libgc (Win32) * Remove documentation specific to particular old BDWGC releases * Remove gcmt-dll generation, rename libgc-lib.a to libgc.a (CMake) * Remove goto statement in print_callers (code refactoring) * Remove new_gc_alloc.h file * Remove redundant GC_with_callee_saves_pushed call in multi-threaded builds * Remove redundant check of GC_free argument in register_finalizer * Remove redundant type casts in backgraph HEIGHT_UNKNOWN/IN_PROGRESS * Remove unused STACK_GRAN macro definitions (code refactoring) * Remove unused sparc_sunos4_mach_dep.s file * Remove weakobj_free_list variable in disclaim_weakmap_test (refactoring) * Rename READ to PROC_READ in os_dep.c (code refactoring) * Rename cord/cord test executable to de (CMake) * Rename ext_descr to typed_ext_descr_t (code refactoring) * Rename gc64.dll to gc.dll and gc[64]_dll.lib to gc.lib in NT_MAKEFILE * Rename gc68060.lib to gc.lib, cord/cord68060.lib to cord.lib in SMakefile * Rename make_as_lib option to enable_static in NT_MAKEFILE and WCC_MAKEFILE * Rename nothreads option to disable_threads in NT_MAKEFILE * Repeat run_one_test NTHREADS times by gctest if single-threaded * Replace "msecs" with "ms" in all comments and messages * Replace 'stack base' with 'stack bottom' in the documentation * Replace SN_TARGET_ORBIS to PLATFORM_* and GC_NO_* macros * Replace _M_AMD64 macro with _M_X64 (code refactoring) * Replace find_limit_openbsd to find_limit_with_bound (OpenBSD 5.2+) * Replace obsolete AC_HELP_STRING with AS_HELP_STRING (refactoring) * Replace push_one calls with push_many_regs one for Win32 thread context * Report time with a nanosecond precision where available * Set GC_collecting hint for GC_collect_a_little_inner calls (pthreads) * Set name of GC marker threads * Set so-version for installed shared libraries (CMake) * Simplify logged message in scratch_recycle * Simplify loops of collect_a_little/stopped_mark invoking mark_some * Support -fvisibility=hidden option in CMake script * Support CFLAGS_EXTRA to pass extra user-defined compiler flags (CMake) * Support FreeBSD/RISC-V, Linux/arc, LoongArch, OpenBSD/powerpc64 * Support header files installation (CMake) * Support most configure options in CMake script * Suppress warnings in test_tinyfl() of gctest reported by Watcom C complier * Take nanoseconds into account when updating full_gc_total_time * Turn off C++ API by default, export it in gccpp library (CMake) * Update README.cmake regarding Unix, C++ and tests * Update libgc.so version info to differentiate against v8.0.x * Update the ASCII diagrams describing the tree structure for pointer lookups * Update the documentation to match the current GC implementation * Upgrade cmake_minimum_required(version) to 3.1 * Use CreateThread without GC_ prefix in gctest (code refactoring) * Use KB/MB/GB abbreviations uniformly across entire documentation * Use USE_MMAP_ANON when USE_MMAP is configured on OpenBSD * Use a specific Emscripten allocator for Tiny * Use atomic primitives for Sony PlayStation Portable 2 and PS4 * Use better precision Windows timers * Use clock_gettime() instead of clock() on Cygwin and Linux * Use compiler TLS on FreeBSD and NetBSD * Workaround 'condition result<=0 is always false' cppcheck FP in get_maps * Workaround 'same value in both branches of ternary operator' cppcheck FP * Workaround various cppcheck false positives == [8.0.6] (not released yet) == * Add loop to handle abort error like in suspend logic on Darwin * Add support of OpenBSD/aarch64 * Add threading libraries to bdw-gc.pc * Allocate start_info struct on the stack in GC_pthread_create * Allow GC_PAUSE_TIME_TARGET environment variable values smaller than 5 ms * Avoid compiler warning about unused d in GC_CALLOC/MALLOC_EXPLICITLY_TYPED * Avoid gcc stringop-overflow warning for intended overflow in smashtest * Check _MSVC_LANG macro in addition to __cplusplus (MS VC) * Compile C++ code with exception handling enabled in NT_MAKEFILE * Define OS_TYPE and DATAEND for UWP targets * Disable mprotect-based incremental GC if /proc roots are used (Linux) * Do not use Manual VDB mode if C malloc is redirected * Do not use iOS private symbols * Eliminate 'GC_non_gc_bytes is deprecated' warning in new_gc_alloc.h * Eliminate 'GC_old_bus_handler defined but not used' compiler warning * Eliminate 'cast between incompatible func types' warnings for FARPROC vars * Eliminate 'comparing signed and unsigned values' BCC warning in cordtest * Eliminate 'gc_pthread_redirects.h should contain header guard' code defect * Eliminate 'implicit declaration of sbrk' gcc warning if -std=c11 on Cygwin * Eliminate 'possible loss of data' BCC and MS VC warnings * Eliminate 'static GC_sysinfo definition has incomplete type' Clang warning * Eliminate 'unused function' compiler warnings (GC_add_map_entry, GC_lock) * Eliminate 'while clause does not guard' GCC warning in GC_parse_map_entry * Enable sbrk-to-mmap fallback on major supported Unix-like platforms * Explicitly zero-initialize trace_buf (fix trace_buf initialization) * Fix 'ACCESS_VIOLATION in marker' GC warning on Win32 async thread start * Fix 'GC_generic_malloc must be available' GCC error in new_gc_alloc.h * Fix 'ISO C++17 does not allow dynamic exception spec' clang-8 error * Fix 'Wrong __data_start/_end pair' if -Bsymbolic-functions used (Linux) * Fix 'condition pred!=NULL is always true' compiler warning * Fix 'external linkage required for var because of dllimport' error on MinGW * Fix 'ulong undefined' compilation error on AIX * Fix 'undefined reference to __data_start' linker error on RISC-V * Fix 'use of undeclared BUS_PAGE_FAULT' compilation error on FreeBSD 12 * Fix 'write to GC log failed' error (Cygwin) * Fix 'wrong finalization data' gctest failure on Windows * Fix CMake build on macOS Catalina * Fix GC_OPENBSD_THREADS definition (OpenBSD/hppa) * Fix MPROTECT_VDB definition for single-threaded GC builds * Fix OS_TYPE and USE_MMAP_ANON definitions for Cygwin/x64 * Fix STACKBOTTOM on 32-bit HP/UX 11.11 * Fix abort in GC_printf when gctest is built as WinMain executable (Cygwin) * Fix build for OS X (CMake) * Fix building of shared library with C++ support on MinGW * Fix compiling by Makefile.direct on OpenBSD/UltraSparc * Fix configure message about 'AIX gcc optimization fix' * Fix cordtest build in SMakefile.amiga * Fix data race regarding *rlh value in generic_malloc_many * Fix first_thread stack_base initialization if custom GC_stackbottom (Win32) * Fix gc_allocator.h compilation by Clang * Fix gc_cflags variable name in configure (HP/UX) * Fix incorrect markup formatting in documentation * Fix misaligned tlfs passed to AO_load on m68k * Fix missing gc_dlopen.c and specific.c in CMake script * Fix mmap() failures on AIX, HP/UX and Haiku * Fix printf format specifier in simple_example.md * Fix save_callers for multi-threaded case if built-in backtrace unavailable * Fix subexpression widening in memhash() of disclaim_weakmap_test * Fix test_cpp failure caused by arbitrary link order (Win32) * Fix test_cpp failure when gc_cpp resides in a dll (Borland, Watcom) * Fix various typos mostly in documentation files * Fix word size, data start and alignment for OpenBSD/mips64(el) * Include when using alloca on AIX * Limit number of unmapped regions (Linux and DragonFly) * New macro to avoid system-wide new/delete inlining in gc_cpp.h (Win32) * Prevent GetThreadContext failure (Windows) * Prevent WARN of incompatible incremental GC if default or manual VDB * Reduce a time period between GetExitCodeThread and SuspendThread (Win32) * Refactoring of WoW64 workaround (Win32) * Refine GC_INIT documentation about its multiple invocation * Refine GC_parallel documentation in gc.h * Refine do_blocking() documentation in gc.h * Remove a misleading comment about Solaris in gc.h * Remove cord .h files from list of non-installed headers (Automake) * Remove dead part of condition to define NEED_FIND_LIMIT in gc_priv.h * Remove gcmt-lib generation by CMake * Support MSYS builds by CMake and configure * Update documentation about the incremental collector support * Use HEURISTIC2 on OpenBSD when single-threaded * Use pstat_getprocvm to determine main stack bottom on HP-UX * Workaround 'expression is only useful for its side effects' WCC warning * Workaround clang-3.8/s390x bug when processing __builtin_frame_address * Workaround fread fail after enable_incremental if malloc redirected (Linux) == [8.0.4] 2019-03-02 == * Avoid a full GC when growing finalizer tables if in incremental mode * Avoid potential race in hb_sz access between realloc and reclaim_block * Avoid test.o rebuild on tests folder timestamp change (Makefile.direct) * Avoid unexpected heap growth in gctest caused by GC_disable * Ensure result of every variant of MS_TIME_DIFF has unsigned long type * Fix 'duplicate symbol' error for tests using multiple static libs (OS X) * Fix 'undefined reference to __data_start' linker error (Android/aarch64) * Fix 'unexpected mark stack overflow' abort in push_all_stack * Fix 'wrong __data_start/_end pair' error on Android * Fix BSD_TIME variant of MS_TIME_DIFF for the case of a.tv_usec < b.tv_usec * Fix GetThreadContext stale register values use if WoW64 (Win32) * Fix invalid initializer of CLOCK_TYPE variables if BSD_TIME * Fix thread_info() count argument value (OS X) * Support de_win.c compilation by Makefile.direct (cord/de) == [8.0.2] 2018-12-23 == * Abort with appropriate message if executable pages cannot be allocated * Add initial testing of GC_enable/disable, MALLOC[_ATOMIC]_IGNORE_OFF_PAGE * Add paths to filenames mentioned in the copyright section in README * Add test using disclaim notifiers to implement a weak map * Adjust #error messages format * Allow to force executable pages allocation in gctest * Avoid potential 'macro redefinition' errors for config.h macros * Call real pthread_sigmask instead of its wrapper in start_mark_threads * Check result of pthread_mutex_unlock in specific.c * Default to a single-threaded build for Nintendo, Orbis, Sony PSP targets * Default to non-executable memory allocation across all make scripts * Define GC_ATOMIC_UNCOLLECTABLE and JAVA_FINALIZATION in all make scripts * Do not prevent GC from looking at environment variables (BCC_MAKEFILE) * Do not use 'ifndef AO_CLEAR' in mark, pthread_support and gctest * Do not use spin locks if AO test-and-set is emulated (pthreads) * Document HANDLE_FORK macro optional usage in Makefile.direct * Document assertion in the setters that used to return old value * Eliminate 'assigned value never used' compiler warning in test_cpp WinMain * Eliminate 'casting signed to bigger unsigned int' CSA warning * Eliminate 'different const qualifiers' MS VC warnings in cordbscs * Eliminate 'function is never used' cppcheck warning for calloc/realloc * Eliminate 'non-virtual destructor for class with inheritors' CSA warning * Eliminate 'pointer targets differ in signedness' compiler warning (Win32) * Eliminate 'struct member is never used' cppcheck warnings in os_dep * Eliminate 'uninitialized var' cppcheck false positive in mach_dep, os_dep * Eliminate 'unreferenced formal parameter' compiler warning in msvc_dbg * Eliminate redundant check in backwards_height * Fix 'USE_MUNMAP macro redefinition' error for NaCl * Fix 'collecting from unknown thread' abort in leak-finding mode for Win32 * Fix 'mprotect remapping failed' abort on NetBSD with PaX enabled * Fix 'too wide non-owner permissions are set for resource' code defect * Fix GC_VSNPRINTF in cordprnt for DJGPP and MS VC for WinCE * Fix GC_register_disclaim_proc for leak-finding mode * Fix a deadlock in write_fault_handler if AO_or is emulated * Fix comment typo in CMakeLists.txt * Fix concurrent bitmap update in GC_dirty * Fix deadlocks in write and suspend handlers if AO test-and-set is emulated * Fix executable memory allocation in GC_unix_get_mem * Fix hbp overflow in GC_install_counts * Fix linkage with a system libatomic_ops shared library * Fix lock assertion violation in get_index if GC_ALWAYS_MULTITHREADED * Fix marking of finalizer closure object * Fix marks and hb_n_marks consistency when disclaim returns true * Fix memory allocation on GCF (Linux/x64) * Fix missing curses.h in cord/de when compiling manually (MS VC, MinGW) * Fix test_cpp assertion violation in find-leak mode * Fix tests linkage with internal atomic_ops.o * Fix unneeded end_stubborn_change/ptr_store_and_dirty in disclaim_test * Guard against potential buffer overflow in CORD_next and CORD_pos_fetch * New macro to suppress printing of leaked objects * Pass -Wall -Wextra -Wpedantic to g++ if supported (configure) * Prefix internal durango_get_mem symbol with 'GC_' * Prevent double inclusion of javaxfc.h and private/specific.h * Print relevant message in tests not appropriate for leak detection mode * Reduce scope of local variables in GC_remove_all_threads_but_me * Refine HIDE_POINTER documentation for the case of the leak-finding mode * Refine documentation in gc_disclaim.h * Remove extra USE_MMAP definition for Interix * Remove redundant header double-inclusion checks in the private headers * Remove strlen calls with a constant string argument in msvc_dbg * Specify register_disclaim_proc and finalized_malloc argument as non-null * Support UWP/arm64 target * Test marking of finalizer closure object in disclaim_test * Turn off leak detection mode explicitly in cord/de * Turn off parallel marker, thread-local allocation if used AO ops emulated * Turn on gcj functionality in BCC, DMC, NT, OS/2, WCC makefiles * Turn on memory unmapping in BCC/DMC/NT/WCC makefiles and Makefile.direct * Update NO_EXECUTE_PERMISSION documentation * Update documentation about arm64 ABI in gcconfig.h * Use AO_or in async_set_pht_entry_from_index if available * Use GC_WORD_MAX macro across all C source files * Use macro to operate on a flag residing in GC_stop_count * Use standalone private macro to guard against ptr_t redefinition * Workaround '#error' cppcheck messages in backgraph and private headers * Workaround 'AST broken' syntax error reported by cppcheck in GC_mark_some * Workaround 'GC_dump function is never used' cppcheck warning * Workaround 'local address assignment to a global variable' CSA warning * Workaround 'local variable end shadows outer symbol' cppcheck warnings * Workaround 'local variable obj_displ shadows outer symbol' cppcheck warning * Workaround 'nonlocal var will use ptr to local var' cppcheck false positive * Workaround 'pointer addition with NULL pointer' cppcheck error in msvc_dbg * Workaround 'potential non-terminated string' false positive in cordbscs * Workaround 'value of _MAX_PATH is unknown' cppcheck warning * Workaround cppcheck warnings regarding CLOCKS_PER_SEC, REDIRECT_REALLOC == [8.0.0] 2018-09-05 == * Accept Android platform by both CMake and configure * Access finalize_now atomically to avoid TSan warning without no-sanitize * Acknowledge thread restart from suspend_handler (NetBSD) * Add a sanity check that load_acquire and store_release are available * Add AO primitives implementation to GC based on C11 atomic intrinsic * Add assertion for suspend_ack_sem in start_world * Add assertion to allocobj that live unmarked object cannot be reclaimed * Add assertions about held lock when accessing all_bottom_indices * Add assertions to ensure ADD_CALL_CHAIN is called holding the lock * Add assertions to finalize and threads support for MANUAL_VDB needs * Add basic calculation of the total full-collection time * Add check that gc_cpp operator delete is called (test_cpp) * Add debug logging to new_thread about GC_threads hash table collisions * Add GC prefix to _MSVC_DBG_H macro * Add initial RISC-V support * Add Makefile target to run all tests without test-driver * Add test_atomic_ops to perform minimal testing of used atomic primitives * Add two-argument alloc_size attribute to calloc_explicitly_typed (GCC) * Align IRIX/OSF1_THREADS definition in gc_config_macros.h with gcconfig.h * Allocate non-executable memory by default (CMake) * Allow compilation of PROC_VDB code on Linux host (GC_NO_SYS_FAULT_H) * Allow configure --with-libatomic-ops=none to use GCC atomic intrinsics * Allow custom N_LOCAL_ITERS and ENTRIES_TO_GET values * Allow disabling of dynamic loading in CMake script and configure * Allow disabling of main static data registration in CMake and configure * Allow disabling of threads discovery in CMake script and configure * Allow gc_assertions enabling in CMake script * Allow gc_debug, redirect_malloc, large_config options in CMake script * Allow GC_NETBSD_THREADS_WORKAROUND macro manual definition * Allow mmap enabling in CMake script and configure * Allow passing -D DEFAULT_VDB to CFLAGS * Allow subthreadcreate_test to be compiled with zero NTHREADS * Allow to turn on spin locking even if thread-local allocations are used * Always include gc_atomic_ops.h unless threads are disabled * Avoid 'Unexpected heap growth' in 64-bit multi-threaded gctest if n_tests=1 * Avoid duplication of code handling pthreads case in configure * Avoid potential data race during apply_to_each_object(reset_back_edge) * Avoid potential data race during GC_dump execution * Avoid potential race between malloc_kind and mark_thread_local_fls_for * Avoid potential race between realloc and clear_hdr_marks/reclaim_generic * Avoid potential race in print_static_roots called by dyld_image_add/remove * Avoid potential race in SET_MARK_BIT_EXIT_IF_SET if parallel marking * Avoid potential race when accessing size_map table * Avoid potential race when storing oh_back_ptr during parallel marking * Avoid SIGSEGV during GC_INIT on some Android devices * Build only shared libraries by default (configure) * Change pointer arguments of push_all[_eager]/conditional API to void* type * Change type of hb_sz field (of hblkhdr) from size_t to word * Check consistency of descr, adjust, clear arguments of GC_new_kind * Check that GC_WIN32_PTHREADS is not specified for Cygwin * Check thread_local is initialized before accessing thread_key * Collapse multiple BCOPY_EXISTS macro definitions * Collapse multiple NT_*_MAKEFILE scripts into a single NT_MAKEFILE * Collapse multiple page_was_dirty, remove_protection, read_dirty definitions * Compile checksums.c only if --enable-checksums is given (configure) * Consistently define WIN32_LEAN_AND_MEAN/NOSERVICE before include windows.h * Convert .html files to Markdown format * Convert code of .c files to valid C++ code * Decide between memory unmapping and mprotect-based dirty bits at runtime * Declare t local variable in the block where the variable is used * Define ABORT() using _CrtDbgBreak (if available) on Windows host * Define CLANG/GNUC_PREREQ macros to check gcc/clang minimum version * Define DYNAMIC_LOADING for Darwin unless IGNORE_DYNAMIC_LOADING * Define GC_ASSERT(x) as C assert(x) for external clients of gc_inline.h * Define GC_PREFETCH_FOR_WRITE to __builtin_prefetch in gc_inline.h (GCC) * Define GC_THREADS instead of GC_x_THREADS in Makefiles * Define macro to specify the environment file name extension (Win32/WinCE) * Define static resend_lost_signals(), restart_all() in pthread_stop_world * Detect sigsetjmp() availability by configure * Determine whether to use compiler TLS for kFreeBSD at compile time * Do not call BCOPY and BZERO if size is zero * Do not call sem_getvalue in stop_world if one thread exists * Do not call set_handle_fork(1) in gctest if pthread_atfork not supported * Do not compile pcr_interface.c and real_malloc.c except by PCR-Makefile * Do not declare dl_iterate_phdr as weak for kFreeBSD * Do not include windows.h when compiling gc_cpp.cc * Do not install gc_allocator.h, gc_disclaim.h unless the features enabled * Do not merge dynamic root with the existing static one in add_roots_inner * Do not print n_rescuing_pages value if incremental collections disabled * Do not push cpsr and frame pointer on Darwin/arm and Darwin/arm64 * Do not rebuild_root_index unless remove_root_at_pos is called * Do not specify version info for test libraries (Automake) * Do not use alternate thread library on Solaris * Do not use asm in GC_pause * Do not use PKG_CHECK_MODULES in configure * Do not use system clock consistently if NO_CLOCK * Do not use x86 asm in PUSH_CONTENTS_HDR for NaCl * Document GC_BUILTIN_ATOMIC macro (and gc_atomic_ops private header file) * Document STACK_NOT_SCANNED macro in gcconfig.h (Emscripten) * Eliminate 'comparison is always false' code defect in get_maps * Eliminate 'GC_DEBUG redefined' compiler warning in smashtest * Eliminate 'potential unsafe sign check of a bitwise operation' code defect * Enable alternative finalization interface (DISCLAIM) in all makefiles * Enable compilation for Cygwin with MPROTECT_VDB * Enable handle-fork and memory unmapping by default * Enable mprotect-based incremental GC for Win64 (GCC) * Expose API to control rate and max prior attempts of collect_a_little * Expose API to control the minimum bytes allocated before a GC occurs * Fix 'comparison of 255 with expr of type bool' error in gc_atomic_ops.h * Fix 'doc' files installation folder * Fix build of cord tests as C++ files (Makefile.direct) * Fix comment typos in backgraph.c, de.c, gcconfig.h * Fix delete operator redirection if gc_cpp is built as .dll (Cygwin, MinGW) * Fix start_world not resuming all threads on Darwin * Fix test_cpp failure in case GC_DEBUG is defined * Group common defines for POSIX platforms in configure and CMake scripts * Guard against USE_PTHREAD_LOCKS and USE_SPIN_LOCK are both defined * Handle pthread restart signals loss if retry_signals * Hide value stored to thread-specific entries for a test purpose * Implement FindTopOfStack(0) for ARM and AArch64 (Darwin) * Implement memory unmapping for Sony PS/3 * Imply configure --single-obj-compilation if --disable-static * Include malloc.c in extra/gc.c after include gc_inline.h * Increase MAX_HEAP_SECTS (10 times) for large-config * Initial single-threaded support of Interix subsystem * Initial support of Nintendo, Orbis, Sony PSP2, WinRT, Xbox One * Initial support of TIZEN platform * Install gc.3 man page instead of copying gc.man to doc folder (configure) * Make extend_size_map() static (code refactoring) * Make subthreadcreate test compilable even without libatomic_ops * Match GC_FAST_MALLOC_GRANS formal and actual arguments where possible * Move de_win compiled resource files to cord/tests * Move pcr_interface.c, real_malloc.c to 'extra' folder * New API function (GC_dump_named) to produce named dumps * New API function (GC_is_incremental_mode) * New API function (get_expl_freed_bytes_since_gc) * New API function (get_size_map_at) to get content of size_map table * New API to stop and start the GC world externally * New API to turn on manual VDB at runtime * New field (expl_freed_bytes_since_gc) in public prof_stats_s * New macro ALWAYS_SMALL_CLEAR_STACK to avoid clearing large stack sections * New public API (PTR_STORE_AND_DIRTY) to simplify store-and-dirty operation * Pass CFLAGS_FOR_PIC value to CFLAGS in Makefile.direct * Print time passed since GC initialization in GC_dump * Public API (GC_deinit) to allow Win32 critical sections deletion * Reduce probability of collision in threads hashtable for 64-bit targets * Reduce the default MUNMAP_THRESHOLD value to 2 for Sony PS/3 * Refactoring of USE_MMAP/USE_MMAP_ANON pairs definition in gcconfig.h * Reformat code and comments in gc_allocator.h * Remove 'dist' target from Makefile.direct * Remove a redundant check of __cplusplus in Symbian-specific .cpp files * Remove Android-specific code in gcconfig.h for M68K * Remove C++ WeakPointer and CleanUp API which lacks implementation * Remove DGUX_THREADS macro which duplicates GC_DGUX386_THREADS (configure) * Remove done_init static variable from fnlz_mlc.c * Remove duplicate definition of ALIGNMENT macro for OpenBSD/arm * Remove duplicated sample code in leak.md * Remove EMX_MAKEFILE (add EMX support to Makefile.direct) * Remove GC code fragment (which already merged) from README.Mac * Remove GC_GNU_THREADS macro (HURD) * Remove GENERAL_MALLOC internal macro * Remove HIGH_BIT macro duplicating SIGNB * Remove lint-specific code * Remove Makefile KandRtest target (that supported K&R C compiler) * Remove MIN_WORDS macro from gc_priv.h * Remove multi-line macros (FOR_EACH_PRED, ITERATE_DL_HASHTBL_*, PUSH_OBJ) * Remove name of optional arguments of operator new and new[] in gc_cpp.h * Remove notes that K&R C compiler is unsupported * Remove PUSH_CONTENTS_HDR multi-line macro * Remove redundant check that clear_fl_marks argument is non-null * Remove redundant THREADS macro checks in alloc.c and gc_priv.h * Remove stubborn objects allocation code completely, remove stubborn.c * Remove unnecessary argument casts in add_roots_inner calls * Remove unnecessary type casts in n_set_marks * Remove unused USE_GENERIC macro definition and description * Remove version info in 'de' cord test application * Replace GC_MALLOC(sizeof T) with GC_NEW(T) in tests * Replace GC_NO_RETRY_SIGNALS environment variable with GC_RETRY_SIGNALS=0 * Replace some FIXME items with TODO ones * Run command passed to if_not_there directly from Makefile.direct * Same type casts for GC_PTR_STORE arguments regardless of GC_DEBUG * Skip grungy_pages update when mark state invalid to speedup read_dirty * Skip typed_test in gctest if NO_TYPED_TEST macro is defined * Support configure --disable-thread-local-alloc option (similar for CMake) * Support enable_checksums option in CMake script * Support Haiku multi-threaded build by CMake * Support threads for DragonFly in configure * Turn on 'atomic uncollectable' functionality by default (CMake) * Turn on GC assertions in NT_MAKEFILE for debug builds * Turn on gcj, disclaim and java finalization by default (CMake) * Turn on incremental collection in gctest also if DEFAULT_VDB or MANUAL_VDB * Turn on incremental mode in cordtest and cord/de * Turn on incremental mode in disclaim_test, test_cpp and staticroots test * Turn on parallel marker by default for all multi-threaded builds * Update GC compilation and usage notes for Win32 * Update shared libraries version info to differentiate against v7.6 * Update top_index entry pointer only when the entry is constructed fully * Use __builtin_expect in SIZET_SAT_ADD macro * Use __declspec(allocator) for malloc-like prototypes (MS VS 2015+) * Use __int64 instead of 'long long' in LONG_MULT if appropriate * Use __thread keyword for Android NDK r12b+ Clang (arm) * Use atomic allocation for leafs in reverse_test (gctest) * Use atomic load/store for the concurrently accessed variables in GC_lock * Use C11 static_assert if available * Use compiler atomic intrinsics by default if available (configure) * Use EXPECT FALSE for mark_from code documented as executed rarely * Use heap-allocated memory for local mark stack of non-marker thread * Use HOST_ANDROID define instead of PLATFORM_ANDROID * Use include gc.h with the angle brackets in the man page synopsis * Use longjmp in fault_handler_openbsd if siglongjmp unavailable (OpenBSD) * Use MARK_BIT_PER_GRANULE instead of MARK_BIT_PER_OBJ where appropriate * Use noexcept specifier in gc_allocator and gc_cpp if C++11 * Use same macro (NTHREADS) across all tests to specify number of threads * Use sigsetjmp() in setjmp_t tool if available * Use thread-local allocations for all multi-threaded builds * Use THREAD_EQUAL consistently to compare pthread_t values * Workaround 'bad pointer arithmetic' false waring in check_annotated_obj * Workaround Clang optimizer bug crashing clear_stack_inner on OS X 10.8 * Workaround Thread Sanitizer (TSan) false positive warnings == [7.6.14] (not released yet) == * Add loop to handle abort error like in suspend logic on Darwin * Add support of OpenBSD/aarch64 * Add threading libraries to bdw-gc.pc * Disable mprotect-based incremental GC if /proc roots are used (Linux) * Do not use iOS private symbols * Eliminate 'GC_old_bus_handler defined but not used' compiler warning * Eliminate 'comparing signed and unsigned values' BCC warning in cordtest * Eliminate 'possible loss of data' BCC and MS VC warnings * Eliminate 'static GC_sysinfo definition has incomplete type' Clang warning * Eliminate 'unused function GC_add_map_entry' compiler warning * Eliminate 'while clause does not guard' GCC warning in GC_parse_map_entry * Explicitly zero-initialize trace_buf (fix trace_buf initialization) * Fix 'ACCESS_VIOLATION in marker' GC warning on Win32 async thread start * Fix 'GC_generic_malloc must be available' GCC error in new_gc_alloc.h * Fix 'ulong undefined' compilation error on AIX * Fix 'undefined reference to __data_start' linker error on RISC-V * Fix 'write to GC log failed' error * Fix MPROTECT_VDB definition for single-threaded GC builds * Fix OS_TYPE and USE_MMAP_ANON definitions for Cygwin/x64 * Fix STACKBOTTOM on 32-bit HP/UX 11.11 * Fix abort in GC_printf when gctest is built as WinMain executable (Cygwin) * Fix compiling by Makefile.direct on OpenBSD/UltraSparc * Fix configure message about 'AIX gcc optimization fix' * Fix cordtest build in SMakefile.amiga * Fix data race regarding *rlh value in generic_malloc_many * Fix first_thread stack_base initialization if custom GC_stackbottom (Win32) * Fix gc_allocator.h compilation by Clang * Fix gc_cflags variable name in configure (HP/UX) * Fix incorrect define GC_OPENBSD_THREADS on sparc64 * Fix misaligned tlfs passed to AO_load on m68k * Fix missing gc_dlopen.c in CMake script * Fix printf format specifier in simple_example.html * Fix save_callers for multi-threaded case if built-in backtrace unavailable * Fix test_cpp failure caused by arbitrary link order (Win32) * Fix test_cpp failure when gc_cpp resides in a dll (Borland, Watcom) * Fix various typos mostly in documentation files * Fix word size, data start and alignment for OpenBSD/mips64(el) * Prevent GetThreadContext failure (Windows) * Prevent WARN of incompatible incremental GC if default or manual VDB * Reduce a time period between GetExitCodeThread and SuspendThread (Win32) * Refactoring of WoW64 workaround (Win32) * Remove a misleading comment about Solaris in gc.h * Workaround 'expression is only useful for its side effects' WCC warning * Workaround fread fail after enable_incremental if malloc redirected (Linux) == [7.6.12] 2019-03-01 == * Eliminate 'assigned value never used' compiler warning in test_cpp WinMain * Fix 'mprotect remapping failed' abort on NetBSD with PaX enabled * Fix 'undefined reference to __data_start' linker error (Android/aarch64) * Fix 'unexpected mark stack overflow' abort in push_all_stack * Fix 'wrong __data_start/_end pair' error on Android * Fix BSD_TIME variant of MS_TIME_DIFF for the case of a.tv_usec < b.tv_usec * Fix GetThreadContext stale register values use if WoW64 (Win32) * Fix executable memory allocation in GC_unix_get_mem * Fix invalid initializer of CLOCK_TYPE variables if BSD_TIME * Fix thread_info() count argument value (OS X) * Update NO_EXECUTE_PERMISSION documentation == [7.6.10] 2018-12-13 == * Add paths to filenames mentioned in the copyright section in README * Call real pthread_sigmask instead of its wrapper in start_mark_threads * Eliminate 'casting signed to bigger unsigned int' CSA warning * Eliminate 'non-virtual destructor for class with inheritors' CSA warning * Fix 'collecting from unknown thread' abort in leak-finding mode for Win32 * Fix 'too wide non-owner permissions are set for resource' code defect * Fix 'undefined reference to GC_incremental' linker error in pthread_start * Fix GC_VSNPRINTF in cordprnt for DJGPP and MS VC for WinCE * Fix GC_register_disclaim_proc for leak-finding mode * Fix a deadlock in write_fault_handler if AO_or is emulated * Fix comment typos in CMakeLists.txt, backgraph.c, de.c, gcconfig.h * Fix concurrent bitmap update in GC_dirty * Fix delete operator redirection if gc_cpp is built as .dll (Cygwin, MinGW) * Fix hbp overflow in GC_install_counts * Fix linkage with a system libatomic_ops shared library * Fix lock assertion violation in get_index if GC_ALWAYS_MULTITHREADED * Fix marking of finalizer closure object * Fix marks and hb_n_marks consistency when disclaim returns true * Fix memory allocation on GCF (Linux/x64) * Fix missing curses.h in cord/de when compiling manually (MS VC, MinGW) * Fix start_world not resuming all threads on Darwin * Fix test_cpp assertion violation in find-leak mode * Fix tests linkage with internal atomic_ops.o * Fix unneeded end_stubborn_change in disclaim_test * Guard against potential buffer overflow in CORD_next and CORD_pos_fetch * New macro to suppress printing of leaked objects * Prevent double inclusion of javaxfc.h and private/specific.h * Reduce scope of local variables in GC_remove_all_threads_but_me * Refine HIDE_POINTER documentation for the case of the leak-finding mode * Refine documentation in gc_disclaim.h * Test marking of finalizer closure object in disclaim_test * Update documentation about arm64 ABI in gcconfig.h * Use AO_or in async_set_pht_entry_from_index if available * Use include gc.h with the angle brackets in the man page synopsis == [7.6.8] 2018-08-12 == * Add cpu, make_as_lib, nothreads options to NT_MAKEFILE * Add NetBSD/aarch64 and initial RISC-V support * Adjust formatting of configure help messages and config.h comments * Avoid multiple 'getcontext failed' warnings if getcontext is broken * Cleanup BCC Makefile (remove absolute GC paths, fix del cmd, update clean) * Collapse multiple NT_*_MAKEFILE scripts into a single NT_MAKEFILE * Do not call GC_dirty_inner unless GC_incremental * Do not use NULL in gc_inline.h * Eliminate 'cast between incompatible function types' compiler warning * Eliminate 'comparing signed and unsigned values' compiler warnings (bcc) * Eliminate 'condition is always true' cppcheck warning in init_gcj_malloc * Eliminate 'declaration of var hides global declaration' compiler warning * Eliminate 'language extension used' Clang warning in gc.h * Eliminate 'possibly incorrect assignment in CORD_vsprintf' compiler warning * Eliminate 'ptr arithmetic with NULL' cppcheck warning in alloc_mark_stack * Eliminate 'scope of var can be reduced' cppcheck warning in pthread_join * Eliminate 'switch statement contains no case label' compiler warning * Eliminate 'variable might be uninitialized' warning in win32_start_inner * Eliminate duplicate clear_mark_bit call when removing disappearing link * Fast fail on invalid CPU parameter passed to NT_MAKEFILE * Fix 'collecting from unknown thread' abort in leak-finding mode * Fix 'pointer arithmetic with NULL' code defect in print_callers * Fix Borland version in documentation to match that in BCC_MAKEFILE * Fix comment about inv_sz computation in setup_header * Fix comments style in configure.ac and Makefile.am * Fix compilation by digimars.mak (DMC) * Fix compilation by WCC makefile * Fix compilation of darwin_stop_world for iOS 8+ * Fix cords for MANUAL_VDB * Fix dependency on gc_cpp source in BCC_MAKEFILE and NT_MAKEFILE * Fix GC_is_valid_displacement and GC_is_visible for non-small objects * Fix gctest in leak-finding mode * Fix infinite restarting of mark_some when a static root disappeared (Linux) * Fix large object base computation in PUSH_CONTENTS() if MARK_BIT_PER_OBJ * Fix mark stack overflow checking in push_selected * Fix missing GC_dirty calls for GC-allocated objects used internally * Fix missing GC_dirty invocation from debug_end_stubborn_change * Fix MSWIN32 macro redefinition (WCC) * Fix multi-threaded gctest for the case of NTHREADS is set to zero * Fix new and delete operators definition for DigitalMars compiler * Fix NT_MAKEFILE for VS 2017 * Fix potential null dereference in GC_CONS * Fix register_dynamic_libraries on Windows 10 * Fix result computation in n_set_marks * Fix return type in GC_set_warn_proc API documentation * Fix tests for GC compiled with MANUAL_VDB * Fix the build for Emscripten * Fix typo in comment for CORD_ec_flush_buf prototype * Fix typos in ChangeLog and generic_malloc * Fix UNTESTED for multi-threaded API functions in gctest * Fix VirtualQuery call in case of malloc failure (Win32) * Install gc.3 man page instead of copying gc.man to doc folder (configure) * Keep pointer to the start of previous entry in remove_specific_after_fork * Move de_win compiled resource files to cord/tests * Never return null by C++ GC allocators and gc_cpp operator new * Perform thread_suspend in loop as it may be interrupted (Darwin) * Really abort if failed to read /proc for library registration (Linux) * Remove code duplication in gcj_malloc and malloc_explicitly_typed * Remove duplicate local variable in reclaim_block * Remove information how to send bugs from README.cords file * Remove libatomic_ops license information * Remove unused USE_GENERIC macro definition and description * Suppress 'functions containing switch are not expanded inline' bcc warning * Suppress 'non-member operator new/delete may not be inline' VC++ warning * Turn on incremental collection in gctest also if MANUAL_VDB * Update copyright information in alloc.c, gc.c/h and the documentation * Update EXTRA_DIST in Makefile, Win32/64 docs after NT_*_MAKEFILE removal * Update NT_MAKEFILE usage information in README files for Win32 and Win64 * Workaround 'class C does not have a copy constructor' cppcheck warning * Workaround 'function nested_sp is never used' cppcheck style warning * Workaround 'opposite expression on both sides of &' cppcheck style warning * Workaround 'template-id not supported in this context' compiler error (WCC) == [7.6.6] 2018-04-20 == * Define GC_FREEBSD_THREADS and GC_ADD_CALLER macros for kFreeBSD * Eliminate 'boolean result used in bitwise operation' cppcheck warning * Eliminate 'there is pointer arithmetic with NULL' cppcheck warning * Explicitly unblock GC signals on GC initialization * Fix 'scope of var can be reduced' cppcheck err in enqueue_all_finalizers * Fix 'undefined reference to __builtin_unwind_init' linker error (ArmCC) * Fix arguments delimiter in pcr_interface.c (PCR) * Fix assertion violation in DllMain of win32_threads * Fix comment for debug_generic_malloc_inner[_ignore_off_page] * Fix data race during apply_to_each_object(reset_back_edge) * Fix dbg_mlc.c/o file name in documentation * Fix gctest with musl libc on s390x * Fix include gc_gcj.h in thread_local_alloc.c * Fix man section number (3) * Fix missing GC_generic_malloc_words_small implementation in new_gc_alloc.h * Fix missing new-line in ABORT_ARG definition * Fix missing SIGBUS handler setup for kFreeBSD * Fix null dereference in print_callers on backtrace_symbols failure * Fix null pointer dereference in get_private_path_and_zero_file (Symbian) * Fix the collector hang when it is configured with --enable-gc-debug * Fix thread_suspend fail for threads registered from key destructor (OS X) * Fix type of local variables receiving result of PHT_HASH * Fix typo in AIX macro name * Fix typo in comment in specific.h * Fix unbounded heap growth in case of intensive disappearing links usage * Remove API symbols renaming in WCC_MAKEFILE * Support Haiku/amd64 and Haiku/x86 hosts * Support threads for DragonFly in configure * Workaround 'address of auto-variable returned' cppcheck error * Workaround gctest hang on kFreeBSD (if thread-local allocations are on) == [7.6.4] 2018-01-26 == * Add note of set_free_space_divisor, set_warn_proc ABI change after gc-7.1 * Change compiler invocation example in gc.man to use dynamic libgc * Delete dont_ar_* build intermediate files on make clean (Makefile.direct) * Do not declare dl_iterate_phdr as weak for DragonFly * Fix 'cords' parallel build in Makefile.direct * Fix 'undeclared identifier USRSTACK' compiler error on OpenBSD-6.2 * Fix error code in abort message if sem_wait failed in start_world (NetBSD) * Fix GC allocation mutex in child after a fork * Fix global operator delete definition for C++14 in gc_cpp * Fix last_reclaimed..gc_no interval comparison to threshold in unmap_old * Fix libgc version which was changed in linkage breaking way * Fix missing EOLn output in threadlibs tool * Fix threadlibs tool to output '-lpthread' for DragonFly * Prevent DATASTART redefinition for NaCl * Remove obsolete advice about linking with _DYNAMIC=0 (Linux) == [7.6.2] 2017-12-23 == * Add assertion that no hb_n_marks underflow occurs * Add minimal testing of GC_MALLOC_[ATOMIC_]WORDS and GC_CONS (gctest) * Add minimal testing of GC_set_bit (gctest) * Add more cases to huge_test to cover sizes close to word-type maximum * Add testing of new[]/delete[] (test_cpp) * Adjust AO_HAVE_x check to match AO_fetch_and_add primitive variant used * Adjust code indentation of calloc_explicitly_typed * Align local_mark_stack in help_marker explicitly * Allow custom TRACE_ENTRIES value * Allow gctest and thread_leak_test with zero NTHREADS * Avoid data race in finalized_count (gctest) * Code refactoring of divide-by-HBLKSIZE occurrences * Code refactoring of huge_test * Code refactoring of tests/subthread_create regarding AO add primitive * Compile thread_local_alloc only if multi-threaded build (Makefile.am) * Delete preprocessor output on make clean (Makefile.direct) * Disable implicit multi-threaded mode for Win32 to avoid LOCK crash * Do not disable parallel mark for WRAP_MARK_SOME * Do not enable mprotect-based incremental mode if unmapping is on (gctest) * Do not install documentation if configure --disable-docs (new option) * Do not use tkill (Android) * Document base and size of objects allocated by finalized_malloc * Document configure 'syntax error' issue in README * Eliminate 'address of local variable returned' static analyzer warning * Eliminate 'array vs singleton' code defect in typed_test (gctest) * Eliminate 'assigned value never used' CSA warning in min_bytes_allocd * Eliminate 'boolean result used in bitwise op' cppcheck false warning * Eliminate 'C-style pointer casting' cppcheck style warnings in test * Eliminate 'checking if unsigned variable is <0' cppcheck style warning * Eliminate 'class member var with name also defined in parent' warning * Eliminate 'comparison is always false' static analyzer warning in finalize * Eliminate 'Condition 0==datastart always false' cppcheck warning (dyn_load) * Eliminate 'condition is always true' cppcheck style warning * Eliminate 'constructor with 1 argument is not explicit' cppcheck warning * Eliminate 'CORD_*printf is never used' cppcheck style warnings (cordtest) * Eliminate 'dereference of null' CSA false warning in array_mark_proc * Eliminate 'function result not used' code defect in GC_mark_local * Eliminate 'GC_collecting is set but never used' code defect (Win32) * Eliminate 'GC_record_fault is never used' cppcheck style warning * Eliminate 'integer shift by a negative amount' code defect in finalize * Eliminate 'label not used' cppcheck false warnings in GC_mark_X * Eliminate 'memory leak' code defect for scratch-allocated memory * Eliminate 'memory leak' code defect in remove_specific * Eliminate 'non-null arg compared to null' warning in toggleref_add (GCC) * Eliminate 'non-reentrant function strtok called' cppcheck warning (POSIX) * Eliminate 'possible integer underflow' code defect (cord-de) * Eliminate 'potential overflow' static analyzer warning in test * Eliminate 'printf format specifies type void*' GCC pedantic warnings * Eliminate 'scope of variable can be reduced' cppcheck warnings * Eliminate 'suspicious pointer subtraction' cppcheck warning (gc_cpp) * Eliminate 'this statement may fall through' GCC warnings * Eliminate 'unnecessary comparison of static strings' cppcheck warning * Eliminate 'unsafe vsprintf is deprecated' compiler warning * Eliminate 'unused formal parameter' compiler warnings in C++ code (MS VC) * Eliminate 'unused variable' compiler warning in remove_all_threads_but_me * Eliminate 'use of vulnerable sprintf' code defect in de_win test (cord) * Eliminate 'value exceeds maximum object size' GCC warning in huge_test * Eliminate 'value of CLOCK_TYPE unknown' cppcheck info message * Eliminate 'value of DATASTART2 unknown' cppcheck info messages * Eliminate 'value of GC_PTHREAD_EXIT_ATTRIBUTE unknown' cppcheck messages * Eliminate 'value of GC_RETURN_ADDR_PARENT unknown' cppcheck info messages * Eliminate 'value of NEED_FIXUP_POINTER unknown' cppcheck info messages * Eliminate 'write to memory that was const-qualified' code analyzer warning * Eliminate all 'scope of variable can be reduced' cppcheck style warnings * Eliminate CSA warning about incorrect cast applied to HBLK_OBJS * Eliminate CSA warning about narrowing cast in CleanUp of test_cpp * Eliminate CSA warning of non-virtual destructor in test_cpp base class * Eliminate CSA warning of staticroot that can be a local variable (tests) * Eliminate CSA warning of unmodified non-const static var (disclaim_test) * Eliminate redundant local variable in register_finalizer * Eliminate TSan (Thread Sanitizer) warnings in gctest * Eliminate UBSan warning of overflow during descr subtraction in mark_from * Eliminate unreachable PROC/DEFAULT_VDB GC_printf calls in gctest main() * Eliminate unsigned fl_builder_count underflow in mark_thread * Enable GC_is_tmp_root for all platforms * Execute more single-threaded GC tests by CMake * Expand tabs to spaces in de_win.rc (tests) * Export GC_dump_finalization/regions() * Export GC_is_tmp_root() and GC_print_trace[_inner]() * Export GC_print_free_list() * Fix '32-bit value shift followed by expansion to 64-bit' code defect * Fix 'GC_written_pages never read' code defect (GWW_VDB) * Fix 'label cannot be reached' static analyzer warning in disclaim_test * Fix 'size of tv is unknown' error in brief_async_signal_safe_sleep (musl) * Fix 'syntax error' reported by cppcheck for mach_dep * Fix 'unknown type name GC_INNER' compilation error (FreeBSD) * Fix 'variable assigned a value that is never used' cppcheck style warnings * Fix 'void pointers in calculations: behavior undefined' cppcheck warning * Fix assertion violation about disabled cancel in try_to_collect_inner * Fix atomic_ops build in Makefile.direct for Solaris * Fix Clang static analyzer warning about not found gc_priv.h in extra files * Fix compilation error in get_main_stack_base (Emscripten) * Fix compilation for winpthreads if HANDLE_FORK * Fix compilation if configured with --enable-werror on OS X * Fix cord/de build in Makefile.direct (Linux) * Fix data race in a list referenced by A.aa (gctest) * Fix data race in collectable_count (gctest) * Fix data race in do_local_mark when comparing active_count to helper_count * Fix data race in GC_suspend/resume_thread * Fix data race in last_stop_count access (suspend_handler_inner) * Fix data race in make_descriptor when setting explicit_typing_initialized * Fix data race in mark_thread when updating mark_no * Fix data race when getting object size in explicitly-typed allocators * Fix deadlock in GC_suspend_thread * Fix gctest failure for Darwin if CPPCHECK is defined * Fix lack of barriers to synchronize memory for suspend_handler * Fix marking of disclaim-reachable objects in the incremental mode * Fix message of VDB implementation used if MPROTECT_VDB+GWW_VDB (gctest) * Fix missing started_thread_while_stopped call from mark_some if GCC/Clang * Fix null dereference in GC_stack_range_for if not DARWIN_DONT_PARSE_STACK * Fix page calculation in checksums * Fix parallel build in Makefile.direct * Fix test_cpp and c++ parallel build in Makefile.direct * Fix typo in comment of GC_mark_some * Fix typos in cdescr.html and README.sgi * Make GC_INIT optional for clients even if thread-local allocations enabled * Match uclinux pattern in configure * Move conditional GC_need_to_lock setting to gc_locks.h (refactoring) * Move README.QUICK from DOC_FILES to OTHER_FILES in Makefile.direct * New API function (GC_is_init_called) to check if BDWGC is initialized * New target (check-cpp) in Makefile.direct * Prevent abort in register_data_segments for Symbian and Emscripten * Prevent multiple 'Caught ACCESS_VIOLATION in marker' per collection * Print realloc_count value in gctest * Put invariant name in quotes to make mark_state comments clearer * Refine configure messages when checking for compiler option support * Remove extraneous semicolons after AC_MSG_WARN (configure) * Remove page_was_dirty and remove_protection duplicate definitions * Remove unnecessary type casts of printf arguments to unsigned long * Remove unused ALIGN_DOUBLE, USE_GENERIC_PUSH_REGS macros (TILE-Gx/Pro) * Rename 'test' to 'check' target in Makefile.direct * Replace deprecated rewind to fseek in cordxtra * Report gcc/clang pedantic warnings (configure) * Skip thread suspend/resume API testing for Tru64 (OSF1) * Support AddressSanitizer (Clang/GCC) and MemorySanitizer (Clang) * Support GC_init (and get_stack_base) from non-main thread on FreeBSD/NetBSD * Suppress 'tainted string passed to vulnerable operation' false defects * Suppress 'taking address of label non-standard' GCC/Clang pedantic warning * Test GC initialization from non-main thread on FreeBSD and NetBSD * Test GCJ object creation with length-based descriptor (gctest) * Update comment in finalized_disclaim to match FINALIZER_CLOSURE_FLAG * Update README regarding make cords with Makefile.direct * Update README to use autogen.sh on build from the source repository * Update shared libraries version info to differentiate against v7.4 * Use mprotect instead of mmap in GC_unmap() on Cygwin * Use same style of include gc.h in documentation * Workaround '!GC_page_size is always false' cppcheck style warning * Workaround '#error' cppcheck error messages * Workaround '32-bit value shift by >31 bits is undefined' cppcheck warnings * Workaround 'array compared to 0', 'untrusted loop bound' false defects * Workaround 'bad address arithmetic' static analysis tool false positive * Workaround 'checking if unsigned value is negative' cppcheck warning * Workaround 'checking unsigned value is negative' code defect in mark_from * Workaround 'comparison of identical expressions' false code defects * Workaround 'Condition 0!=GETENV() is always false' cppcheck style warnings * Workaround 'condition is always false' cppcheck warning in get_next_stack * Workaround 'condition is always true' cppcheck style warnings in GC_init * Workaround 'function is never used' cppcheck style warnings * Workaround 'insecure libc pseudo-random number generator used' code defect * Workaround 'int shift by negative amount' false code defect in finalize * Workaround 'local variable size too big' static analyzer warning * Workaround 'memory leak: result' cppcheck false error (POSIX) * Workaround 'null pointer dereference' false positive in push_next_marked * Workaround 'obsolescent bcopy, bzero called' cppcheck warnings (POSIX) * Workaround 'obsolescent usleep called' cppcheck warning (POSIX) * Workaround 'obsolete function alloca() called' cppcheck warnings * Workaround 'passing untyped NULL to variadic function' cppcheck warning * Workaround 'pointer used before comparison to null' code defect (pthread) * Workaround 'possible null pointer dereference' cppcheck warnings * Workaround 'potential multiplication overflow' code defect in de_win (cord) * Workaround 'redundant assignment of *result to itself' cppcheck warning * Workaround 'resource leak' false positives in alloc_MS, bl/envfile_init * Workaround 'same expression on both sides of ==' cppcheck style warning * Workaround 'same expression on both sides of OR' cppcheck style warning * Workaround 'struct member is never used' cppcheck style warnings * Workaround 'tainted int used as loop bound' static analysis tool warning * Workaround 'Uninitialized variable' cppcheck errors * Workaround 'unused variable' cppcheck style warnings * Workaround 'va_list used before va_start' cppcheck error in cord * Workaround 'value of macro unknown' cppcheck info messages * Workaround 'value of REDIRECT_MALLOC/FREE unknown' cppcheck info messages * Workaround 'value of SIGBUS unknown' cppcheck info messages * Workaround 'value of WINAPI unknown' cppcheck info messages * Workaround 'variable hides enumerator with same name' cppcheck warnings * Workaround 'variable reassigned before old value used' cppcheck warnings * Workaround 'waiting while holding lock' code defect in stop_world (Unix) * Workaround false 'uninitialized var use' code defect (initsecondarythread) Also, includes 7.4.6 changes == [7.6.0] 2016-08-02 == * ABORT_ARGn log details at INFO level (Android) * Add 'pragma message' to gc.h to detect inconsistent WIN64/_WIN64 (MS VC) * Add API function to calculate total memory in use by all GC blocks * Add API function to set/modify GC log file descriptor (Unix) * Add alloc_size attribute to GC_generic_malloc * Add alt-stack registration support * Add assertion for GC_new_kind boolean arguments * Add assertion on lock status to GC_alloc_large and its callers * Add build scripts for VC 9 (Win32/64) * Add build system plumbing for building with -Werror * Add incremental GC support for Darwin/arm64 * Add profiling callback events to indicate start/end of reclaim phase * Add support for enumerating the reachable objects in the heap * Add toggle-ref support (following Mono GC API) * Added instructions to README.md for building from git * Adjust code indentation of malloc/calloc/str[n]dup * Allow fork() automatic handling on Android with API level 21+ * Allow specific TLS attributes for GC_thread_key * Allow thread local allocations from within pthread TLS destructors * Allow to force GC_dump_regularly set on at compilation * Altera NIOS2 support * Change 'cord' no-argument functions declaration style to ANSI C * Check DATASTART is less than DATAEND even assertions off * Check for execinfo.h by configure * Code refactoring of GC_push_finalizer/thread/typed_structures * Code refactoring regarding 'data start' definition for FreeBSD * Consistently set type of DATASTART/END to ptr_t (code refactoring) * Consistently use int[] type for '_end' symbol (code refactoring) * Consistently use outermost parentheses for DATASTART/END, STACKBOTTOM * Define GC_LINUX_THREADS, NO_EXECUTE_PERMISSION in configure for NaCl * Define ROUNDUP_PAGESIZE, ROUNDUP_GRANULE_SIZE macros (code refactoring) * Define public GC_GENERIC_OR_SPECIAL_MALLOC and GC_get_kind_and_size * Do no declare kernel_id field of GC_Thread_Rep for 64-bit Android * Do not allow SHORT_DBG_HDRS if KEEP_BACK_PTRS or MAKE_BACK_GRAPH * Do not warn of missing PT_GNU_RELRO segment when custom DSO filter used * Document GC_register_my_thread returned value * Dump the block information in CSV format * Eliminate redundant *flh check for null in GC_allocobj * Enable atomic-uncollectable in operator new in gc_cpp.h * Enable build with musl libc * Enable gc.h inclusion by client without implicit include windows.h (Win32) * Enable huge_test for Win64 (and LLP64 target) * Enable thread-local storage for Android Clang * Enable thread-local storage usage for GC_malloc/calloc_explicitly_typed * Export GC_push_all_eager, GC_push_finalizer_structures * Fix 'arg parameter might be clobbered by setjmp' compiler warning * Fix assertion in GC_mark_from for non-heap regions * Fix compilation for Android clang/arm with bfd linker * Fix integer shift undefined behavior in GC_init_explicit_typing * Fix missing new-line and redundant trailing dot in WARN messages * Fix STACKBOTTOM for Solaris 11/x86 * Fix tag collision between ENABLE_DISCLAIM and KEEP_BACK_PTRS * Fix unchecked fork() result in gctest (Unix, Cygwin) * Fix user-defined signals drop by marker threads * Fix various typos in comments and documentation * FreeBSD/arm support improvement * GC_make_descriptor code refactoring (eliminate two local variables) * GC_malloc[_atomic] global and thread-local generalization with kind * GC_malloc_[atomic_]uncollectable generalization * GC_scratch_alloc code refactoring (and WARN message improvement) * Group all compact fields of GC_arrays to fit in single page * Handle load_segs overflow in register_dynlib_callback gracefully * Harmonize OSX/iOS configuration; enable compiling for iPhone simulator * Implement event callbacks for profiling (following Mono GC API) * Implement the finalization extension API * Implement thread suspend/resume API (Linux threads only) * Improve documentation for disappearing links in gc.h * Make heap growth more conservative after GC_gcollect_and_unmap call * Mark fo_head, finalize_now with a single GC_push_all call (refactoring) * Move MessageBox invocation code from GC_abort to a separate routine (Win32) * NaCl/arm initial support; NaCl runtime fixes for other CPUs * New macro (GC_ALWAYS_MULTITHREADED) to set multi-threaded mode implicitly * New macro (NO_WINMAIN_ENTRY) to prefer main() instead of WinMain in test * New macro (REDIRECT_MALLOC_IN_HEADER) to enable source-level redirection * Process all PT_LOAD segments before PT_GNU_RELRO segments (Glibc) * Re-implement GC_finalized_malloc using GC_malloc_kind * Refactoring of android_thread_kill/pthread_kill calls * Refactoring of GC_Xobjfreelist (use single array to keep free lists) * Refactoring of thread-local *_freelists (use single array of free lists) * Refine description in README how to build from source repository * Refine GC_free_space_divisor comment regarding its initial value * Reformat code of gc_cpp.cc/h * Remove 'opp' local variable in GC_malloc_X * Remove 'sig' argument of GC_suspend_handler_inner (code refactoring) * Remove code commented out by 'ifdef UNDEFINED' * Remove hb_large_block field (use 1 extra bit of hb_flags instead) * Remove obsolete BACKING_STORE_ALIGNMENT/DISPLACEMENT macros for Linux/IA64 * Remove redundant casts in GC_generic_or_special_malloc and similar * Remove unsupported FreeBSD/ia64 case from gcconfig.h file * Remove unused GC_gcjdebugobjfreelist * Rename ATOMIC_UNCOLLECTABLE to GC_ATOMIC_UNCOLLECTABLE * Replace non-API occurrences of GC_word to word (code refactoring) * Return GC_UNIMPLEMENTED instead of abort in GC_get_stack_base (OS/2) * Show WoW64 warning message if running 32-bit on Win64 (enabled by macro) * Standalone profiling callback for threads suspend/resume * Support (add machine description for) TILE-Gx and TILEPro targets * Support build for Android 64-bit (arm64, mips64, x86_64) * Support FreeBSD/aarch64, FreeBSD/mips * Support iOS7 64-bit (AArch64) and iOS8+ 32/64-bit (Darwin) * Support MinGW build in scripts * Turn off sigsetjmp workaround for Android/x86 starting from NDK r8e * Use magic header on objects to improve disclaim_test * Workaround 'sa_sigaction member missing' compiler error (Android/x32) * Workaround 'unresolved __tls_get_addr' error for Android NDK Clang * Workaround a bug in winpthreads causing parallel marks deadlock (MinGW) Also, includes 7.4.4 changes == [7.4.20] (not released yet) == * Do not hold GC_fault_handler_lock when in Sleep (Windows) * Eliminate 'static GC_sysinfo definition has incomplete type' Clang warning * Eliminate 'unused function GC_add_map_entry' compiler warning * Eliminate 'while clause does not guard' GCC warning in GC_parse_map_entry * Fix OS_TYPE and USE_MMAP_ANON definitions for Cygwin/x64 * Fix abort in GC_printf when gctest is built as WinMain executable (Cygwin) * Fix configure message about 'AIX gcc optimization fix' * Fix cordtest build in SMakefile.amiga * Prevent GetThreadContext failure (Windows) * Refactoring of WoW64 workaround (Win32) Also, includes 7.2o changes == [7.4.18] 2019-03-01 == * Fix 'wrong __data_start/_end pair' error on Android * Fix thread_info() count argument value (OS X) Also, includes 7.2n changes == [7.4.16] 2018-12-13 == * Fix 'collecting from unknown thread' abort in leak-finding mode for Win32 * Fix 'undefined reference to GC_incremental' linker error in pthread_start * Fix GC_register_disclaim_proc for leak-finding mode * Fix concurrent bitmap update in GC_dirty * Fix marking of finalizer closure object * Fix marks and hb_n_marks consistency when disclaim returns true * Fix missing curses.h in cord/de when compiling manually (MS VC, MinGW) * Refine documentation in gc_disclaim.h Also, includes 7.2m changes == [7.4.14] 2018-08-11 == * Cleanup BCC Makefile (remove absolute GC paths, fix del cmd, update clean) * Do not call GC_dirty_inner unless GC_incremental * Eliminate 'cast between incompatible function types' compiler warning * Eliminate 'comparing signed and unsigned values' compiler warnings (bcc) * Eliminate 'language extension used' Clang warning in gc.h * Eliminate 'possibly incorrect assignment in CORD_vsprintf' compiler warning * Eliminate 'switch statement contains no case label' compiler warning * Eliminate 'variable might be uninitialized' warning in win32_start_inner * Eliminate duplicate clear_mark_bit call when removing disappearing link * Fix 'collecting from unknown thread' abort in leak-finding mode * Fix compilation by digimars.mak (DMC) and by WCC makefile * Fix cords for MANUAL_VDB * Fix dependency on gc_cpp source in BCC_MAKEFILE and NT_MAKEFILE * Fix gctest in leak-finding mode * Fix missing GC_dirty calls for GC-allocated objects used internally * Fix missing GC_dirty invocation from debug_end_stubborn_change * Fix multi-threaded gctest for the case of NTHREADS is set to zero * Fix typos in ChangeLog and generic_malloc * Keep pointer to the start of previous entry in remove_specific_after_fork * New API function (GC_is_init_called) to check if BDWGC is initialized * Remove code duplication in gcj_malloc and malloc_explicitly_typed * Remove duplicate local variable in reclaim_block * Remove libatomic_ops license information from README * Workaround 'dynamic exception specifications deprecated in C++11' warning Also, includes 7.2l changes == [7.4.12] 2018-04-19 == * Define GC_FREEBSD_THREADS and GC_ADD_CALLER macros for kFreeBSD * Fix comment for debug_generic_malloc_inner[_ignore_off_page] * Fix gctest with musl libc on s390x * Fix missing new-line in ABORT_ARG definition * Fix null pointer dereference in get_private_path_and_zero_file (Symbian) * Fix type of local variables receiving result of PHT_HASH * Remove API symbols renaming in WCC_MAKEFILE Also, includes 7.2k changes == [7.4.10] 2018-01-22 == * Fix error code in abort message if sem_wait failed in start_world (NetBSD) Also, includes 7.2j changes == [7.4.8] 2017-12-22 == * Eliminate 'this statement may fall through' GCC warnings * Eliminate 'value exceeds maximum object size' GCC warning in huge_test * Fix data race in make_descriptor when setting explicit_typing_initialized * Fix marking of disclaim-reachable objects in the incremental mode * Update comment in finalized_disclaim to match FINALIZER_CLOSURE_FLAG Also, includes 7.2i changes == [7.4.6] 2017-10-26 == * Add configure --enable-gcov option (enable code coverage analysis) * Add configure check whether to define NO_GETCONTEXT * Adjust GC_memalign comment * Allow HAVE_DL_ITERATE_PHDR to be defined by client (musl) * Allow PKG_CHECK_MODULES in configure.ac to be commented out easily * Avoid busy waiting in mark_thread while GC_parallel is false * Better document minimum value of size argument for typed allocations * Change type of THREAD_TABLE_INDEX result to int in win32_threads.c * Consistently use 'msec' instead of 'ms' in comments in pthread_support * Do not define amiga_get_mem, MacTemporaryNewPtr unless really used (extra) * Do not produce .tar.bz2 distribution file (configure) * Do not require libatomic_ops for single-threaded builds (configure) * Do not warn of missing PT_GNU_RELRO segment when custom DSO filter used * Document GWW_VDB in gcdescr.html * Eliminate 'cast to void* from int' compiler warnings (Darwin/x64) * Eliminate 'conditional expression is always true' code defect in GC_init * Eliminate 'FP divide-by-zero' static analyzer warning * Eliminate 'incompatible function pointer' warning in mark_some (MinGW/x86) * Eliminate 'ISO C forbids an empty translation unit' GCC pedantic warning * Eliminate 'ISO C forbids object to function pointer conversion' warning * Eliminate 'locally defined symbol imported' MS linker warnings (cord) * Eliminate 'null dereference' code defect warning in register_finalizer * Eliminate 'possible loss of data' compiler warnings (MS VC) * Eliminate 'printf format specifier mismatch' compiler warning (tools) * Eliminate 'type defaults to int in declaration' warning (REDIRECT_MALLOC) * Eliminate 'value stored is never read' warning of Clang static analyzer * Eliminate duplicate log messages in GC_mark_from * Eliminate most of collisions in GC_threads on Linux/x64 * Ensure GC initialized when atfork_prepare is called by client * Fix 'arg parameter might be clobbered by setjmp' compiler warning * Fix 'bogus LR' detection in FindTopOfStack (Darwin) * Fix 'execvp argument incompatible pointer type' compiler warning (tools) * Fix 'GetVersion deprecated' compiler warning in os_dep (MS VC) * Fix 'incompatible pointer' compiler warning in GC_init_dyld (OS X 64-bit) * Fix 'incompatible ptr-to-int conversion' compiler warning in push_all_stack * Fix 'ISO C90 does not support %lf, %lg gnu_printf formats' GCC warnings * Fix 'ISO C90 forbids mixed declarations and code' compiler warning * Fix 'missing libc-version.h' build error (uClibc/x86[_64]) * Fix 'replacement operator delete cannot be inline' GCC warning (Cygwin) * Fix 'variable unused' compiler warning in FirstDLOpenedLinkMap * Fix 'zero-size array is extension' Clang warning in os_dep (Linux/x86) * Fix (adjust) GC_scratch_alloc actual argument type * Fix deadlock in GC_help_marker caused by use of mark_cv of parent process * Fix finalize.c compilation in 'strict ANSI' mode * Fix GC shared library tests failure related to dl_iterate_phdr (musl) * Fix gc.h compliance to strict ANSI (pthreads) * Fix GC_bytes_allocd incrementation in case of allocation failure * Fix GC_jmp_buf multiple definition * Fix GC_noop6 definition to avoid its calls to be optimized away * Fix gctest failure if PARALLEL_MARK (musl) * Fix gctest thread stack overflow (musl-gcc) * Fix initsecondarythread_test runtime failure if GC compiled w/o threads * Fix lack of 2 trailing zeros in _MSC_VER numbers * Fix local variable declarations in disclaim_bench * Fix missing #error pragma * Fix missing .exe for disclaim test filenames in Makefile (MinGW) * Fix missing atomic/[un]collectable/realloc_count increments in gctest * Fix missing new-line and redundant trailing dot in WARN messages * Fix missing new-line at format strings end in subthread_create test * Fix mixed include of GC public header and gc_priv.h in disclaim bench/test * Fix potential overflow in decrement when computing GC_markers_m1 * Fix printf format specifiers in extra files (cppcheck warnings) * Fix pthread_start compilation if single-obj-compilation (Linux) * Fix register_finalizer call in disclaim_bench for GC_DEBUG * Fix static assertion violation in LONG_MULT for 64-bit targets * Fix tag collision between ENABLE_DISCLAIM and KEEP_BACK_PTRS * Fix thread id leaks in subthread_create and threadkey_test * Fix threaded tests runtime crash if GC_NO_THREAD_REDIRECTS supplied * Fix tools/setjmp_t to prevent nested_sp inlining * Fix typo in CHECK_GCLIB_VERSION name (test) * Fix typos in comments/documentation (ews4800, extend_size_map, push_roots) * Fix unchecked fork() result in gctest (Unix, Cygwin) * Improve detection of internal libatomic_ops (configure) * Move libraries version info to the beginning of Makefile.am * Prevent abort in register_data_segments for Symbian * Process all PT_LOAD segments before PT_GNU_RELRO segments (Glibc) * Refine Makefile.direct comment about multi-threaded GC build * Refine README about library source downloading * Refine should_invoke_finalizers documentation * Remove all generated files by NT_X64_THREADS_MAKEFILE 'clean' target * Remove non-existent configure option in simple_example.html * Replace C++ style comments to C ones, remove commented out code (extra) * Support CFLAGS_EXTRA to pass extra user-defined compiler flags (configure) * Support CFLAGS_EXTRA when checking for inline and dladdr (configure) * Suppress 'tainted string passed to vulnerable operation' false defects * Suppress MS VC warnings about unused param, const condition (NT_MAKEFILE) * Update bdwgc mailing list online archive link in documentation * Update shared libraries version info to differentiate against v7.2 * Use AC_DEFINE for defining NO_GETCONTEXT in configure * Workaround 'index out of bounds' UBSan false warning in push_marked * Workaround 'mmap() resource handle leak' static analyzer warning * Workaround 'redundant assignment of *result to itself' cppcheck warning * Workaround 'resource leak' error reported by cppcheck (tools, test) Also, includes 7.2h changes == [7.4.4] 2016-05-25 == * Allow GC_FAST_MALLOC_GRANS() multiple use in a function * Also enable the TSX workaround for i386 (Linux) * Avoid unstructured procfs on Solaris * Change cord/de main() declaration style from K-R to ANSI C * Change no-argument functions declaration style to ANSI C (cord) * Do not include sigcontext.h and asm/sigcontext.h * Eliminate 'divide by zero' compiler warning in cordtest * Eliminate warning about 64-bit pointer-to-int cast (Win64/pthreads-w32) * Eliminate warnings detected by Cppcheck in cord de[_win] * Fix 'comparison of non-null parameter is always false' warning (Clang) * Fix 'CORD_iter5 unused result' code defect in cordxtra * Fix 'GC_generic_malloc_inner_ignore_off_page not used' compiler warning * Fix 'implicit declaration of vsnprintf' GCC warning (if strict ANSI mode) * Fix 'signed-to-bigger-unsigned value assignment' in GC_init_size_map * Fix 'signed-to-bigger-unsigned value assignment' warning for hb_map * Fix 'signed-to-bigger-unsigned value assignment' warning in GC_setpagesize * Fix 'statement unreachable' compiler warning in GC_mark_from * Fix 'statement unreachable' compiler warning in memalign * Fix 'unused label' compiler warning in cord/de * Fix 'value truncated' compiler warning in CORD_cat (MS VC) * Fix 'variable unused' warning in GC_save_callers * Fix 'visibility attribute not supported' GCC warning (IBM AIX) * Fix CMake warning about CMP0054 by unquoting instances of HOST * Fix Cygwin64 build * Fix GC_REALLOC to call GC_FREE if new size is zero and pointer is non-NULL * Fix Makefile.direct for Cygwin * Fix __alloc_size__ availability detection (Clang) * Fix abort message in GC_move_long_link * Fix and code refactoring of lock elision workaround (Linux/x64) * Fix assertion on mark_lock_holder for non-unique NUMERIC_THREAD_ID * Fix data race in GC_init_explicit_typing * Fix gc.mak regarding msvc_dbg and test (MSVC) * Fix missing error handling of pthread_attr_init/getstacksize * Fix missing error handling of pthreads_mutex_init and cond_wait * Fix missing numeric casts in cord * Fix potential left shift overflows in finalize.c (64-bit targets) * Fix pthreads-win32 name in comments and documentation * Fix setup_mark_lock missing prototype * Fix unchecked fcntl() result * Fix unchecked pointer dereference in check_ints (gctest) * Fix unchecked pthread_join() result in threadkey_test * Fix unchecked sigdelset() result in pthread_support * Fix undefined PTRFREE/NORMAL in gc_inline.h * Prefix PREFETCH_FOR_WRITE with GC_ as used in gc_inline.h public header * Relax mark_mutex attribute needed to disable elision (Linux/x64) * Remove (deprecate) TODO file * Remove code duplication in GC_realloc * Remove duplicate new-line in OUT_OF_MEMORY message (cord) * Remove references to missing linux_threads.c from documentation * Revert "Move asm machine-dependent files to 'src' folder" (partly) * Support Android API level 21 * Update compiler options in gc.mak (Win32) * Use mmap instead of sbrk (Hurd) * Workaround 'comparison is always false' GCC warning in GC_FAST_MALLOC_GRANS * Workaround 'identical expr on both sides of bitwise op' warning * Workaround Linux NTPL lock elision bug * Workaround false warning about unreachable code path * Workaround invalid '_end' symbol on Android clang 3.5+ Also, includes 7.2g changes == [7.4.2] 2014-06-03 == * Add config option to use STGRTMIN-based signals for thread suspend/resume * Allow parallel mark to be enabled on powerpc-linux systems * Check for Fujitsu compiler in builtin_unwind logic (enable FX10/K-Computer) * Fix 'Array subscript is above array bounds' GCC warning in GC_new_kind/proc * Fix 'attribute declaration must precede definition' warning (clang-3.1) * Fix (enable) Cygwin-64 build * Fix GC_finalized_malloc failure on disclaim_test * Fix GC_sig_suspend initialization when non-constant SIGRTMIN used * Fix MS VC redefinition warning for functions declared with GC_ATTR_MALLOC * Fix TEXT() usage for concatenated strings in GC_CreateLogFile (Win32) * Fix data roots registration for Android/x86 and NDK ARM 'gold' linker * Fix find stackbottom on BlueGene P/Q systems * Fix machdep .lo files path in configure (SPARC, IA-64) * Fix ok_init assignment (missing cast) in GC_new_kind_inner * Fix typos in names in AUTHORS and ChangeLog files * Remove barrett_diagram file duplicated by tree.html * Remove non-existing DISCARD_WORDS from GC data structure ASCII diagram * Restore contribution information for ancient releases in ChangeLog Also, includes 7.2f changes == [7.4.0] 2013-11-17 == * Add 'bytes reclaimed' counters to public GC_prof_stats_s * Add AArch64 (64-bit ARM) target support * Add GC_LONG_REFS_NOT_NEEDED ifdefs to exclude long link functionality * Add GC_get_prof_stats[_unsafe]() to GC public API * Add GC_push_all/conditional() to GC public API * Add assertion on number_of_objs to GC_extend_size_map * Add assertion to GC_enable() ensuring no counter underflow * Add assertion to LOCK definition that lock is not already held * Add assertion to LONG_MULT and remove useless assert in PUSH_CONTENTS_HDR * Add double-lock assertion to GC_acquire_mark_lock * Add manual POSIX fork handling support (Android) * Add note about 'pkg-config' solving problem with autoconf 2.68 or older * Add public GC_set/get_abort_func to replace default GC_on_abort * Add public GC_start_mark_threads() to allow parallel marker in fork child * Add public setter and getter for GC_push_other_roots * Add support of Android logger * Add tests for GC_register/move/unregister_long_link * Add thread suspend/resume signals public setters (POSIX threads) * Added long weakref support * Adjust GC_dont_expand/gc/precollect and GC_print_stats type to match gc.h * Adjust README.md title and references to doc .html files in it * Adjust build scripts to enable additional test library in staticrootstest * Adjust logged messages in start_mark_threads and GC_thr_init * Adjust printf format specifiers in GC_print_trace * Allow not to rely on __data_start value (Linux) * Allow pthread_kill error code logging in GC_suspend/resume (debugging) * Allow to compile GC_inner_start_routine aside from extra/gc.c * Allow to omit libc atexit() call * Avoid LOCK/UNLOCK hard-coding in gc_locks.h for PS3 target * Better document GC_warn_proc in gc.h * Call GC_on_abort (with NULL argument) on exit(1) * Call GC_stats/verbose_log_printf instead of GC_log_printf if print_stats * Change policy regarding version numbers ("micro" part instead of "alpha") * Changed C99-style designated init of GC_dl_hashtbl struct to use C89-style * Check GC_base result in GC_print_all_smashed_proc * Check that SIG_SUSPEND and SIG_THR_RESTART are different (Pthreads) * Check traceable_allocator.allocate result before dereference in test_cpp * Code refactoring of GC_x_printf (move shared code to macro) * Convert readme to markdown * Default to use libc_stack_end in single-threaded GC on glibc targets * Define GC_VSNPRINTF internal macro in misc.c (code refactoring) * Define functions in darwin_semaphore.h as inline instead of static * Define old_bus_handler static variable only if used (Unix) * Detect dladdr() presence by configure * Disable find-leak GC_gcollect on GC abnormal EXIT * Do not define _setjmp/_longjmp macros in mach_dep.c * Do not duplicate android_log_write output to GC log file (Android) * Do not include sigcontext.h if NO_SIGCONTEXT_H (Linux) * Do not set GC_lock_holder by call_with_alloc_lock if assertions disabled * Do not use pthread_getattr_np if NO_PTHREAD_GETATTR_NP specified * Elaborate comment on dependencies in autogen.sh * Eliminate 'cast from int to pointer' warning in GC_exclude_static_roots * Eliminate 'missing exception specification' warning in gc_cpp.cc (Clang) * Eliminate 'uninitialized variable use' warning in test_printf (cord) * Eliminate 'unused result' compiler warning in main() of test_cpp * Eliminate 'unused value' compiler warning in GC_stop_world (Pthreads) * Eliminate 'unused variable' compiler warning in start_mark_threads (HP/UX) * Eliminate Clang warning for GC_pthread_exit attribute * Eliminate GCC warning about uninitialized 'hhdr' in GC_allochblk_nth * Eliminate GCC warning in GC_get_main_stack_base (OpenBSD) * Eliminate GCC warnings in setjmp_t.c, test_cpp and cord 'de' app * Eliminate GC_first_nonempty atomic value reload in GC_mark_local assertion * Eliminate SIGBUS-related dead code in GC_write_fault_handler (Linux) * Eliminate warning and simplify expression in GC_init_explicit_typing * Enable 'force GC at every GC_malloc' debug-related functionality * Enable on-demand debug logging in GC_FindTopOfStack (Darwin) * Enable prefetch operations by default (GCC 3.0+) * Enable staticrootstest for the case of GC shared library build * Enable thread-local allocation support for Clang on Cygwin * Explicitly specify that Darwin, Linux and Solaris platforms have dladdr * Fix ABORT definition for mingw32ce (WinCE) * Fix AM_CONFIG_HEADER in configure for autoconf-2.69-1 * Fix GC_CreateThread and GC_beginthreadex definition for Cygwin * Fix GC_INIT_CONF_ROOTS in gc.h for Android * Fix GC_INLINE definition to comply with ISO C90 standard (GCC) * Fix GC_remove_all_threads_but_me for Android (fork support) * Fix debug_register_displacement calls from GC_debug_generic_malloc_inner * Fix dyn_load.c compilation for Android 4.3 * Fix make disclaim_test to link with new GNU ld linking rules * Improve GC error printing atomicity in GC_debug_X and GC_print_obj * Improve GC output atomicity in GC_print_obj, GC_print_all_errors * Improve debug-only messages of add/remove_roots and init_linux_data_start * Improve fork test logging in gctest * Improve logged messages about heap size and usage * Improve logging for Android differentiating messages by log level * Improve staticrootstest (add global data to library, add lib w/o GC_INIT) * Improve staticrootstest checks (tests) * Include "config.h" instead of "private/config.h" on HAVE_CONFIG_H * Include proper header file in 'tools' for configuration macros * Include pthread_np.h from pthread_stop_world.c on OpenBSD * Log error messages to stderr instead of stdout in tests * Make GC_generic_malloc_ignore_off_page() public * Make GC_mark_lock_holder variable static * Make GC_print_trace always thread-safe and remove 'lock' argument * Mark GC_started_thread_while_stopped() as GC_INNER * Minimize code duplication in GC_mark_and_push * Move 'include setjmp.h' from mach_dep.c to gc_priv.h * Move GC_OPENBSD_UTHREADS definition to private/gcconfig.h (OpenBSD) * Move GC_get_suspend/thr_restart_signal to misc.c for NaCl and OpenBSD * Move LOCK/UNLOCK from GC_unregister_disappearing_link_inner outer * Port BDWGC to Android/x86 * Postpone the suspend signal in GC_dirty_init only if used to stop world * Prepend '#' symbol to GC number in logged messages * Prevent POSIX fork if mprotect_thread is started (Darwin) * Prevent abort on GC_err/warn_printf write failure * Prevent misleading AC_MSG_ERROR/AS_IF errors reported in configure.ac * Put gc_cpp symbols into 'boehmgc' namespace if GC_NAMESPACE defined * Recognize GC_DONT_GC macro in gc.h (causes GC_INIT to turn off GC) * Recognize GC_SIG_SUSPEND and GC_SIG_THR_RESTART tuning macros in gc.h * Redirect WRITE to __android_log_write if GC_ANDROID_LOG (Android) * Refine comment of GC_is_heap_ptr and GC_thread_is_registered in gc.h * Register dynamic libraries via dl_iterate_phdr on Android and OpenBSD * Remove DebugBreak on WriteFile failure (Win32) * Remove GC_BUILD definition from build scripts * Remove abort on open log failure from GC_write (Win32) * Remove configure.ac outdated revision number * Remove nested EXPECT in GC_core_finalized_malloc * Remove nested always-false ifdef for HPUX and FREEBSD * Remove redundant GC_err_printf before abort * Remove unused UTHREAD_SP_OFFSET macro (OpenBSD) * Rename subthread_create to subthreadcreate_test (Makefile) * Replace GC_COND_LOG_PRINTF calls with WARN for allocation failure messages * Replace GC_log/err_printf() followed by ABORT with ABORT_ARGn() * Replace GC_stats_log_printf with GC_DBG/INFOLOG_PRINTF * Replace SIG_SUSPEND/THR_RESTART macros to variables in pthread_stop_world * Replace Win32 GC_delete_gc_thread with GC_delete_gc_thread_no_free * Replace conditional GC_log_printf calls with GC_COND/VERBOSE_LOG_PRINTF * Replace sprintf with defensive snprintf * Replace var-args GC_noop with GC_noop6 (to eliminate Clang warning) * Simplify LOCK/UNLOCK macro definition for static code analysis tools * Specify GC_malloc result is unused in some tests * Specify GC_pthread_join result is unused in threadkey_test * Specify LT_INIT in configure.ac * Start of port to QNX * Support rthreads introduced in OpenBSD 5.2+ * Suppress 'GC_dont_gc deprecated' warning in gc.h if GC_DONT_GC * Tag GC malloc routines with alloc_size attribute for Clang 3.2+ * Test NO_WRAP_MARK_SOME macro to suppress WRAP_MARK_SOME-specific code * Turn off GC_LOOP_ON_ABORT functionality if GC compiled with NO_DEBUGGING * Turn on world-stop delay logging at debug level by default for Android * Use EXPECT in GC_COND/VERBOSE_LOG_PRINTF * Use GC_log_printf for logging instead of GC_[err_]printf * Use compiler TLS for Android NDK gcc/arm * Use memcpy (BCOPY) instead of strcpy (to suppress GCC warning) * Use pthread API to operate thread-local data on Linux if no compiler TLS * Workaround 'ELF_DATA/EM_ALPHA redefined' warning in Android linker.h * Workaround 'unresolved __tls_get_addr' error for Android NDK Clang Also, includes 7.2e, 7.2d, 7.2c, 7.2b changes == [7.3alpha2] 2012-05-11 == * Add 'const' qualifier to pointer argument of some API functions * Add GC_UNDERSCORE_STDCALL, UNICODE macro templates to configure (Win32) * Add GC_get_thr_restart_signal, GC_thread_is_registered to GC API * Add GC_is_heap_ptr, GC_move_disappearing_link to GC API * Add SHORT_DBG_HDRS macro template to configure * Add Symbian port to mainline (porting done by Djamel Magri) * Add TODO file * Add assertion ensuring proper alignment of 'pushed' GC symbols * Add assertion in GC_getspecific on qtid * Add assertion to GC_incremental_protection_needs, refine documentation * Add assertion to check GC_large_free_bytes by GC_finish_collection * Add configure option to compile all library .c files into single gc.o * Add cordtest to make check * Add disclaim callbacks for efficient finalization (ENABLE_DISCLAIM) * Add finalization.html to 'doc' folder * Add javaxfc.h to the installation set of GC header files (configure) * Add on-heap-resize event notification to API * Adjust GC_log_printf format specifiers (regarding signed/unsigned long) * Adjust GC_requested_heapsize on GC_init if GC_INITIAL_HEAP_SIZE given * Allow GC_exclude_static_roots() region start to be unaligned * Allow Win32 DllMain chaining on the client side * Allow to exclude finalization support by GC_NO_FINALIZATION macro * Allow to get memory via Win32 VirtualAlloc (USE_WINALLOC) on Cygwin * Avoid unnecessary GC_find_limit invocation if GC_no_dls * Avoid use of deprecated GC_dont_gc and GC_stackbottom in gctest * Cast pointers to word (instead of unsigned long) in specific.h * Changed the order in autogen.sh so ltmain exists in time for automake * Declare privately and use handy GC_base_C() for constant object pointers * Define GC_DLL if DLL_EXPORT at GC build (for Cygwin/MinGW) * Define GC_READ_ENV_FILE in configure for WinCE unless gc-debug is off * Do not compile backgraph.c unless configure '--enable-gc-debug' * Do not compile pthread_stop_world.c for Cygwin/Darwin (configure) * Do not install ancient new_gc_alloc.h broken for modern STL (configure) * Enable GC_MIN_MARKERS to set minimal number of pthread-based markers * Enable PARALLEL_MARK and THREAD_LOCAL_ALLOC for FreeBSD in configure * Enable parallel mark by default in configure (Darwin/Linux/Solaris/Win32) * Export GC_is_marked, GC_clear/set_mark_bit (for mark-bit manipulation) * Extend thread-related debug messages * Fix 'configure --enable-cplusplus' for Cygwin/MinGW * Fix DATASTART (and other minor improvements) for NaCl target * Fix GC_setspecific to prevent garbage collection inside * Fix compiler warning in cordtest * Fix minor warnings reported by GCC with '-pedantic' option * Fix static data roots registration on Android (if GC is shared) * Implement GC_get_stack_base for Darwin for single-threaded mode * Improve GC_allochblk algorithm of block splitting when unmapping enabled * Improve GC_collect_or_expand algorithm for many finalizers registered case * In tests, print a message in case a test is a no-op * Instruct configure to hide internal libgc.so symbols if supported by GCC * Log amount of unmapped memory (if enabled) on marking-for-collection * Make __data_start a weak symbol to allow loading modules on mips * Move "cord" library tests to "cord/tests" folder * Move asm machine-dependent files to "src" folder * Move build tools sources to "tools" folder * Move cord_pos.h to public headers folder * Open log file in APPEND mode on Win32 (similar that on Unix/Cygwin) * Optimize some functions by moving pthread_self calls out of LOCK section * Place only major per-release changes description to ChangeLog (this file) * Prevent compiler warnings in GC_FindTopOfStack and GC_ports (Darwin) * Recognize GC_LOG_TO_FILE_ALWAYS macro to log to 'gc.log' by default * Remove all auto-generated files from the repo * Remove binary icon file for de_win * Remove cordtest from "cord" library * Remove duplicate MacOS_Test_config.h file * Remove gc_amiga_redirects.h (included internally) from public headers * Remove obsolete Makefile.DLL (superseded by Cygwin/MinGW configure) * Remove obsolete unused asm files for ALPHA, HPUX, SGI, RS6000, ULTRIX * Remove unsupported MMAP_STACKS (specific to Solaris threads) * Remove unused ancient SILENT, __STDC__, NO_SIGNALS macros * Replace ARGSUSED comment-based annotation with GCC 'unused' attribute * Replace GC_ms_entry declaration with opaque definition for public API * Replace long GC_markers global variable with int GC_markers_m1 * Replace pointer relational comparisons with non-pointer ones * Replace printf PRIxMAX specifier with '%p' for thread id debug output * Require autoconf 2.61 instead of v2.64 * Simplify autogen.sh (use autoreconf) * Split GC_abort with GC_on_abort and abort() invoked from ABORT * Support GC_ATTR_MALLOC for MS VisualStudio * Tag auxiliary malloc-like API functions with 'malloc' attribute * Tag deprecated variables in GC API * Tag must-be-non-null arguments of GC API functions * Turn on "extra" GCC warnings * Turn on unused-parameter checking for GCC * Update AUTHORS file * Use EXPECT for checking various 'initialized' boolean variables * Use USE_COMPILER_TLS on Cygwin * Use pthread_key for thread-local storage on FreeBSD * Use union of AO_t and word to favor strict-aliasing compiler optimization Also, includes 7.2 changes == [7.2o] (not released yet) == * Add loop to handle abort error like in suspend logic on Darwin * Disable mprotect-based incremental GC if /proc roots are used (Linux) * Explicitly zero-initialize trace_buf (fix trace_buf initialization) * Fix 'ACCESS_VIOLATION in marker' GC warning on Win32 async thread start * Fix 'GC_generic_malloc must be available' GCC error in new_gc_alloc.h * Fix 'expected function body after declarator' clang error in gc_cpp.cc * Fix 'write to GC log failed' error * Fix configure message about 'AIX gcc optimization fix' * Fix data race regarding *rlh value in generic_malloc_many * Fix first_thread stack_base initialization if custom GC_stackbottom (Win32) * Fix fread failure after enable_incremental if malloc is redirected (Linux) * Fix gc_cflags variable name in configure (HP/UX) * Fix incorrect define GC_OPENBSD_THREADS on sparc64 * Fix misaligned tlfs passed to AO_load on m68k * Fix missing gc_dlopen.c in CMake script * Fix printf format specifier in simple_example.html * Fix save_callers for multi-threaded case if built-in backtrace unavailable * Fix various typos in comments and documentation files * Fix word size, data start and alignment for OpenBSD/mips64(el) * Prevent WARN of incompatible incremental GC if default or manual VDB * Reduce a time period between GetExitCodeThread and SuspendThread (Win32) * Remove a misleading comment about Solaris in gc.h == [7.2n] 2019-03-01 == * Fix 'mprotect remapping failed' abort on NetBSD with PaX enabled * Fix 'unexpected mark stack overflow' abort in push_all_stack * Fix BSD_TIME variant of MS_TIME_DIFF for the case of a.tv_usec < b.tv_usec * Fix GetThreadContext stale register values use if WoW64 (Win32) * Fix executable memory allocation in GC_unix_get_mem * Fix invalid initializer of CLOCK_TYPE variables if BSD_TIME == [7.2m] 2018-12-11 == * Fix comment typos in CMakeLists.txt, backgraph.c, de.c, gcconfig.h * Fix hbp overflow in GC_install_counts * Fix start_world not resuming all threads on Darwin * Guard against potential buffer overflow in CORD_next and CORD_pos_fetch == [7.2l] 2018-08-10 == * Fix 'pointer arithmetic with NULL' code defect in print_callers * Fix Borland version in documentation to match that in BCC_MAKEFILE * Fix comment about inv_sz computation in setup_header * Fix comments style in configure.ac and Makefile.am * Fix GC_is_valid_displacement and GC_is_visible for non-small objects * Fix global operator delete definition for C++14 in gc_cpp * Fix infinite restarting of mark_some when a static root disappeared (Linux) * Fix large object base computation in PUSH_CONTENTS() if MARK_BIT_PER_OBJ * Fix mark stack overflow checking in push_selected * Fix MSWIN32 macro redefinition (WCC) * Fix potential null dereference in GC_CONS * Fix register_dynamic_libraries on Windows 10 * Fix result computation in n_set_marks * Fix return type in GC_set_warn_proc API documentation * Fix typo in comment for CORD_ec_flush_buf prototype * Fix typos in ChangeLog * Fix VirtualQuery call in case of malloc failure (Win32) * Install gc.3 man page instead of copying gc.man to doc folder (configure) * Perform thread_suspend in loop as it may be interrupted (Darwin) * Workaround 'template-id not supported in this context' compiler error (WCC) == [7.2k] 2018-04-19 == * Fix arguments delimiter in pcr_interface.c (PCR) * Fix assertion violation in DllMain of win32_threads * Fix data race during apply_to_each_object(reset_back_edge) * Fix dbg_mlc.c/o file name in documentation * Fix include gc_gcj.h in thread_local_alloc.c * Fix man section number (3) * Fix missing GC_generic_malloc_words_small implementation in new_gc_alloc.h * Fix missing SIGBUS handler setup for kFreeBSD * Fix null dereference in print_callers on backtrace_symbols failure * Fix the collector hang when it is configured with --enable-gc-debug * Fix thread_suspend fail for threads registered from key destructor (OS X) * Fix typo in AIX macro name * Fix typo in comment in specific.h == [7.2j] 2018-01-21 == * Fix GC allocation mutex in child after a fork * Fix last_reclaimed..gc_no interval comparison to threshold in unmap_old * Fix libgc version which was changed in linkage breaking way * Fix missing EOLn output in threadlibs tool == [7.2i] 2017-12-21 == * Avoid data race in finalized_count (gctest) * Fix assertion violation about disabled cancel in try_to_collect_inner * Fix data race in a list referenced by A.aa (gctest) * Fix data race in do_local_mark when comparing active_count to helper_count * Fix data race in GC_init_explicit_typing * Fix data race in last_stop_count access (suspend_handler_inner) * Fix data race in mark_thread when updating mark_no * Fix data race when getting object size in explicitly-typed allocators * Fix lack of barriers to synchronize memory for suspend_handler * Fix typos in cdescr.html, extend_size_map and ews4800 doc, README.sgi * Prevent 'Unexpected heap growth' in single-threaded gctest (Linux/x64) == [7.2h] 2017-10-12 == * Add gctest as a test (CMake) * Change no-argument functions declaration style to ANSI C (extra files) * Do not allow SHORT_DBG_HDRS if KEEP_BACK_PTRS or MAKE_BACK_GRAPH * Ensure oom_fn callback executed on out-of-memory in calloc * Fix '~' operator application to unsigned values shorter than word * Fix 'context local variable might be clobbered by setjmp' compiler warning * Fix 'doc' files installation folder * Fix 'shift count >= width of type' compiler warning in GC_SQRT_SIZE_MAX * Fix ALL_INTERIOR_POINTERS name in comments and documentation * Fix AO_SRC_DIR target name in NT_*_MAKEFILE * Fix assertion in GC_mark_from for non-heap regions * Fix assertion in GC_steal_mark_stack for non-heap regions * Fix assertion violation in GC_repeat_read if --enable-redirect-malloc * Fix assertion violation in GC_wait_builder called from start_mark_threads * Fix assertion violation in mark_local checking GC_mark_stack_top * Fix assertion violation in return_single_freelist in child process * Fix bm_huge initialization for 64-bit targets (gctest) * Fix broken external links in documentation * Fix bytes count passed to add_to_our_memory in backgraph new_back_edges * Fix calloc_explicitly_typed in case of lb*n overflow * Fix CMake warning about CMP0054 by unquoting instances of HOST * Fix conditional expression in pos_fetch, next non-macro definitions (cord) * Fix configure --disable-munmap handling * Fix CORD_substr_closure for the case when CORD_from_fn returns C string * Fix crash in FirstDLOpenedLinkMap if app linked statically (Alpine Linux) * Fix double lock in pthread_detach (Cygwin, winpthreads) * Fix double multiplication of lb by n in calloc_explicitly_typed * Fix enable_parallel_mark condition in CMake script * Fix external libatomic_ops pkg-config-based detection * Fix gc_allocator.h file name in new_gc_alloc.h comment * Fix gc_backptr.h, gc_mark.h, GC_DS_TAGS names in documentation * Fix gc_cleanup destructor for non-heap objects (gc_cpp) * Fix GC_collect_or_expand to prevent allocation size value wrap-around * Fix GC_incremental declaration/definition type mismatch * Fix GC_mark_stack_top assertion violation properly in mark_local * Fix GC_remove_specific invocation from remove_all_threads_but_me * Fix GC_requested_heapsize increment in GC_init * Fix GC_setspecific to prevent garbage collection inside * Fix GC_SIZE_MAX definition (Linux/musl-gcc) * Fix GCJ support in CMake build script * Fix gctest crash if configure --enable-handle-fork on Darwin * Fix get_maps on proc maps file asynchronous growth * Fix hb_n_marks underflow in clear_fl_marks if MARK_BIT_PER_OBJ * Fix header filename in gcconfig.h comment * Fix infinite mark_some calls after memory mapping disappeared (Glibc) * Fix integer shift undefined behavior in GC_init_explicit_typing * Fix leak_test crash in print_callers if free() is redirected * Fix Makefile.direct recursive invocation * Fix malloc routines to prevent size value wrap-around (fix CVE-2016-9427) * Fix missing win32_threads.c compilation for Cygwin (CMake) * Fix MS VC warning about compiling unused checksums and thread_local_alloc * Fix name typos in GC_FAST_MALLOC_GRANS comment * Fix null dereference in reclaim_block if DONT_ADD_BYTE_AT_END * Fix OSF1 host pattern in CMakeLists.txt * Fix PCR-Makefile by removing compilation of a missing file * Fix potential data race in GC_SysVGetDataStart (SPARC) * Fix potential integer overflow in GC_find_limit_* functions * Fix printf arguments type in print_callers * Fix pthread_detach for threads not yet registered (Cygwin, winpthreads) * Fix pthread_join to avoid thread removal on failure (Cygwin, winpthreads) * Fix pthread_join when thread is registered in thread key destructor * Fix push_complex_descriptor to avoid unlimited global mark stack growth * Fix removal of dead threads in a child process * Fix SIGSEGV in GC_is_marked when gc_cleanup is used in leak-finding mode * Fix SIGSEGV in mark_from called from do_local_mark if WRAP_MARK_SOME * Fix Solaris/sparc detection in case of strict C compliance is enforced * Fix STACKBOTTOM for Solaris 11/x86 * Fix storage class of local variable in register_dynamic_libraries (Irix) * Fix tools/setjmp_t hang (OS X) * Fix typed_test to prevent fails in malloc_explicitly_typed (64-bit) * Fix undefined HEAP_START in register_dynamic_libraries * Fix USE_CUSTOM_SPECIFIC mode (if manually enabled) for Win32 * Fix USE_GET_STACKBASE_FOR_MAIN definition in gcconfig.h * Fix various typos in comments, documentation and printed messages * Handle load_segs overflow in register_dynlib_callback gracefully * Prevent misleading AC_MSG_ERROR/AS_IF errors reported in configure.ac * Replace (fix) 'objs' acronym in comments with 'objects' word * Revert "Skip GC_DS_PER_OBJECT objs with negative descriptor in GC_mark_from" * Update documentation about bugs reporting and new releases notification * Update Download information in GC overview document * Update shared libraries version info (v7.2) * Workaround a bug in winpthreads causing parallel marks deadlock (MinGW) * Workaround missing getcontext() in Docker osrf/ubuntu_32bit == [7.2g] 2016-05-23 == * Fix 'illegal option -xassembler-with-cpp' error (Oracle SunCC) * Fix 'implicit declaration of function' compiler warnings in cord/de * Fix CFLAGS in configure regarding -O flag passing to SunCC compiler * Fix FirstDLOpenedLinkMap for case libgc not 1st dynamically linked (NetBSD) * Fix GC initialization in cord de_win for Cygwin * Fix GC_get_stack_base if called before GC_init (Win32) * Fix OSX issue with pthread_attr_setstacksize failure * Fix Unicode Win32 API calls in cord de_win * Fix USE_COMPILER_TLS macro duplicate description in README * Fix cord de_win WndProc prototype parameters for 64-bit (Win64) * Fix file descriptor resource leak in GC_register_data_segments (OS/2) * Fix filename printing in cordtest * Fix missing cord_pos.h, ec.h among installed headers (Automake) * Fix missing GC_get_stack_base for Amiga * Fix missing msvc_dbg.h in dist_noinst_HEADERS (Automake) * Fix mistyped ARM_THREAD_STATE macro (Darwin/arm) * Fix null-pointer dereferences on out-of-memory in cord and tests * Fix potential multiplication overflow in check_heap_stats (gctest) * Fix race (and potential deadlock) at marker threads initialization * Fix signedness of char values passed to isspace, iscntrl, isxdigit * Fix typo (items numbering) in GC_finalize_all documentation * Fix typos in ERROR_FL, GC_malloc_uncollectable comments * Fix typos in gc_priv.h, in README for ews4800 * Fix unresolved vsnprintf in misc.c and snprintf in cordtest (DJGPP, VC) * Fix various spelling errors * Fix vsprintf_args initialization/cleanup in CORD_vsprintf for EMX * Regenerate configure files using official libtool release (v2.4.2) * Remove documentation about obsolete GC_REDIRECT_TO_LOCAL * Skip GC_DS_PER_OBJECT objects with negative descriptor in GC_mark_from * windows-untested: Fix paths to msvc_dbg.c/h == [7.2f] 2014-06-03 == * Fix 'Bad signal in suspend_handler' abort on FreeBSD-9.2 * Fix 'source file in a subdirectory' Automake warnings * Fix ABORT message in GC_restart_handler * Fix ADD_DEFINITION in CMakeLists.txt for kFreeBSD * Fix CMakeLists.txt: do not override CMAKE_OSX_ARCHITECTURES * Fix GC_alloc_large by bumping GC_collect_at_heapsize in GC_add_to_heap * Fix GC_scratch_last_end_ptr update on GC_scratch_alloc failure * Fix GET_MEM argument rounding in GC_scratch_alloc and similar * Fix PARALLEL_MARK for Windows 7+ * Fix build (broken by fenv.h inclusion) on Linux/x86_64 under uClibc * Fix crash when using GC_malloc_many() as first allocation call * Fix mark stack excessive growth during parallel mark * Fix or remove broken URLs in documentation * Fix out-of-memory case in new_back_edges, push_in_progress (backgraph) * Fix typo in GC_collect_or_expand comment * Fix typos in GC overview file, gc_config_macros.h, gc_cpp.h, README.changes * Regenerate configure files by automake 1.14.1, libtool 2.4.2.418 * Update emails/links due to project site and ML transition == [7.2e] 2013-11-10 == * Add weak attribute to avoid __data_start undefined messages (s390x) * Add weak stubs for pthread_cancel API * Adjust 'pthread_[un]register_cancel undefined ref' workaround (Pthreads) * Append _test suffix to 'initsecondarythread' binary file names * Enable PARALLEL_MARK and THREAD_LOCAL_ALLOC for FreeBSD in configure * Fix 'stack section' pointer passed to push_all_stack_sections (Pthreads) * Fix GC_CreateThread 'dwStackSize' argument type for Win64 * Fix GC_PTHREAD_PTRVAL definition for GC_PTHREADS_PARAMARK (Win32) * Fix GC_clear_stack by declaring 'dummy' local array as volatile * Fix GC_get_stack_base assembly code (Cygwin/Clang) * Fix GC_malloc_explicitly_typed_ignore_off_page for large allocations * Fix GC_marker_Id elements initialization (WinCE) * Fix GC_print_trace missing unlock * Fix GC_unix_mmap_get_mem for open of /dev/zero failure * Fix GC_win32_free_heap compilation error for Cygwin * Fix GC_win32_free_heap to prevent memory leak if USE_GLOBAL_ALLOC * Fix Win32 GC_write preventing potential infinite recursion at abort * Fix assertion violation in GC_mark_from prefetch loop * Fix collection of objects referenced only from GC_mark_stack_X variables * Fix dwSize argument of VirtualFree call in detect_GetWriteWatch (Win32) * Fix heap sections overflow for Win32/Cygwin with enabled parallel marker * Fix min_bytes_allocd preventing potential infinite loop in GC_allocobj * Fix missing tabs in SMakefile.amiga file * Fix null-pointer dereference in CORD_substr_closure * Fix old_segv/bus_act variables initialization for FreeBSD * Fix potential double fclose in test_extras (cordtest) * Fix pthread_attr_t resource leak in pthread_create * Fix race in GC_print_all_errors regarding GC_leaked * Fix sizeof in GC_push_thread_structures * Fix stackbottom/stack_end assignment in GC_call_with_gc_active * Fix tests makefile to link with new GNU ld linking rules * Fix typos in comments and documentation * Fix unportable '==' test operators in configure * Fix vsprintf_args cleanup in CORD_vsprintf * Merge FreeBSD New ports collection for boehm-gc v7.2d * Replace GC_DBG_RA with GC_DBG_EXTRAS macro * Replace deprecated [CXX]INCLUDES to AM_C[PP]FLAGS in configure.ac file * Use __builtin_extract_return_addr in GC_RETURN_ADDR_PARENT (gcc/x86) == [7.2d] 2012-08-09 == * Fix GC_call_with_stack_base to prevent its tail-call optimization * Fix all address-of-dummy operations by using GC_approx_sp() instead * Fix stop_info.stack_ptr assignment in GC_suspend_all for OpenBSD * Fix test_cpp (ensure the collector recognizes pointers to interiors) * Fix thread-related tests for pthreads-w32 * test_cpp: Fix WinMain to prevent SEGV if zero arguments passed (MinGW) == [7.2c] 2012-06-11 == * Fix CORD_cat_char_star to prevent SEGV in case of out-of-memory * Fix GC_FirstDLOpenedLinkMap() for NetBSD 6 release * Fix GC_scratch_alloc and GC_get_maps invocations to prevent SEGV * Fix visibility of GC_clear/set_mark_bit (unhide symbols) * Fix visibility of GC_push_all/conditional, GC_push_other_roots symbols == [7.2b] 2012-05-23 == * Fix assertion in GC_malloc_[atomic_]uncollectable (THREADS case only) == [7.2] 2012-05-11 == * Abort in GC_thr_init on pthread_atfork failure (POSIX threads) * Add GC_WIN32_PTHREADS target in configure * Add GC_is_disabled new function to GC API * Add info that getcontext() resets FPE mask no longer on Linux/x86_64 * Add public GC_set_handle_fork to control forked child handling support * Add realloc_test.c test * Add support for Hexagon target * Add thread-safe GC_get_heap_usage_safe to GC API * Change GC_check_fl_marks prototype and implementation * Check pthread_create/join result in test * Define GC_DLL (in configure) if building only dynamic libraries * Define NO_DEBUGGING (in configure) if "--disable-gc-debug" is set * Disable incremental mode on Darwin if fork handling requested * Enable parallel marker in configure for Solaris * Fix "comparison of signed and unsigned values" compiler warnings * Fix 'volatile' keyword placement in GC_SysVGetDataStart * Fix ALIGNMENT, CPP_WORDSZ, GC_GRANULE_BYTES/WORDS for x32 target * Fix GC_READ_ENV_FILE code for Cygwin * Fix GC_add_roots_inner for Mac OS X (align segment start) * Fix GC_check_fl_marks regarding concurrent access * Fix GC_finalizer_nested size to workaround alignment problem in Watcom * Fix GC_find_limit_with_bound to always reset fault handler on return * Fix GC_init static assertion for clang/x64 (Darwin) * Fix GC_init[_lib_bounds] and GC_get_main_stack_base for malloc redirection * Fix GC_push_all/selected boundaries check * Fix GC_register_my_thread marking thread as detached (Cygwin/pthreads-w32) * Fix GC_remove_all_threads_but_me to cleanup thread-specific data storage * Fix GC_restart_handler to preserve errno if needed * Fix GC_root_size update in GC_add_roots_inner (Win32) * Fix GC_unregister_my_thread to ensure no ongoing incremental GC (Win32) * Fix GC_with_callee_saves_pushed for clang (disable __builtin_unwind_init) * Fix calloc, GC_generic_malloc to check for allocation size overflows * Fix compiler warning in GC_dyld_image_add/remove (Darwin) * Fix configure --enable-cplusplus make install * Fix configure to disable GCC aliasing optimization unless forced to * Fix duplicate definitions in gcconfig.h for NetBSD * Fix fork() support on Cygwin and Darwin targets * Fix gc.h compatibility regression regarding GC_PTR, GC_I_HIDE_POINTERS * Fix gc_cpp.cc for Cygwin (remove duplicate function definition) * Fix gcconfig.h to define USE_GET_STACKBASE_FOR_MAIN for Android * Fix gcconfig.h to handle mips64-linux target * Fix gctest (for Win32) to avoid GC_print_stats internal variable usage * Fix mach_dep.c to include sys/ucontext.h on Mac OS X 10.6 * Fix tests to check GC_malloc result for NULL (out-of-memory) * Fix thread model in configure for MinGW ("win32" instead of "posix") * Fix various warnings reported by LINT-like tools * Fix visibility of some GC internal symbols used by GNU GCJ currently * Port some thread tests to Win32 * Refine API GC setters and getter comments regarding locking * Refine GC_stackbottom description in gc.h * Remove duplicate calls in GC_register_dynamic_libraries * Remove locking in API GC_get_bytes_since_gc and friends * Remove newly-added GC_get_heap_size/free_bytes_inner from API * Remove some local variables that are unused * Support multi-threading for RTEMS target * Use global GC_noop_sink variable in GC_noop1 to suppress compiler warning * Use pkg-config to pick up libatomic_ops, etc * Workaround some Linux/arm kernels bug to get correct GC_nprocs value == [7.2alpha6] 2011-06-14 == * configure_atomic_ops.sh: Remove. * Makefile.direct (dist gc.tar): Remove configure_atomic_ops.sh. * Makefile.am (EXTRA_DIST): Add autogen.sh. * NT_STATIC_THREADS_MAKEFILE (.cpp.obj): Remove duplicate .cpp filename passed. * NT_X64_THREADS_MAKEFILE (.cpp.obj): Use lowercase file extension. * NT_X64_STATIC_THREADS_MAKEFILE (.cpp.obj): Likewise. * NT_MAKEFILE (.cpp.obj): Likewise. * alloc.c (GC_add_current_malloc_heap, GC_build_back_graph, GC_traverse_back_graph): Move prototype to gc_priv.h. * checksums.c (GC_page_was_ever_dirty): Likewise. * dbg_mlc.c (GC_default_print_heap_obj_proc): Likewise. * dyn_load.c (GC_parse_map_entry, GC_get_maps, GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base, GC_get_next_stack): Likewise. * finalize.c (GC_reset_finalizer_nested, GC_check_finalizer_nested): Likewise. * gcj_mlc.c (GC_start_debugging, GC_store_debug_info): Likewise. * malloc.c (GC_extend_size_map, GC_text_mapping): Likewise. * mark_rts.c (GC_mark_thread_local_free_lists): Likewise. * misc.c (GC_register_main_static_data, GC_init_win32, GC_setpagesize, GC_init_linux_data_start, GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf, GC_initialize_offsets, GC_bl_init, GC_do_blocking_inner, GC_bl_init_no_interiors): Likewise. * os_dep.c (GC_greatest_stack_base_below, GC_push_all_stacks): Likewise. * reclaim.c (GC_check_leaked): Likewise. * win32_threads.c (GC_gww_dirty_init): Likewise. * darwin_stop_world.c (GC_is_mach_marker, GC_mprotect_stop, GC_mprotect_resume): Move prototype to darwin_stop_world.h. * pthread_support.c (GC_FindTopOfStack): Likewise. * dyn_load.c (GC_cond_add_roots): Merge adjacent definitions. * mark.c (GC_page_was_ever_dirty): Remove (as already declared). * mark_rts.c (GC_roots_present): Change return type to void pointer (to match the prototype); return NULL instead of FALSE. * mark_rts.c (GC_add_roots_inner): Cast GC_roots_present() result. * os_dep.c (NEED_PROC_MAPS): Move definition to gcconfig.h. * os_dep.c (GC_write_fault_handler): Make STATIC. * os_dep.c (GC_set_write_fault_handler): New function (only if GC_WIN32_THREADS). * pthread_start.c (GC_start_rtn_prepare_thread, GC_thread_exit_proc): Move prototype to pthread_support.h. * pthread_support.c (GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread, GC_unblock_gc_signals): Likewise. * pthread_support.c (GC_stop_init): Move prototype to pthread_stop_world.h. * win32_threads.c (GC_write_fault_handler): Remove prototype. * win32_threads.c (GC_register_my_thread_inner): Call GC_set_write_fault_handler instead of SetUnhandledExceptionFilter (only if MPROTECT_VDB). * doc/README.win32: Add information about DMC. * include/private/gc_priv.h (GC_set_write_fault_handler): New prototype (only if GC_WIN32_THREADS and MPROTECT_VDB). * misc.c (vsnprintf): Redirect to vsprintf() if NO_VSNPRINTF. * win32_threads.c (GC_unregister_my_thread): Use KNOWN_FINISHED() instead of FINISHED macro. * tests/test.c (check_heap_stats): Round up max_heap_sz value for Win32 (same as for USE_MMAP). * tests/test.c (check_heap_stats): Adjust printf format specifier for max_heap_sz; cast max_heap_sz accordingly. * doc/README.solaris2: Add note. * configure.ac (SOLARIS25_PROC_VDB_BUG_FIXED): Don't define for Solaris/x86 2.10+. * tests/threadkey_test.c (SKIP_THREADKEY_TEST): Skip the test if defined; explicitly define for some targets. * mark.c (GC_dirty): Add prototype (only if MANUAL_VDB). * stubborn.c (GC_dirty): Likewise. * include/private/gcconfig.h (GWW_VDB, MPROTECT_VDB, PCR_VDB, PROC_VDB): Undefine if MANUAL_VDB. * include/private/gcconfig.h (DEFAULT_VDB): Don't define if MANUAL_VDB. * os_dep.c (async_set_pht_entry_from_index): Define for MANUAL_VDB. * os_dep.c (GC_read_dirty): Set GC_dirty_maintained only if success; if ioctl() failed then just print warning instead of aborting. * include/private/gc_priv.h (GC_ASSERT): Use "%d" (instead of %ld) for line number printing. * os_dep.c (GC_read_dirty): Add debug logging if DEBUG_DIRTY_BITS (for PROC_VDB only); print errors via GC_err_printf; rename "ps" and "np" local variables to npages and pagesize, respectively; remove "current_addr" local variable. * os_dep.c (GC_get_main_stack_base): Convert to GC_get_stack_base for BeOS and OS/2; define HAVE_GET_STACK_BASE. * os_dep.c (GET_MAIN_STACKBASE_SPECIAL): Define when a specific GC_get_main_stack_base implementation is defined. * os_dep.c (GC_get_main_stack_base): Define that based on GC_get_stack_base() in a single place (only if GET_MAIN_STACKBASE_SPECIAL is unset); check GC_get_stack_base() result. * mark.c (GC_push_selected): Remove "push_fn" argument (use GC_push_all directly); update the documentation. * mark.c (GC_push_conditional): Simplify the code (for better readability). * mark.c (alloc_mark_stack): Use FALSE/TRUE (instead of 0/1) for boolean local variables. * doc/README.macros (GC_PREFER_MPROTECT_VDB): Update. * os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty, GC_remove_protection): Define for GWW_VDB and PROC_VDB in a single place. * os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty): Compute PHT_HASH(h) only once (store result to a local variable). * doc/README.solaris2: Update. * include/private/gcconfig.h (end, InitStackBottom): Declare extern variable for RTEMS. * include/private/gcconfig.h (DATASTART, DATAEND, STACKBOTTOM): Update (for RTEMS). * include/private/gcconfig.h (DATAEND): Fix a typo in the macro name (for RTEMS). * tests/test.c (CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER): Replace with CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER (for RTEMS). * include/private/gcconfig.h (MPROTECT_VDB): Enable for Solaris in single-threaded environment. * include/private/gcconfig.h (MPROTECT_VDB): Undefine if PROC_VDB. * tests/test.c (NUMBER_ROUND_UP): New macro. * tests/test.c (check_heap_stats): Round up total expected heap size to the nearest 4 MiB bound. * tests/test.c (check_heap_stats): Print the current and expected heap sizes in case of failure. * checksums.c (GC_check_blocks, GC_check_dirty): Do log printing only if GC_print_stats; print errors using GC_err_printf. * checksums.c (GC_check_blocks): Join adjacent printf() calls into a single one. * pthread_support.c (pthread_join): Add assertion (check thread is finished). * pthread_support.c (GC_register_my_thread): Don't detach the thread if invoked from the thread destructor. * win32_threads.c (GC_register_my_thread): Likewise. * win32_threads.c (GC_unregister_my_thread): Don't delete the thread (just set FINISHED) if the thread is not detached (only if GC_PTHREADS); add assertion (check the thread is not finished). * tests/threadkey_test.c (main): Join some created threads. * pthread_support.c (GC_delete_gc_thread): Rename "gc_id" local variable to "t". * win32_threads.c (GC_delete_gc_thread): Likewise. * pthread_support.c (pthread_join, pthread_detach, pthread_cancel): Rename "thread_gc_id" local variable to "t". * win32_threads.c (GC_pthread_detach): Likewise. * win32_threads.c (GC_delete_gc_thread): Remove "gc_nvid" local variable. * win32_threads.c (GC_pthread_join): Rename "joinee" local variable to "t". * pthread_stop_world.c (pthread_sigmask): Undefine even if not DEBUG_THREADS. * pthread_stop_world.c (GC_unblock_gc_signals): New function (only if GC_EXPLICIT_SIGNALS_UNBLOCK). * pthread_support.c (GC_unblock_gc_signals): New prototype. * pthread_support.c (GC_register_my_thread_inner, GC_register_my_thread): Call GC_unblock_gc_signals (only if GC_EXPLICIT_SIGNALS_UNBLOCK); add comment. * include/private/gcconfig.h (GC_EXPLICIT_SIGNALS_UNBLOCK): New macro. * pthread_stop_world.c (GC_suspend_handler_inner): Remove "dummy", "sig" local variables; rename my_thread local variable to "self". * tests/threadkey_test.c (LIMIT): Use smaller value (don't create more than 30 in parallel by default). * tests/threadkey_test.c (key_once, main): Work around for Solaris PTHREAD_ONCE_INIT. * tests/threadkey_test.c (LIMIT): Use smaller value for Solaris. * dyn_load.c (GC_FirstDLOpenedLinkMap): Remove unused "r" local variable. * pthread_support.c (GC_unregister_my_thread_inner): Revert back GC_remove_specific invocation; add a comment. * include/private/thread_local_alloc.h (GC_remove_specific): Revert back. * specific.c (slow_getspecific): Cast qtid to AO_t. * include/private/specific.h (key_create, setspecific, remove_specific): Remove "extern" keyword. * include/private/specific.h (getspecific): Change type of "qtid" local variable to unsigned long. * pthread_support.c (GC_check_tls): Fix "#endif" comment. * include/gc.h (GC_REDIRECT_TO_LOCAL): Remove deprecated comment. * include/private/thread_local_alloc.h (THREAD_LOCAL_ALLOC): Remove redundant test of the macro. * backgraph.c (add_edge): Recognize DEBUG_PRINT_BIG_N_EDGES macro. * os_dep.c (GC_set_and_save_fault_handler): Recognize SIGACTION_FLAGS_NODEFER_HACK macro. * pthread_support.c (mark_mutex): Recognize GLIBC_2_1_MUTEX_HACK macro. * pthread_support.c (GC_acquire_mark_lock): Remove commented out code. * include/private/gc_priv.h (SUNOS5SIGS): Don't include sys/siginfo.h on Linux. * include/private/gcconfig.h (FORCE_WRITE_PREFETCH): New macro recognized, force PREFETCH_FOR_WRITE to be defined on x86. * include/private/gcconfig.h (USE_HPUX_FIXED_STACKBOTTOM): New macro recognized (for HP/UX). * os_dep.c (GC_gww_page_was_ever_dirty): Fix comment (for GWW_VDB). * os_dep.c (GC_dirty_init): Use memset() for GC_written_pages resetting (for PROC_VDB). * tests/threadkey_test.c: New file. * tests/tests.am (TESTS, check_PROGRAMS): Add 'threadkey_test'. * tests/tests.am (threadkey_test_SOURCES, threadkey_test_LDADD): New variable. * pthread_support.c (GC_unregister_my_thread_inner): Don't call GC_remove_specific. * include/private/thread_local_alloc.h (GC_remove_specific): Remove (since it is empty for all targets). * pthread_support.c (GC_record_stack_base): New inline function. * win32_threads.c (GC_record_stack_base): Likewise. * pthread_support.c (GC_register_my_thread_inner): Invoke GC_record_stack_base. * win32_threads.c (GC_register_my_thread_inner): Likewise. * pthread_support.c (GC_register_my_thread): If thread is FINISHED then call GC_record_stack_base, clear FINISHED, initialize thread-local list and return success. * win32_threads.c (GC_register_my_thread): Likewise. * include/gc.h (GC_register_my_thread): Update documentation. * include/private/thread_local_alloc.h (GC_thread_key): Likewise. * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Join adjacent "#ifdef". * thread_local_alloc.c (GC_malloc_atomic): Call GC_core_malloc_atomic (instead of GC_core_malloc). * pthread_start.c (GC_start_rtn_prepare_thread): Change return type to GC_thread. * pthread_start.c (GC_inner_start_routine): Pass the current thread descriptor to pthread_cleanup_push (same as in win32_threads.c). * pthread_stop_world.c (GC_push_all_stacks): Rename "me" local variable to "self". * win32_threads.c (GC_push_all_stacks): Likewise. * pthread_stop_world.c (GC_suspend_all, GC_start_world): Rename "my_thread" local variable to "self". * pthread_support.c (GC_unregister_my_thread_inner): New static function. * pthread_support.c (GC_unregister_my_thread, GC_thread_exit_proc): Use GC_unregister_my_thread_inner. * win32_threads.c (GC_register_my_thread, GC_unregister_my_thread, GC_do_blocking_inner): Rename "t" local variable to "thread_id". * win32_threads.c (GC_wait_marker, GC_notify_all_marker): Rename "id" local variable to "thread_id". * pthread_support.c (GC_unregister_my_thread): Call pthread_self only once. * win32_threads.c (GC_pthread_start_inner): Likewise. * pthread_support.c (GC_unregister_my_thread): Add debug output. * win32_threads.c (GC_unregister_my_thread): Likewise. * pthread_support.c (GC_register_my_thread, GC_start_rtn_prepare_thread): Rename "my_pthread" local variable to "self". * include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): Define unconditionally (do not test GC_I_HIDE_POINTERS); update the comment. * include/gc.h (HIDE_POINTER, REVEAL_POINTER): Define as alias to GC_HIDE/REVEAL_POINTER, respectively. * include/private/gc_pmark.h (GC_I_HIDE_POINTERS): Do not define. * include/private/gc_priv.h (GC_I_HIDE_POINTERS): Likewise. * include/gc.h (GC_register_my_thread): Refine the comment. * include/gc_inline.h (GC_MALLOC_WORDS, GC_CONS): Add missing parentheses. * include/gc_typed.h (GC_get_bit, GC_set_bit, GC_CALLOC_EXPLICITLY_TYPED): Likewise. * include/private/gcconfig.h (NO_GETCONTEXT): Add missing ')'. * include/private/gcconfig.h (NO_GETCONTEXT): Do not use getcontext(2) on m68k because it is not implemented there. * alloc.c (GC_clear_a_few_frames): Use BZERO(). * mark_rts.c (GC_clear_roots, GC_rebuild_root_index): Likewise. * reclaim.c (GC_start_reclaim): Likewise. * blacklst.c (total_stack_black_listed): Remove "len" local variable. * dbg_mlc.c (GC_generate_random_valid_address): Replace "for" statement with "do-while" one. * dyn_load.c (GC_register_dynamic_libraries, GC_register_dynlib_callback): Remove redundant parentheses. * cord/cordxtra.c (CORD_from_file_lazy_inner): Suppress "unused result" compiler warning for fread(). * os_dep.c (GC_write_fault_handler): Break when in_allocd_block is set to true. * dbg_mlc.c (GC_has_other_debug_info): Change return type to int; return -1 if the object has (or had) debugging info but was marked deallocated. * include/private/dbg_mlc.h (GC_has_other_debug_info): Likewise. * dbg_mlc.c (GC_has_other_debug_info): Update documentation; remove "ohdr" local variable. * dbg_mlc.c (GC_debug_free): Don't call GC_free if the object has probably been deallocated. * dbg_mlc.c (GC_debug_free): Don't actually free the object even in the leak-finding mode if GC_findleak_delay_free. * dbg_mlc.c (GC_check_leaked): New function (only unless SHORT_DBG_HDRS). * doc/README.environment (GC_FINDLEAK_DELAY_FREE): Document. * doc/README.macros (GC_FINDLEAK_DELAY_FREE): Likewise. * include/private/dbg_mlc.h (START_FLAG, END_FLAG): Use GC_WORD_C on 64-bit architectures. * include/private/dbg_mlc.h (NOT_MARKED): Remove redundant parentheses. * include/private/dbg_mlc.h (GC_HAS_DEBUG_INFO): Update (due to GC_has_other_debug_info change). * include/private/gc_priv.h (GC_findleak_delay_free): New global variable declaration (unless SHORT_DBG_HDRS). * misc.c (GC_findleak_delay_free): New global variable; recognize GC_FINDLEAK_DELAY_FREE. * misc.c (GC_init): Recognize GC_FINDLEAK_DELAY_FREE environment variable (unless SHORT_DBG_HDRS). * reclaim.c (GC_check_leaked): Declare (unless SHORT_DBG_HDRS). * reclaim.c (GC_add_leaked): Don't add the object to leaked list if marked as deallocated. * dbg_mlc.c (GC_has_other_debug_info): Fix punctuation in the comment. * dbg_mlc.c (GC_FREED_MEM_MARKER): New macro. * dbg_mlc.c (GC_debug_free): Use GC_FREED_MEM_MARKER. * dbg_mlc.c (GC_smashed): Refine documentation. * mark.c (GC_push_selected): Change dirty_fn return type to GC_bool. * os_dep.c (GC_page_was_ever_dirty): Make GC_INNER. * reclaim.c (GC_reclaim_small_nonempty_block): Remove "kind" local variable. * reclaim.c (GC_reclaim_block): Pass true constant to GC_reclaim_small_nonempty_block (instead of report_if_found). * doc/README.autoconf: Update; fix a typo. * include/private/gcconfig.h (GC_WORD_C): New macro. * dbg_mlc.c (GC_store_debug_info_inner): Cast "linenum". * dbg_mlc.c (GC_check_annotated_obj): Fix punctuation in the comment. * dbg_mlc.c (GC_print_smashed_obj): Add (and print) "msg" argument. * dbg_mlc.c (GC_debug_free, GC_print_all_smashed_proc): Pass message to GC_print_smashed_obj. * dbg_mlc.c (GC_debug_free): Call GC_size once. * dbg_mlc.c (GC_debug_realloc): Calculate old_sz only if allocation succeeded; remove unnecessary check for object is smashed (since this is done in GC_debug_free); remove "clobbered" local variable. * dbg_mlc.c (GC_store_debug_info_inner, GC_store_debug_info): Rename "integer" argument to "linenum"; change the type of the argument to int. * gcj_mlc.c (GC_store_debug_info): Likewise. * dbg_mlc.c (GET_OH_LINENUM): New macro. * dbg_mlc.c (GC_print_obj, GC_print_smashed_obj): Use GET_OH_LINENUM; adjust print format specifier. * dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page, GC_debug_malloc_stubborn, GC_debug_malloc_atomic, GC_debug_malloc_uncollectable, GC_debug_malloc_atomic_uncollectable): Remove unnecessary cast of "i". * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * os_dep.c (GC_linux_stack_base): Rename to GC_linux_main_stack_base. * os_dep.c (GC_freebsd_stack_base): Rename to GC_freebsd_main_stack_base; adjust error message. * pthread_stop_world.c (GC_stop_init): Use GC_SEM_INIT_PSHARED as an argument for sem_init(). * pthread_support.c (pthread_create): Likewise. * pthread_support.c (pthread_create): Abort in case sem_init() fails. * include/private/gc_priv.h (GC_SEM_INIT_PSHARED): Define. * tests/initsecondarythread.c: Include gcconfig.h; call GC_INIT from main() if it should be done from the primordial thread only. * alloc.c: Don't include sys/types.h for ArmCC. * dyn_load.c: Likewise. * os_dep.c: Likewise. * mach_dep.c (_setjmp, _longjmp): Redirect to setjmp/longjmp for ArmCC. * mark.c (GC_noop): Define specially for ArmCC. * include/private/gc_priv.h (GC_noop): Likewise. * misc.c (GC_init): Don't test pointers comparison for ArmCC. * misc.c: Don't include unistd.h for ArmCC. * os_dep.c (pages_executable): Rename to GC_pages_executable; make STATIC. * os_dep.c (GC_unix_mmap_get_mem): Don't define for ArmCC. * ptr_chck.c (GC_is_visible): Explicitly cast (GC_DS_PER_OBJECT-GC_INDIR_PER_OBJ_BIAS) to word (to suppress a compiler warning). * include/private/gcconfig.h: Recognize __arm. * include/private/gcconfig.h (HBLKPTR): Define for ArmCC. * include/private/gcconfig.h (HBLKPTR): Add parentheses for "bytes" argument. * pthread_support.c (GC_get_nprocs): Don't define for Android. * pthread_support.c (GC_dummy_thread_local): Don't test GC_LINUX_THREADS. * include/gc_config_macros.h (GC_ADD_CALLER, GC_RETURN_ADDR): Define for Android. * mach_dep.c (NO_GETCONTEXT): Move to gcconfig.h. * os_dep.c (GC_write_fault_handler): Don't include ucontext.h if NO_GETCONTEXT. * include/private/gcconfig.h (GETPAGESIZE): Define as a sysconf call for Android. * include/private/gc_locks.h (WIN32_LEAN_AND_MEAN, NOSERVICE): Define before including windows.h. * include/private/gc_priv.h (WIN32_LEAN_AND_MEAN, NOSERVICE): Likewise. * include/private/thread_local_alloc.h (WIN32_LEAN_AND_MEAN, NOSERVICE): Likewise. * include/private/gc_priv.h (MS_TIME_DIFF): Avoid floating-point arithmetics; add a comment. * mark.c (GC_clear_hdr_marks): Don't test USE_MARK_BYTES. * extra/setjmp_t.c (main): Don't test USE_MARK_BITS. * include/private/gc_pmark.h (SET_MARK_BIT_EXIT_IF_SET): Likewise. * include/private/gc_pmark.h (SET_MARK_BIT_EXIT_IF_SET): Remove "mark_byte" local variable. * include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET): Add a comment about that AO_or() is not used by GC unless USE_MARK_BITS explicitly set. * include/private/gc_priv.h (OR_WORD): Likewise. * include/private/gc_pmark.h (INCR_MARKS): Remove trailing ';', add parentheses. * include/private/gc_priv.h (ONES): Define before use by MAKE_COOLER. * include/private/gc_priv.h (MARK_BITS_SZ): Define where used. * include/private/gc_priv.h (OR_WORD): Don't define if USE_MARK_BYTES. * include/private/gcconfig.h (USE_MARK_BYTES); Remove duplicate definition; simplify expression. * os_dep.c (GC_get_maps): Always close the file. * pthread_support.c (GC_get_nprocs): Likewise. * os_dep.c (READ): Define similarly across the file (without parameters). * pthread_support.c (GC_get_nprocs): Use signed int type for "i" and "len" local variables (since read() may return -1). * include/private/gc_pmark.h (LONG_MULT): Add prefix/suffix double underscore; add "volatile" for asm. * include/private/gc_pmark.h (LONG_MULT): Add missing parentheses. * include/private/gc_priv.h (OR_WORD): Likewise. * include/private/gc_priv.h (OR_WORD): Remove unnecessary brackets and ';' symbol. * os_dep.c (GC_get_stack_base): Implement for Android (same as for Linux). * pthread_support.c (GC_get_nprocs): Return 1 (instead of -1) if failed to open "stat" file (not to issue a warning twice); update the comment. * pthread_support.c (GC_thr_init): Call sysconf() on Android to get the number of CPUs. * include/private/gc_priv.h (_GNU_SOURCE): Revert one of the recent patches regarding this macro as the macro should be set (to 1) before including any other system header. * doc/README.environment (GC_INITIAL_HEAP_SIZE, GC_MAXIMUM_HEAP_SIZE): Update. * misc.c (GC_parse_mem_size_arg): Allow 'k', 'M', 'G' suffixes in heap size specifier; return 0 if not a valid one. * include/gc_cpp.h: Explicitly define inline one-argument delete operator for Cygwin (as a workaround). * tests/test_cpp.cc (main): Suppress compiler warnings about "assigned value is unused". * misc.c (GC_parse_mem_size_arg): New function. * misc.c (GC_init): Use GC_parse_mem_size_arg(). * pthread_stop_world.c (tkill): Declare for Android. * include/private/gc_priv.h (_GNU_SOURCE): Include features.h first (except for NaCl) and then define the macro to 1 if not yet. * tests/tests.am (TESTS, check_PROGRAMS): Add 'initsecondarythread'. * tests/tests.am (initsecondarythread_SOURCES, initsecondarythread_LDADD): New variable. * dbg_mlc.c (GC_store_debug_info_inner): Always define; add "const" to its string argument. * dbg_mlc.c (GC_store_debug_info): Call GC_store_debug_info_inner. * dbg_mlc.c (GC_debug_free): Set GC_have_errors in case of smashed or previously deallocated found. * dbg_mlc.c (GC_check_heap_block): Replace while loop with a for one. * reclaim.c (GC_reclaim_check): Likewise. * dbg_mlc.c (GC_check_heap_proc): Remove redundant cast to word. * os_dep.c (GC_get_stack_base): Don't initialize stackbase_main_self/ss_sp on Solaris if thr_main() is zero (thus calling GC_INIT() from a non-primordial thread is possible now). * reclaim.c (GC_add_leaked): Turn into an inline one. * reclaim.c (GC_reclaim_small_nonempty_block): Change report_if_found type from int/word to boolean. * include/private/gc_priv.h (GC_start_reclaim): Likewise. * include/private/gc_priv.h (set_mark_bit_from_hdr, clear_mark_bit_from_hdr): Place closing parenthesis properly. * os_dep.c (GC_get_main_stack_base): Try to use pthread_attr_getstack first for Linux if THREADS. * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Adjust text alignment. * dbg_mlc.c (GC_generate_random_backtrace_no_gc): Fix a message typo. * dbg_mlc.c (GC_debug_malloc): Add a comment (about zero size). * dbg_mlc.c (GC_strdup): Call GC_err_printf instead of WARN (in case of NULL argument). * dbg_mlc.c (GC_free): In case of NULL argument, just return (without any warning printed); eliminate "uncollectable" local variable. * configure.ac (THREADDLLIBS): Use alternate thread library on Solaris 8. * configure.ac (need_atomic_ops_asm): Set to true only for SPARC Solaris. * configure.ac: Don't use libdl on mips-sgi-irix6. * mach_dep.c (NO_GETCONTEXT); Define for RTEMS. * mach_dep.c (GC_with_callee_saves_pushed): Don't call __builtin_unwind_init() for RTEMS; use setjmp() without the leading underscore (for RTEMS). * tests/test.c (BIG): Use smaller value for RTEMS. * tests/test.c (main): Customize for RTEMS. * configure.host: Remove doubled words in comments. * os_dep.c: Likewise. * doc/README: Likewise. * extra/setjmp_t.c: Likewise. * tests/huge_test.c: Likewise. * extra/setjmp_t.c (getpagesize, nested_sp, main, g): Replace the K&R-style function definition with the ANSI C one. * extra/setjmp_t.c (nested_sp): Implement in the same way as GC_approx_sp. * dyn_load.c (GC_dyld_sections): Add more sections. * dyn_load.c (GC_dyld_add_sect_fmts): New static variable. * dyn_load.c (L2_MAX_OFILE_ALIGNMENT): New macro. * dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove): Improve logging; add support for on-demand sections. * gcj_mlc.c (GC_gcj_malloc_initialized): Use STATIC unless GC_ASSERTIONS. * include/private/gc_priv.h (GC_gcj_malloc_initialized): Don't declare (as external) unless GC_ASSERTIONS. * os_dep.c (GC_win32_free_heap): Clear GC_heap_bases[] also for Cygwin; add FIXME. * include/private/gcconfig.h: Include for RTEMS. * include/private/gcconfig.h: Add "#error" for every "-->" mark. * include/private/gcconfig.h (CLEAR_DOUBLE): Turn the code into an expression. * include/private/pthread_support.h (SUSPENDED_EXT): Add new flag (which existed previously as SUSPENDED and still exists in GCJ). * include/private/pthread_support.h (DISABLED_GC): Change the value (as it is already used by SUSPENDED_EXT). * tests/test.c (reverse_test): Modify count (BIG) for ppc64-darwin. * reclaim.c (GC_print_all_errors): Recognize new GC_ABORT_ON_LEAK macro and environment variable; abort if any error has been printed provided the environment variable (or macro) is set. * doc/README.environment (GC_ABORT_ON_LEAK): Document. * doc/README.macros (GC_ABORT_ON_LEAK): Likewise. * os_dep.c (GC_unix_sbrk_get_mem, GC_unix_get_mem): Don't define for RTEMS. * include/private/gcconfig.h (RTEMS): Add support for. * include/private/gcconfig.h (GET_MEM): Use calloc() for RTEMS. * mallocx.c (GC_malloc_uncollectable): Move to malloc.c (since it is used internally in some places). * dbg_mlc.c (GC_register_finalizer_no_order): Remove redundant declaration. * dbg_mlc.c (GC_debug_malloc_replacement, GC_debug_realloc_replacement): Rename RA to GC_DBG_RA. * malloc.c (GC_debug_malloc_replacement): Likewise. * mallocx.c (GC_debug_realloc_replacement): Likewise. * dbg_mlc.c (GC_store_debug_info): Move proto from dbg_mlc.h. * malloc.c (GC_strdup, GC_strndup, GC_wcsdup): Move to mallocx.c. * malloc.c: Include errno.h only REDIRECT_MALLOC; remove redundant includes of string.h. * mallocx.c: Include string.h (for GC_strdup). * include/private/dbg_mlc.h (GC_store_debug_info): Move declaration to dbg_mlc.c. * include/private/gc_locks.h (UNCOND_LOCK, UNCOND_UNLOCK): Remove redundant trailing ';'. * include/private/gc_priv.h (START_WORLD, COND_DUMP): Likewise. * include/private/gc_locks.h (LOCK, UNLOCK): Place opening '{' properly. * include/private/gc_priv.h (GC_DBG_RA): Move from dbg_mlc.c, malloc.c, mallocx.c. * alloc.c (GC_check_heap, GC_print_all_smashed): Move the definition from misc.c. * dbg_mlc.c (GC_debug_malloc_atomic_uncollectable): Define as public. * include/gc.h (GC_debug_malloc_atomic_uncollectable): Declare. * include/gc.h (GC_MALLOC_ATOMIC_UNCOLLECTABLE): Define new public macro. * dbg_mlc.c (MAX_SMASHED): Don't define if already set. * reclaim.c (MAX_LEAKED): Likewise. * dbg_mlc.c (GC_add_smashed): Add FIXME about the concurrent access to the global array. * reclaim.c (GC_add_leaked): Likewise. * misc.c (GC_print_back_height): Set on if GC_PRINT_BACK_HEIGHT (new macro) is defined. * doc/README.macros (GC_PRINT_BACK_HEIGHT): Document. * misc.c (GC_dump_regularly, GC_init): Replace 0/1 for GC_dump_regularly and GC_print_back_height variables with FALSE/TRUE. * reclaim.c (GC_print_all_errors): Refine the comment. * tests/test.c (reverse_test_inner): Undo one of the previous patches which shifts "c" and "d" pointers only if ALL_INTERIOR_POINTERS (since interior pointers are always recognized in stacks). * misc.c (GC_stdout, GC_stderr): Move the definition to the place where GC_log is defined (Unix only). * misc.c (GC_init): Recognize "GC_ONLY_LOG_TO_FILE" environment variable and the similar macro; redirect GC_stdout and GC_stderr to GC_log if "GC_LOG_FILE" environment variable is set unless prohibited by GC_ONLY_LOG_TO_FILE (Unix only). * doc/README.environment (GC_ONLY_LOG_TO_FILE): Document. * doc/README.macros (GC_ONLY_LOG_TO_FILE): Likewise. * misc.c (GC_stdout, GC_write): Rename GC_stdout to GC_log (Win32 only). * misc.c (GC_write): Add for MacOS (and OS/2); change WRITE() accordingly. * misc.c (GC_printf): Check GC_quiet before va_start(). * allchblk.c (GC_freehblk): Use GC_log_printf instead of GC_printf inside "if (GC_print_stats)" branch. * alloc.c (GC_collect_or_expand): Likewise. * dyn_load.c (GC_register_dynamic_libraries): Likewise. * headers.c (GC_scratch_alloc): Likewise. * os_dep.c (GC_get_maps, GC_remap, PROTECT, GC_write_fault_handler, GC_dirty_init, GC_mprotect_thread): Likewise. * alloc.c (min_bytes_allocd): Use GC_log_printf instead of GC_printf for DEBUG_THREADS output. * darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list, GC_stop_world, GC_thread_resume, GC_start_world): Likewise. * pthread_start.c (GC_inner_start_routine): Likewise. * pthread_stop_world.c (GC_suspend_handler, GC_restart_handler, GC_push_all_stacks, GC_suspend_all, GC_stop_world, GC_start_world): Likewise. * pthread_support.c (GC_mark_thread, GC_get_nprocs, GC_start_rtn_prepare_thread, pthread_create): Likewise. * checksums.c (GC_update_check_page): Use GC_printf() instead of GC_err_printf() for error printing. * checksums.c (GC_check_blocks, GC_check_dirty): Use GC_log_printf instead of GC_printf for logging purposes. * dyn_load.c (sys_errlist, sys_nerr, errno): Move declaration of external variable outside from GC_register_dynamic_libraries. * dyn_load.c (GC_register_dynamic_libraries): Don't use sys_errlist value if errno equals to sys_nerr. * dyn_load.c (GC_register_dynamic_libraries): Use GC_log_printf instead of GC_printf for DL_VERBOSE output. * dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove, GC_init_dyld): Use GC_log_printf instead of GC_printf for DARWIN_DEBUG output. * os_dep.c (catch_exception_raise): Use GC_log_printf instead of GC_printf for DEBUG_EXCEPTION_HANDLING output. * reclaim.c (GC_print_free_list): Move "n" increment out of GC_printf() call. * win32_threads.c (DEBUG_CYGWIN_THREADS, DEBUG_WIN32_PTHREADS, DEBUG_WIN32_THREADS): Remove. * win32_threads.c (GC_register_my_thread_inner, GC_win32_start_inner): Use GC_log_printf instead of GC_printf inside "if (GC_print_stats)" branch. * win32_threads.c (GC_PTHREAD_PTRVAL): New macro (defined only if GC_PTHREADS). * win32_threads.c (GC_delete_gc_thread, NUMERIC_THREAD_ID, GC_pthread_join, GC_pthread_create): Use GC_PTHREAD_PTRVAL macro. * win32_threads.c (GC_push_stack_for, GC_mark_thread, GC_CreateThread, GC_beginthreadex, GC_pthread_join, GC_pthread_create, GC_pthread_start_inner, GC_thread_exit_proc, GC_mark_thread_local_free_lists): Use GC_log_printf instead of GC_printf for DEBUG_THREADS output. * win32_threads.c (GC_win32_start_inner, GC_CreateThread, GC_beginthreadex, GC_pthread_join, GC_pthread_create, GC_pthread_start_inner, GC_thread_exit_proc): Cast GetCurrentThreadId result to long; don't cast value of pthread_t type to int; adjust printf format specifiers. * doc/README.win32 (DEBUG_WIN32_PTHREADS): Remove obsolete information. * tests/test.c (cons, small_cons, gcj_cons, check_ints, check_uncollectable_ints, print_int_list, check_marks_int_list, fork_a_thread, finalizer, mktree, chktree, alloc8bytes, alloc_small, tree_test, typed_test, check_heap_stats, WinMain, test, main): Remove unnecessary casts of GC_printf calls to void. * allchblk.c (GC_print_hblkfreelist): Adjust (make uniform across BDWGC) printed message (adjust letters case, terminating dot and new line symbols). * alloc.c (GC_check_fl_marks): Likewise. * backgraph.c (new_back_edges): Likewise. * checksums.c (GC_check_dirty): Likewise. * darwin_stop_world.c (GC_push_all_stacks, GC_suspend_thread_list): Likewise. * dbg_mlc.c (GC_print_type, GC_debug_free, GC_debug_realloc, store_old): Likewise. * dyn_load.c (GC_register_dynamic_libraries): Likewise. * mark.c (GC_initiate_gc, GC_mark_some, GC_mark_from, GC_push_all, GC_push_selected, GC_push_next_marked_dirty): Likewise. * mark_rts.c (GC_exclude_static_roots_inner): Likewise. * os_dep.c (GC_remap, GC_default_push_other_roots, GC_push_thread_structures, GC_dirty_init, GC_read_dirty, catch_exception_raise_state, catch_exception_raise_state_identity, GC_mprotect_thread_notify, GC_mprotect_thread, catch_exception_raise): Likewise. * pthread_stop_world.c (GC_print_sig_mask, GC_push_all_stacks, GC_stop_world, GC_stop_init): Likewise. * pthread_support.c (GC_thr_init, GC_register_my_thread_inner, GC_start_routine): Likewise. * win32_threads.c (GC_register_my_thread_inner, GC_push_all_stacks, GC_win32_start_inner, GC_pthread_join, GC_pthread_start_inner): Likewise. * alloc.c (GC_expand_hp_inner): Realign the code. * mark.c (GC_mark_from, GC_mark_local, GC_do_parallel_mark): Likewise. * misc.c (GC_init): Likewise. * os_dep.c (GC_dirty_init, GC_read_dirty): Likewise. * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Likewise. * tests/test.c (run_one_test): Likewise. * misc.c (GC_err_puts): Document. * misc.c (GC_err_write): Remove. * os_dep.c (dump_maps): Likewise. * include/private/gc_priv.h (GC_err_write): Likewise. * os_dep.c (GC_print_address_map): Call GC_err_puts() instead of dump_maps() and GC_err_write(). * os_dep.c (GC_read_dirty): Remove redundant brackets. * tests/test.c (reverse_test_inner): Test interior pointer recognition only if ALL_INTERIOR_POINTERS. * tests/test.c (run_one_test): Replace GC_all_interior_pointers with GC_get_all_interior_pointers(); simplify the expression. * tests/test.c (check_heap_stats): Replace GC_bytes_allocd and GC_bytes_allocd_before_gc with GC_get_total_bytes(). * tests/test.c (main): Replace GC_gc_no with GC_get_gc_no(). * dbg_mlc.c (GC_debug_strdup, GC_debug_free): Output a portability warning if the argument is NULL and GC is in leaks detection mode. * dbg_mlc.c (GC_debug_strndup, GC_debug_wcsdup): New public function definition. * malloc.c (GC_strndup, GC_wcsdup, strndup): Likewise. * mallocx.c (GC_posix_memalign): Likewise. * malloc.c (strdup): Fix string size value; rename "len" to "lb". * mallocx.c: Include errno.h unless WinCE (otherwise include windows.h for Win32 error constants). * win32_threads.c: Define WIN32_LEAN_AND_MEAN and NOSERVICE before windows.h inclusion. * misc.c (GC_init): Register at-exit callback if GC_find_leak (even if GC_FIND_LEAK macro is unset). * pthread_stop_world.c (NACL_STORE_REGS, __nacl_suspend_thread_if_needed, GC_nacl_initialize_gc_thread): Use BCOPY() instead of memcpy(). * pthread_support.c (GC_init_real_syms): Likewise. * doc/README.macros (GC_DEBUG_REPLACEMENT, GC_REQUIRE_WCSDUP): Document new macro. * doc/README.macros (REDIRECT_MALLOC): Update documentation. * include/gc.h (GC_strndup, GC_posix_memalign, GC_debug_strndup): New API function prototype. * include/gc.h (GC_MALLOC, GC_REALLOC): Redirect to GC_debug_malloc/realloc_replacement() if GC_DEBUG_REPLACEMENT. * include/gc.h (GC_STRDUP): Remove redundant parentheses. * include/leak_detector.h (realloc, strdup): Likewise. * include/gc.h (GC_STRNDUP): New API macro. * include/gc.h (GC_NEW, GC_NEW_ATOMIC, GC_NEW_STUBBORN, GC_NEW_UNCOLLECTABLE): Add missing parentheses. * include/gc.h (GC_wcsdup, GC_debug_wcsdup): New API function prototype (only if GC_REQUIRE_WCSDUP). * include/gc.h (GC_WCSDUP): New API macro (only if GC_REQUIRE_WCSDUP). * include/leak_detector.h: Include stdlib.h and string.h after gc.h (unless GC_DONT_INCLUDE_STDLIB). * include/leak_detector.h (malloc, calloc, free, realloc): Undefine symbol before its redefinition. * include/leak_detector.h (strndup, memalign, posix_memalign): Redefine to the corresponding GC function. * include/leak_detector.h (wcsdup): Redefine to GC_WCSDUP (only if GC_REQUIRE_WCSDUP). * include/leak_detector.h (CHECK_LEAKS): Add comment; don't define the macro if already defined. * misc.c (GC_abort): Use _exit() (instead of DebugBreak) on Win32 when doing code static analysis (to inform the tool that the function is a no-return one). * os_dep.c (GC_linux_stack_base): Remove a duplicate validation of the length of "stat" file; use signed int type for "i", "buf_offset" and "len" local variables (since read() may return -1). * blacklst.c (GC_bl_init_no_interiors): New function (the code moved from GC_bl_init). * blacklst.c (GC_bl_init): Invoke GC_bl_init_no_interiors unless GC_all_interior_pointers mode; remove unnecessarily parameter cast for GC_scratch_alloc call. * include/private/gc_priv.h (GC_bl_init): Move the function declaration to misc.c file. * misc.c (GC_bl_init_no_interiors): Add a prototype. * misc.c (GC_set_all_interior_pointers): Allow values other than 0 and 1; allow altering GC_set_all_interior_pointers value even after GC initialization. * obj_map.c (GC_initialize_offsets): Clear GC_valid_offsets and GC_modws_valid_offsets if GC_all_interior_pointers is off. * misc.c (GC_init): Don't call GC_initialize_offsets() unless GC_all_interior_pointers mode. * alloc.c (GC_finish_collection): Remove redundant brackets; adjust code indentation. * blacklst.c (GC_add_to_black_list_normal): Simplify expression (to improve code readability). * blacklst.c (GC_is_black_listed): Join nested "if" (into a single conditional expression); initialize "nblocks" just before the loop beginning. * misc.c (GC_init): Don't compute initial_heap_sz if GC is already initialized. * include/private/gc_priv.h (GC_initialize_offsets): Move the function declaration to misc.c file. * obj_map.c (GC_initialize_offsets): Remove offsets_initialized static variable since the function is called only once. * tests/middle.c (main): Use setter for GC_all_interior_pointers; adjust printf format specifier (and cast the value passed to). * doc/README.macros (SMALL_CONFIG, LARGE_CONFIG): Refine the documentation. * include/private/gc_hdrs.h (LOG_BOTTOM_SZ): Ignore SMALL_CONFIG if LARGE_CONFIG is defined. * include/private/gc_priv.h (CPP_LOG_HBLKSIZE): Likewise. * alloc.c (GC_finish_collection): Replace "#else #ifdef" with "#elif". * include/private/gc_priv.h (CPP_LOG_HBLKSIZE, LOG_PHT_ENTRIES, MAX_ROOT_SETS, MAX_HEAP_SECTS): Likewise. * alloc.c (GC_expand_hp_inner): Check for GC_collect_at_heapsize overflow even if not LARGE_CONFIG. * dbg_mlc.c (GC_check_heap_proc): Check "oh" size even if SMALL_CONFIG. * finalize.c (GC_print_finalization_stats): Fix "#endif" comment. * doc/README.environment (GC_LOG_FILE, GC_PRINT_VERBOSE_STATS, GC_FULL_FREQUENCY): Refine the documentation. * extra/msvc_dbg.c: Test _MSC_VER macro; include "gc.h" (for GC_word). * extra/msvc_dbg.c (ULONG_PTR): Replace with GC_ULONG_PTR; define as word. * dbg_mlc.c (GC_get_back_ptr_info, GC_print_obj, GC_print_smashed_obj, GC_debug_free_inner): Add a code for a LINT-like tool to instruct it that the function is invoked only with valid parameters (otherwise a SEGV is ok); recognize LINT2 new macro. * misc.c (GC_abort): Instruct a LINT-like tool that the function never returns in fact. * os_dep.c (GC_linux_stack_base): Check for read buffer overflow; close the file immediately after read; use STRTOULL() instead of decoding the address number manually. * include/private/gc_priv.h (EXPECT): Don't specify outcome for a LINT-like tool. * include/private/gc_priv.h (GC_all_interior_pointers): Instruct a LINT-like tool that the value is restricted to zero and one only (required since the variable is global and its value is used as a part of array index expression is some places). * dbg_mlc.c (GC_make_closure): Fix SEGV in case GC_malloc returns NULL. * dbg_mlc.c (GC_debug_register_finalizer, GC_debug_register_finalizer_no_order, GC_debug_register_finalizer_unreachable, GC_debug_register_finalizer_ignore_self): Handle out of memory case properly (similar to GC_register_finalizer_inner). * headers.c (GC_install_header): Handle the case when alloc_hdr() returns NULL. * os_dep.c (GC_get_maps_len): Defend against missing "maps" file. * pthread_support.c (GC_mark_thread): Place a dummy return statement (which uses "id" argument) before the actual use of "id" as an array index (to suppress a warning produced by some static code analysis tools). * win32_threads.c (GC_mark_thread): Likewise. * pthread_support.c (GC_thr_init): Abort (with the appropriate message) if out of memory. * finalize.c (GC_register_finalizer_inner): Fix a typo in a comment. *include/private/gcconfig.h (STACKBOTTOM): Likewise. * gcj_mlc.c (GC_core_gcj_malloc): Replace 0/1 with TRUE/FALSE in EXPECT (the 2nd argument). * malloc.c (GC_core_malloc_atomic, GC_core_malloc, GC_free): Likewise. * mark.c (GC_mark_and_push, GC_mark_and_push_stack): Likewise. * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Likewise. * include/private/gc_hdrs.h (HC_GET_HDR): Likewise. * include/private/gc_priv.h (SMALL_OBJ): Likewise. * include/private/specific.h (getspecific): Likewise. * pthread_support.c (LOCK_STATS): Add a comment. * include/gc_pthread_redirects.h (GC_NO_DLOPEN, GC_NO_PTHREAD_SIGMASK, GC_PTHREAD_CREATE_CONST, GC_PTHREAD_EXIT_ATTRIBUTE, GC_NO_PTHREAD_CANCEL): Move the definition to gc_config_macros. * pthread_support.c (pthread_cancel, GC_pthread_cancel_t, GC_pthread_cancel): Test GC_NO_PTHREAD_CANCEL (instead of NACL and GC_PTHREAD_EXIT_ATTRIBUTE). * include/gc_pthread_redirects.h (GC_pthread_cancel, pthread_cancel): Likewise. * pthread_support.c (GC_pthread_create, GC_pthread_sigmask, GC_pthread_join, GC_pthread_detach, GC_pthread_cancel): Realign code. * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): Define as empty for NaCl. * include/gc_pthread_redirects.h (GC_NO_PTHREAD_CANCEL): New macro defined. * dyn_load.c (GC_init_dyld): Do not invoke _dyld_bind_fully_image_containing_address() if GC_no_dls (as it is not required to register the main data segment in that case). * include/gc.h (GC_no_dls): Adjust the comment. * dyn_load.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Test GC_NO_DLOPEN. * gc_dlopen.c: Likewise. * include/gc_pthread_redirects.h (GC_dlopen, dlopen): Likewise. * gc_dlopen.c: Don't include dlfcn.h (as it is included in gc_pthread_redirects.h). * pthread_support.c (pthread_sigmask, GC_pthread_sigmask_t, GC_pthread_sigmask): Test GC_NO_PTHREAD_SIGMASK (instead of GC_DARWIN_THREADS, GC_OPENBSD_THREADS and NACL). * include/gc_pthread_redirects.h (GC_pthread_sigmask, pthread_sigmask): Likewise. * win32_threads.c (pthread_sigmask, GC_pthread_sigmask): Test GC_NO_PTHREAD_SIGMASK (instead of GC_WIN32_PTHREADS). * pthread_support.c (pthread_create, GC_pthread_create_t, GC_pthread_create): Rename GC_PTHREAD_CONST to GC_PTHREAD_CREATE_CONST. * win32_threads.c (GC_pthread_create): Likewise. * include/gc_pthread_redirects.h: Likewise. * include/gc_pthread_redirects.h (GC_NO_DLOPEN, GC_NO_PTHREAD_SIGMASK): New macro defined. * include/gc_pthread_redirects.h (GC_PTHREAD_CREATE_CONST): Set to empty for NaCl. * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): Do not define for Android (as CANCEL_SAFE is not defined). * include/gc.h (GC_ADD_CALLER, GC_RETURN_ADDR, GC_HAVE_BUILTIN_BACKTRACE, GC_CAN_SAVE_CALL_STACKS): Move definition to gc_config_macros.h file. * include/gc_config_macros.h: Check the file is included from gc.h file. * include/gc_version.h: Likewise. * gc_dlopen.c: Empty unit for NaCl. * os_dep.c: Include fcntl.h for NaCl. * os_dep.c (GC_get_main_stack_base): Ignore USE_GET_STACKBASE_FOR_MAIN macro for NaCl. * os_dep.c (GC_get_stack_base): Return GC_UNIMPLEMENTED for NaCl. * os_dep.c (GC_remap): Use mmap (instead of mprotect) for NaCl. * pthread_start.c (GC_inner_start_routine): Don't invoke pthread_cleanup_push/pop for NaCl. * pthread_stop_world.c (GC_nacl_num_gc_threads, GC_nacl_thread_idx, GC_nacl_park_threads_now, GC_nacl_thread_parker, GC_nacl_gc_thread_self, GC_nacl_thread_parked, GC_nacl_thread_used, GC_nacl_thread_parking_inited, GC_nacl_thread_alloc_lock): New variable (fo NaCl only). * pthread_stop_world.c (GC_remove_allowed_signals, suspend_handler_mask, GC_stop_count, GC_world_is_stopped, GC_retry_signals, SIG_THR_RESTART, GC_suspend_ack_sem, GC_restart_ack_sem, GC_suspend_handler_inner, GC_suspend_handler, GC_restart_handler): Don't define for NaCl. * pthread_support.c (GC_get_nprocs): Likewise. * include/private/gc_priv.h (SIG_SUSPEND): Likewise. * include/private/gcconfig.h (LINUX): Likewise. * pthread_stop_world.c (GC_push_all_stacks): Push register storage for NaCl. * pthread_stop_world.c (GC_suspend_all, GC_stop_world, GC_start_world): Implement for NaCl. * pthread_stop_world.c (GC_stop_world): Don't define unused "i" local variable for OpenBSD (and NaCl). * pthread_stop_world.c (NACL_STORE_REGS): New macro definition for NaCl. * pthread_stop_world.c (nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed, nacl_post_syscall_hook, GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread): New function (for NaCl only). * pthread_stop_world.c (GC_stop_init): Empty for NaCl. * pthread_support.c (pthread_cancel, pthread_sigmask): Don't redirect for NaCl. * include/gc_pthread_redirects.h (pthread_cancel, pthread_sigmask): Likewise. * pthread_support.c (GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread): New internal prototype (NaCl only). * pthread_support.c (GC_new_thread, GC_delete_thread): Initialize and shutdown thread for NaCl. * pthread_support.c (GC_thr_init): Call sysconf for NaCl. * pthread_support.c (GC_pthread_exit): Call GC_thread_exit_proc for NaCl. * include/gc.h: Don't include features.h for NaCl. * include/gc_pthread_redirects.h (GC_PTHREAD_CONST): New macro. * include/gc_pthread_redirects.h (GC_pthread_create): Use GC_PTHREAD_CONST instead of const. * win32_threads.c (GC_pthread_create): Likewise. * pthread_support.c (GC_pthread_create_t, GC_pthread_create, pthread_create): Likewise. * include/private/gcconfig.h (NACL): Recognize NaCl. * include/private/gcconfig.h (GC_LINUX_THREADS): Valid for NaCl. * include/private/pthread_stop_world.h (thread_stop_info): Add reg_storage member; define NACL_GC_REG_STORAGE_SIZE macro (for NaCl only). * include/private/pthread_support.h (GC_nacl_gc_thread_self): Declare internal variable (for NaCl only). * mach_dep.c (GC_with_callee_saves_pushed): Fix FE_ALL_EXCEPT macro. * mark.c (GC_mark_some): Prefix and suffix "asm" and "volatile" keywords with double underscore. * os_dep.c (catch_exception_raise, catch_exception_raise_state, catch_exception_raise_state_identity): Add GC_API_OSCALL to function definition. * os_dep.c (catch_exception_raise_state, catch_exception_raise_state_identity): Move definition to be before GC_ports. * os_dep.c (catch_exception_raise): Declare to have the symbol defined before GC_ports. * os_dep.c (GC_ports): Store references to catch_exception_raise, catch_exception_raise_state, catch_exception_raise_state_identity (to prevent stripping these symbols as dead). * os_dep.c (catch_exception_raise, catch_exception_raise_state, catch_exception_raise_state_identity): Mark these symbols as "referenced dynamically" via an assembler directive (unless NO_DESC_CATCH_EXCEPTION_RAISE). * include/private/gc_priv.h (GC_API_OSCALL): New macro (defined similar to GC_API but as if GC_DLL is always defined). * os_dep.c: Don't include signal.h for GC_write_fault_handler on Win32. * os_dep.c (SIG_OK): Don't return true unless SIGSEGV or SIGBUS on FreeBSD. * os_dep.c (CODE_OK): Use SEGV_ACCERR on FreeBSD (define SEGV_ACCERR for older FreeBSD releases). * dyn_load.c (GC_register_map_entries, GC_register_dynamic_libraries_dl_iterate_phdr): Calculate DATASTART only once if DATASTART_IS_FUNC. * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Calculate DATAEND only once if DATAEND_IS_FUNC. * dyn_load.c: Add comment to some endif; realign some code. * dyn_load.c (GC_init_dyld): Don't use _dyld_bind_fully_image_containing_address if NO_DYLD_BIND_FULLY_IMAGE defined; add FIXME. * include/private/gcconfig.h (GC_data_start, GC_find_limit): Declare if used by DATASTART/DATAEND, respectively. * include/private/gcconfig.h (DATASTART_IS_FUNC, DATAEND_IS_FUNC): Define if DATASTART/DATAEND is a function, respectively. * include/private/gcconfig.h (GETPAGESIZE, NO_PTHREAD_TRYLOCK, NO_DYLD_BIND_FULLY_IMAGE): Define for Darwin/arm as well; include unistd.h. * os_dep.c (GC_setpagesize, GC_task_self, PROTECT, UNPROTECT): Reorder to remove redundant ifdef for Win32. * os_dep.c: Add comment to some endif. * os_dep.c: Include pthread.h (for Linux even if single-threaded) if USE_GET_STACKBASE_FOR_MAIN; also include it for Darwin. * os_dep.c (STACKBOTTOM): Redefine for Darwin (unless prohibited for some reason). * os_dep.c (GC_get_main_stack_base): Allow USE_GET_STACKBASE_FOR_MAIN for Linux even if single-threaded; add assertion for the returned result. * os_dep.c (GC_get_stack_base): Define for Darwin if multi-threaded. * os_dep.c (SIG_OK, CODE_OK): Add comment (for FreeBSD). * os_dep.c (ID_STOP, ID_RESUME): Define only if threads. * os_dep.c (catch_exception_raise): Remove redundant parentheses; refine the documentation. * NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE for C++ files as well. * NT_STATIC_THREADS_MAKEFILE: Likewise. * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Refine. * include/gc.h (GC_INIT): Document. * include/private/gc_priv.h (GC_MACH_HEADER, GC_MACH_SECTION, GC_GETSECTBYNAME): Define depending only on the word size (i.e., define these macros also for ARM). * tests/test.c (check_heap_stats): Print main thread stack bottom as well (only if verbose mode is on). * mach_dep.c (GC_with_callee_saves_pushed): Fix and improve code introduced by the previous patch (if GETCONTEXT_FPU_EXCMASK_BUG and X86_64). * darwin_stop_world.c (GC_FindTopOfStack): Prefix and suffix "volatile" keyword with double underscore. * mach_dep.c (GETCONTEXT_FPU_EXCMASK_BUG): Recognize new macro and include fenv.h if defined (unless NO_GETCONTEXT or HAVE_PUSH_REGS). * mach_dep.c (GC_with_callee_saves_pushed): Restore FPU exception mask corrupted by getcontext if GETCONTEXT_FPU_EXCMASK_BUG. * include/private/gcconfig.h (GETCONTEXT_FPU_EXCMASK_BUG): Define for Linux/amd64 (since its GLibc getcontext currently has the bug). * allchblk.c (GC_use_entire_heap): Change type to int (as declared in gc.h); set the default value depending on new GC_USE_ENTIRE_HEAP macro. * misc.c (GC_init): Test GC_USE_ENTIRE_HEAP environment variable to alter the default value of GC_use_entire_heap. * doc/README.environment (GC_USE_ENTIRE_HEAP): Document. * doc/README.macros (GC_USE_ENTIRE_HEAP): Likewise. * include/private/gcconfig.h (PARALLEL_MARK): Do not make it cause MPROTECT_VDB undefining. * include/private/gcconfig.h (DYNAMIC_LOADING): Fix filename in the comment. * include/private/gc_priv.h (_GC_arrays): Move the conditional macro definitions (shortcuts for GC_arrays members) into the structure body. * darwin_stop_world.c (GC_mach_handler_thread, GC_use_mach_handler_thread, GC_darwin_register_mach_handler_thread): Define only if MPROTECT_VDB. * darwin_stop_world.c (GC_suspend_thread_list): Use GC_mach_handler_thread and GC_use_mach_handler_thread only if MPROTECT_VDB. * darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count only if defined (i.e. unless GC_NO_THREADS_DISCOVERY). * misc.c (GC_init): Fix comment for GWW_VDB. * os_dep.c (DARWIN_EXC_STATE, DARWIN_EXC_STATE_COUNT, DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR): New macros. * os_dep.c (catch_exception_raise): Use DARWIN_EXC_STATE, DARWIN_EXC_STATE_COUNT, DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR. * pthread_support.c (GC_thr_init): Define "dummy" local variable only unless GC_DARWIN_THREADS. * include/private/gcconfig.h (MPROTECT_VDB): Define for Darwin even in the single-threaded mode; define for iPhone/iPad. * include/private/gcconfig.h (IA64): Remove unnecessary "ifdef" around "undef". * include/private/gcconfig.h (HEURISTIC1): Remove unused for Cygwin. * include/private/gcconfig.h (STACKBOTTOM): Use fixed address for Darwin/arm (instead of HEURISTIC1). * misc.c (GC_write): Replace multiple "ifdef/endif" with "elif" (for ECOS and NOSYS). * os_dep.c (GC_get_main_stack_base): Likewise. * os_dep.c (GC_get_main_stack_base): Check USE_GET_STACKBASE_FOR_MAIN macro before checking STACKBOTTOM one; remove "dummy" variable (use result one instead). * doc/README.macros (SN_TARGET_PS3): Document. * extra/threadlibs.c (main): Don't output "-lpthread" (and "-ldl") for Android. * include/private/pthread_support.h: Fix comment for "endif". * misc.c (GC_allocate_ml): Define global variable if SN_TARGET_PS3. * misc.c (GC_init): Initialize GC_allocate_ml if SN_TARGET_PS3. * os_dep.c (SIGSEGV): Define to dummy zero if SN_TARGET_PS3. * os_dep.c (GC_unix_mmap_get_mem): Don't define if SN_TARGET_PS3. * os_dep.c (GC_default_push_other_roots, GC_push_thread_structures): Define for SN_TARGET_PS3. * include/private/gc_locks.h (GC_allocate_ml, LOCK, UNLOCK): Define for SN_TARGET_PS3. * include/private/gcconfig.h (SN_TARGET_PS3): Recognize new macro (Sony PS/3 target). * include/private/gcconfig.h (THREADS): Define unconditionally if SN_TARGET_PS3. * include/private/gcconfig.h (GET_MEM): Define for SN_TARGET_PS3. * alloc.c (GC_collect_or_expand): Replace NIL with NULL in message. * dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_generic_malloc_inner, GC_generic_malloc_inner_ignore_off_page, GC_debug_malloc_stubborn, GC_debug_malloc_atomic, GC_debug_malloc_uncollectable, GC_debug_malloc_atomic_uncollectable): Likewise. * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * dbg_mlc.c (GC_check_annotated_obj): Replace NIL with NULL in a comment. * dyn_load.c (GC_FirstDLOpenedLinkMap): Likewise. * mark_rts.c (GC_roots_present): Likewise. * doc/README: Likewise. * include/private/gc_hdrs.h (IS_FORWARDING_ADDR_OR_NIL): Likewise. * include/private/gc_priv.h (_GC_arrays): Likewise. * configure.ac: Use AC_CHECK_LIB() to check for pthread instead of just blindly linking to -lpthread, as Android includes pthread support within libc and does not provide a separate libpthread. * dyn_load.c (GC_register_dynamic_libraries): Skip current link map entry if l_addr is NULL (Android/bionic only). * pthread_stop_world.c (android_thread_kill): New internal function (Android only). * pthread_stop_world.c (GC_suspend_all, GC_start_world): Call android_thread_kill (based on tkill) instead of pthread_kill on Android (since pthread_kill cannot be used safely on the platform). * pthread_support.c (GC_new_thread): Store thread Id (obtained from gettid) for use by android_thread_kill (Android only). * include/private/pthread_support.h (GC_Thread_Rep): Add kernel_id structure member (Android only). * include/private/gcconfig.h: Recognize __x86_64 macro as a synonym of __x86_64__ (Darwin); define __environ macro (Android on M68K). * allchblk.c (GC_freehblk): Print extended error message (done via GC_printf() before aborting with a short message) only if GC_print_stats. * dyn_load.c (GC_register_dynamic_libraries): Likewise. * os_dep.c (GC_get_maps, GC_register_data_segments, GC_remap, PROTECT, GC_write_fault_handler, GC_mprotect_thread): Likewise. * pthread_stop_world.c (GC_start_world): Likewise. * win32_threads.c (GC_register_my_thread_inner): Likewise. * os_dep.c (GC_get_main_stack_base, GC_register_data_segments, GC_dirty_init): Remove redundant print of an error message before aborting with the same message. * os_dep.c (GC_register_data_segments): Remove format specifier from the string passed to GC_err_puts(); use ABORT instead of EXIT (if invalid executable type). * os_dep.c (GC_remap): Adjust printf format specifier (for long type). * os_dep.c (GC_dirty_init): Print a message about SIG_IGN detected (for SIGSEGV/BUS) only if GC_print_stats. * os_dep.c (catch_exception_raise): Join 2 adjacent GC_err_printf calls. * tests/test.c (main): Print the relevant message if GWW_VDB. * include/private/gcconfig.h: Don't define MPROTECT_VDB for Win32 on x64 if compiled by GCC. * tests/staticrootstest.c: Include string.h for memset() prototype. * tests/thread_leak_test.c (main): Fix printf() format specifiers. * CMakeLists.txt: Check enable_parallel_mark on Darwin. * configure.ac: Likewise. * darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS, DARWIN_QUERY_TASK_THREADS): Rename to GC_NO_THREADS_DISCOVERY and GC_DISCOVER_TASK_THREADS, respectively. * os_dep.c (DARWIN_SUSPEND_GC_THREADS): Likewise. * pthread_support.c (DARWIN_SUSPEND_GC_THREADS): Likewise. * darwin_stop_world.c (DARWIN_QUERY_TASK_THREADS): Don't define (and remove FIXME). * darwin_stop_world.c (GC_use_threads_discovery): Add GC_API; comment; remove FIXME. * win32_threads.c (GC_NO_DLLMAIN): Rename to GC_NO_THREADS_DISCOVERY. * tests/test.c (GC_NO_DLLMAIN): Likewise. * doc/README.macros (GC_NO_DLLMAIN): Likewise. * doc/README.win32 (GC_NO_DLLMAIN): Likewise. * doc/README.macros (GC_NO_THREADS_DISCOVERY): Update the comment. * win32_threads.c (GC_win32_dll_threads): Define as macro to true if GC_DISCOVER_TASK_THREADS (and not GC_NO_THREADS_DISCOVERY); update the comment. * win32_threads.c (GC_use_DllMain): Rename to GC_use_threads_discovery; do not set GC_win32_dll_threads if GC_DISCOVER_TASK_THREADS. * win32_threads.c (GC_started_thread_while_stopped, GC_lookup_thread_inner, UNPROTECT_THREAD, GC_lookup_pthread, GC_thr_init, GC_pthread_create, DllMain): Rewrite some expressions which use GC_win32_dll_threads to minimize the possibility of an "unreachable code" compiler warning when GC_win32_dll_threads is defined as a macro. * win32_threads.c (GC_unregister_my_thread): Don't call GC_delete_thread() if GC_win32_dll_threads and THREAD_LOCAL_ALLOC (since can't happen); use "t" local variable only if not GC_win32_dll_threads. * doc/README.macros (GC_DISCOVER_TASK_THREADS): Document. * include/gc.h (GC_use_DllMain): Rename to GC_use_threads_discovery but keep old name as a macro definition. * include/gc.h (GC_use_threads_discovery): Declare also for Darwin; update the comment. * tests/test.c (main): Call GC_use_threads_discovery for Darwin (to test the mode if possible). * darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS, DARWIN_QUERY_TASK_THREADS): New macro recognized. * darwin_stop_world.c (GC_query_task_threads): add STATIC; initialize to false; define as macro if DARWIN_SUSPEND_GC_THREADS or DARWIN_QUERY_TASK_THREADS; remove FIXME. * darwin_stop_world.c (GC_use_threads_discovery): New function (for setting GC_query_task_threads value). * darwin_stop_world.c (GC_mach_handler_thread, GC_use_mach_handler_thread, GC_mach_thread, GC_MAX_MACH_THREADS, GC_mach_threads, GC_mach_threads_count, GC_suspend_thread_list, GC_darwin_register_mach_handler_thread): Define only if not DARWIN_SUSPEND_GC_THREADS. * darwin_stop_world.c (GC_stop_world, GC_start_world): Exclude the code for GC_query_task_threads case from compilation unless DARWIN_SUSPEND_GC_THREADS. * os_dep.c (GC_darwin_register_mach_handler_thread): Declared only if Darwin threads and not DARWIN_SUSPEND_GC_THREADS. * os_dep.c (GC_mprotect_thread): Call GC_darwin_register_mach_handler_thread only if THREADS and not DARWIN_SUSPEND_GC_THREADS. * pthread_support.c (marker_mach_threads): Don't define if DARWIN_SUSPEND_GC_THREADS. * pthread_support.c (GC_mark_thread): Don't fill in marker_mach_threads if DARWIN_SUSPEND_GC_THREADS. * include/private/gc_locks.h (GC_need_to_lock): Always declare for THREADS case. * darwin_stop_world.c (GC_query_task_threads): Don't define to false for DARWIN_DONT_PARSE_STACK case; unconditionally initialize the variable to false (for now). * darwin_stop_world.c (GC_push_all_stacks): Call task_threads() only if not DARWIN_DONT_PARSE_STACK. * darwin_stop_world.c (GC_stop_world, GC_start_world): Use the approach based on task_threads() only if GC_query_task_threads else use GC_threads table. * darwin_stop_world.c (GC_mach_threads): Remove static qualifier. * darwin_stop_world.c (GC_stop_init): Remove (as we do not need to really clear GC_mach_threads[]). * darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count (instead of calling GC_stop_init). * include/private/pthread_support.h (GC_stop_init): Remove proto. * pthread_support.c (GC_stop_init): Add proto (unless Darwin). * pthread_support.c (GC_thr_init): Don't call GC_stop_init() if GC_DARWIN_THREADS. * darwin_stop_world.c (GC_stack_range_for): New static function (move the code from GC_push_all_stacks). * darwin_stop_world.c (GC_push_all_stacks): Call GC_stack_range_for(); rename kern_return local variable to kern_result. * darwin_stop_world.c (GC_is_mach_marker): Change argument type from mach_port_t to thread_act_t. * pthread_support.c (GC_is_mach_marker): Likewise. * darwin_stop_world.c (GC_push_all_stacks): Fix "my_task" local variable initialization (always call current_task()). * pthread_support.c (GC_thr_init, GC_register_my_thread_inner): Don't set thread's stop_info.stack_ptr value for Darwin. * include/private/darwin_stop_world.h (thread_stop_info): Update the comment for stack_ptr. * darwin_stop_world.c (GC_push_all_stacks): Rename "r", "me" local variables to "kern_return" and "my_thread" ones, respectively; call mach_port_deallocate() unconditionally. * darwin_stop_world.c (GC_stop_world): Don't call mach_thread_self if DEBUG_THREADS. * darwin_stop_world.c (GC_mach_thread): Move from darwin_stop_world.h. * include/private/darwin_stop_world.h (GC_mach_thread): Remove. * win32_threads.c (GC_start_world): Define "thread_id" local variable only if GC_ASSERTIONS; decide whether to resume a thread based on its "suspended" field value; assert that suspended thread stack_base is non-zero and the thread is not our one. * darwin_stop_world.c (GC_thread_resume): New inline function (move code from GC_thread_resume). * darwin_stop_world.c (GC_start_world): Check result of task_threads(); call GC_thread_resume(). * os_dep.c (GC_malloc_heap_l, GC_is_malloc_heap_base): Define only if not CYGWIN32. * os_dep.c (GC_is_heap_base): Call GC_is_malloc_heap_base() only if not CYGWIN32. * darwin_stop_world.c (FindTopOfStack): Change return type to ptr_t (from long); make GC_INNER; add GC_ prefix. * darwin_stop_world.c (GC_push_all_stacks): Add thread_blocked local variable (initialized from the corresponding GC_thread field unless GC_query_task_threads); add assertion that our thread is not blocked; prefix FindTopOfStack with GC_ and remove no longer needed cast to ptr_t of the result; handle thread blocked case (and remove FIXME); use GC_push_all_stack_sections unless GC_query_task_threads (and remove FIXME). * pthread_support.c (GC_FindTopOfStack): Declare (if needed). * pthread_support.c (GC_do_blocking_inner): Call GC_save_regs_in_stack (if needed) before acquiring the lock. * win32_threads.c (GC_do_blocking_inner): Likewise. * pthread_support.c (GC_do_blocking_inner): Set/clear topOfStack field of GC_thread (Darwin only). * include/private/pthread_support.h (GC_thread): Add topOfStack field for Darwin (unless DARWIN_DONT_PARSE_STACK). * finalize.c (GC_check_finalizer_nested): Change return type to char pointer (instead of int pointer); use explicit cast for GC_finalizer_nested assignment. * pthread_support.c (GC_check_finalizer_nested): Likewise. * win32_threads.c (GC_check_finalizer_nested): Likewise. * finalize.c (GC_finalizer_nested): Change type to unsigned char. * finalize.c (GC_notify_or_invoke_finalizers): Change type of "pnested" local variable to char pointer. * pthread_support.c (GC_do_blocking_inner, GC_call_with_gc_active): Use explicit cast for "thread_blocked" field assignment. * win32_threads.c (GC_lookup_pthread): Use explicit cast for "suspended" field assignment. * win32_threads.c (GC_Thread_Rep): Use short type for finalizer_skipped; use char type for finalizer_nested and flags fields and reorder some fields (to minimize GC_Thread_Rep structure size). * include/private/pthread_support.h (GC_Thread_Rep): Likewise. * win32_threads.c (GC_Thread_Rep): Use char type for suspended field (instead of GC_bool). * include/private/pthread_support.h (GC_Thread_Rep): Use char type for thread_blocked field (instead of short). * darwin_stop_world.c (GC_query_task_threads): New variable (or macro). * darwin_stop_world.c (GC_push_all_stacks): Use GC_query_task_threads (to choose between algorithms based on kernel task_threads and based on GC_threads table); update FIXME; remove commented out GC_push_one statements. * pthread_support.c (GC_thr_init, GC_do_blocking_inner, GC_call_with_gc_active, GC_register_my_thread_inner): Initialize stack_ptr field for all platforms. * pthread_support.c (GC_call_with_gc_active): Initialize saved_stack_ptr field for all platforms. * include/private/darwin_stop_world.h (thread_stop_info): Add stack_ptr field; change type of already_suspended from int to GC_bool. * darwin_stop_world.c (GC_MAX_MACH_THREADS): New macro. * darwin_stop_world.c (GC_mach_threads, GC_stop_init): Use GC_MAX_MACH_THREADS instead of THREAD_TABLE_SZ. * darwin_stop_world.c (GC_mach_threads): Add FIXME. * darwin_stop_world.c (GC_stop_init, GC_suspend_thread_list, GC_stop_world): Use FALSE and TRUE for already_suspended field and "changed", "found" variables. * darwin_stop_world.c (GC_is_mach_marker): New prototype (only if PARALLEL_MARK). * darwin_stop_world.c (GC_suspend_thread_list): Change return type to GC_bool; change type of "changed", "found" to GC_bool; make "my_thread" as an argument (instead of acquiring/deallocating it locally); do not add my_thread, GC_mach_handler_thread and marker threads to GC_mach_threads table; check for overflow of GC_mach_threads table; increase GC_mach_threads_count if "found" is true and info.suspend_count is non-zero. * darwin_stop_world.c (GC_suspend_thread_list, GC_start_world): Adjust "thread" format specifiers for GC_printf(); search thread in "old_list" starting from the previous found one. * darwin_stop_world.c (GC_stop_world): Rename "changes" to "changed" local variable; remove "result" variable; adjust GC_printf debugging message. * darwin_stop_world.c (GC_start_world): Do not check for my_thread and GC_use_mach_handler_thread (since they are not added to GC_mach_threads table); call thread_info() only if DEBUG_THREADS or GC_ASSERTIONS. * pthread_support.c (marker_mach_threads): New static variable (if Darwin). * pthread_support.c (GC_is_mach_marker): New function (if Darwin). * pthread_support.c (GC_mark_thread): Fill in marker_mach_threads table (if Darwin). * alloc.c (GC_parallel): Define only if THREADS. * misc.c (GC_get_parallel): Likewise. * include/gc.h (GC_parallel, GC_get_parallel, GC_get_suspend_signal, GC_allow_register_threads, GC_register_my_thread, GC_unregister_my_thread): Define only if GC_THREADS. * include/gc.h (GC_get_heap_size): Fix a typo in a comment. * configure.ac: Use `AC_C_INLINE'. * include/private/gc_priv.h (GC_INLINE): Use "inline" keyword (determined by configure AC_C_INLINE) if HAVE_CONFIG_H is defined. * dyn_load.c (DL_ITERATE_PHDR_STRONG): New macro (define for FreeBSD). * dyn_load.c (GC_register_main_static_data): Move the definition above GC_register_dynamic_libraries_dl_iterate_phdr one (FreeBSD case); unconditionally return FALSE if DL_ITERATE_PHDR_STRONG. * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Test GC_register_main_static_data() result (instead of direct testing of dl_iterate_phdr (to prevent a compiler warning). * os_dep.c (CODE_OK): Test si_code also for the value of 2 (FreeBSD case; required for FreeBSD v7+). * os_dep.c (CODE_OK): Properly use parentheses (HPUX case). * include/private/gcconfig.h (DATASTART): Cast etext argument in GC_FreeBSDGetDataStart() call; remove unnecessary "&" (FreeBSD case). * include/private/specific.h (quick_thread_id): Define thru GC_approx_sp(); define as a macro. * include/private/specific.h (getspecific): Use GC_INLINE instead of __inline__ (to work around Sun CC which does not recognize inline keyword surrounded with underscores). * darwin_stop_world.c (FindTopOfStack): Simplify condition expressions. * darwin_stop_world.c (GC_push_all_stacks): Merge two variants of this function (DARWIN_DONT_PARSE_STACK). * darwin_stop_world.c (GC_push_all_stacks): Add a check for our thread is found (same as in pthread_stop_world.c). * darwin_stop_world.c (GC_push_all_stacks): Print the number of scanned threads if verbose (same as in pthread_stop_world.c). * darwin_stop_world.c (GC_push_all_stacks): Reset thread_state_count value before every thread_get_state call; refine the comment for thread_state_count. * darwin_stop_world.c (GC_push_all_stacks): Ignore rsp, rip/eip, rflags, cs, fs, gs, ss, ds, es, __pc registers; uncomment ebp register pushing. * darwin_stop_world.c (GC_push_all_stacks): Set outCount to GC_MACH_THREAD_STATE_COUNT (instead of THREAD_STATE_MAX). * darwin_stop_world.c (GC_push_all_stacks): Remove FIXME and WARN for i386. * doc/README.macros (DARWIN_DONT_PARSE_STACK): Fix a typo. * darwin_stop_world.c (GC_use_mach_handler_thread): Change type to GC_bool. * darwin_stop_world.c (GC_suspend_thread_list, GC_start_world): Simplify the expressions involving GC_use_mach_handler_thread. * darwin_stop_world.c (GC_darwin_register_mach_handler_thread): Initialize GC_use_mach_handler_thread to TRUE (instead of 1). * include/gc_pthread_redirects.h (GC_pthread_sigmask, GC_dlopen, pthread_sigmask, dlopen): Don't define for Win32 pthreads (and don't include signal.h and dlfcn.h). * dyn_load.c (GC_register_dynlib_callback): Add FIXME. * include/private/gcconfig.h: Add support for FreeBSD on ppc64. * os_dep.c (PROTECT, UNPROTECT): Correct VM_PROT_EXEC to VM_PROT_EXECUTE. * os_dep.c (os2_alloc): Don't set PAG_EXECUTE unless pages_executable is on. * os_dep.c (os2_alloc): Add FIXME (for recursion). * os_dep.c (UNPROTECT): Abort with a more informative message if pages_executable is on ("mprotect" case). * os_dep.c (PROTECT, UNPROTECT): Set VM_PROT_EXEC if pages_executable is on (Darwin case). * pthread_support.c (GC_init_real_syms): Abort with an informative message if libgc is linked after libpthread. * dyn_load.c (GC_register_dynlib_callback): Adjust "start" pointer for 64-bit targets. * pthread_support.c (start_mark_threads): Expand PTHREAD_CREATE macro. * pthread_support.c (start_mark_threads): Call INIT_REAL_SYMS() since REAL(pthread_create) is used. * pthread_support.c (PTHREAD_CREATE): Remove unused. * extra/threadlibs.c (main): Remove --wrap for "read" (since not wrapped anymore). * doc/README.linux (GC_USE_LD_WRAP): Likewise. * os_dep.c (__wrap_read): Likewise. * include/gc_pthread_redirects.h: Test GC_PTHREADS and GC_H at the beginning of the file. * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): New macro (defined only for Linux and Solaris). * include/gc_pthread_redirects.h (GC_pthread_cancel, GC_pthread_exit): Declare new API function (only if GC_PTHREAD_EXIT_ATTRIBUTE). * include/gc_pthread_redirects.h (pthread_cancel, pthread_exit): Redirect (if GC_PTHREAD_EXIT_ATTRIBUTE). * include/private/pthread_support.h (DISABLED_GC): New macro. * pthread_support.c (pthread_cancel, pthread_exit): Restore original definition or declare "real" function (if needed and GC_PTHREAD_EXIT_ATTRIBUTE). * pthread_support.c (GC_pthread_cancel_t, GC_pthread_exit_t): Declare new types if needed. * pthread_support.c (GC_pthread_cancel, GC_pthread_exit): New function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE). * pthread_support.c (GC_init_real_syms): Initialize pointers to the "real" pthread_cancel and pthread_exit (only if GC_PTHREAD_EXIT_ATTRIBUTE). * pthread_support.c (GC_unregister_my_thread): Enable collections if DISABLED_GC was set (only if GC_PTHREAD_EXIT_ATTRIBUTE). * pthread_support.c (pthread_cancel, pthread_exit): New wrapped function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE defined). * pthread_support.c (GC_start_routine): Refine the comment. * extra/threadlibs.c (main): Adjust --wrap (add "read", "pthread_exit", "pthread_cancel" but remove "sleep"). * doc/README.linux (GC_USE_LD_WRAP): Likewise. * include/gc.h (GC_MALLOC_STUBBORN): Remove trailing ';' in the macro definition. * include/gc.h (GC_reachable_here): Likewise. * include/gc.h (GC_reachable_here): Prefix and postfix "volatile" with double '_'. * pthread_start.c: New file. * CMakeLists.txt (SRC): Add pthread_start.c. * Makefile.am (libgc_la_SOURCES): Likewise. * Makefile.direct (CSRCS): Likewise. * Makefile.direct (OBJS): Add pthread_start.obj. * extra/gc.c: Add a comment; include pthread_start.c. * pthread_support.c (start_info): Move the struct definition down closer to its usage. * pthread_support.c (GC_thread_exit_proc): Replace STATIC with GC_INNER. * pthread_support.c (GC_inner_start_routine): Move to the definition to pthread_start.c; leave only the prototype; remove STATIC. * pthread_support.c (GC_start_rtn_prepare_thread): New function (contains parts of the original GC_inner_start_routine). * configure.ac (NO_EXECUTE_PERMISSION): Add comment. * doc/README.macros (NO_EXECUTE_PERMISSION): Update the documentation. * include/gc.h (GC_set_pages_executable, GC_get_pages_executable): New API function declaration. * os_dep.c (OPT_PROT_EXEC): Remove (superseded by pages_executable). * os_dep.c (pages_executable): New static variable. * os_dep.c (IGNORE_PAGES_EXECUTABLE): New macro (used by GC_get_pages_executable only). * os_dep.c (GC_unix_mmap_get_mem, GC_remap, PROTECT, UNPROTECT): Replace OPT_PROT_EXEC with pages_executable. * os_dep.c (GC_unix_mmap_get_mem, GC_remap, GC_win32_get_mem, GC_wince_get_mem, UNPROTECT): Undefine IGNORE_PAGES_EXECUTABLE. * os_dep.c (GC_win32_get_mem, GC_wince_get_mem, GC_remap, PROTECT, UNPROTECT): Use PAGE_EXECUTE_... only if pages_executable is on. * os_dep.c (GC_set_pages_executable, GC_get_pages_executable): New API function definition. * tests/test.c (check_heap_stats): Increase max_heap_sz by 20% for 64-bit CPUs (to prevent "Unexpected heap growth" failure on Win64, at least). * tests/test.c (check_heap_stats): Increase max_heap_sz by 25% for 32-bit CPUs (to prevent "Unexpected heap growth" failure). * gc_dlopen.c (dlopen): Prototype REAL_DLFUNC if GC_USE_LD_WRAP. * pthread_support.c (pthread_create, pthread_join, pthread_detach, pthread_sigmask): Likewise. * gc_dlopen.c (dlopen): Remove cast (redundant since the prototype is added). * gc_dlopen.c (GC_dlopen): Fix return type. * pthread_support.c (GC_init_real_syms): Don't define LIBPTHREAD_NAME, LIBPTHREAD_NAME_LEN, len, namebuf and libpthread_name if RTLD_NEXT. * gc_dlopen.c (disable_gc_for_dlopen): Update the comment. * gc_dlopen.c (dlopen): Likewise. * include/gc.h (GC_enable_incremental): Refine the comment. * include/gc.h (DECLSPEC_NORETURN): Define macro as empty if missing (only for Win32). * include/gc.h (GC_ExitThread): Use DECLSPEC_NORETURN. * win32_threads.c (GC_ExitThread): Likewise. * include/gc.h (GC_endthreadex): Add a comment. * include/cord.h: Fix typos. * Makefile.am (EXTRA_DIST): Add "CMakeLists.txt" and "tests/CMakeLists.txt". * doc/doc.am (dist_pkgdata_DATA): Add "doc/README.cmake". * mach_dep.c (NO_GETCONTEXT): Also define if AVR32. * include/private/gcconfig.h (AVR32): New macro (also define the supplementary macros for the target). * include/private/thread_local_alloc (USE_COMPILER_TLS): Don't define for AVR32. * tests/leak_test.c (main): Explicitly define as returning int (to prevent a spurious test failure on some Linux/alpha targets). * tests/thread_leak_test.c (main): Likewise. * tests/thread_leak_test.c: Initialize GC_find_leak in the main thread (before GC_INIT) only. * tests/leak_test.c (main): Use GC_set_find_leak() instead of accessing GC_find_leak directly. * tests/thread_leak_test.c (main): Likewise. * include/gc.h (GC_find_leak, GC_finalize_on_demand, GC_java_finalization, GC_dont_expand, GC_no_dls, GC_dont_precollect): Simplify the comment (remove the information about data races since the value is boolean). * os_dep.c (GC_get_stack_base, GC_get_main_stack_base): New Solaris-specific implementation (based on thr_stksegment). * os_dep.c (stackbase_main_self, stackbase_main_ss_sp): New static variable used by the Solaris-specific GC_get_stack_base(). * pthread_support.c (GC_mark_thread_local_free_lists, GC_check_tls): Mark (and check) only for live threads (in case of GC_destroy_thread_local() is called already but GC_delete_thread() is not yet). * win32_threads.c (GC_mark_thread_local_free_lists, GC_check_tls): Likewise. * NT_MAKEFILE: Remove the comment about DLL and Win32S. * NT_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_STATIC_THREADS_MAKEFILE: Likewise. * NT_MAKEFILE: Add ".SUFFIXES" directive (to handle gc_cpp.cc properly on VS 2005+). * NT_MAKEFILE: Update GC log file name in comments. * NT_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_THREADS_MAKEFILE: Likewise. * doc/README.win32: Likewise. * NT_MAKEFILE: Remove ":full" for "-debug" option (since no longer supported by VS). * NT_STATIC_THREADS_MAKEFILE: Likewise. * NT_MAKEFILE: Commented out copying of gc_cpp.cc to gc_cpp.cpp. * NT_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_THREADS_MAKEFILE: Likewise. * NT_STATIC_THREADS_MAKEFILE: Add -D PARALLEL_MARK option. * NT_STATIC_THREADS_MAKEFILE: Increase stack size for gctest.exe. * NT_X64_STATIC_THREADS_MAKEFILE: Remove "-stack" option (use the default stack size limit). * NT_X64_THREADS_MAKEFILE: Rename "gc64_dll.dll" to "gc64.dll". * win32_threads.c (GC_get_next_stack): Always define (since it is also used for Cygwin now). * alloc.c (GC_maybe_gc): Move GC_notify_full_gc() call upper to be just before GC_clear_marks() call. * include/gc_mark.h (GC_start_callback_proc): Refine the comment. * Makefile.am (check_LTLIBRARIES): Initialize to empty. * tests/tests.am (TESTS, check_PROGRAMS): Add staticrootstest. * tests/tests.am (staticrootstest_SOURCES, staticrootstest_LDADD, libstaticrootslib_la_SOURCES, libstaticrootslib_la_LIBADD, libstaticrootslib_la_LDFLAGS, libstaticrootslib_la_DEPENDENCIES): Define. * tests/tests.am (check_LTLIBRARIES): Add libstaticrootslib.la. * tests/staticrootstest.c: New file. * tests/staticrootslib.c: Likewise. * dyn_load.c (GC_get_next_stack, GC_cond_add_roots): Define for Cygwin as well as other win32 targets. * dyn_load.c (GC_wnt): Define to constant true. * dyn_load.c (GC_register_dynamic_libraries): Define for Cygwin as well as other win32 targets. * mark_rts.c (rt_hash, GC_roots_present, add_roots_to_index): Don't define for Cygwin, as on other win32. * mark_rts.c (GC_add_roots_inner, GC_clear_roots): Handle on Cygwin as for other win32 targets. * mark_rts.c (GC_rebuild_root_index): Don't declare on Cygwin, as other win32. * mark_rts.c (GC_remove_tmp_roots): Do declare on Cygwin as on other win32. * mark_rts.c (GC_remove_roots, GC_remove_roots_inner): Don't declare on Cygwin as on other win32. * mark_rts.c (GC_is_tmp_root): Do declare on Cygwin when !NO_DEBUGGING, as on other win32 targets. * mark_rts.c (GC_cond_register_dynamic_libraries): Handle on Cygwin as for other win32 targets. * os_dep.c (GC_setpagesize): Handle on Cygwin as on other win32. * os_dep.c (GC_get_main_stack_base): Don't declare on Cygwin, as other win32. * os_dep.c (GC_sysinfo): Declare on Cygwin, as other win32. * os_dep.c (GC_win32_get_mem): Declare on Cygwin, as on other Win32, but call GC_unix_get_mem instead of GlobalAlloc. * os_dep.c (GC_win32_free_heap): Declare on Cygwin (as empty). * ptr_chck.c (GC_is_visible): Register dynamic libraries on Cygwin as on other win32 platforms. * win32_threads.c (GC_get_next_stack): Define on Cygwin as well as for dynamic loading targets. * include/private/gc_priv.h (GC_INNER): Don't try to use visibility on Cygwin which does not support it. * include/private/gc_priv.h (struct roots): Don't declare r_next member on Cygwin as on other windows hosts. * include/private/gc_priv.h (LOG_RT_SIZE, RT_SIZE): Don't define likewise. * include/private/gc_priv.h (struct _GC_arrays): Do declare _heap_bases[] member and don't declare _root_index likewise. * include/private/gc_priv.h (GC_heap_bases): Do define likewise. * include/private/gc_priv.h (_SYSTEM_INFO): Do forward-declare likewise. * include/private/gc_priv.h (GC_sysinfo): Do declare extern likewise. * include/private/gcconfig.h (GC_win32_get_mem, GET_MEM): Do prototype on Cygwin as other win32 platforms. * os_dep.c (GC_get_main_stack_base): Use pthread_getattr_np() and pthread_attr_getstack() instead of GC_get_stack_base() (and check returned stackaddr for NULL); output a warning on failure. * alloc.c (GC_start_call_back): Replace the definition type to GC_start_callback_proc. * alloc.c (GC_set_start_callback, GC_get_start_callback): New setter/getter function. * alloc.c (GC_try_to_collect_inner): Call GC_notify_full_gc() unconditionally (because GC_try_to_collect_inner always does full GC). * include/gc_mark.h (GC_start_callback_proc): New type. * include/gc_mark.h (GC_set_start_callback, GC_get_start_callback): New API function declaration. * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Document. * os_dep.c (GC_get_main_stack_base): Recognize USE_GET_STACKBASE_FOR_MAIN (only if THREADS and LINUX_STACKBOTTOM) and use GC_get_stack_base() in this case. * os_dep.c (GC_get_stack_base): Add LOCK/UNLOCK() (since GC_find_limit_with_bound() should be called with the lock held). * backgraph.c (FOR_EACH_PRED): Fix a typo. * alloc.c (GC_set_stop_func, GC_get_stop_func): Add DCL_LOCK_STATE. * finalize.c (GC_notify_or_invoke_finalizers): Likewise. * gc_dlopen.c (disable_gc_for_dlopen): Likewise. * gcj_mlc.c (maybe_finalize, GC_debug_gcj_malloc): Likewise. * mark.c (GC_print_trace): Likewise. * misc.c (GC_set_warn_proc, GC_get_warn_proc, GC_enable, GC_disable, GC_new_free_list, GC_new_kind, GC_new_proc, GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier, GC_get_finalizer_notifier): Likewise. * os_dep.c (GC_get_stack_base, GC_print_callers): Likewise. * pthread_support.c (GC_is_thread_tsd_valid, GC_wait_for_gc_completion, GC_init_parallel, GC_do_blocking_inner, GC_call_with_gc_active, GC_unregister_my_thread, pthread_join, pthread_detach, GC_register_my_thread, GC_inner_start_routine, pthread_create): Likewise. * reclaim.c (GC_print_all_errors): Likewise. * win32_threads.c (GC_is_thread_tsd_valid, GC_register_my_thread, GC_unregister_my_thread, GC_do_blocking_inner, GC_call_with_gc_active, GC_lookup_pthread, GC_pthread_join, GC_pthread_start_inner, GC_thread_exit_proc, GC_pthread_detach, GC_init_parallel): Likewise. * doc/README.darwin: Update. * CMakeLists.txt: Adjust INCLUDE_DIRECTORIES and SRC (to make it usable on Mac OS X). * doc/README.cmake: Update. * CMakeLists.txt: New file (adding CMake support). * tests/CMakeLists.txt: Likewise. * doc/README.cmake: Likewise. * configure.ac (darwin): Don't define HAS_PPC_THREAD_STATE... macros. * include/private/gc_priv.h (THREAD_FLD): Recognize __DARWIN_UNIX03 instead of HAS_PPC_THREAD_STATE... macros. * pthread_support.c: Include and for OpenBSD. * pthread_support.c (get_ncpu): Define also for Darwin, NetBSD and OpenBSD. * pthread_support.c (GC_thr_init): Use get_ncpu() for Darwin, NetBSD and OpenBSD. * mallocx.c (GC_generic_malloc_many, GC_malloc_many): Define even if THREADS is undefined. * include/gc.h (GC_malloc_many): Update the comment. * include/gc_cpp.h (GC_PLACEMENT_DELETE): Define for Embarcadero (formerly known as Borland) C++ compiler v6.21+. * include/gc_cpp.h (GC_NO_OPERATOR_NEW_ARRAY): Define for ancient VC++ compilers. * win32_threads.c (GC_register_my_thread_inner, GC_pthread_start_inner): Undo the previous commit changes for the thread flags and DETACHED state (since the state is only tested in GC_thread_exit_proc). * include/gc.h (GC_unregister_my_thread): Fix a typo; update the comment. * pthread_support.c (GC_delete_thread): Allow to delete the main thread (don't call GC_INTERNAL_FREE for it); update the comment. * win32_threads.c (GC_delete_thread): Likewise. * pthread_support.c (GC_unregister_my_thread): Add an assertion for FINISHED flag is unset. * tests/test.c (check_heap_stats): Test the main thread unregistering (only if THREADS). * win32_threads.c (GC_register_my_thread_inner): Set flags to DETACHED (only if GC_PTHREADS). * win32_threads.c (GC_unregister_my_thread): Add FIXME (for GC_wait_for_gc_completion). * win32_threads.c (GC_pthread_start_inner): Clear flags detached state if needed; set pthread_id and flags while holding the lock. * include/private/gc_priv.h (SIG_SUSPEND): Don't define for OpenBSD and Darwin. * include/gc.h: Recognize _M_X64 (as an alias for _AMD64_). * test.c (main, WinMain): Consistently don't invoke GC_enable_incremental() if MAKE_BACKGRAPH is defined, but do invoke it even if parallel marking is enabled. * tests/test.c (reverse_test): Comment out a check for MSWIN32 (when determining BIG value) assuming outdated win32S. * tests/test.c (reverse_test): Rename to reverse_test_inner; change the declaration (to be of GC_fn_type); call itself thru GC_call_with_gc_active() if the argument is zero. * tests/test.c (reverse_test): New function added calling reverse_test_inner thru GC_do_blocking (to test GC_do_blocking and GC_call_with_gc_active). * doc/README.macros (IGNORE_DYNAMIC_LOADING, PLATFORM_ANDROID): Document. * dyn_load.c: Don't include if PLATFORM_ANDROID. * dyn_load.c: Include bionic (instead of ) if PLATFORM_ANDROID. * include/private/gcconfig.h (LINUX): Define also if PLATFORM_ANDROID (for the windows-based toolkit). * include/private/gcconfig.h (SEARCH_FOR_DATA_START): Explicitly define for Android/x86 platform. * include/private/gcconfig.h (IGNORE_DYNAMIC_LOADING): Recognize new macro (undefine DYNAMIC_LOADING in this case). * include/private/gcconfig.h (CANCEL_SAFE): Don't define if PLATFORM_ANDROID. * include/private/gcconfig.h (IF_CANCEL): Fix definition for the explicitly defined CANCEL_SAFE. * allchblk.c (GC_allochblk_nth): Don't call GC_remove_protection() if GC_DISABLE_INCREMENTAL. * reclaim.c (GC_reclaim_generic): Likewise. * checksums.c (GC_page_was_ever_dirty): Add prototype. * include/private/gc_locks.h (GC_mark_lock_holder): Don't declare unless PARALLEL_MARK. * include/private/gc_priv.h (GC_dirty_maintained, GC_page_was_dirty, GC_remove_protection, GC_dirty_init): Don't declare if GC_DISABLE_INCREMENTAL. * include/private/gc_priv.h (GC_print_finalization_stats): Don't declare if SMALL_CONFIG. * include/private/gcconfig.h (CHECKSUMS): Explicitly undefine if GC_DISABLE_INCREMENTAL (since nothing to check). * include/private/gcconfig.h (DEFAULT_VDB): Don't define if GC_DISABLE_INCREMENTAL. * os_dep.c (GC_dirty_maintained): Likewise. * mark.c (GC_initiate_gc): Don't call GC_read_dirty() if GC_DISABLE_INCREMENTAL. * os_dep.c (GC_gww_page_was_ever_dirty, GC_page_was_ever_dirty): Uncomment; define only if CHECKSUMS. * darwin_stop_world.c (GC_push_all_stacks): Fix a bug (call GC_push_all_stack() instead of GC_push_all_stack_frames()). * include/private/gc_priv.h (GC_push_all_stack_frames, GC_push_all_register_frames): Rename to GC_push_all_stack_sections and GC_push_all_register_sections, respectively. * mark_rts.c (GC_push_all_stack_frames, GC_push_all_register_frames, GC_push_all_stack_part_eager_frames, GC_push_current_stack): Likewise. * pthread_stop_world.c (GC_push_all_stacks): Likewise. * win32_threads.c (GC_push_stack_for): Likewise. * misc.c (GC_call_with_gc_active): Rename "frame" local variable to "stacksect". * pthread_support.c (GC_call_with_gc_active): Likewise. * win32_threads.c (GC_call_with_gc_active): Likewise. * pthread_support.c (GC_call_with_gc_active): Update FIXME for Darwin. * win32_threads.c (GC_Thread_Rep): Update the comment for traced_stack_sect. * darwin_stop_world.c (GC_push_all_stacks): Rename activation_frame to traced_stack_sect. * include/private/gc_priv.h (GC_push_all_stack_frames, GC_push_all_register_frames): Likewise. * include/private/pthread_support.h (GC_Thread_Rep): Likewise. * mark_rts.c (GC_push_all_register_frames, GC_push_all_stack_frames, GC_push_all_stack_part_eager_frames, GC_push_current_stack): Likewise. * pthread_stop_world.c (GC_push_all_stacks): Likewise. * pthread_support.c (GC_call_with_gc_active): Likewise. * win32_threads.c (GC_Thread_Rep, GC_call_with_gc_active, GC_push_stack_for): Likewise. * include/private/gc_priv.h (GC_activation_frame_s): Rename to GC_traced_stack_sect_s. * include/private/gc_priv.h (GC_activation_frame): Rename to GC_traced_stack_sect. * misc.c (GC_activation_frame, GC_call_with_gc_active): Likewise. * doc/README.macros (UNICODE): Document. * doc/README.macros (GC_READ_ENV_FILE): Document (new macro). * include/private/gc_priv.h (GETENV): Recognize GC_READ_ENV_FILE; declare and use GC_envfile_getenv(). * misc.c (GC_envfile_content, GC_envfile_length): New static variable (only if GC_READ_ENV_FILE). * misc.c (GC_ENVFILE_MAXLEN): New macro (used in GC_envfile_init). * misc.c (GC_envfile_init, GC_envfile_getenv): New function (only if GC_READ_ENV_FILE). * misc.c (GC_init): Call GC_envfile_init() (before using GETENV) if GC_READ_ENV_FILE. * misc.c (GC_init): Move GC_setpagesize() and GC_init_win32() calls to be just before GC_envfile_init() one (since the latter uses GET_MEM). * misc.c (GC_abort): use ExitProcess() (instead of DebugBreak) for WinCE if NO_DEBUGGING; add a comment for DebugBreak() (for WinCE). * mark_rts.c (GC_add_roots_inner): Remove redundant trailing '\n' from the ABORT message. * misc.c (GC_init): Likewise. * os_dep.c (GC_get_main_stack_base, GC_register_data_segments): Likewise. * pthread_stop_world.c (GC_push_all_stacks): Likewise. * pthread_support.c (GC_init_real_syms, start_mark_threads): Likewise. * win32_threads.c (GC_get_next_stack): Don't define for Cygwin (since unused for now). * dyn_load.c (HAVE_REGISTER_MAIN_STATIC_DATA): Don't define unless GC_register_main_static_data() is defined. * dyn_load.c (GC_register_dynamic_libraries): Define only if used (if DYNAMIC_LOADING or PCR or Win32/CE). * dyn_load.c (GC_register_main_static_data): Define the default one only if DYNAMIC_LOADING. * include/private/gc_priv.h (GC_register_dynamic_libraries): Declare only if used (to prevent compiler warning). * mark_rts.c (GC_approx_sp): Add a comment (for GCC). == [7.2alpha4] 2009-12-01 == * configure.ac (AC_CONFIG_COMMANDS): Quote srcdir value. * include/gc.h (GC_get_suspend_signal): New function declaration. * misc.c (GC_get_suspend_signal): New API function (only if THREADS). * alloc.c (min_bytes_allocd): Multiply GC_free_space_divisor by two if GC_incremental (instead of TRUE_INCREMENTAL). * sparc_mach_dep.S (GC_push_regs): Remove the reference. * os_dep.c (SIZE_T, PULONG_PTR): Remove. * os_dep.c (ULONG_PTR): Replace with GC_ULONG_PTR (defined as GC "word"); add the comment. * os_dep.c (GetWriteWatch_type, detect_GetWriteWatch, GC_gww_read_dirty): Prefix ULONG_PTR with "GC_". * win32_threads.c (THREAD_TABLE_SZ): Change back to a power-of-two const value (for speed). * win32_threads.c (THREAD_TABLE_INDEX): New macro. * win32_threads.c (GC_new_thread, GC_lookup_thread_inner, GC_delete_gc_thread, GC_delete_thread, GC_lookup_pthread): Use THREAD_TABLE_INDEX instead of THREAD_TABLE_SZ. * win32_threads.c (PTHREAD_MAP_HASH): Rename to PTHREAD_MAP_INDEX. * win32_threads.c (THREAD_TABLE_SZ): Make the const value prime. * backgraph.c: Remove apostrophe char from "#error". * doc/README.macros (GC_DISABLE_INCREMENTAL): Document. * include/private/gcconfig.h (GC_DISABLE_INCREMENTAL): Recognize new macro; implicitly define it if SMALL_CONFIG. * alloc.c (GC_incremental, GC_timeout_stop_func): Check for GC_DISABLE_INCREMENTAL instead of SMALL_CONFIG. * include/private/gc_priv.h (GC_incremental, TRUE_INCREMENTAL, GC_push_conditional): Likewise. * mark.c (GC_push_next_marked_dirty, GC_push_selected, GC_push_conditional, GC_block_was_dirty): Likewise. * misc.c (GC_enable_incremental): Likewise. * misc.c (GC_init): Likewise. * dyn_load.c (WIN32_LEAN_AND_MEAN): Guard with ifndef. * misc.c (WIN32_LEAN_AND_MEAN): Likewise. * os_dep.c (WIN32_LEAN_AND_MEAN): Likewise. * allchblk.c (GC_allochblk_nth): Fix a minor typo (don't/doesn't) in a comment. * backgraph.c: Likewise. * dyn_load.c (GC_register_dynamic_libraries): Likewise. * extra/threadlibs.c (main): Likewise. * pthread_support.c (pthread_join): Likewise. * tests/test.c (main): Likewise. * mach_dep.c (GC_push_regs): Remove STATIC (just to catch a duplicate symbol definition linker error). * misc.c (GC_clear_stack_inner): Likewise. * sparc_mach_dep.S (GC_push_regs): Comment out the reference. * include/private/gc_priv.h (GC_write_disabled): New variable declaration (only if GC_ASSERTIONS and Win32 threads). * misc.c (GC_write): Add assertion for GC_write_disabled value is not on (only if THREADS). * win32_threads.c (GC_write_disabled): New variable (only if GC_ASSERTIONS and not Cygwin). * win32_threads.c (GC_stop_world): Set and clear GC_write_disabled (while holding GC_write_cs). * win32_threads.c (GC_please_stop): If DllMain-based thread registration is not compiled in then define GC_please_stop as a non-volatile variable for assertion only. * win32_threads.c (GC_stop_world): Set and clear only if defined. * win32_threads.c (GC_stop_world): Add the comment for GC_printf() usage (while holding GC_write_cs). * win32_threads.c (GC_delete_gc_thread): Likewise. * os_dep.c (GC_remove_protection): Likewise. * pthread_support.c (GC_inner_start_routine): Join 3 sequential GC_printf() calls into a single one (for DEBUG_THREADS). * include/private/gc_priv.h (GC_total_stacksize): New variable declaration (only if THREADS). * alloc.c (GC_total_stacksize): New variable (only if THREADS). * alloc.c (min_bytes_allocd): Calculate stack_size using GC_stackbottom only in the single-threaded case; otherwise use GC_total_stacksize; print GC_total_stacksize value if DEBUG_THREADS. * darwin_stop_world.c (GC_push_all_stacks): Use "%p" printf type specifier for lo/hi values (instead of "%lx"). * darwin_stop_world.c (GC_push_all_stacks): Use GC_push_all_stack_frames() instead of GC_push_all_stack(). * darwin_stop_world.c (GC_push_all_stacks): Recalculate GC_total_stacksize value. * pthread_stop_world.c (GC_push_all_stacks): Likewise. * win32_threads.c (GC_push_all_stacks): Likewise. * win32_threads.c (GC_push_stack_for): Pass "me" argument; return stack size; don't check for non-zero value of thread->stack_base. * win32_threads.c (GC_push_all_stacks): Don't call GC_push_stack_for() and don't check for "t->id == me" if thread->stack_base is zero. * dyn_load.c (GC_dump_meminfo): Prefix "%lx" printf type specifier with "0x". * os_dep.c (PROTECT): Likewise. * win32_threads.c (GC_mark_thread_local_free_lists): Cast p->id to int (to match printf type specifier). * tests/test.c (check_heap_stats): Take into account the unmapped memory size when checking for "Unexpected heap growth"; remove FIXME. * alloc.c: Revert last change. * include/private/gcconfig.h (STACKBOTTOM): Add a presence check for eCos/NOSYS. * misc.c (GC_write): Comment out _Jv_diag_write() call (since no longer defined in GCJ). * os_dep.c (brk): Rename to ecos_gc_brk. * alloc.c (min_bytes_allocd): Use GC_stackbottom value to compute stack_size even if THREADS. * doc/README.macros (DEBUG_THREADS): Document. * pthread_support.c (DEBUG_THREADS): Remove the commented out definition. * win32_threads.c (DEBUG_WIN32_THREADS): Remove duplicate definition. * win32_threads.c: Include errno.h (except for WinCE). * win32_threads.c (GC_win32_start_inner): Copy "start" and "param" to local variables, and free "arg" parameter before "start" invocation. * win32_threads.c (GC_beginthreadex): Set errno to EAGAIN on error (instead of calling SetLastError(ERROR_NOT_ENOUGH_MEMORY)). * win32_threads.c (GC_beginthreadex): Return 0 on error (instead of -1). * darwin_stop_world.c (GC_darwin_register_mach_handler_thread): Use GC_INNER for the function definition. * include/private/darwin_stop_world.h (GC_darwin_register_mach_handler_thread): Remove the prototype. * os_dep.c (GC_darwin_register_mach_handler_thread): Use GC_INNER for the function prototype. * include/private/gc_priv.h (NDEBUG): Explicitly define if NO_DEBUGGING and not GC_ASSERTIONS (before the standard headers inclusion). * include/private/gcconfig.h: Move DebugBreak() workaround (for x86mingw32ce toolchain) to gc_priv.h (after windows.h inclusion). * allchblk.c (GC_unmap_old, GC_merge_unmapped, GC_allochblk, GC_freehblk): Use GC_INNER for the function definition. * alloc.c (GC_never_stop_func, GC_should_collect, GC_try_to_collect_inner, GC_collect_a_little_inner, GC_set_fl_marks, GC_add_to_our_memory, GC_add_to_heap, GC_expand_hp_inner, GC_collect_or_expand, GC_allocobj): Likewise. * backgraph.c (GC_build_back_graph, GC_traverse_back_graph): Likewise. * blacklst.c (GC_default_print_heap_obj_proc, GC_bl_init, GC_promote_black_lists, GC_unpromote_black_lists, GC_add_to_black_list_normal, GC_add_to_black_list_stack, GC_is_black_listed): Likewise. * darwin_stop_world.c (GC_push_all_stacks, GC_push_all_stacks, GC_stop_init, GC_stop_world, GC_start_world): Likewise. * dbg_mlc.c (GC_has_other_debug_info, GC_store_back_pointer, GC_marked_for_finalization, GC_generate_random_backtrace_no_gc, GC_store_debug_info, GC_start_debugging, GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page, GC_debug_malloc_uncollectable, GC_debug_free_inner): Likewise. * dyn_load.c (GC_register_dynamic_libraries, GC_register_main_static_data, GC_init_dyld): Likewise. * finalize.c (GC_push_finalizer_structures, GC_finalize, GC_notify_or_invoke_finalizers, GC_print_finalization_stats): Likewise. * gcj_mlc.c (GC_core_gcj_malloc): Likewise. * headers.c (GC_find_header, GC_header_cache_miss, GC_scratch_alloc, GC_init_headers, GC_install_header, GC_install_counts, GC_remove_header, GC_remove_counts, GC_next_used_block, GC_prev_block): Likewise. * mach_dep.c (GC_with_callee_saves_pushed): Likewise. * malloc.c (GC_collect_or_expand, GC_alloc_large, GC_generic_malloc_inner, GC_generic_malloc_inner_ignore_off_page, GC_core_malloc_atomic, GC_core_malloc, GC_free_inner): Likewise. * mallocx.c (GC_generic_malloc_ignore_off_page): Likewise. * mark.c (GC_collection_in_progress, GC_clear_hdr_marks, GC_set_hdr_marks, GC_set_mark_bit, GC_clear_mark_bit, GC_clear_marks, GC_initiate_gc, GC_mark_some, GC_mark_stack_empty, GC_invalidate_mark_state, GC_signal_mark_stack_overflow, GC_mark_from, GC_help_marker, GC_mark_init, GC_push_all, GC_push_conditional, GC_mark_and_push_stack, GC_push_all_eager, GC_push_all_stack): Likewise. * mark_rts.c (GC_is_static_root, GC_roots_present, GC_approx_sp, GC_exclude_static_roots_inner, GC_push_all_register_frames, GC_push_all_stack_frames, GC_cond_register_dynamic_libraries, GC_push_roots): Likewise. * misc.c (GC_extend_size_map, GC_clear_stack, GC_err_write): Likewise. * new_hblk.c (GC_build_fl, GC_new_hblk): Likewise. * obj_map.c (GC_register_displacement_inner, GC_add_map_entry, GC_initialize_offsets): Likewise. * os_dep.c (GC_get_maps, GC_parse_map_entry, GC_text_mapping, GC_init_linux_data_start, GC_init_netbsd_elf, GC_setpagesize, GC_set_and_save_fault_handler, GC_setup_temporary_fault_handler, GC_reset_fault_handler, GC_get_register_stack_base, GC_init_win32, GC_add_current_malloc_heap, GC_is_heap_base, GC_unmap, GC_remap, GC_unmap_gap, GC_push_all_stacks, GC_gww_dirty_init, GC_dirty_init, GC_read_dirty, GC_page_was_dirty, GC_page_was_ever_dirty, GC_remove_protection, GC_write_fault_handler, GC_mprotect_stop, GC_mprotect_resume, GC_save_callers, GC_print_callers): Likewise. * pthread_stop_world.c (GC_push_all_stacks, GC_stop_world, GC_start_world, GC_stop_init): Likewise. * pthread_support.c (GC_mark_thread_local_free_lists, GC_lookup_thread, GC_reset_finalizer_nested, GC_check_finalizer_nested, GC_segment_is_thread_stack, GC_greatest_stack_base_below, GC_thr_init, GC_init_parallel, GC_do_blocking_inner, GC_lock, GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_for_reclaim, GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker): Likewise. * reclaim.c (GC_print_all_errors, GC_block_empty, GC_reclaim_generic, GC_start_reclaim, GC_continue_reclaim, GC_reclaim_all): Likewise. * thread_local_alloc.c (GC_init_thread_local, GC_destroy_thread_local, GC_mark_thread_local_fls_for): Likewise. * win32_threads.c (GC_reset_finalizer_nested, GC_check_finalizer_nested, GC_do_blocking_inner, GC_stop_world, GC_start_world, GC_push_all_stacks, GC_get_next_stack, GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_for_reclaim, GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker, GC_thr_init, GC_init_parallel, GC_lock, GC_mark_thread_local_free_lists): Likewise. * alloc.c (GC_add_current_malloc_heap, GC_build_back_graph, GC_traverse_back_graph): Use GC_INNER for the function prototype. * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume): Likewise. * dbg_mlc.c (GC_default_print_heap_obj_proc): Likewise. * dyn_load.c (GC_parse_map_entry, GC_get_maps, GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base, GC_get_next_stack): Likewise. * finalize.c (GC_reset_finalizer_nested, GC_check_finalizer_nested): Likewise. * gcj_mlc.c (GC_start_debugging): Likewise. * include/private/dbg_mlc.h (GC_save_callers, GC_print_callers, GC_has_other_debug_info, GC_store_debug_info): Likewise. * include/private/gc_hdrs.h (GC_header_cache_miss): Likewise. * include/private/gc_locks.h (GC_lock): Likewise. * include/private/gc_pmark.h (GC_signal_mark_stack_overflow, GC_mark_from): Likewise. * include/private/pthread_support.h (GC_lookup_thread, GC_stop_init): Likewise. * include/private/thread_local_alloc.h (GC_init_thread_local, GC_destroy_thread_local, GC_mark_thread_local_fls_for): Likewise. * malloc.c (GC_extend_size_map, GC_text_mapping): Likewise. * mark.c (GC_page_was_ever_dirty): Likewise. * mark_rts.c (GC_mark_thread_local_free_lists): Likewise. * misc.c (GC_register_main_static_data, GC_init_win32, GC_setpagesize, GC_init_linux_data_start, GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf, GC_do_blocking_inner): Likewise. * os_dep.c (GC_greatest_stack_base_below): Likewise. * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init): Likewise. * include/private/gc_priv.h: Likewise. * include/private/gc_priv.h (GC_INNER): Update the comment. * doc/README.macros (GC_DLL): Update. * alloc.c (GC_collection_in_progress): Move the prototype to gc_priv.h. * gc_dlopen.c (GC_collection_in_progress): Likewise. * pthread_support.c (GC_collection_in_progress): Likewise. * misc.c (GC_init_parallel): Likewise. * pthread_support.c (GC_init_parallel): Likewise. * win32_threads.c (GC_init_parallel): Likewise. * darwin_stop_world.c (GC_thr_init): Likewise. * misc.c (GC_thr_init): Likewise. * pthread_stop_world.c (GC_thr_init): Likewise. * pthread_support.c (GC_thr_init): Likewise. * blacklst.c (GC_clear_bl, GC_copy_bl, GC_number_stack_black_listed): Make STATIC. * dbg_mlc.c (GC_print_obj, GC_make_closure, GC_debug_invoke_finalizer): Likewise. * malloc.c (GC_alloc_large_and_clear): Likewise. * mark.c (GC_push_selected, GC_push_marked1, GC_push_marked2, GC_push_marked4, GC_push_marked, GC_push_next_marked, GC_push_next_marked_dirty, GC_push_next_marked_uncollectable): Likewise. * misc.c (GC_clear_stack_inner): Likewise. * os_dep.c (GC_repeat_read, GC_default_push_other_roots): Likewise. * darwin_stop_world.c (FindTopOfStack): Make static; define only if not DARWIN_DONT_PARSE_STACK. * dbg_mlc.c (GC_debug_free_inner): Define only if DBG_HDRS_ALL. * dyn_load.c (GC_repeat_read): Remove unused prototype. * include/private/gc_pmark.h (GC_find_start): Likewise. * misc.c (GC_read, GC_register_finalizer_no_order): Likewise. * dyn_load.c (GC_segment_is_thread_stack): Add prototype (only if THREADS). * dyn_load.c (GC_register_main_static_data): Define only if DYNAMIC_LOADING. * finalize.c (GC_enqueue_all_finalizers): Remove unnecessary tail "return" statement. * gc_dlopen.c (GC_SOLARIS_THREADS): Don't recognize (since implies GC_PTHREADS). * include/gc.h: Fix a typo. * include/gc_inline.h (GC_ASSERT): Define (if not defined) since the header is public. * include/gc_inline.h (GC_generic_malloc_many): New public function declaration. * mallocx.c (GC_generic_malloc_many): Make public. * include/private/gc_priv.h (GC_INNER): Use visibility attribute (if available). * include/private/gc_priv.h (GC_EXTERN): Define using GC_INNER. * include/private/gc_priv.h: Include atomic_ops.h if THREADS and MPROTECT_VDB. * os_dep.c: Don't include atomic_ops.h * win32_threads.c: Likewise. * include/private/gc_priv.h (GC_push_selected, GC_push_regs, GC_push_marked, GC_number_stack_black_listed, GC_alloc_large_and_clear, GC_reclaim_or_delete_all, GC_generic_malloc_many, GC_make_closure, GC_debug_invoke_finalizer, GC_print_obj, GC_page_was_ever_dirty): Remove the prototype. * mark.c (GC_page_was_ever_dirty): Add prototype (only if PROC_VDB). * include/private/gc_priv.h (GC_push_next_marked_dirty, GC_push_next_marked, GC_push_next_marked_uncollectable): Move the prototype to mark.c. * include/private/gc_priv.h (GC_is_static_root): Declare only if not THREADS. * include/private/gc_priv.h (GC_free_inner): Declare only if THREADS. * include/private/gc_priv.h (GC_debug_free_inner): Declare only if THREADS and DBG_HDRS_ALL. * include/private/gc_priv.h (GC_markers): Declare GC_markers only if PARALLEL_MARK. * include/private/gc_priv.h (GC_register_main_static_data): Move the prototype to misc.c. * mach_dep.c (GC_push_regs): Make STATIC; define only along with HAVE_PUSH_REGS definition. * mach_dep.c (GC_clear_stack_inner): Replace K&R-style function definition with the ANSI C one. * mark.c (GC_started_thread_while_stopped): Declared only if not GNU C. * win32_threads.c (GC_started_thread_while_stopped): Don't define if GNU C. * mark.c (GC_mark_from): Avoid unbalanced brackets in #if-#else-#endif blocks. * mark_rts.c (GC_is_static_root): Define only if not THREADS. * os_dep.c (GC_get_stack_base): Make public (for OpenBSD). * os_dep.c (GC_page_was_ever_dirty): Comment out the function except for PROC_VDB. * tests/test.c (main): Don't reference GC_print_obj, GC_make_closure, GC_debug_invoke_finalizer, GC_page_was_ever_dirty, GC_is_fresh (in GC_noop). * thread_local_alloc.c: Don't include "gc_inline.h". * win32_threads.c (GC_write_fault_handler): Declare only if MPROTECT_VDB. * allchblk.c (DEBUG): Remove macro (since unused). * allchblk.c: Include private/gc_priv.h before other includes and definitions. * alloc.c: Likewise. * gc_dlopen.c: Likewise. * headers.c: Likewise. * mallocx.c: Likewise. * mark_rts.c: Likewise. * new_hblk.c: Likewise. * reclaim.c: Likewise. * mark.c: Include private/gc_pmark.h before other includes. * misc.c: Likewise. * dyn_load.c (_GNU_SOURCE): Move the definition to gc_priv.h. * pthread_support.c (_USING_POSIX4A_DRAFT10): Likewise. * pthread_support.c (_POSIX4A_DRAFT10_SOURCE): Remove (since already defined in gc_config_macros.h). * dyn_load.c (GC_init_dyld): Remove parameter cast for _dyld_register_func_for_add_image() and _dyld_register_func_for_remove_image(); add the comment about possible warnings; add FIXME for the deprecated _dyld_bind_fully_image_containing_address(). * include/private/gc_priv.h: Include gc.h before the standard headers inclusion. * tests/test.c: Likewise. * include/private/gcconfig.h (DebugBreak): Update the comment. * typd_mlc.c (ED_INITIAL_SIZE): Remove ';'. * configure.ac (openbsd): Define GC_OPENBSD_THREADS. * configure.ac: Add AM_CONDITIONAL(OPENBSD_THREADS). * configure.ac: Add sparc-openbsd case. * doc/README.macros (GC_NETBSD_THREADS, GC_OPENBSD_THREADS): Document. * tests/test.c (main): Handle OpenBSD case. * include/private/pthread_stop_world.h: Likewise. * extra/threadlibs.c (main): Replace K&R-style function definition with the ANSI C one. * extra/threadlibs.c (main): Handle GC_OPENBSD_THREADS case. * dyn_load.c (OPENBSD): Recognize (similar to NETBSD). * include/gc_config_macros.h (GC_SOLARIS_THREADS): Recognize; define it for OpenBSD. * include/gc_pthread_redirects.h (GC_pthread_sigmask, pthread_sigmask): Don't declare and redefine for OpenBSD. * include/private/gcconfig.h: Handle OpenBSD (on arm, sh, i386, amd64, powerpc). * mach_dep.c (NO_GETCONTEXT): Likewise. * include/private/pthread_stop_world.h (thread_stop_info): Don't define last_stop_count field if OpenBSD. * misc.c (GC_init_dyld): Add declaration (if NetBSD). * misc.c (GC_init): Don't call GC_init_netbsd_elf() for OpenBSD. * os_dep.c (GC_init_netbsd_elf): Don't define for OpenBSD. * os_dep.c (old_segv_act, GC_jmp_buf_openbsd): New static variable (only if OpenBSD). * os_dep.c (GC_fault_handler_openbsd, GC_find_limit_openbsd, GC_skip_hole_openbsd): New static function (only if OpenBSD). * os_dep.c (GC_get_stack_base, GC_get_main_stack_base, GC_register_data_segments): Define specially for OpenBSD case. * os_dep.c (GC_fault_handler_lock): Initialize to AO_TS_INITIALIZER (instead of 0). * pthread_support.c (GC_allocate_lock): Likewise. * pthread_stop_world.c (NSIG, GC_print_sig_mask, GC_remove_allowed_signals, suspend_handler_mask, GC_stop_count, GC_world_is_stopped, GC_retry_signals, SIG_THR_RESTART, GC_suspend_ack_sem, GC_suspend_handler_inner, GC_suspend_handler, GC_restart_handler): Don't define and use if OpenBSD. * pthread_stop_world.c (GC_suspend_all, GC_stop_world, GC_start_world): Handle OpenBSD case. * pthread_stop_world.c (GC_stop_init): Define as empty if OpenBSD. * pthread_support.c (pthread_sigmask): Don't undefine the macro and don't define the wrapper function if OpenBSD. * pthread_support.c (GC_thr_init): Handle OpenBSD case. * dyn_load.c: Move the inclusion of private/gc_priv.h below definition of a feature macro (_GNU_SOURCE). * include/gc.h (REVEAL_POINTER): Remove redundant parentheses. * include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): New macros (only if GC_I_HIDE_POINTERS). * backgraph.c (GET_OH_BG_PTR): Prefix REVEAL_POINTER() with "GC_". * dbg_mlc.c (GC_get_back_ptr_info): Likewise. * finalize.c (GC_grow_table, GC_dump_finalization, GC_finalize, GC_enqueue_all_finalizers): Likewise. * backgraph.c (SET_OH_BG_PTR): Prefix HIDE_POINTER() with "GC_". * finalize.c (GC_general_register_disappearing_link, GC_unregister_disappearing_link, GC_register_finalizer_inner, GC_finalize): Likewise. * include/private/dbg_mlc.h (HIDE_BACK_PTR): Likewise. * include/private/dbg_mlc.h (GC_I_HIDE_POINTERS): Define instead of I_HIDE_POINTERS. * include/private/gc_priv.h (GC_I_HIDE_POINTERS): Likewise. * include/gc.h (_GC_H): Strip leading underscore. * include/gc_backptr.h (_GC_H): Likewise. * include/gc_gcj.h (_GC_H): Likewise. * include/gc_mark.h (_GC_H): Likewise. * include/gc_typed.h (_GC_TYPED_H, _GC_H): Likewise. * include/javaxfc.h (_GC_H): Likewise. * include/new_gc_alloc.h (__GC_SPECIALIZE): Likewise. * include/private/dbg_mlc.h (_GC_H): Likewise. * include/private/gc_priv.h (_GC_H): Likewise. * gc_cpp.cc: Include "gc_cpp.h" instead of . * include/private/gc_priv.h (GC_INNER): New macro (for GC-scope variable definitions). * include/private/gc_priv.h (GC_EXTERN): Update the comment. * allchblk.c (GC_unmap_threshold): Define as GC_INNER. * alloc.c (GC_incremental, GC_world_stopped, GC_n_heap_sects, GC_n_memory, GC_fail_count): Likewise. * blacklst.c (GC_black_list_spacing, GC_print_heap_obj): Likewise. * gcj_mlc.c (GC_gcj_malloc_initialized, GC_gcjobjfreelist): Likewise. * mach_dep.c (GC_save_regs_ret_val): Likewise. * mark.c (GC_n_mark_procs, GC_obj_kinds, GC_n_kinds, GC_mark_stack, GC_mark_stack_limit, GC_mark_stack_size, GC_mark_stack_top, GC_mark_state, GC_mark_stack_too_small, GC_mark_no, GC_markers): Likewise. * mark_rts.c (GC_root_size, GC_push_typed_structures): Likewise. * misc.c (GC_allocate_ml, GC_debugging_started, GC_check_heap, GC_print_all_smashed, GC_print_back_height, GC_dump_regularly, GC_backtraces, GC_force_unmap_on_gcollect, GC_large_alloc_warn_interval, GC_is_initialized, GC_write_cs, GC_current_warn_proc, GC_blocked_sp, GC_activation_frame): Likewise. * os_dep.c (GC_page_size, GC_dont_query_stack_min, GC_no_win32_dlls, GC_wnt, GC_sysinfo, GC_push_other_roots, GC_dirty_maintained, GC_fault_handler_lock): Likewise. * pthread_support.c (GC_allocate_ml, GC_lock_holder, GC_need_to_lock, GC_thr_initialized, GC_threads, GC_in_thread_creation, GC_collecting, GC_allocate_lock, GC_mark_lock_holder): Likewise. * reclaim.c (GC_bytes_found, GC_fl_builder_count, GC_have_errors): Likewise. * win32_threads.c (GC_allocate_ml, GC_lock_holder, GC_need_to_lock, GC_mark_lock_holder, GC_collecting): Likewise. * extra/gc.c (GC_INNER, GC_EXTERN): Define as STATIC. * mach_dep.c (GC_with_callee_saves_pushed): Remove redundant {}. * include/private/gc_priv.h (GC_bytes_allocd, GC_objfreelist, GC_aobjfreelist): Replace GC_EXTERN to extern for SEPARATE_GLOBALS case (since they are not defined inside GC at present). * include/private/gc_priv.h (GC_objects_are_marked): Remove the declaration (since made static). * mark.c (GC_objects_are_marked): Define as STATIC. * win32_threads.c (GC_thr_initialized, GC_in_thread_creation): Likewise. * mark.c (GC_N_KINDS_INITIAL_VALUE): New macro (defined and used to initialize GC_n_kinds). * win32_threads.c (start_mark_threads): Adjust the comment. * alloc.c (GC_notify_full_gc): Use GC_INLINE for a tiny static function. * backgraph.c (pop_in_progress, GC_apply_to_each_object): Likewise. * mark_rts.c (add_roots_to_index): Likewise. * extra/gc.c: New file. * Makefile.am (EXTRA_DIST): Add "extra/gc.c". * misc.c (GC_log): Remove the declaration; move the definition (to the place where it is used); make STATIC. * misc.c (GC_init): Use GC_err_printf() instead of GC_log_printf() to print open log failure. * misc.c (GC_write): Don't abort on open log failure if the GC is compiled with GC_PRINT_VERBOSE_STATS (useful for WinCE). * include/private/gcconfig.h (USE_MMAP): Guard with ifndef. * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Move the variable declaration to gc_priv.h. * alloc.c (GC_bytes_found, GC_unmap_threshold, GC_force_unmap_on_gcollect): Likewise. * dyn_load.c (GC_no_win32_dlls, GC_wnt): Likewise. * finalize.c (GC_fail_count): Likewise. * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder, GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Likewise. * include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size, GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack, GC_mark_stack_too_small, GC_mark_state): Likewise. * include/private/pthread_support.h (GC_threads, GC_thr_initialized, GC_in_thread_creation): Likewise. * mallocx.c (GC_bytes_found): Likewise. * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Likewise. * misc.c (GC_unmap_threshold): Likewise. * os_dep.c (GC_unmap_threshold): Likewise. * pthread_support.c (GC_markers): Likewise. * thread_local_alloc.c (GC_gcjobjfreelist, GC_gcj_malloc_initialized, GC_gcj_kind): Likewise. * win32_threads.c (GC_fault_handler_lock, GC_write_cs, GC_dont_query_stack_min, GC_markers, GC_wnt): Likewise. * include/private/gc_priv.h (GC_EXTERN): New macro (used mostly as a tag for now); defined after "gcconfig.h" inclusion. * include/private/gc_priv.h: Use GC_EXTERN instead of "extern" keyword for most global variables. * alloc.c (GC_copyright): Add the comment about the symbol visibility. * finalize.c (GC_fo_entries): Likewise. * include/private/gc_priv.h (GC_print_stats): Likewise. * misc.c (GC_quiet): Likewise. * mallocx.c (GC_bytes_allocd_tmp): Make the volatile variable STATIC. * pthread_support.c (GC_threads): Add explicit zero initializer (to make the variable definition differ from the declaration). * backgraph.c (GC_quiet): Remove the declaration (not needed anymore since gc_priv.h is always included). * checksums.c (GC_quiet): Likewise. * gcj_mlc.c (GC_quiet): Likewise. * headers.c (GC_hdr_cache_hits, GC_hdr_cache_misses): Add the comment. * include/private/gc_hdrs.h (GC_hdr_cache_hits, GC_hdr_cache_misses): Likewise. * mark.c (GC_first_nonempty): Make the volatile variable STATIC. * pthread_stop_world.c (GC_stop_count, GC_world_is_stopped): Likewise. * win32_threads.c (GC_please_stop, GC_max_thread_index, GC_mark_mutex_waitcnt): Likewise. * pthread_support.c (GC_USE_LD_WRAP): Fix a typo (swapped 'L' and 'D') in the name. * gc_dlopen.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Define if dlopen redirection is turned off; turn it on later when dlopen real symbol is no longer needed (according to the comment and the same as in dyn_load.c). * gc_dlopen.c (WRAP_FUNC, REAL_FUNC): Rename to WRAP_DLFUNC and REAL_DLFUNC, respectively (to have unique names since the definitions may differ from that of the similar ones in pthread_support.c). * mark.c (source): Undefine the macro when no longer needed. * os_dep.c (handler): Rename the type to GC_fault_handler_t (to have the unique name across the project). * os_dep.c (STAT_BUF_SIZE, STAT_READ); Guard with ifndef; add the comment. * pthread_support.c (STAT_BUF_SIZE, STAT_READ): Likewise. * os_dep.c (sbrk): Undo sbrk() redirection (for ECOS) when no longer needed. * pthread_stop_world.c (pthread_sigmask): Undefine before using in GC_print_sig_mask() (only if DEBUG_THREADS); add the comment. * win32_threads.c (dlopen, _beginthread): Don't undefine (since neither redirected nor used here). * win32_threads.c (GC_Thread_Rep): Rename "table_management" to "tm" for short; remove "tm_" prefix. * win32_threads.c (in_use, next): Don't define the macros; use tm.in_use and tm.next fields, respectively (to ease debugging). * win32_threads.c (HASH): Rename to PTHREAD_MAP_HASH (to have unique name across the project). * include/private/gc_priv.h (I_HIDE_POINTERS): Define before gc.h inclusion. * include/private/gc_pmark.h (I_HIDE_POINTERS): Define if gc.h is not included yet. * finalize.c (I_HIDE_POINTERS): Don't define. * include/private/dbg_mlc.h (I_HIDE_POINTERS): Likewise. * misc.c (I_HIDE_POINTERS): Likewise. * include/private/dbg_mlc.h (HIDE_POINTER, REVEAL_POINTER, GC_hidden_pointer): Don't define if HIDE_POINTER is undefined. * include/private/gc_pmark.h: Remove the comment about gc_priv.h inclusion order. * dyn_load.c: Include gc_priv.h before using configuration information (MACOS). * dyn_load.c (GC_must_restore_redefined_dlopen): Rename to GC_MUST_RESTORE_REDEFINED_DLOPEN. * backgraph.c (SET_OH_BG_PTR): Place outermost parenthesis properly. * darwin_stop_world.c: Replace "if DEBUG_THREADS" with "ifdef DEBUG_THREADS". * pthread_stop_world.c: Likewise. * pthread_support.c: Likewise. * include/gc_inline.h: Guard with GC_INLINE_H. * alloc.c (GC_copyright): Define as const. * alloc.c (GC_collect_at_heapsize): Replace "static" with "STATIC" (since the name starts with "GC_" prefix). * dbg_mlc.c (GC_describe_type_fns): Likewise. * dyn_load.c (GC_FirstDLOpenedLinkMap, GC_register_dynlib_callback, GC_dyld_sections, GC_dyld_name_for_hdr, GC_dyld_image_add, GC_dyld_image_remove): Likewise. * malloc.c (GC_libpthread_start, GC_libpthread_end, GC_libld_start, GC_libld_end): Likewise. * mark_rts.c (GC_remove_root_at_pos, GC_rebuild_root_index): Likewise. * os_dep.c (GC_gww_read_dirty, GC_gww_page_was_dirty, GC_gww_page_was_ever_dirty, GC_mprotect_thread_notify, GC_mprotect_thread_reply, GC_mprotect_thread, GC_darwin_sigbus, GC_forward_exception): Likewise. * pthread_support.c (GC_syms_initialized): Likewise. * typd_mlc.c (GC_push_typed_structures_proc): Likewise. * win32_threads.c (GC_win32_dll_threads, GC_register_my_thread_inner, GC_lookup_pthread, GC_get_stack_min, GC_waitForSingleObjectInfinite): Likewise. * darwin_stop_world.c (GC_use_mach_handler_thread, GC_use_mach_handler_thread, GC_mach_threads_count): Replace "static" with "STATIC" and add zero initializer. * os_dep.c (GC_task_self, GC_ports, GC_mprotect_state, GC_sigbus_count): Likewise. * headers.c (free_hdr): Replace "static" with GC_INLINE. * misc.c (GC_tmp): Rename static variable to fwrite_gc_res. * os_dep.c (memory): Rename static variable to ecos_gc_memory. * os_dep.c (async_set_pht_entry_from_index): Make static (for MPROTECT_VDB case). * pthread_support.c (GC_real_pthread_create, GC_real_pthread_sigmask, GC_real_pthread_join, GC_real_pthread_detach, GC_init_real_syms): Use REAL_FUNC() macro for static GC_real_XXX symbols. * win32_threads.c (GC_may_be_in_stack): Remove "GC_" prefix. * alloc.c (GC_finish_collection): Replace getenv() with GETENV(). * dyn_load.c (GC_init_dyld): Likewise. * os_dep.c (GC_print_callers): Likewise. * dyn_load.c (GC_dyld_name_for_hdr): Cast _dyld_get_image_name() result (since it's always of "struct mach_header" type). * dyn_load.c (GC_init_dyld): Cast GC_dyld_image_add and GC_dyld_image_remove (to always have the first argument of "struct mach_header" pointer type). * configure.ac: Add threads support for OpenBSD case (threads may not work correctly for it). * acinclude.m4: Rename to m4/gc_set_version.m4. * m4/libtool.m4: Delete the file. * m4/lt~obsolete.m4: Likewise. * m4/ltoptions.m4: Likewise. * m4/ltsugar.m4: Likewise. * m4/ltversion.m4: Likewise. * include/private/gcconfig.h: Define DebugBreak() as _exit(-1) for x86mingw32ce toolchain to workaround the incorrect DebugBreak() declaration in winbase.h (the workaround would turn into a no-op when DebugBreak() will be defined as a macro in the toolchain). * include/private/gcconfig.h: Recognize __i386__ if WinCE (for x86mingw32ce toolchain). * include/private/gcconfig.h (NO_GETENV): Don't define for CeGCC toolchain (or if already defined). * include/private/gcconfig.h (NO_GETENV_WIN32): New macro (always defined for WinCE or if NO_GETENV is defined). * misc.c (GC_CreateLogFile): Use NO_GETENV_WIN32 macro instead of NO_GETENV one. * configure.ac: Add AC_CONFIG_MACRO_DIR([m4]). * Makefile.am: Add "ACLOCAL_AMFLAGS = -I m4". * libtool.m4: Remove. * m4/libtool.m4: New file (generated). * m4/lt~obsolete.m4: Likewise. * m4/ltoptions.m4: Likewise. * m4/ltsugar.m4: Likewise. * m4/ltversion.m4: Likewise. * include/gc.h (GC_UNDERSCORE_STDCALL): Recognize new macro; prefix GC_CreateThread and GC_ExitThread with '_' if defined. * doc/README.macros (GC_UNDERSCORE_STDCALL): Document. * alloc.c (GC_collect_or_expand): Add "retry" argument; add the comments; don't use "default" stop_func on a retry if GC_dont_expand. * alloc.c (GC_allocobj): Pass "retry" argument to GC_collect_or_expand(). * malloc.c (GC_alloc_large): Likewise. * include/private/gc_priv.h (GC_collect_or_expand): Move the declaration to malloc.c; add "retry" argument. * alloc.c (GC_start_call_back): Move the variable definition from misc.c. * include/private/gc_priv.h (GC_start_call_back): Remove the declaration. * alloc.c (GC_notify_full_gc): Remove unnecessary cast of 0. * alloc.c (GC_try_to_collect_inner): Also call stop_func at the beginning of the function. * include/gc.h (GC_try_to_collect): Refine the comment about stop_func. * alloc.c (GC_default_stop_func, GC_try_to_collect_general, GC_gcollect): Add the comment. * alloc.c (GC_try_to_collect_general): Move the assertion on stop_func != 0 to GC_try_to_collect(). * alloc.c (GC_try_to_collect_general): If stop_func == 0 then use GC_default_stop_func instead (holding the lock). * alloc.c (GC_gcollect): Pass 0 as stop_func instead of GC_default_stop_func (to prevent data races). * Makefile.direct: Move "define arguments" documentation to doc/README.macros; add reference to doc/README.macros. * Makefile.dj: Change the documentation reference to doc/README.macros. * README.QUICK: Likewise. * configure.ac: Likewise. * allchblk.c: Remove unnecessary "-D" from the comment. * doc/README.macros: Likewise. * README.environment: Likewise. * include/gc.h: Likewise. * include/gc_inline.h: Likewise. * include/private/gcconfig.h: Likewise. * README.QUICK: Fix a typo. * misc.c (GC_CreateLogFile): Use FILE_ATTRIBUTE_NORMAL for CreateFile(); don't immediately flush every write if very verbose. * doc/README.win32: Replace ".exe.log" to ".gc.log". * doc/README.win64: Likewise. * doc/README.win64: Fix a typo. * misc.c (GC_CreateLogFile): Strip executable file extension for the log file; use ".gc.log" extension (instead of ".log"). * include/gc_config_macros.h: Avoid the redefinition of GC_xxx_THREADS macros. * alloc.c (GC_try_to_collect_general): Change the type of "result" local variable to GC_bool. * include/gc_config_macros.h: Use old behavior for FreeBSD and NetBSD platform detection code (check that other GC_xxx_THREADS are undefined); add FIXME. * include/gc_config_macros.h: Rearrange the platform detection code (GC_WIN32_PTHREADS implies GC_WIN32_THREADS; define GC_THREADS first if GC_XXX_THREADS already set; define proper GC_XXX_THREADS if GC_THREADS; define GC_PTHREADS in a single place; define _REENTRANT if posix threads except for Win32). * alloc.c (GC_try_to_collect_general): New function (move the code from GC_try_to_collect, pass force_unmap argument). * alloc.c (GC_try_to_collect, GC_gcollect): Call GC_try_to_collect_general(). * alloc.c (GC_gcollect_and_unmap): New public function. * include/gc.h (GC_gcollect_and_unmap): New function declaration. * tests/test.c (window_proc): Call GC_gcollect_and_unmap() on WM_HIBERNATE event (instead of GC_set_force_unmap_on_gcollect() and GC_gcollect()). * include/gc.h (GC_allow_register_threads, GC_register_my_thread, GC_unregister_my_thread, GC_malloc_many): Refine the comment. * include/gc.h (GC_malloc_many, GC_NEXT): Declare unconditionally (that is, don't depend on GC_THREADS macro). * include/gc.h: Don't check for __CYGWIN32__ and __CYGWIN__ along with a check for GC_PTHREADS (since the former implies the latter). * include/gc.h (GC_SOLARIS_THREADS): Don't check for. * include/gc.h (GC_MIN, GC_MAX): Don't define. * mallocx.c (GC_malloc_many): Add comment to #endif. * configure.ac: Drop the subdir-objects Automake option, since it's incompatible with picking source files from libatomic_ops. * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Add "extern" keyword to a global variable declaration (some compilers require it). * alloc.c (GC_bytes_found, GC_unmap_threshold, GC_force_unmap_on_gcollect): Likewise. * dyn_load.c (GC_no_win32_dlls, GC_wnt): Likewise. * finalize.c (GC_fail_count): Likewise. * include/private/gc_hdrs.h (GC_hdr_cache_hits, GC_hdr_cache_misses): Likewise. * mallocx.c (GC_bytes_found): Likewise. * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Likewise. * misc.c (GC_unmap_threshold): Likewise. * os_dep.c (GC_unmap_threshold, GC_old_allocator): Likewise. * pthread_support.c (GC_markers): Likewise. * thread_local_alloc.c (GC_gcjobjfreelist, GC_gcj_malloc_initialized, GC_gcj_kind): Likewise. * win32_threads.c (GC_fault_handler_lock, GC_write_cs, GC_dont_query_stack_min, GC_markers, GC_wnt): Likewise. * tests/huge_test.c: Define GC_IGNORE_WARN (if not defined) to suppress misleading GC "Out of Memory!" warning printed on every GC_MALLOC(LONG_MAX) call. * tests/huge_test.c: Include "gc.h" instead of . * tests/huge_test.c (main): Replace K&R-style function definition with the ANSI C one. * dyn_load.c (GC_register_dynamic_libraries): Always use lpMaximumApplicationAddress value for WinCE (even for old versions). * os_dep.c (VER_PLATFORM_WIN32_CE): Define if not in winbase.h. * os_dep.c (GC_dont_query_stack_min): New global variable (only if WinCE and THREADS). * os_dep.c (GC_setpagesize): Adjust lpMaximumApplicationAddress for WinCE (prior to version 6) if not _WIN32_WCE_EMULATION; set GC_dont_query_stack_min for older WinCE (prior to version 5). * win32_threads.c (GC_dont_query_stack_min): Declare. * win32_threads.c (GC_get_stack_min): Rename the macro to GC_wince_evaluate_stack_min for WinCE; update the comment. * win32_threads.c (GC_push_stack_for, GC_get_next_stack): Use GC_wince_evaluate_stack_min() instead of GC_get_stack_min() for WinCE and don't update thread's last_stack_min value (only if GC_dont_query_stack_min). * win32_threads.c (GC_push_stack_for): Skip assertion for WinCE if GC_dont_query_stack_min (since the evaluated stack_min value may be incorrect if the stack is bigger than 64 KiB). * gc_dlopen.c (GC_dlopen): Add function redirector (only if GC_USE_LD_WRAP). * include/gc.h: Include "gc_pthread_redirects.h" even if GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS. * include/gc_pthread_redirects.h (GC_PTHREAD_REDIRECTS_H): Don't define and check for (since included only from gc.h). * include/gc_pthread_redirects.h: Declare "GC_" symbols even if GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS. * include/gc_pthread_redirects.h: Include signal.h only to get sigset_t definition. * Makefile.direct: Document GC_REGISTER_MEM_PRIVATE. * mark_rts.c (GC_is_tmp_root): Define also for WinCE unless NO_DEBUGGING (that is, replace _WIN32_WCE_EMULATION with MSWINCE). * os_dep.c (GC_sysinfo): Remove explicit global variable initialization to "{0}" (revert back the previous change) since it might produce a warning. * allchblk.c (GC_large_alloc_warn_interval): Move declaration from gc_priv.h. * allchblk.c (GC_large_alloc_warn_suppressed): Move definition from misc.c; define as STATIC. * include/private/gc_priv.h (GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed): Remove declaration. * alloc.c (GC_bytes_found): Add "defined in" comment. * mallocx.c (GC_bytes_found): Likewise. * misc.c (GC_unmap_threshold): Likewise. * os_dep.c (GC_old_allocator): Likewise. * pthread_support.c (GC_markers): Likewise. * thread_local_alloc.c (GC_gcjobjfreelist, GC_gcj_malloc_initialized, GC_gcj_kind): Likewise. * win32_threads.c (GC_markers): Likewise. * alloc.c (GC_start_time): Explicitly initialize to 0 or NULL (to be distinctive from a variable declaration). * backgraph.c (GC_max_height, GC_deepest_obj): Likewise. * blacklst.c (GC_old_normal_bl, GC_incomplete_normal_bl, GC_old_stack_bl, GC_incomplete_stack_bl): Likewise. * checksums.c (GC_faulted, GC_n_dirty_errors, GC_n_faulted_dirty_errors, GC_n_changed_errors, GC_n_clean, GC_n_dirty, GC_bytes_in_used_blocks): Likewise. * dbg_mlc.c (GC_smashed): Likewise. * finalize.c (GC_old_dl_entries): Likewise. * gcj_mlc.c (GC_gcj_kind, GC_gcj_debug_kind, GC_gcjobjfreelist, GC_gcjdebugobjfreelist): Likewise. * mach_dep.c (GC_save_regs_ret_val): Likewise. * mark.c (GC_n_rescuing_pages, GC_mark_stack, GC_mark_stack_limit, GC_mark_stack_top): Likewise. * misc.c (GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset): Likewise. * os_dep.c (GC_data_start, GC_page_size, GC_sysinfo, GC_old_segv_handler, GC_old_bus_handler, GC_old_bus_handler_used_si, GC_old_segv_handler_used_si, GC_proc_buf, GC_proc_fd, GC_vd_base): Likewise. * pthread_stop_world.c (GC_stop_count, GC_stopping_pid): Likewise. * reclaim.c (GC_leaked): Likewise. * typd_mlc.c (GC_explicit_kind, GC_array_kind, GC_ext_descriptors, GC_typed_mark_proc_index, GC_array_mark_proc_index, GC_eobjfreelist, GC_arobjfreelist): Likewise. * win32_threads.c (GC_pthread_map_cache, GC_marker_cv, GC_marker_Id): Likewise. * dbg_mlc.c (GC_smashed, GC_n_smashed): Define as STATIC. * gcj_mlc.c (GC_gcjdebugobjfreelist): Likewise. * os_dep.c (GC_vd_base): Likewise. * pthread_support.c (GC_mark_threads): Likewise. * reclaim.c (GC_leaked): Likewise. * typd_mlc.c (GC_bm_table): Likewise. * mark_rts.c (GC_save_regs_ret_val): Change declaration type to that of definition; add "defined in" comment. * mark_rts.c (GC_push_current_stack): Remove unnecessary cast for GC_save_regs_ret_val. * misc.c (GC_check_heap, GC_print_all_smashed, GC_start_call_back): Remove unnecessary cast (of 0). * misc.c (GC_LARGE_ALLOC_WARN_INTERVAL): New tuning macro. * misc.c (GC_large_alloc_warn_interval): Initialize to GC_LARGE_ALLOC_WARN_INTERVAL value. * misc.c (GC_tmp): Change to "static". * os_dep.c (GC_mprotect_state): Define as static. * pthread_support.c (dummy_thread_local): Prefix with "GC_". * win32_threads.c (WinMain): Remove FIXME for WinCE. * os_dep.c (PROTECT, UNPROTECT): Use distinct ABORT messages. * configure.ac: Rewrite the tests for external or internal libatomic_ops. * configure.ac: In particular, drop the symbolic links. Add option --with-libatomic-ops for forced selection. * Makefile.am: Adjust the path of source files from libatomic_ops to not use the links. * Makefile.am (libgc_la_LIBADD): Add $(ATOMIC_OPS_LIBS). This will be empty if we use the bundled AO sources. * Makefile.am: Strip version suffix for libatomic_ops directory. * build_atomic_ops.sh: Likewise. * build_atomic_ops.sh.cygwin: Likewise. * configure_atomic_ops.sh: Likewise. * Makefile.direct: Remove AO_VERSION definition; strip version suffix for libatomic_ops directory. * NT_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_THREADS_MAKEFILE: Likewise. * gc.mak: Likewise. * libatomic_ops: Rename from "libatomic_ops-1.2". * alloc.c (GC_version): Add "const" keyword. * alloc.c (GC_get_version): New public function. * include/gc.h (GC_get_version): New function declaration; update the comment for the GC version. * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder, GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Use "extern" (for the global variable declaration) again. * include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size, GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack, GC_mark_stack_too_small, GC_mark_state): Likewise. * include/private/gcconfig.h (GC_register_stackbottom): Likewise. * include/private/pthread_support.h (GC_threads, GC_thr_initialized, GC_in_thread_creation): Likewise. * include/private/gc_priv.h: Likewise. * real_malloc.c: Include private/config.h if HAVE_CONFIG_H. * allchblk.c (GC_hblkfreelist): Define as STATIC. * blacklst.c (GC_total_stack_black_listed): Likewise. * include/private/gc_priv.h (GC_hblkfreelist, GC_stopped_mark, GC_total_stack_black_listed, GC_push_stubborn_structures): Remove declaration. * mark_rts.c (GC_stopped_mark): Add declaration (only if THREAD_LOCAL_ALLOC). * allchblk.c (GC_fail_count): Move the declaration out of GC_allochblk_nth(); remove "extern". * alloc.c (IF_THREADS): Remove unused macro. * alloc.c (GC_world_stopped): Define only if THREAD_LOCAL_ALLOC. * alloc.c (GC_stopped_mark): Set GC_world_stopped value only if THREAD_LOCAL_ALLOC. * alloc.c (GC_bytes_found, GC_collection_in_progress, GC_check_tls, GC_unmap_threshold, GC_force_unmap_on_gcollect): Remove K&R-style "extern" for the declaration. * dbg_mlc.c (GC_free_inner): Likewise. * dyn_load.c (GC_repeat_read, GC_roots_present, GC_is_heap_base, GC_get_next_stack, GC_no_win32_dlls, GC_wnt): Likewise. * finalize.c (GC_fail_count): Likewise. * include/private/gc_hdrs.h (GC_hdr_cache_hits, GC_hdr_cache_misses): Likewise. * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder, GC_lock, GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Likewise. * include/private/gc_pmark.h (GC_mark_procs, GC_n_mark_procs, GC_mark_stack_size, GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack, GC_mark_stack_too_small, GC_mark_state): Likewise. * include/private/gc_priv.h (GC_current_warn_proc, GC_obj_kinds, GC_n_kinds, GC_fo_entries, GC_n_heap_sects, GC_n_memory, GC_page_size, GC_sysinfo, GC_black_list_spacing, GC_objects_are_marked, GC_incremental, GC_dirty_maintained, GC_root_size, GC_debugging_started, GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed, GC_blocked_sp, GC_activation_frame, GC_push_other_roots, GC_push_finalizer_structures, GC_push_thread_structures, GC_push_typed_structures, GC_start_call_back, GC_is_initialized, GC_check_heap, GC_print_all_smashed, GC_print_all_errors, GC_print_heap_obj, GC_have_errors, GC_print_stats, GC_dump_regularly, GC_backtraces, GC_print_back_height, GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page, GC_fl_builder_count, GC_mark_no, GC_help_marker, GC_setup_temporary_fault_handler, GC_reset_fault_handler): Likewise. * include/private/gcconfig.h (GC_SysVGetDataStart, GC_FreeBSDGetDataStart, GC_register_stackbottom, GC_MacTemporaryNewPtr, GC_amiga_get_mem): Likewise. * include/private/pthread_support.h (GC_threads, GC_thr_initialized, GC_in_thread_creation): Likewise. * malloc.c (GC_text_mapping): Likewise. * mallocx.c (GC_bytes_found): Likewise. * mark.c (GC_check_dirty, GC_started_thread_while_stopped): Likewise. * mark_rts.c (GC_save_regs_ret_val): Likewise. * misc.c (GC_clear_stack_inner, GC_init_parallel, GC_init_win32, GC_setpagesize, GC_init_linux_data_start, GC_set_and_save_fault_handler, GC_unmap_threshold): Likewise. * os_dep.c (GC_unmap_threshold, GC_push_all_stacks, GC_darwin_register_mach_handler_thread): Likewise. * pthread_support.c (GC_markers, GC_collection_in_progress): Likewise. * tests/test.c (GC_amiga_free_all_mem): Likewise. * thread_local_alloc.c (GC_gcjobjfreelist, GC_gcj_malloc_initialized, GC_gcj_kind): Likewise. * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init, GC_fault_handler_lock, GC_write_cs, GC_markers): Likewise. * misc.c (GC_read, GC_register_finalizer_no_order, GC_init_dyld): Move the declaration out of GC_init(); remove "extern". * os_dep.c (GC_abort): Add the comment; add workaround to suppress compiler "unreachable code" warnings for ABORT callers (where ABORT is followed by a dummy return statement). * os_dep.c (GC_old_allocator): Move the declaration out of GC_default_push_other_roots(); remove "extern". * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume): Move the declaration out of GC_stop_world() and GC_start_world() (only if MPROTECT_VDB); remove "extern". * win32_threads.c (GC_get_stack_min, GC_push_stack_for, GC_get_next_stack): Recognize _WIN32_WCE_EMULATION macro (used for WinCE emulation and for custom WinCE 6 devices); add the comment. * win32_threads.c (GC_get_stack_min): Cast pointer to word instead of DWORD. * win32_threads.c (GC_get_next_stack): Don't use and maintain the latest known stack_min value for WinCE (if GC_get_stack_min is defined as a macro); update the comments. * win32_threads.c (GC_wnt): Don't declare for WinCE. * Makefile.direct: Document EMPTY_GETENV_RESULTS. * gcj_mlc.c (GC_clear_stack): Remove declaration. * malloc.c (GC_clear_stack): Likewise. * mallocx.c (GC_clear_stack): Likewise. * typd_mlc.c (GC_clear_stack): Likewise. * gcj_mlc.c (GENERAL_MALLOC, GENERAL_MALLOC_IOP): Rename to GENERAL_MALLOC_INNER and GENERAL_MALLOC_INNER_IOP, respectively; remove "lb" unnecessary cast to word. * include/private/gc_priv.h (GC_clear_stack): Add declaration. * include/private/gc_priv.h (GENERAL_MALLOC, GENERAL_MALLOC_IOP): Move common declaration from typd_mlc.c and malloc.c; remove unnecessary result and "lb" parameter casts. * include/private/thread_local_alloc.h: Guard against duplicate header file inclusion. * os_dep.c (USE_MUNMAP): Replace "-->" with an error directive for the case when USE_MMAP is not defined. * pthread_support.c (GC_is_thread_tsd_valid): New internal function (only if GC_ASSERTIONS and THREAD_LOCAL_ALLOC); move the code from thread-local GC_malloc(); add FIXME for the condition. * win32_threads.c (GC_is_thread_tsd_valid): Likewise. * thread_local_alloc.c (GC_gcjobjfreelist): Change the type (to match that of its definition). * thread_local_alloc.c (GC_destroy_thread_local): Add a cast for GC_gcjobjfreelist. * thread_local_alloc.c (GC_lookup_thread, GC_lookup_thread_inner): Remove unused declaration; don't include pthread.h. * thread_local_alloc.c (GC_is_thread_tsd_valid): New declaration (only if GC_ASSERTIONS). * thread_local_alloc.c (GC_malloc): Use GC_is_thread_tsd_valid() instead of GC_lookup_thread(). * win32_threads.c (GC_lookup_thread_inner): Define as STATIC. * win32_threads.c (UNPROTECT): Rename to UNPROTECT_THREAD (to have id different from that in os_dep.c). * allchblk.c (GC_enough_large_bytes_left): Replace "inline static" with GC_INLINE. * include/private/gc_priv.h (fixed_getenv): Likewise. * alloc.c (GC_max, GC_min): Replace "static INLINE" with GC_INLINE. * mark_rts.c (rt_hash): Likewise. * win32_threads.c (GC_get_max_thread_index): Likewise. * include/private/gc_priv.h (INLINE): Prefix with "GC_"; include "static"; define for Sun CC; define for VC++ (and other compilers). * pthread_support.c: Don't define __inline__ for non-GNU compilers (not needed anymore). * NT_THREADS_MAKEFILE: Remove file (since it duplicates gc.mak). * Makefile.in: Remove reference to NT_THREADS_MAKEFILE. * Makefile.am: Likewise. * Makefile.dj: Likewise. * Makefile.direct: Likewise. * doc/README.win32: Add reference to gc.mak. * NT_X64_THREADS_MAKEFILE: Likewise. * Makefile.direct: Remove references to acinclude.m4, libtool.m4. * autogen.sh: Update. * Makefile.am: Don't add libtool.m4 to EXTRA_DIST. * acinclude.m4: Fix underquoting of GC_SET_VERSION. * README.QUICK: Update information for Makefile. * Makefile.am: Do not distribute the substituted bdw-gc.pc. * configure.ac: Add AM conditional analog to KEEP_BACK_PTRS. * tests/tests.am: Use it here to conditionally enable tracetest when possible. * dyn_load.c (GC_wnt): Update the comment. * dyn_load.c (GC_register_dynamic_libraries): Add the comment for _WIN32_WCE_EMULATION; recognize GC_REGISTER_MEM_PRIVATE (new macro); call GC_is_heap_base() only if check for Type succeeded. * mark_rts.c (GC_is_tmp_root): Don't define unless NO_DEBUGGING; update the comment. * include/private/gc_priv.h (GC_is_tmp_root): Remove declaration. * include/private/gcconfig.h (CANCEL_SAFE, IF_CANCEL): new macros. * include/private/gc_priv.h (DISABLE_CANCEL, RESTORE_CANCEL, ASSERT_CANCEL_DISABLED): New macros. * alloc.c (GC_maybe_gc): Assert cancellation disabled. (GC_collect_a_little_inner,GC_try_to_collect, GC_collect_or_expand): Disable cancellation. (GC_add_to_our_memory): Check for overflow. * misc.c (GC_cancel_disable_count): declare. (GC_init, GC_write): Disable cancellation. (GC_init): Remove redundant GC_is_initialized test. * os_dep.c (GC_repeat_read): Assert cancellation disabled. (GC_get_stack_base): Disable cancellation. * pthread_stop_world.c (GC_suspend_handler_inner): Disable cancellation. * pthread_support.c (GC_mark_thread): Permanently disable cancellation. (GC_wait_for_gc_completion, GC_wait_builder, GC_wait_marker): Assert cancellation disabled. (fork handling): Disable cancellation, fix comment. (GC_pthread_create): Disable cancellation. (GC_unregister_my_thread): Disable cancellation. * Makefile.direct: Document NO_CANCEL_SAFE. * Makefile: Remove outdated file (Makefile.direct should be used instead). * include/gc.h (GC_use_DllMain): Refine the comment. * configure.ac: Add documentation to AC_DEFINE for GC_THREADS and EMPTY_GETENV_RESULTS. * configure.ac: Fix a typo. * Makefile.am: Likewise. * checksums.c (GC_checksum, GC_update_check_page): Remove "register" keyword in local variable declarations (for the code used only for debugging or which is not time-critical). * dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info, GC_store_debug_info_inner, GC_check_annotated_obj, GC_print_obj, GC_print_smashed_obj, GC_debug_end_stubborn_change, GC_debug_invoke_finalizer): Likewise. * dyn_load.c (GC_register_dynamic_libraries): Likewise. * mallocx.c (GC_realloc): Likewise. * mark_rts.c (GC_print_static_roots, GC_is_static_root, GC_clear_roots): Likewise. * misc.c (GC_write): Likewise. * os_dep.c (GC_print_callers): Likewise. * dyn_load.c (GC_register_dynamic_libraries): Rename "i" local variable to "j" for the nested loop (just not to hide the similar variable in the outer one). * mark_rts.c (GC_print_static_roots): Output an error message using GC_err_printf() (instead of GC_printf()). * configure.ac: Move include flag from ${INCLUDE} ... * Makefile.am: ... to AM_CPPFLAGS and also add the build directory. * configure.ac: Call AM_CONFIG_HEADER([include/private/config.h]). * configure.ac: Add documentation to all AC_DEFINE either directly or using AH_TEMPLATE. * win32_threads.c (GC_waitForSingleObjectInfinite): New static function (only if GC_WINMAIN_REDIRECT). * win32_threads.c (WinMain): Call GC_waitForSingleObjectInfinite() thru GC_do_blocking() instead of calling WaitForSingleObject() directly. * pthread_support.c (start_mark_threads): Refine printed message. * win32_threads.c (GC_thr_init): Likewise. * Makefile.direct (GC_WINMAIN_REDIRECT): Add the comment for. * Makefile.direct (NO_GETENV): Update the comment. * include/gc.h (GC_WINMAIN_WINCE_LPTSTR): Remove macro. * include/gc.h (GC_WinMain): Remove declaration. * include/gc.h (WinMain): Define (as GC_WinMain) if and only if GC_WINMAIN_REDIRECT. * tests/test.c (GC_COND_INIT): Define as GC_INIT() also in case of WinCE target unless GC_WINMAIN_REDIRECT is defined. * tests/test.c (WINMAIN_LPTSTR): New macro. * tests/test.c (WinMain): Use WINMAIN_LPTSTR instead of LP[W]STR and GC_WINMAIN_WINCE_LPTSTR. * win32_threads.c (start_mark_threads): Add the comment for MARK_THREAD_STACK_SIZE. * win32_threads.c: Recognize new GC_WINMAIN_REDIRECT macro. * win32_threads.c (WINMAIN_LPTSTR, WINMAIN_THREAD_STACK_SIZE): New macro (only if GC_WINMAIN_REDIRECT). * win32_threads.c: Undefine WinMain macro if GC_WINMAIN_REDIRECT. * win32_threads.c (GC_WinMain): Add prototype (only if GC_WINMAIN_REDIRECT). * win32_threads.c (main_thread_args, WinMain): Rename GC_WINMAIN_WINCE_LPTSTR to WINMAIN_LPTSTR. * win32_threads.c (WinMain): Call GC_INIT() instead of GC_init(); use WINMAIN_THREAD_STACK_SIZE. * win32_threads.c (WinMain): Call GC_deinit() and DeleteCriticalSection() only if WinCE; add FIXME. * os_dep.c (GC_get_main_stack_base): add assertion for mem_base value returned by GC_get_stack_base(). * Makefile.direct (MUNMAP_THRESHOLD, GC_FORCE_UNMAP_ON_GCOLLECT): Add the comment for. * alloc.c (GC_unmap_threshold, GC_force_unmap_on_gcollect): Declare external variable (only if USE_MUNMAP). * alloc.c (GC_try_to_collect): Temporarily set GC_unmap_threshold value to 1 if GC_force_unmap_on_gcollect and restore it before unlocking (only if USE_MUNMAP). * doc/README.environment (GC_FORCE_UNMAP_ON_GCOLLECT): Add information for. * include/gc.h (GC_set_force_unmap_on_gcollect, GC_get_force_unmap_on_gcollect): New public function prototype. * include/gc.h (GC_FORCE_UNMAP_ON_GCOLLECT): New macro is recognized. * misc.c (GC_FORCE_UNMAP_ON_GCOLLECT): Likewise. * include/gc.h (GC_INIT_CONF_FORCE_UNMAP_ON_GCOLLECT): New internal macro (used by GC_INIT only). * misc.c (GC_force_unmap_on_gcollect): New global variable. * misc.c (GC_init): Recognize new "GC_FORCE_UNMAP_ON_GCOLLECT" environment variable (and set GC_force_unmap_on_gcollect). * misc.c (GC_set_force_unmap_on_gcollect, GC_get_force_unmap_on_gcollect): New public function. * tests/test.c (window_proc): Call GC_set_force_unmap_on_gcollect to force the mode on if WM_HIBERNATE; restore the mode after GC_gcollect(). * Makefile.direct (LARGE_CONFIG): Update information. * include/gc.h (GC_stop_func): Refine the comment. * configure.ac: Use EMPTY_GETENV_RESULTS instead of NO_GETENV for Win32 (workaround for Wine bug). * allchblk.c (GC_freehblk): Adjust local variables indentation. * mallocx.c (GC_generic_malloc_many): Likewise. * typd_mlc.c (GC_malloc_explicitly_typed_ignore_off_page, GC_calloc_explicitly_typed): Likewise. * typd_mlc.c (GC_make_array_descriptor): Remove unnecessary brackets. * configure.ac: Replace GC_WIN32_THREADS with GC_THREADS. * configure.ac: Process enable_parallel_mark option for Cygwin and Win32; define THREAD_LOCAL_ALLOC for Win32. * include/private/gc_priv.h: Define AO_ASSUME_WINDOWS98 if PARALLEL_MARK (required for VC++ x86). * dbg_mlc.c (GC_generate_random_backtrace): Call GC_try_to_collect(GC_never_stop_func) instead of GC_gcollect(); if GC is disabled then print error message and return. * include/gc.h (GC_try_to_collect): Refine the comment. * include/private/gc_priv.h (GC_never_stop_func): Fix return type; refine the comment. * add_gc_prefix.c: Move the file to the new "extra" directory. * AmigaOS.c: Likewise. * gcname.c: Likewise. * if_mach.c: Likewise. * if_not_there.c: Likewise. * MacOS.c: Likewise. * msvc_dbg.c: Likewise. * setjmp_t.c: Likewise. * threadlibs.c: Likewise. * EMX_MAKEFILE: Prepend setjmp_t.c with "extra" directory. * Makefile: Prepend AmigaOS.c, MacOS.c, add_gc_prefix.c, gcname.c, if_mach.c, if_not_there.c, msvc_dbg.c, setjmp_t.c, threadlibs.c with "extra" directory. * Makefile.am: Likewise. * Makefile.direct: Likewise. * Makefile.dj: Likewise. * Makefile.in: Likewise. * NT_MAKEFILE: Prepend msvc_dbg.obj with "extra" directory. * NT_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_THREADS_MAKEFILE: Likewise. * NT_THREADS_MAKEFILE: Prepend msvc_dbg.c with "extra" directory. * gc.mak: Likewise. * PCR-Makefile: Prepend if_mach.c, if_not_there.c with "extra" directory. * SMakefile.amiga: Prepend AmigaOS.c, setjmp_t.c with "extra" directory. * doc/simple_example.html: Update for threadlibs.c. * os_dep.c: Prepend included AmigaOS.c with "extra" directory. * include/gc.h (GC_do_blocking, GC_call_with_gc_active): New function prototype. * include/private/gc_priv.h (STOP_WORLD): Replace a no-op (for the single-threaded case) with an assertion check for the state to be not a "do-blocking" one. * include/private/gc_priv.h (blocking_data): Move the structure definition from pthread_support.c; change "fn" return type to void pointer. * include/private/gc_priv.h (GC_activation_frame_s): New structure type. * include/private/gc_priv.h (GC_push_all_stack_frames): New function declaration (only if THREADS). * include/private/gc_priv.h (GC_world_stopped): Don't declare unless THREADS. * include/private/gc_priv.h (GC_blocked_sp, GC_activation_frame_s): New declaration (only if not THREADS). * include/private/gc_priv.h (GC_push_all_register_frames): New function declaration (only for IA-64). * include/private/gc_priv.h (NURSERY, GC_push_proc): Remove obsolete (unused) symbols. * include/private/gc_priv.h (GC_push_all_stack_partially_eager): Remove declaration (since it is static now). * mark_rts.c (GC_push_all_stack_partially_eager): Move from mark.c (for code locality) and make STATIC. * mark_rts.c (GC_push_all_register_frames): New function (only for IA-64). * mark_rts.c (GC_push_all_stack_frames): New function (only if THREADS). * mark_rts.c (GC_add_trace_entry): New function prototype (used by GC_push_all_stack_partially_eager(), only if TRACE_BUF). * mark_rts.c (GC_push_all_stack_part_eager_frames): New function. * mar_rts.c (GC_save_regs_ret_val): Move the declaration out of a function body (only for IA-64). * mark_rts.c (GC_push_current_stack): Call GC_push_all_stack_part_eager_frames() instead of GC_push_all_stack_partially_eager(). * mark_rts.c (GC_push_current_stack): Call GC_push_all_register_frames() instead of GC_push_all_eager() for IA-64 backing store. * misc.c (GC_do_blocking_inner): Declare function (if THREADS only). * misc.c (GC_blocked_sp, GC_blocked_register_sp, GC_activation_frame): New global variables (only if not THREADS). * misc.c (GC_call_with_gc_active, GC_do_blocking_inner): New API function (only if not THREADS). * misc.c (GC_do_blocking): Move the function from pthread_support.c. * include/private/pthread_support.h (GC_Thread_Rep): Add "activation_frame" field. * pthread_stop_world.c (GC_push_all_stacks): Call GC_push_all_stack_frames() and GC_push_all_register_frames instead of GC_push_all_stack() and/or GC_push_all_eager(); don't check for STACK_GROWS_UP here. * pthread_support.c (GC_do_blocking_inner): Remove "static"; store "fn" result back to "client_data" field. * pthread_support.c (GC_call_with_gc_active): New API function. * win32_threads.c (GC_call_with_gc_active): Likewise. * win32_threads.c (GC_Thread_Rep): Add "thread_blocked_sp" and "activation_frame" fields. * win32_threads.c (GC_new_thread): Add assertion checking for thread_blocked_sp is NULL. * win32_threads.c (GC_do_blocking_inner): New function. * win32_threads.c (GC_stop_world): Don't suspend a thread if its thread_blocked_sp is non-NULL. * win32_threads.c (GC_push_stack_for): Use thread "activation_frame" (if non-NULL); use "thread_blocked_sp" if non-NULL (instead of calling GetThreadContext()); "UNPROTECT" the thread before modifying its last_stack_min; call GC_push_all_stack_frames() instead of GC_push_all_stack(); update the comments. * alloc.c (GC_default_stop_func): New static variable (initialized to GC_never_stop_func). * alloc.c (GC_set_stop_func, GC_get_stop_func): New function. * alloc.c (GC_timeout_stop_func): Define as GC_default_stop_func (instead of GC_never_stop_func) if SMALL_CONFIG (or NO_CLOCK), else call GC_default_stop_func() before getting "current_time". * alloc.c (GC_maybe_gc): Expand GC_gcollect_inner() macro (for FIXME comment). * alloc.c (GC_maybe_gc, GC_collect_a_little_inner): add FIXME for replacing GC_never_stop_func with GC_default_stop_func (if possible). * alloc.c (GC_gcollect): Use GC_default_stop_func. * alloc.c (GC_collect_or_expand): Use GC_default_stop_func (instead of GC_never_stop_func) unless it is trigged due to out of memory; don't increment GC_fail_count and don't output warning (before trying to collect again) in case the collection has been interrupted (by GC_default_stop_func) and the heap expansion has failed too. * include/gc.h (GC_set_stop_func, GC_get_stop_func): New function prototypes. * os_dep.c (GC_get_stack_base): Add FIXME; add assertion for GC_get_writable_length() result. * configure.ac: Don't use -lpthread -ldl for Cygwin. * NT_THREADS_MAKEFILE: Make it back equal to gc.mak. * include/private/gcconfig.h (GWW_VDB): Undefine if USE_GLOBAL_ALLOC (since incompatible). * os_dep.c (GetWriteWatch_alloc_flag): Define as 0 unless GWW_VDB is defined. * os_dep.c (GC_unmap_threshold): Declare (for use in GC_init_win32) if USE_MUNMAP. * os_dep.c (GC_init_win32): Turn off memory unmapping if GlobalAlloc() is used. * os_dep.c (GC_win32_get_mem): Define and use new VIRTUAL_ALLOC_PAD macro; don't waste an extra memory page unless MPROTECT_VDB is in use. * Makefile: Replace "version.h" with "include/gc_version.h". * include/gc_version.h: Likewise. * alloc.c (GC_collect_or_expand): Output heap size in WARN() (before returning FALSE) for convenience. * allchblk.c (GC_allochblk_nth): Use GC_PRIdPTR in WARN() format string. * pthread_support.c (start_mark_threads, GC_thr_init): Likewise. * win32_threads.c (GC_delete_thread): Likewise. * include/private/gc_priv.h (GC_PRIdPTR): New macro. * pthread_stop_world.c (GC_suspend_handler_inner): Remove unnecessary cast for WARN argument. * pthread_support.c (start_mark_threads): if pthread_create() failed then don't try to create other marker threads and (after printing a warning) adjust GC_markers and GC_parallel values; log GC_markers value (possibly adjusted) after that. * win32_threads.c (start_mark_threads): if pthread_create() is failed then don't try to create other marker threads and (after printing a warning) adjust GC_markers and GC_parallel values. * win32_threads.c (mark_mutex_event, builder_cv, mark_cv): Move the definition upper (to be visible in start_mark_threads()). * win32_threads.c (start_mark_threads): if CreateThread() or _beginthreadex() is failed then don't try to create other marker threads and (after printing a warning) adjust GC_markers, GC_parallel values, and destroy the event objects (either only some for the uncreated threads if DONT_USE_SIGNALANDWAIT or all if not a single thread is created). * win32_threads.c (GC_thr_init): Log GC_markers value (possibly adjusted) after start_mark_threads() call. * Makefile.am: Back remove "GC_" prefix for PTHREADS, DARWIN_THREADS, WIN32_THREADS (for configure.ac). * include/private/gc_priv.h: Change include of config.h to private/config.h. * include/private/gc_pmark.h: Likewise. * gc_cpp.cc: Likewise. * tests/test.c: Likewise. * tests/test_cpp.cc: Include private/config.h (if HAVE_CONFIG_H); undefine GC_BUILD. * finalize.c (GC_general_register_disappearing_link): Return GC_SUCCESS, GC_DUPLICATE, GC_NO_MEMORY (instead of 0, 1 and 2, respectively). * include/gc.h (GC_NO_MEMORY): New macro (defined as 2). * include/gc.h (GC_register_disappearing_link, GC_general_register_disappearing_link): Update the comment. * typd_mlc.c (GC_calloc_explicitly_typed): Use GC_NO_MEMORY macro. * finalize.c (GC_general_register_disappearing_link, GC_register_finalizer_inner): Recalculate the hash table index after GC_oom_fn succeeded (since the table may grow while not holding the lock) and check again that the entry is still not in the table (free the unused entry otherwise unless DBG_HDRS_ALL). * finalize.c (GC_register_finalizer_inner): Initialize "hhdr" local variable (to prevent a compiler warning). * finalize.c (GC_register_finalizer_inner): Don't modify the data pointed by "ocd" and "ofn" in GC_register_finalizer_inner() failed (due to out of memory). * alloc.c (GC_set_fl_marks, GC_clear_fl_marks): Transform loop to suppress compiler "variable might be uninitialized" warnings. * Makefile.direct (DONT_USE_SIGNALANDWAIT): Add the comment for. * win32_threads.c (DONT_USE_SIGNALANDWAIT): Always define for WinCE. * win32_threads.c (THREAD_HANDLE): Cast Id (of DWORD type) to HANDLE thru word type (to avoid a compiler warning) for WinCE. * win32_threads.c (GC_marker_cv, GC_marker_Id): New static array (only if DONT_USE_SIGNALANDWAIT). * win32_threads.c (start_mark_threads): Initialize GC_marker_Id and GC_marker_cv for each helper thread (only if DONT_USE_SIGNALANDWAIT). * win32_threads.c (GC_mark_mutex_state): New static variable (only if DONT_USE_SIGNALANDWAIT). * win32_threads.c (GC_mark_mutex_waitcnt, signalObjectAndWait_func): Don't define if DONT_USE_SIGNALANDWAIT. * win32_threads.c (GC_acquire_mark_lock, GC_release_mark_lock): Use InterlockedExchange() over GC_mark_mutex_state (instead of AO_fetch_and_add()) if DONT_USE_SIGNALANDWAIT. * win32_threads.c (GC_wait_marker, GC_notify_all_marker): Implement wait/broadcast primitives using Win32 multiple events (one for each marker thread) if DONT_USE_SIGNALANDWAIT (instead of using Win32 SignalObjectAndWait). * win32_threads.c (GC_thr_init): Don't declare hK32 local variable, don't check for GC_wnt, and don't initialize signalObjectAndWait_func if DONT_USE_SIGNALANDWAIT. * alloc.c (GC_finish_collection): Call GC_print_finalization_stats if GC_print_stats (after getting "done_time"). * finalize.c (GC_old_dl_entries): New static variable (only if not SMALL_CONFIG). * finalize.c (GC_finalize): Save current GC_dl_entries value (only if not SMALL_CONFIG). * finalize.c (GC_print_finalization_stats): Define if and only if not SMALL_CONFIG; use GC_old_dl_entries value; use GC_log_printf() instead of GC_printf(); use "%lu" (instead of "%u") print format specifier; use unsigned long type for "ready" counter (for LP64 targets). * misc.c (GC_dump): No longer call GC_print_finalization_stats() here (since it is called from GC_finish_collection()). * misc.c (STACKBASE): Remove unused macro undef (for NOSYS and ECOS). * alloc.c (GC_expand_hp): Replace GC_init_inner() call with GC_init() one. * malloc.c (GC_alloc_large, GC_generic_malloc_inner): Likewise. * mallocx.c (GC_generic_malloc_many): Likewise. * misc.c (GC_enable_incremental): Likewise. * alloc.c (GC_expand_hp): Update the comment. * mark.c (GC_obj_kinds): Likewise. * win32_threads.c (GC_allow_register_threads): Likewise. * private/gc_priv.h (GC_init_inner): Remove function declaration. * misc.c (GC_init_inner): Replace with public GC_init(). * gcj_mlc.c (GC_gcj_fake_mark_proc): New static function. * gcj_mlc.c (GC_init_gcj_malloc): If mp is 0 then supply GC_gcj_fake_mark_proc (aborting with the appropriate message) instead. * os_dep.c (GC_wince_get_mem): If VirtualAlloc() returns NULL (due to out of memory) then don't increment GC_n_heap_bases and don't call VirtualAlloc() again (with MEM_COMMIT). * os_dep.c (GC_remap): Abort with a more informatory message if VirtualAlloc() fails due to out of memory; update FIXME. * Makefile: Fix typo for msvc_dbg.c. * Makefile.direct: Likewise. * Makefile.am: Prefix PTHREADS, DARWIN_THREADS, WIN32_THREADS with "GC_". * Makefile.dj: Don't reference remove files (nursery.c, gc_nursery.h, gc_copy_descr.h). * NT_MAKEFILE: Don't define __STDC__ macro (no longer used). * NT_STATIC_THREADS_MAKEFILE: Likewise. * NT_THREADS_MAKEFILE: Likewise. * NT_X64_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_THREADS_MAKEFILE: Likewise. * gc.mak: Likewise. * NT_MAKEFILE: Remove unnecessary -DGC_BUILD (since it is always defined in the source files). * NT_THREADS_MAKEFILE: Likewise. * NT_X64_THREADS_MAKEFILE: Likewise. * gc.mak: Likewise. * NT_X64_THREADS_MAKEFILE: Fix typo for -DGC_NOT_DLL. * NT_STATIC_THREADS_MAKEFILE: Replace GC_WIN32_THREADS with GC_THREADS. * NT_THREADS_MAKEFILE: Likewise. * NT_X64_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_THREADS_MAKEFILE: Likewise. * gc.mak: Likewise. * NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE to suppress the compiler warnings. * NT_STATIC_THREADS_MAKEFILE: Likewise. * NT_X64_STATIC_THREADS_MAKEFILE: Place -D_CRT_SECURE_NO_DEPRECATE before "$*.C" (and "$*.CPP"). * NT_X64_THREADS_MAKEFILE: Likewise. * doc/README.solaris2: Replace GC_SOLARIS_THREADS with GC_THREADS. * doc/README.win32: Replace GC_WIN32_THREADS with GC_THREADS. * doc/README.win64: Add info about mingw-w64; add note for VC++ warnings suppression. * os_dep.c (GC_forward_exception): Fix logic in several places. (OSX-specific) * include/private/gc_priv.h (MAX_HEAP_SECTS): Guard with ifndef. * Makefile.direct: Copy missing information for -DSHORT_DBG_HDRS from Makefile. * Makefile: Remove the information about "define arguments" (which is incomplete and outdated compared to that in Makefile.direct); add help reference to Makefile.direct. * Makefile.dj: Likewise. * alloc.c (world_stopped_total_time, world_stopped_total_divisor): Replace "STATIC" with "static" in the definition (since the symbols aren't prefixed with "GC_"). * win32_threads.c (marker_sp, marker_bsp, marker_last_stack_min, start_mark_threads, mark_mutex, builder_cv, mark_cv, mark_mutex_event, signalObjectAndWait_func, main_thread_start): Likewise. * pthread_support.c (GC_wait_builder): Define as STATIC. * win32_threads.c (GC_wait_builder): Likewise. * misc.c (GC_get_heap_size_inner, GC_get_free_bytes_inner): New API function. * include/gc_pmark.h (GC_get_heap_size_inner, GC_get_free_bytes_inner): New function declaration. * include/gc.h: Recognize __CEGCC__ (as a synonym for _WIN32_WCE). * include/gc_config_macros.h: Likewise. * include/gc.h (GC_MAXIMUM_HEAP_SIZE): Recognize new macro. * include/gc.h (GC_INIT_CONF_MAXIMUM_HEAP_SIZE): New macro (for internal use). * include/gc_config_macros.h: Always include stddef.h if GCC. * include/gc_config_macros.h (GC_API): Define for CeGCC in the same way as for MinGW. * include/gc_config_macros.h (GC_API): Group the definition for all cases together (check for GC_DLL only once). * include/gc_pthread_redirects.h: Group non-Darwin code together. * tests/test.c: Recognize GC_PRINT_VERBOSE_STATS (only if GC_DLL). * Makefile.direct (GC_PTHREADS_PARAMARK, GC_IGNORE_GCJ_INFO, GC_PRINT_VERBOSE_STATS, GC_DONT_EXPAND, GC_INITIAL_HEAP_SIZE, GC_FREE_SPACE_DIVISOR, GC_TIME_LIMIT, GC_FULL_FREQ): Add the comment for. * misc.c (GC_init_inner): Recognize GC_PRINT_VERBOSE_STATS (new macro). * dyn_load.c (GC_wnt): Change definition to TRUE for WinCE; add FIXME and the comment for WinCE. * gcj_mlc.c (GC_init_gcj_malloc): Recognize GC_IGNORE_GCJ_INFO (new macro). * include/gc.h (GC_HAVE_BUILTIN_BACKTRACE): Don't define for VC++ WinCE (since backtrace() is unimplemented). * include/private/gc_priv.h (GC_n_heap_bases): Remove declaration (since static). * os_dep.c (GC_n_heap_bases): Define as STATIC; move the definition to be above GC_is_heap_base(). * include/private/gcconfig.h: Don't define NOSYS for WinCE on ARM (both for MinGW and CeGCC toolchains). * include/private/gcconfig.h: Recognize __CEGCC__ and __MINGW32CE__ (as synonyms for __WIN32_WCE). * include/private/gcconfig.h: If SH4 then don't set config parameters for SH. * include/private/thread_local_alloc.h (GC_key_create): Don't abort on failures, just return -1 in these cases (this also prevents compilation error for targets where ABORT is defined indirectly as an inline assembler sequence). * mark.c (WRAP_MARK_SOME): Also define for WinCE; add FIXME for the GCC-based cross-compiler. * mark.c (ext_ex_regn, mark_ex_handler): Don't define unless WRAP_MARK_SOME is defined; define also for WinCE case; don't check for _WIN64 (since WRAP_MARK_SOME is undefined for it). * mark.c (GC_mark_some): Use __try/__except also for WinCE; update the comment. * misc.c: Include signal.h after gc_pmark.h included; check for MSWINCE instead of _WIN32_WCE. * misc.c (GC_init_inner): Remove duplicate GC_setpagesize() call. * misc.c: Don't include for WinCE targets. * misc.c (GC_write): Define _MAX_PATH if undefined (workaround for CeGCC toolchain). * misc.c (GC_write): Use OutputDebugStringW() instead of _CrtDbgReport() for WinCE targets. * os_dep.c (GC_least_described_address): Define as STATIC. * os_dep.c (GC_register_data_segments): Fix code indentation. * os_dep.c (GC_wince_get_mem): Initialize "result" local variable (to prevent a compiler warning). * os_dep.c (GC_dirty_init): Add comment for WinCE target. * tests/test.c: Don't include winbase.h directly if GCC for WinCE, include assert.h instead. * tests/test.c (tiny_reverse_test): Define and use TINY_REVERSE_UPPER_VALUE macro (4 if VERY_SMALL_CONFIG else 10); useful for WinCE. * win32_threads.c (GC_Thread_Rep): Don't declare "handle" field for WinCE (since thread Id is used as a "real" thread handle). * win32_threads.c (THREAD_HANDLE): New macro. * win32_threads.c (GC_register_my_thread_inner): Don't recognize DONT_IMPORT_GETCURTHREAD anymore; don't record thread handle on WinCE. * Makefile.direct (DONT_IMPORT_GETCURTHREAD): Remove comment for. * win32_threads.c (UNPROTECT, GC_fault_handler_lock): Don't check for MSWINCE. * win32_threads.c (GC_delete_gc_thread, GC_delete_thread): Don't close thread handle on WinCE (since it's a thread Id). * win32_threads.c (GC_suspend): Don't check for MSWINCE in the MPROTECT-related code (for the case if MPROTECT_VDB would be implemented for WinCE). * win32_threads.c (GC_suspend, GC_start_world, GC_push_stack_for): Use THREAD_HANDLE(t) to obtain thread handle. * win32_threads.c (GC_PTHREADS_PARAMARK): New macro recognized; implicitly define GC_PTHREADS_PARAMARK if GC_PTHREADS; include pthread.h; define NUMERIC_THREAD_ID(id) if undefined yet; replace GC_PTHREADS with GC_PTHREADS_PARAMARK where appropriate (for the parallel mark support). * win32_threads.c (start_mark_threads): Use int type for "i" local variable (instead of "unsigned") to prevent a compiler warning. * win32_threads.c (start_mark_threads): Don't check CreateThread() result for -1; call CloseHandle() for the handle created by CreateThread() (on WinCE); don't use errno (since errno.h is missing on some targets like WinCE) when printing warning on a marker thread creation failure. * win32_threads.c (signalObjectAndWait_func): Define for WinCE. * win32_threads.c (GC_wait_marker): Remove unnecessary assertion for non-zero signalObjectAndWait_func (to make the code compilable for WinCE). * win32_threads.c (GC_thr_init): Allow PARALLEL_MARK for WinCE; use GC_sysinfo to get processors count if WinCE; don't check for SignalObjectAndWait() if WinCE; replace GC_PTHREADS with GC_PTHREADS_PARAMARK. * win32_threads.c (GC_thr_init): Recognize GC_MIN_MARKERS new macro (useful for testing parallel marking on WinCE). * win32_threads.c (GC_win32_start, main_thread_start): Define as STATIC. * win32_threads.c: Don't define main_thread_args, main_thread_start(), WinMain() for WinCE if GC_DLL. * win32_threads.c (WINCE_MAIN_STACK_SIZE): Remove useless macro (since the stack size parameter is ignored on WinCE). * win32_threads.c (main_thread_start): Remove forward declaration; place its definition before WinMain() one. * win32_threads.c (WinMain): Abort if GC_CreateThread() or WaitForSingleObject() failed (for the main thread). * allchblk.c (MUNMAP_THRESHOLD): Move macro definition out of a function. * allchblk.c (GC_unmap_threshold): New global variable definition (initialized to MUNMAP_THRESHOLD). * allchblk.c (GC_unmap_old): Use GC_unmap_threshold instead of MUNMAP_THRESHOLD; skip unmapping if GC_unmap_threshold is 0. * doc/README.environment (GC_UNMAP_THRESHOLD): Add information. * misc.c (GC_unmap_threshold): New variable declaration. * misc.c (GC_init_inner): Recognize "GC_UNMAP_THRESHOLD" environment variable to set GC_unmap_threshold value (only if USE_MUNMAP). * dbg_mlc.c (OFN_UNSET): New macro (to detect GC_register_finalizer() failures). * dbg_mlc.c (store_old): Add a check for register_finalizer() failure caused by an out-of-memory event (leave *ofn and *ocd unmodified in that case). * dbg_mlc.c (GC_debug_register_finalizer, GC_debug_register_finalizer_no_order, GC_debug_register_finalizer_unreachable, GC_debug_register_finalizer_ignore_self): Initialize my_old_fn to OFN_UNSET; clear *ocd and *ofn for non-heap objects (the same as in GC_register_finalizer_inner()). * Makefile.direct (GC_DLL): Add the comment for. * doc/README.macros: Fix a typo. * doc/README.macros (_DLL, GC_DLL, GC_NOT_DLL): Update info. * doc/README.macros (__STDC__): Remove info. * dbg_mlc.c (GC_get_back_ptr_info, GC_generate_random_heap_address, GC_generate_random_valid_address, GC_print_backtrace, GC_generate_random_backtrace, GC_register_describe_type_fn): Add GC_API and GC_CALL to function definition. * malloc.c (GC_generic_malloc): Likewise. * mallocx.c (GC_incr_bytes_allocd, GC_incr_bytes_freed): Likewise. * mark.c (GC_mark_and_push): Likewise. * misc.c (GC_new_free_list_inner, GC_new_free_list, GC_new_kind_inner, GC_new_kind, GC_new_proc_inner, GC_new_proc): Likewise. * include/gc_backptr.h (GC_get_back_ptr_info, GC_generate_random_heap_address, GC_generate_random_valid_address, GC_generate_random_backtrace, GC_print_backtrace): Add GC_API and GC_CALL to function prototype. * include/gc_mark.h (GC_mark_and_push, GC_new_free_list, GC_new_free_list_inner, GC_new_kind, GC_new_kind_inner, GC_new_proc, GC_new_proc_inner, GC_generic_malloc, GC_register_describe_type_fn): Likewise. * include/new_gc_alloc.h (GC_incr_bytes_allocd, GC_incr_mem_freed, GC_generic_malloc_words_small): Likewise. * gc_cpp.cc: Include "config.h" (if HAVE_CONFIG_H defined). * include/private/gc_pmark.h: Likewise. * include/private/gc_priv.h: Likewise. * tests/test.c: Likewise. * gc_cpp.cc: Define GC_BUILD. * include/private/gc_pmark.h: Likewise. * include/private/gc_priv.h: Likewise. * gc_dlopen.c (WRAP_FUNC, REAL_FUNC): New macro. * gc_dlopen.c (dlopen): Add GC_API to the wrapper function definition. * pthread_support.c (GC_pthread_create, GC_pthread_sigmask, GC_pthread_join, GC_pthread_detach, pthread_sigmask, pthread_join, pthread_detach, pthread_create): Likewise. * win32_threads.c (GC_pthread_join, GC_pthread_create, GC_pthread_sigmask, GC_pthread_detach): Likewise. * gc_dlopen.c (dlopen): Use WRAP_FUNC and REAL_FUNC macros. * include/gc_backptr.h: Include "gc.h". * include/gc_backptr.h: Use extern "C" for the exported functions. * include/gc_mark.h: Likewise. * include/gc_config_macros.h (GC_THREADS): Define the macro if any GC_XXX_THREADS is defined. * include/gc_config_macros.h (_PTHREADS, _POSIX4A_DRAFT10_SOURCE): Move the definitions below the place where GC_NETBSD_THREADS and GC_DGUX386_THREADS are defined. * include/gc_config_macros.h (GC_DLL): Don't define (even if _DLL is defined) for GCC. * include/gc_config_macros.h (GC_API): Define for Cygwin (in the same way as for VC++); define for GCC v4+ (other than already recognized MinGW/Cygwin) as a "default" visibility attribute if GC_DLL is defined. * include/gc_config_macros.h (GC_ATTR_MALLOC, GC_ATTR_ALLOC_SIZE): New macro. * include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup, GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign, GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page, GC_malloc_atomic_ignore_off_page, GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_strdup, GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_malloc_replacement): Add GC_ATTR_MALLOC attribute. * include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise. * include/gc.h (GC_malloc, GC_malloc_atomic, GC_malloc_uncollectable, GC_malloc_stubborn, GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page, GC_malloc_atomic_ignore_off_page, GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_malloc_replacement: Add GC_ATTR_ALLOC_SIZE attribute (for the first argument). * include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise. * include/gc.h (GC_memalign, GC_realloc, GC_debug_realloc, GC_debug_realloc_replacement): Add GC_ATTR_ALLOC_SIZE attribute (for the second argument). * include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup, GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign, GC_malloc_atomic_uncollectable, GC_free, GC_base, GC_size, GC_realloc, GC_expand_hp, GC_set_max_heap_size, GC_exclude_static_roots, GC_add_roots, GC_remove_roots, GC_register_displacement, GC_debug_register_displacement, GC_try_to_collect, GC_malloc_ignore_off_page, GC_malloc_atomic_ignore_off_page, GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_strdup, GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_free, GC_debug_realloc, GC_debug_malloc_replacement, GC_debug_realloc_replacement, GC_finalization_proc, GC_register_finalizer, GC_debug_register_finalizer, GC_register_finalizer_ignore_self, GC_debug_register_finalizer_ignore_self, GC_register_finalizer_no_order, GC_debug_register_finalizer_no_order, GC_register_finalizer_unreachable, GC_debug_register_finalizer_unreachable, GC_register_disappearing_link, GC_general_register_disappearing_link, GC_unregister_disappearing_link, GC_noop1, GC_warn_proc, GC_set_warn_proc, GC_ignore_warn_proc, GC_fn_type, GC_call_with_alloc_lock, GC_stack_base_func, GC_call_with_stack_base, GC_same_obj, GC_pre_incr, GC_post_incr, GC_is_visible, GC_is_valid_displacement, GC_same_obj_print_proc, GC_is_valid_displacement_print_proc, GC_is_visible_print_proc, GC_malloc_many, GC_CreateThread, GC_beginthreadex, GC_endthreadex): Comment out (or remove if single and meaningless) function argument names (to avoid identifiers out of the name space). * include/gc_gcj.h (GC_init_gcj_malloc, GC_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise. * include/gc.h (GC_try_to_collect): Update the comment. * include/gc.h (GC_size, GC_register_my_thread): Add const qualifier for the argument referent. * misc.c (GC_size): Likewise. * pthread_support.c (GC_register_my_thread_inner, GC_register_my_thread): Likewise. * win32_threads.c (GC_register_my_thread_inner, GC_register_my_thread): Likewise. * include/gc.h (GC_INIT_CONF_ROOTS): New macro for internal use (define instead of GC_INIT() for Cygwin and AIX). * include/gc.h (GC_DONT_EXPAND, GC_MAX_RETRIES, GC_FREE_SPACE_DIVISOR, GC_FULL_FREQ, GC_TIME_LIMIT, GC_IGNORE_WARN, GC_INITIAL_HEAP_SIZE): Recognize new macro. * include/gc.h (GC_INIT_CONF_DONT_EXPAND, GC_INIT_CONF_MAX_RETRIES, GC_INIT_CONF_FREE_SPACE_DIVISOR, GC_INIT_CONF_FULL_FREQ, GC_INIT_CONF_TIME_LIMIT, GC_INIT_CONF_IGNORE_WARN, GC_INIT_CONF_INITIAL_HEAP_SIZE): New macro for internal use. * include/gc.h (GC_INIT): Use GC_INIT_CONF_XXX macros. * include/gc_mark.h: Prefix GC_H with '_'. * include/gc_mark.h (GC_least_plausible_heap_addr, GC_greatest_plausible_heap_addr, GC_debug_header_size): Use GC_API for the public variable declaration. * include/new_gc_alloc.h (GC_objfreelist_ptr, GC_aobjfreelist_ptr, GC_uobjfreelist_ptr, GC_auobjfreelist_ptr): Likewise. * include/gc_pthread_redirects.h (GC_pthread_create, GC_pthread_sigmask, GC_dlopen, GC_pthread_join, GC_pthread_detach): Use GC_API for the wrapper prototype. * include/gc_pthread_redirects.h (pthread_create, pthread_join, pthread_detach, pthread_sigmask, dlopen): Undefine unconditionally before redirecting. * include/new_gc_alloc.h: Replace GC_incr_mem_freed() with GC_incr_bytes_freed(); remove FIXME. * include/private/gc_priv.h (GC_make_closure, GC_debug_invoke_finalizer, GC_noop): Remove GC_API for the private function. * tests/test.c (GC_print_stats): Handle GC_DLL case regardless of the target. * finalize.c (GC_general_register_disappearing_link, GC_register_finalizer_inner): Remove unnecessary "ifdef THREADS" guard for LOCK/UNLOCK(). * finalize.c (GC_general_register_disappearing_link, GC_register_finalizer_inner): Get GC_oom_fn value before releasing the lock (to prevent data races). * gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise. * mallocx.c (GC_generic_malloc_ignore_off_page): Likewise. * include/gc_inline.h (GC_FAST_MALLOC_GRANS): Use GC_get_oom_fn() instead of GC_oom_fn (to prevent data races). * malloc.c (GC_generic_malloc): Likewise. * mallocx.c (GC_memalign): Likewise. * pthread_support.c (pthread_create): Likewise. * gcj_mlc.c (maybe_finalize): Acquire the lock before setting last_finalized_no value to prevent data races. * include/gc.h (GC_gc_no, GC_get_gc_no, GC_oom_fn, GC_set_oom_fn, GC_set_find_leak, GC_set_finalize_on_demand, GC_set_java_finalization, GC_set_finalizer_notifier, GC_set_dont_expand, GC_set_full_freq, GC_set_non_gc_bytes, GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries, GC_set_dont_precollect, GC_set_time_limit, GC_warn_proc): Refine the comment. * misc.c (GC_set_oom_fn): Likewise. * include/gc.h (GC_general_register_disappearing_link): Refine the comment (replace "soft" word with "weak"). * misc.c (GC_oom_fn, GC_get_gc_no, GC_get_parallel, GC_set_finalizer_notifier, GC_set_find_leak): Add the comment. * misc.c (GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier, GC_get_finalizer_notifier): Use LOCK/UNLOCK to prevent data races. * dbg_mlc.c: Guard include with ifndef MSWINCE; include "private/dbg_mlc.h" before it. * malloc.c: Likewise. * dbg_mlc.c (GC_debug_strdup): Use memcpy() instead of strcpy() for WinCE (since deprecated); evaluate strlen() only once; don't set errno for WinCE. * malloc.c (GC_strdup): Likewise. * dyn_load.c (GC_wnt): Define as macro (FALSE) for WinCE. * include/gc.h (GC_unregister_my_thread): Refine the comment. * include/gc.h (GC_uintptr_t, GC_beginthreadex, GC_endthreadex): Don't declare for WinCE. * include/gc.h (GC_WINMAIN_WINCE_LPTSTR): New macro (WinCE only). * include/gc.h (GC_WinMain): Remove GC_API. * include/gc.h (GC_WinMain): Use GC_WINMAIN_WINCE_LPTSTR for lpCmdLine. * tests/test.c (GC_WinMain): Likewise. * win32_threads.c (main_thread_args, GC_WinMain): Likewise. * include/gc_config_macros.h (ptrdiff_t): Guard with ifndef _PTRDIFF_T_DEFINED; define _PTRDIFF_T_DEFINED macro. * include/private/gc_locks.h: Guard include "atomic_ops.h" with ifdef GC_PTHREADS (and not GC_WIN32_THREADS). * mark.c: Include "atomic_ops.h" if PARALLEL_MARK. * thread_local_alloc.c: Include "atomic_ops.h" if GC_GCJ_SUPPORT. * win32_threads.c: Include "atomic_ops.h" if MPROTECT_VDB. * include/private/gc_locks.h: Use include "atomic_ops.h" instead of include . * include/private/gc_priv.h: Likewise. * include/private/gc_locks.h (GC_allocate_ml, GC_need_to_lock): Don't export (replace GC_API to "extern"). * win32_threads.c (GC_allocate_ml): Don't export. * include/private/gc_priv.h (DebugBreak): Define as macro for WinCE (if not UNDER_CE and DebugBreak is not defined yet). * include/private/gc_priv.h (UNALIGNED): Rename to UNALIGNED_PTRS (since "UNALIGNED" is defined in winnt.h of WinCE). * mark.c (UNALIGNED): Likewise. * include/private/gcconfig.h (ARM32): Recognize _M_ARM and _ARM_. * include/private/gcconfig.h (ALIGNMENT): Check always defined. * include/private/gcconfig.h: Allow GC_WIN32_THREADS for WinCE. * include/private/thread_local_alloc.h: Define USE_WIN32_SPECIFIC for WinCE (since __declspec(thread) is unsupported). * include/private/thread_local_alloc.h (TLS_OUT_OF_INDEXES): Define for WinCE (if undefined). * malloc.c (GC_malloc): Remove outdated comment about disabling signals. * misc.c: Don't include (since not used anymore and may break TEXT() macro defined in winnt.h). * misc.c (GC_init_inner): Don't use GetModuleHandle() and InitializeCriticalSectionAndSpinCount() for WinCE. * misc.c (GC_init_inner): Replace GetModuleHandleA() with GetModuleHandle() (and use TEXT() macro controlled by UNICODE). * misc.c (LOG_FILE): Remove unused macro; don't use _T() macro. * misc.c (GC_CreateLogFile): New static function (Win32/WinCE only); move the code from GC_write(); replace GETENV() with GetEnvironmentVariable(); replace CreateFileA() with CreateFile(); use TEXT() macro (for Unicode support); replace strcat() with memcpy() (since deprecated in WinCE). * misc.c (GC_write): Define as STATIC. * win32_threads.c (GC_attached_thread): Likewise. * misc.c (GC_write): Use GC_CreateLogFile(). * misc.c: Define vsnprintf macro as StringCchVPrintfA for WinCE. * misc.c (GC_abort): Try to invoke MessageBoxA() dynamically (Win32 only) if DONT_USE_USER32_DLL is defined. * misc.c (GC_abort): Duplicate msg to GC log file (for Win32 and WinCE). * misc.c (GC_abort): Use a more user-friendly abort if NO_DEBUGGING (Win32 only). * os_dep.c: Include "atomic_ops.h" only if MPROTECT_VDB (and THREADS). * os_dep.c (detect_GetWriteWatch): Use TEXT() for GetModuleHandle (for Unicode support); check GetModuleHandle() result. * tests/test.c: Don't define assert for WinCE (since may be redefined by "assert.h" included from libatomic_ops). * tests/test.c (FAIL): Define as ABORT for all targets (except for PCR). * tests/test.c (n_tests): Don't use AO_t. * tests/test.c (check_heap_stats): Don't cast n_tests. * tests/test.c (inc_int_counter): New function (for n_tests atomic incrementation). * tests/test.c (run_one_test): Test GC_memalign() for all targets. * tests/test.c (run_one_test): Avoid unbalanced brackets in #if-#else-#endif blocks. * tests/test.c (run_one_test): Replace AO_fetch_and_add1() and private LOCK/UNLOCK with GC_call_with_alloc_lock(inc_int_counter). * tests/test.c (check_heap_stats): Replace "if (sizeof(char *) > 4)" with "#if CPP_WORDSZ == 64" to suppress "unreachable code" compiler warning. * tests/test.c (WinMain): Set cmd type to LPWSTR (for WinCE "UNDER_CE" mode); else use LPSTR type (for Win32 and WinCE). * tests/test.c (thr_window): Replace "L" string prefix with TEXT(). * thread_local_alloc.c: Check THREADS is defined (to prevent other compiler errors and warnings otherwise). * tests/test.c (WinMain): Recognize GC_NO_DLLMAIN macro (for GC_use_DllMain()). * Makefile.direct (GC_NO_DLLMAIN, DONT_IMPORT_GETCURTHREAD): Add the comments for. * win32_threads.c (GC_register_my_thread_inner): Recognize DONT_IMPORT_GETCURTHREAD macro. * win32_threads.c: Recognize GC_NO_DLLMAIN macro (to exclude DllMain support if needed). * win32_threads.c (GC_NO_DLLMAIN): Define implicitly if DllMain thread registration is unsupported for a given configuration. * win32_threads.c (GC_use_DllMain): Update the comment; refine ABORT message. * win32_threads.c (GC_use_DllMain, GC_started_thread_while_stopped, GC_register_my_thread_inner, GC_lookup_thread_inner, GC_delete_gc_thread, GC_allow_register_threads, GC_lookup_pthread, GC_push_thread_structures, GC_stop_world, GC_push_all_stacks): Check for GC_NO_DLLMAIN. * win32_threads.c (GC_Thread_Rep.tm_in_use, GC_attached_thread, DllMain): Don't define if GC_NO_DLLMAIN. * win32_threads.c (GC_stop_world): Declare "i" and "max" local variables only if not GC_NO_DLLMAIN (to suppress compiler warning). * win32_threads.c (GC_mark_thread, start_mark_threads): Use CreateThread() instead of _beginthreadex() for WinCE. * win32_threads.c (MARK_THREAD_STACK_SIZE, WINCE_MAIN_STACK_SIZE): New macros defined (used by start_mark_threads(), WinMain()). * win32_threads.c (GC_thr_init): Exclude parallel-specific code on WinCE for now (since getenv(), GetProcessAffinityMask() and SignalObjectAndWait() are missing on WinCE). * win32_threads.c (GC_thr_init): replace GetModuleHandleA() with GetModuleHandle(); replace CreateEventA() with CreateEvent(); use TEXT() macro (for Unicode support). * include/gc.h (GC_has_static_roots_func): New typedef (user filter callback). * include/gc.h (GC_register_has_static_roots_callback): Use GC_has_static_roots_func type. * dyn_load.c (GC_has_static_roots, GC_register_has_static_roots_callback): Likewise. * dyn_load.c (GC_has_static_roots, GC_register_has_static_roots_callback): Define on all platforms. * dyn_load.c (GC_register_dynlib_callback, GC_register_dynamic_libraries, GC_init_dyld): Replace K&R-style functions definition with the ANSI C one. * dyn_load.c (GC_register_dynlib_callback): Use new local variable "callback" (initialized from GC_has_static_roots) to minimize data races. * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr, GC_cond_add_roots): Define as STATIC. * mark_rts.c (GC_remove_roots_inner): Likewise. * dyn_load.c (GC_dyld_image_add): Don't call GC_add_roots() for sections smaller than pointer size (just to avoid acquiring the lock unnecessarily). * dyn_load.c (GC_dyld_name_for_hdr): Define unconditionally (not only for DARWIN_DEBUG). * dyn_load.c (GC_dyld_image_add): Replace GC_add_roots() call with LOCK + GC_add_roots_inner() + UNLOCK. * dyn_load.c (GC_dyld_image_add): Call GC_has_static_roots() user callback (if set) holding the lock; if it returns 0 then don't call GC_add_roots_inner() for that region. * dyn_load.c (GC_register_has_static_roots_callback): Put "callback" value to GC_has_static_roots on all platforms. * dyn_load.c (GC_has_static_roots): Update the comments. * include/gc.h (GC_exclude_static_roots, GC_add_roots, GC_remove_roots, GC_register_has_static_roots_callback): Likewise. * include/private/gc_priv.h (struct roots): Likewise. * include/private/gc_priv.h (GC_remove_roots_inner): Move prototype to mark_rts.c and declare it as STATIC. * include/private/gc_priv.h (GC_exclude_static_roots_inner): New prototype. * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Use GC_exclude_static_roots_inner() instead of GC_exclude_static_roots. * misc.c (GC_init_inner): Likewise. * mark_rts.c (GC_exclude_static_roots_inner): New function (move all the code from GC_exclude_static_roots(); add the comment. * mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots_inner): add alignment assertion for the lower bound; add assertion for the lower bound to be less than the upper one. * mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots): Adjust the upper bound (round down to be of a pointer-aligned value); return in case of an empty range. * mark_rts.c (GC_exclude_static_roots): Acquire the lock and call GC_exclude_static_roots_inner(). * mark_rts.c (GC_remove_roots): Quickly check the bounds and return in case of a do-nothing case (before acquiring the lock). * finalize.c (GC_fail_count): New external variable declaration. * finalize.c (GC_reset_finalizer_nested, GC_check_finalizer_nested): New function declarations (if THREADS only). * finalize.c (GC_finalizer_nested, GC_finalizer_skipped): New static global variables (used internally by GC_finalize() and GC_check_finalizer_nested()). * finalize.c (GC_check_finalizer_nested): New static function definition (only if not THREADS, used internally by GC_notify_or_invoke_finalizers() to minimize the probability of a deep recursion when a client finalizer tries to allocate GC memory). * finalize.c (GC_finalize): Reset GC_finalizer_nested value (or call GC_reset_finalizer_nested()) if last heap expansion failed. * finalize.c (GC_notify_or_invoke_finalizers): Access GC_gc_no, GC_finalizer_now, GC_finalize_on_demand, GC_finalizer_notifier, last_finalizer_notification variables holding the lock (to avoid data races). * finalize.c (GC_finalizer_notifier): Add comment. * finalize.c (GC_notify_or_invoke_finalizers): Add "quick" check for an empty finalization queue (only if THREADS and not KEEP_BACK_PTRS/MAKE_BACK_GRAPH). * finalize.c (GC_notify_or_invoke_finalizers): Call GC_check_finalizer_nested() and skip GC_invoke_finalizers() call if appropriate. * include/private/pthread_support.h (GC_Thread_Rep): Add unsigned finalizer_nested and finalizer_skipped fields (for internal use by the multi-threaded GC_check_finalizer_nested()). * win32_threads.c (GC_Thread_Rep): Likewise. * pthread_support.c (GC_reset_finalizer_nested, GC_check_finalizer_nested): New function definitions (the multi-threaded variants of that in finalize.c). * win32_threads.c (GC_reset_finalizer_nested, GC_check_finalizer_nested): Likewise. * alloc.c (GC_stopped_mark): Remove GC_log_printf("") (not needed anymore and GCC produces a warning for it). * alloc.c (GC_stopped_mark): Adjust printf argument type specifier. * backgraph.c: Include dbg_mlc.h before ifdef MAKE_BACK_GRAPH (for the case when the configuration information comes from a config.h file). * checksums.c: Likewise. * include/gc_allocator.h (GC_ATTR_UNUSED): Use "__unused__" keyword instead of "unused". * include/gc_allocator.h: Fix typos in comments. * thread_local_alloc.c: Likewise. * include/javaxfc.h (GC_finalize_all): Update comment. * include/private/gc_priv.h (GC_API_PRIV): New macro (defined as GC_API and serves only as a marker for the private but exported symbols used by test.c only). * include/private/gc_priv.h (GC_abort, GC_arrays, GC_is_marked, GC_printf, GC_err_printf, GC_log_printf): Replace GC_API decl with GC_API_PRIV one. * include/private/gc_priv.h (GC_fo_entries): Don't export it outside a DLL. * include/private/gc_priv.h (GC_ATTR_FORMAT_PRINTF): New macro designated to check the arguments correctness of printf-like functions (currently works only for GCC v3+). * include/private/gc_priv.h (GC_printf, GC_err_printf, GC_log_printf): Use GC_ATTR_FORMAT_PRINTF attribute. * dyn_load.c (HAVE_DL_ITERATE_PHDR): Break definition from use. Define for FreeBSD 7.0+. * mach_dep.c: Don't include ucontext.h with NO_GETCONTEXT. * include/gc_gcj.h (GC_init_gcj_malloc): Improve descriptive comment. * allchblk.c (GC_merge_unmapped): Don't assume that adjacent free blocks have different mapping status. Correctly handle gap between blocks. (GC_split_block): Remove dead code setting hb_flags. Add comment. (GC_allochblk): Split blocks also in generational-only mode. * os_dep.c (GC_unmap_gap): Don't really use munmap. * include/private/gc_priv.h (GC_unmapped_bytes): Define as 0 for not USE_MUNMAP case. * Makefile.direct (MARK_BIT_PER_OBJ, PRINT_BLACK_LIST, USE_PROC_FOR_LIBRARIES): Fix typo in the comments. * Makefile.direct (USE_MMAP, USE_MUNMAP, THREAD_LOCAL_ALLOC, PARALLEL_MARK, STATIC): Update the comments. * include/private/gcconfig.h (GC_PREFER_MPROTECT_VDB): New macro recognized (only if MPROTECT_VDB). * Makefile.direct (DONT_USE_USER32_DLL, GC_PREFER_MPROTECT_VDB): Add the comments for. * os_dep.c (detect_GetWriteWatch): Recognize "GC_USE_GETWRITEWATCH" environment variable (only if MPROTECT_VDB, if the variable is unset when GC_PREFER_MPROTECT_VDB macro controls the strategy). * doc/README.environment (GC_USE_GETWRITEWATCH): New variable. * include/private/gcconfig.h (MPROTECT_VDB): Add FIXME for USE_MUNMAP and PARALLEL_MARK cases (to relax the conditions in the future). * misc.c (GC_get_heap_size, GC_get_free_bytes): Ignore the memory space returned to OS (GC_unmapped_bytes). * include/gc.h (GC_get_heap_size, GC_get_free_bytes): Update the comments. * misc.c (GC_get_unmapped_bytes): New API function. * include/gc.h (GC_get_unmapped_bytes): New API prototype. * os_dep.c (GC_dirty_init): Move "ifdef GWW_VDB" block out of "ifdef MSWIN32" one (for Cygwin). * pthread_support.c (GC_allow_register_threads): New API function. * win32_threads.c (GC_allow_register_threads): Likewise. * include/gc.h (GC_allow_register_threads): New API prototype. * include/gc.h (GC_register_my_thread, GC_unregister_my_thread): Update the comments. * pthread_support.c (GC_register_my_thread): Check the collector is in the multi-threaded mode. * win32_threads.c (GC_register_my_thread): Likewise. * finalize.c (GC_finalize_all): Always call GC_invoke_finalizers instead, following Ivan's original patch. * allchblk.c (GC_allochblk_nth): Add assertion. * checksums.c: Add GC_record_fault, GC_was_faulted, CC_n_faulted_dirty_errors. (GC_check_dirty): Remove register declarations, print dirty bit errors on faulted pages. * os_dep.c (GC_write_fault_handler): Call GC_record_fault(). * os_dep.c (GC_remove_protection): Compute index correctly. == [7.2alpha2] 2009-06-12 == * dbg_mlc.c (GC_print_smashed_obj): Convert a group of printf() calls into a single one (for output atomicity). * typd_mlc.c (GC_calloc_explicitly_typed): Don't declare and use GC_finalization_failures variable; check the result of GC_general_register_disappearing_link() (for lack of memory) instead. * finalize.c (GC_finalization_failures): Remove unused global variable. * finalize.c (GC_general_register_disappearing_link, GC_general_register_disappearing_link): Don't update the value of GC_finalization_failures (since unused). * include/private/gc_pmark.h (PUSH_ONE_CHECKED_STACK, GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP): The first parameter is of word type now (as FIXUP_POINTER requires numeric argument). * finalize.c (GC_ignore_self_finalize_mark_proc): GC_PUSH_ONE_HEAP requires the first parameter of word type. * mark.c (PUSH_GRANULE): Likewise. * mark.c (GC_push_one, GC_push_all_eager): Likewise. * finalize.c (GC_finalize_all): Call GC_invoke_finalizers() or GC_finalizer_notifier directly, instead of GC_INVOKE_FINALIZERS() to prevent infinite looping. * include/javaxfc.h: Clarify GC_finalize_all comment. * gcj_mlc.c: Include gc_pmark.h before "ifdef GC_GCJ_SUPPORT" (not after) for configuration information. * gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Add comment. * gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Check "op" local variable for NULL before dereferencing it, return GC_oom_fn() in this case. * typd_mlc.c (GC_malloc_explicitly_typed, GC_malloc_explicitly_typed_ignore_off_page): Transform the code to suppress compiler warning (for uninitialized "lg" variable). * win32_threads.c (GC_unregister_my_thread): add false assertion in unreachable code. * pthread_support.c (GC_inner_start_routine): Don't release the GC lock between GC_register_my_thread_inner() and GC_init_thread_local() calls (post the "registered" even after calling GC_init_thread_local()). * win32_threads.c (GC_register_my_thread, GC_unregister_my_thread): Use GC_lookup_thread_inner() instead of GC_lookup_thread() and acquire the GC lock only once. * win32_threads.c (GC_thr_init): Call GC_register_my_thread_inner() directly instead of GC_register_my_thread() since I_HOLD_LOCK and our (main) thread is not registered yet (add assertion for it). * win32_threads.c (GC_init_parallel): Call GC_lookup_thread_inner() directly instead of GC_lookup_thread() (since I_HOLD_LOCK). * win32_threads.c (GC_lookup_thread): Remove unused function. * win32_threads.c: Remove "#error GC_DLL untested with Cygwin". * win32_threads.c (GC_win32_dll_threads): Define as FALSE macro also if THREAD_LOCAL_ALLOC or GC_PTHREADS. * win32_threads.c (GC_use_DllMain): Call ABORT also if GC_PTHREADS (for Cygwin). * win32_threads.c (GC_push_stack_for): Add parentheses around "&&" (inside GC_ASSERT) to prevent compiler warning. * win32_threads.c (GC_push_all_stacks): Remove FIXME for PARALLEL_MARK. * win32_threads.c (MAX_MARKERS, GC_markers): Move the definitions to a place before GC_get_next_stack(). * win32_threads.c (marker_sp, marker_bsp): New static arrays (same as in pthread_support.c). * win32_threads.c (marker_last_stack_min): New static arrays (the same semantics as for last_stack_min of GC_Thread_Rep). * win32_threads.c (GC_get_next_stack): Handle marker threads. * win32_threads.c (GC_mark_thread): Save the current stack pointer to marker_[b]sp. * win32_threads.c (start_mark_threads): Initialize marker_last_stack_min elements (to "unset" value). * misc.c (GC_set_oom_fn, GC_set_all_interior_pointers, GC_set_finalize_on_demand, GC_set_java_finalization, GC_set_finalizer_notifier, GC_set_dont_expand, GC_set_full_freq, GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries, GC_set_dont_precollect, GC_set_time_limit, GC_set_warn_proc): Change return type to void (these API functions no longer return the old value). * include/gc.h: Likewise. * tests/test.c (main, WinMain, test): Remove explicit cast to void for GC_set_warn_proc(). * misc.c (GC_get_oom_fn, GC_get_all_interior_pointers, GC_get_finalize_on_demand, GC_get_java_finalization, GC_get_finalizer_notifier, GC_get_dont_expand, GC_get_full_freq, GC_get_no_dls, GC_get_free_space_divisor, GC_get_max_retries, GC_get_dont_precollect, GC_get_time_limit, GC_get_warn_proc): New API functions (to get the current value of the corresponding R/W public variables). * include/gc.h: Likewise. * include/gc.h (GC_set_warn_proc, GC_set_free_space_divisor): Update the comment. * misc.c (GC_ignore_warn_proc): New API call-back function. * include/gc.h (GC_ignore_warn_proc): Likewise. * misc.c (GC_set_find_leak, GC_get_find_leak, GC_set_non_gc_bytes, GC_get_non_gc_bytes): New API setter and getter functions (for the public GC_find_leak and GC_non_gc_bytes variables, respectively). * include/gc.h: Likewise. * include/gc.h (GC_memalign): Add proto to GC API. * mallocx.c (GC_memalign): Use GC_API, GC_CALL for the definition. * tests/test.c (run_one_test): Test GC_memalign() on Win32 too, remove GC_memalign() proto. * misc.c (GC_write): Use multi-byte (A) variants of Win32 GetModuleFileName() and CreateFile(). * tests/test.c (main): Replace K&R-style function definition with the ANSI C one. * include/private/gcconfig.h (PLATFORM_ANDROID): New macro recognized (for Linux on ARM32 without glibc). * include/private/gcconfig.h (STRTOULL): Define for all targets (define as "strtoul" for most targets except for LLP64/Win64). * misc.c (GC_init_inner): Use STRTOULL instead of atoi/atol() (cast the result to word type) to decode values of "GC_TRACE", "GC_INITIAL_HEAP_SIZE", "GC_MAXIMUM_HEAP_SIZE" environment variables. * include/gc_allocator.h: Add gc_allocator_ignore_off_page. * tests/test_cpp.cc: Add call to gc_allocator_ignore_off_page. * win32_threads.c (GC_release_mark_lock): Correct misspelling of AO_load in assertion. * win32_threads.c (MAX_THREADS): Define as 1 if GC_win32_dll_threads is defined as FALSE (otherwise the size of dll_thread_table is near 200 KiB for 32-bit). * win32_threads.c (GC_use_DllMain): Optimize for THREAD_LOCAL_ALLOC. * win32_threads.c (GC_Thread_Rep): Add backing_store_end and backing_store_ptr fields for IA64 support. * win32_threads.c (GC_register_my_thread_inner): Set backing_store_end field to reg_base value for IA64 (same as in pthread_support.c). * win32_threads.c (SET_PTHREAD_MAP_CACHE): Put parentheses in the "right" places, remove ';'. * win32_threads.c (GC_fault_handler_lock): Declare only if MPROTECT_VDB (and not WinCE). * win32_threads.c (GC_suspend): Acquire and release GC_fault_handler_lock only if MPROTECT_VDB (and not WinCE). * win32_threads.c (GC_suspend): Define as STATIC. * win32_threads.c (GC_push_stack_for): Fix WARN() format specifier (should be word-compliant, "%p" is used w/o "0x"), don't cast sp. * win32_threads.c (GC_push_all_stacks): Convert a group of printf() calls into a single one (for output atomicity). * win32_threads.c (GC_get_next_stack): Unprotect thread descriptor before altering its last_stack_min ("thread" variable is added). * win32_threads.c (GC_get_next_stack): Remove unnecessary checks for "s" is non-NULL. * win32_threads.c (GC_get_next_stack): Don't call GC_may_be_in_stack if WinCE. * win32_threads.c (GC_get_next_stack): Pass current_min value to GC_get_stack_min as-is (without -1). * win32_threads.c (GC_wait_marker): Remove FIXME and use "release" version of AO_fetch_and_sub1(). * win32_threads.c (GC_win32_start_inner, GC_win32_start): convert int to pointer (and vice versa) thru word type to suppress warnings. * win32_threads.c (GC_mark_mutex_waitcnt): Fix comment, always access atomically. * misc.c: Change GC_THREADS tests back to THREADS. * allchblk.c (GC_print_hblkfreelist, GC_dump_regions): Convert a group of printf() calls into a single one (for output atomicity). * include/gc.h (GC_set_all_interior_pointers, GC_set_full_freq, GC_set_time_limit): New prototypes. * misc.c (GC_set_all_interior_pointers, GC_set_full_freq, GC_set_time_limit): New public setter/getter functions. * include/gc.h: Fix (and remove outdated) comments for thread-local allocation. * include/gc.h: Fix typos in comments. * misc.c (GC_init_inner, GC_printf): Likewise. * include/gc.h (GC_unregister_disappearing_link): Refine comment. * include/gc.h (GC_stack_base): Recognize _M_IA64 macro. * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset, DEGRADE_RATE): Define only if THREADS. * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset): Define as STATIC. * misc.c (GC_get_heap_size, GC_get_free_bytes, GC_get_bytes_since_gc, GC_get_total_bytes): Acquire the GC lock to avoid data races. * misc.c (GC_write_cs): Define only if THREADS (Win32/WinCE only). * misc.c (GC_init_inner): Initialize GC_write_cs only if THREADS. * misc.c (GC_init_inner): Use GC_INITIAL_HEAP_SIZE (if available) to set the default initial value of initial_heap_sz. * misc.c (GC_deinit): Destroy GC_write_cs only if THREADS. * misc.c (GC_init_inner): Fix WARN() format specifier (should be word-compliant, "%p" is used w/o "0x"). * misc.c (GC_init_inner): Don't recognize "GC_PAUSE_TIME_TARGET" environment variable if SMALL_CONFIG. * misc.c (GC_init_inner): Recognize "GC_FULL_FREQUENCY" environment variable to set initial GC_full_freq value (if not SMALL_CONFIG). * doc/README.environment (GC_FULL_FREQUENCY): Add information. * doc/README.environment (GC_MARKERS): Refine information. * misc.c (GC_init_inner): Change GC_ASSERT to GC_STATIC_ASSERT where possible. * misc.c (IF_NEED_TO_LOCK): New macro (instead of GC_need_to_lock). * misc.c (GC_write): Use IF_NEED_TO_LOCK for handling GC_write_cs. * misc.c (GC_abort): Don't define if SMALL_CONFIG. * misc.c (GC_abort): Directly use WRITE() instead of GC_err_printf() (to prevent possible infinite recursion). * finalize.c (finalization_mark_proc): Replace K&R-style declaration with ANSI C one. * finalize.c (GC_grow_table, GC_register_finalizer_inner, GC_enqueue_all_finalizers): Remove outdated comments about disabling signals. * finalize.c (GC_general_register_disappearing_link): Fix assertion to catch NULL "obj" value. * finalize.c (GC_unregister_disappearing_link): Check "link" alignment before gaining the lock. * finalize.c (GC_finalize): Refine comment. * finalize.c (GC_finalize): Fix WARN() format specifier (should be word-compliant, "%p" is used w/o "0x"). * finalize.c (GC_invoke_finalizers): Initialize "bytes_freed_before" variable (to 0) to suppress compiler warning. * include/gc_gcj.h (MARK_DESCR_OFFSET): Move to private/gc_pmark.h. * include/gc_gcj.h: add "extern C" header and tail. * include/private/gc_pmark.h: Remove GC_do_parallel_mark(), GC_help_wanted, GC_helper_count, GC_active_count declarations (move the comments to the place where these symbols are defined in mark.c). * mark.c: Add STATIC GC_do_parallel_mark() declaration (for use by GC_mark_some_inner, if PARALLEL_MARK only). * mark.c (GC_mark_some_inner, GC_help_wanted, GC_helper_count, GC_active_count, GC_do_parallel_mark): Define as STATIC. * pthread_support.c (GC_mark_thread): Likewise. * typd_mlc.c (GC_explicit_typing_initialized, GC_explicit_kind, GC_array_kind, GC_ext_descriptors, GC_ed_size, GC_avail_descr, GC_typed_mark_proc_index, GC_array_mark_proc_index, GC_eobjfreelist, GC_arobjfreelist): Likewise. * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Change GC_ASSERT for HBLKSIZE to GC_STATIC_ASSERT. * mark.c (GC_noop): Define for Borland C the same as for Watcom. * mark.c (GC_noop, GC_mark_and_push): Add ARGSUSED tag. * pthread_support.c (GC_do_blocking_inner): Likewise. * mark.c (GC_mark_from): Initialize "limit" (to 0) in the default switch branch to suppress compiler warning. * mark.c (GC_return_mark_stack): Append new-line to printf message. * mark.c: Remove unused GC_true_func(), GC_PUSH_ALL(). * pthread_support.c (GC_mark_thread): Add dummy "return 0" to suppress compiler warning. * pthread_support.c (start_mark_threads): Move the code limiting "GC_markers" value (and printing a warning) to GC_thr_init(). * pthread_support.c (GC_thr_init): Silently limit "GC_markers" value if based on the number of CPUs. * pthread_support.c (GC_thr_init): Treat incorrect "GC_markers" values as one. * pthread_support.c (GC_register_my_thread_inner): Add a check for "stack_end" is non-NULL (the same as in win32_threads.c). * pthread_support.c (pthread_create): Call GC_oom_fn before giving up with ENOMEM. * thread_local_alloc.c (return_single_freelist): Convert "for" loop to "while" one to suppress "possible extraneous ';'" warning. * darwin_stop_world.c (GC_push_all_stacks): Recognize ARM32. * include/private/gc_priv.h (GC_THREAD_STATE_T): Define for ARM32 (Darwin only). * include/private/gcconfig.h: Add machine-specific part for DARWIN. * include/private/gcconfig.h (ARM32): Define config parameters for DARWIN (iPhone). * alloc.c (GC_FULL_FREQ, GC_DONT_EXPAND, GC_FREE_SPACE_DIVISOR, GC_TIME_LIMIT): New macros (used to control the default initial values of GC_full_freq variable, GC_dont_expand, GC_free_space_divisor, GC_time_limit respectively). * include/private/gc_priv.h (TIME_LIMIT): Remove macro (replaced with GC_TIME_LIMIT in alloc.c). * alloc.c (GC_need_full_gc, GC_stopped_mark, GC_finish_collection): Define as STATIC. * mark_rts.c (GC_push_current_stack, GC_push_gc_structures): Likewise. * include/private/gc_priv.h (GC_stopped_mark, GC_finish_collection): Move the prototypes to alloc.c, make STATIC. * include/private/gc_priv.h (GC_push_current_stack, GC_push_gc_structures, GC_push_regs_and_stack): Remove prototypes (move the comments to the places where these functions are defined). * mach_dep.c (GC_push_regs_and_stack): Move to mark_rts.c and define as STATIC. * alloc.c (GC_timeout_stop_func, GC_stopped_mark, GC_print_heap_sects): Convert a group of printf() calls into a single one (for output atomicity). * mark_rts.c (GC_print_static_roots): Likewise. * alloc.c (GC_stopped_mark): Output blank line (when logging) for convenience to delimit collections. * alloc.c (GC_clear_a_few_frames): Rename NWORDS to CLEAR_NWORDS; make "frames" local variable volatile (to prevent optimization). * alloc.c (GC_try_to_collect_inner, GC_stopped_mark, GC_finish_collection, GC_allocobj): Remove outdated comments about disabling signals. * include/private/gc_priv.h (GC_register_displacement_inner, GC_gcollect_inner): Likewise. * alloc.c (GC_try_to_collect_inner, GC_stopped_mark, GC_finish_collection): Initialize "start_time" local variable (to 0) to suppress compiler warning. * mark_rts.c (GC_add_roots_inner): Likewise. * alloc.c (GC_RATE, MAX_PRIOR_ATTEMPTS): Guard with "ifndef". * include/private/gc_priv.h (clock, GC_stop_world, GC_start_world, GC_acquire_mark_lock, GC_release_mark_lock, GC_notify_all_builder, GC_wait_for_reclaim, GC_notify_all_marker, GC_wait_marker): Replace K&R-style function prototypes with ANSI C one. * include/private/gc_priv.h (ABORT): Define as DebugBreak() for Win32/WinCE if SMALL_CONFIG (the same as in GC_abort()). * include/private/gc_priv.h (ROUNDED_UP_WORDS, abs): Remove unused macros. * include/private/gc_priv.h (GC_noop): Declare for Borland C the same as for Watcom. * mark_rts.c (GC_push_conditional_with_exclusions): Add ARGSUSED tag. * dbg_mlc.c (GC_store_debug_info, GC_store_debug_info_inner): Remove outdated comment about disabling signals. * mallocx.c (GC_malloc_uncollectable, GC_malloc_atomic_uncollectable): Likewise. * os_dep.c: Likewise. * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change): Add ARGSUSED tag. * pthread_stop_world.c (GC_suspend_handler, GC_suspend_handler_inner): Likewise. * dbg_mlc.c (GC_debug_free, GC_debug_realloc): Fix printf message. * dbg_mlc.c (GC_debug_realloc): Set "result" to NULL in the default switch branch to suppress compiler warning. * dyn_load.c (GC_init_dyld): Use ABORT() instead of GC_abort(). * include/private/darwin_semaphore.h (sem_init): Likewise. * include/javaxfc.h: Replace "GC_H" with "_GC_H". * include/private/dbg_mlc.h (GC_has_other_debug_info, GC_store_debug_info): Replace K&R-style function prototypes with ANSI C one. * include/private/gcconfig.h (GC_FreeBSDGetDataStart, real_malloc, GC_win32_get_mem, GC_wince_get_mem, GC_unix_get_mem): Likewise. * include/private/pthread_support.h (GC_stop_init): Likewise. * include/private/gcconfig.h: Refine comment about setting GC_stackbottom. * include/private/gcconfig.h (FIXUP_POINTER): Put parentheses in the "right" places. * include/private/pthread_support.h (GC_Thread_Rep): Refine comment for "stack_end" field. * mallocx.c (GC_malloc_uncollectable, GC_malloc_atomic_uncollectable): Remove cast to undefined "hbklk". * os_dep.c (GC_USE_MEM_TOP_DOWN): New macro (for setting GC_mem_top_down to MEM_TOP_DOWN for debug purposes). * os_dep.c (GC_gww_read_dirty, catch_exception_raise): Fix WARN() format specifier (should be word-compliant, "%p" is used w/o "0x"). * pthread_stop_world.c (GC_suspend_handler_inner): Likewise. * os_dep.c (GC_dirty_init): Append new-line to printf messages. * os_dep.c (GC_mprotect_thread): Fix GC_err_printf message. * os_dep.c (GC_save_callers): Change GC_ASSERT to GC_STATIC_ASSERT. * pthread_stop_world.c (GC_retry_signals, GC_suspend_ack_sem): Define as STATIC. * pthread_stop_world.c (GC_push_all_stacks): Add assertion for that "thread_blocked" is not set for the current thread. * real_malloc.c: Add "extern GC_quiet" to suppress compiler warning. * reclaim.c (GC_reclaim_all): Initialize "start_time" (to 0) to suppress compiler warning. * tests/test.c (check_heap_stats): Avoid unbalanced brackets in ifdef. * win32_threads.c: restructure parallel marking mutex initialization. * win32_threads.c, alloc.c, darwin_stop_world.c, mallocx.c, mark.c, pthread_stop_world.c, pthread_support.c: Add runtime conditions on GC_parallel were appropriate. * pthread_support.c: Condition marker_bsp on ia64. (GC_segment_is_thread_stack): Fix loop upper bound. * reclaim.c: Limit some assertions to PARALLEL_MARK. * pthread_support.c: Don't acquire mark lock for thread-local allocation. * include/private/gc_priv.h: Don't define parallel mark sync support just for THREAD_LOCAL_ALLOC. * include/private/gcconfig.h: refine MINGW32 test. * mark.c: Add win64/gcc tests. * test.c (fork_a_thread, reverse_test, alloc8bytes, tree_test, typed_test, run_one_test, check_heap_stats, main, test): Replace all K&R-style function definitions with ANSI C ones. * trace_test.c (main): Likewise. * test.c (GC_COND_INIT): Define as GC_INIT() also in case of THREAD_LOCAL_ALLOC. * test.c (reverse_test): Call fork_a_thread() only if GC_PTHREADS or GC_WIN32_THREADS; remove fork_a_thread() macros definition. * test.c (reverse_test): Use "volatile" when clearing "b" and "c" local variables (to suppress "assigned value is never used" compiler warning). * test.c (tree_test): Use public GC_noop1() instead of private GC_noop(). * test.c (typed_test): Likewise. * test.c (check_heap_stats): Define and assign value to "late_finalize_count" local variable only if its value is used (if FINALIZE_ON_DEMAND defined). * test.c (main): Remove DJGPP-specific initialization of GC_stackbottom (not needed anymore, handled in gcconfig.h). * trace_test.c: Guard #define GC_DEBUG with #ifndef. * trace_test.c: Include "gc_backptr.h". * trace_test.c (main): Call GC_INIT(). * trace_test.c (main): Add "return 0" statement. * dyn_load.c (GC_register_dynlib_callback): Use new index j instead of i in the inner loop. * tests/test.c: Increment n_tests with fetch_and_add when possible, avoiding need to export lock. * include/gc_pthread_redirects.h: - dlfcn.h is included for dlopen() proto before undefining "dlopen" (so, it's possible now to include dlfcn.h after gc.h from user code); - GC_dlopen() proto is added (except for Darwin as it's missing there); - "dlopen" is explicitly undefined (before its redefinition). * include/gc.h: - "process.h" is included besides "windows.h" (for _beginthreadex/_endthreadex); win32 only. - GC_NO_THREAD_DECLS is moved to the right place (before closing "extern C"). * pthread_support.c: Fix out of memory handling for Thread_Reps. * win32_threads.c: Don't include process.h on winCE, improve out of memory handling for thread structures, don't define GC_beginthreadex and GC_endthreadex for winCE. * tests/test.c: Change gcj vtable decriptor type from size_t to GC_word. * gcj_mlc.c: Add comment. * tests/test.c: Change NTEST to NTHREADS. Fork 5 threads by default. Run reverse_test a second time in each thread.Add comments. Don't rely on AO_fetch_and_add. * dyn_load.c (GC_register_dynlib_callback, GC_register_dynamic_libraries_dl_iterate_phdr): Add support for GNU_PT_RELRO relocations. * Makefile, Makefile.direct: GC_SOLARIS_PTHREADS was replaced by GC_SOLARIS_THREADS. * include/gc.h: Improve finalizer documentation. * mips_sgi_mach_dep.s: Replace _MIPS_SIM_ABI32 with _ABIO32. * pthread_stop_world.c, Makefile.dj: Fix typos. * win32_threads.c (GC_new_thread): Make first_thread visible to the whole file. (UNPROTECT): New macro. (GC_push_stack_for, GC_suspend, GC_start_world): unprotect thread structures before writing. (GC_suspend): Acquire GC_fault_handler_lock before suspending thread. * os_dep.c: export GC_fault_handler_lock. (GC_remove_protection): Check if already unprotected. * doc/README.win32: Add OpenWatcom warning. * include/private/gcconfig.h: Really check it in. * os_dep.c (GC_get_stack_base, windows): Replace with Dave Korn's code from gcc version. * os_dep.c: make gc compilable (optionally) for Cygwin with GetWriteWatch-based virtual dirty bit implementation ("os_dep.c" file). * os_dep.c: Make non-win32 GC_write_fault_handler STATIC. * mark.c (GC_noop): fix declaration definition mismatch for DMC. * include/private/gcconfig.h: Enable MPROTECT_VDB and GWW_VDB for Watcom (Win32 only). It works. * mach_dep.c: Don't use __builtin_unwind_init for register state on PowerPC/Darwin. * doc/gcdescr.html: Improve description of object freelist structure. * include/private/gc_priv.h: Fix comment for _size_map. * os_dep.c (GC_linux_stack_base): Relax sanity test. * include/private/gc_pmark.h (PUSH_CONTENTS_HDR for MARK_BIT_PER_OBJ): Add missing backslash before eoln. * misc.c (GC_set_warn_proc): Implicitly initialize GC on non-Cygwin win32. * configure.ac: Enable thread-local allocation for sparc-linux. * alloc.c (GC_try_to_collect): Remove duplicate initialization check. * malloc.c (GC_generic_malloc): Remove lw to eliminate single- threaded warnings. * mallocx.c (GC_generic_malloc_ignore_off_page): Likewise. * allchblk.c, backgraph.c, dbg_mlc.c, dyn_load.c, finalize.c, include/private/gc_pmark.h, malloc.c, mark.c, os_dep.c, pthread_stop_world.c, pthread_support.c, reclaim.c, thread_local_alloc.c. * misc.c: Refine comment. * os_dep.c: Define GC_GWW_BUF_LEN more intelligently. Add FIXME comment. * win32_threads.c (GC_push_stack_for): Yet another attempt at the stack_min finding logic. Try to clean up the existing code while minimizing VirtualQuery calls. (GC_win32_start_inner): Register thread before GC_printf. Produce more output with DEBUG_THREADS. *include/gc.h: Update obsolete comments. * tests/test.c: (gcj_class_struct2): Use cast instead of l suffix. Cast GetLastError to int in various places. Avoid unused result warning from incr/decr macros. Add cast for fake_gcj_mark_proc. Cast GC_gc_no to unsigned in printf. * include/gc.h: Fix two typos in comments. * finalize.c: Fix typo in comment. * blacklst.c (GC_print_source_pointer): Don't call GC_print_heap_obj with lock. * reclaim.c: (GC_reclaim_block): Scan even nearly full blocks if we are checking for leaks. * win32_threads.c: Remove mark lock spinning. * win32_threads.c, pthread_support.c: Update GC_unlocked_count, GC_spin_count, and GC_block_count using atomic operations. * tests/test.c: Declare n_tests as AO_t only if we have threads. * win32_threads.c: Support PARALLEL_MARK. Make printf arg types agree with format specifiers. Add STATIC for GC_threads. * include/private/gcconfig.h: Add FIXME comment. * tests/test.c (run_ine_test): Replace LOCK/UNLOCK use with AO_fetch_and_add1_full. Declare n_tests as AO_t. (WinMain): Don't call GC_use_DllMain. with PARALLEL_MARK or THREAD_LOCAL_ALLOC. * alloc.c (GC_try_to_collect_inner): Don't print redundant GC_bytes_allocd and GC_gc_no. (GC_stopped_mark): Print average world stop time. * include/private/gc_priv.h (MS_TIME_DIFF): Add cast. * misc.c, doc/README.environment: Add support for GC_FREE_SPACE_DIVISOR and GC-disable-incremental. * include/gc.h: Make GC_set_free_space_divisor correspond to (somewhat unfortunate) reality. (Mostly improves LLP64 support.) * backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c, misc.c, reclaim.c: Changed some int and long type to word or size_t (and vice versa where appropriate) * gcj_mlc.c, include/private/dbg_mlc.h, include/private/gcconfig.h, include/private/thread_local_alloc.h, mark.c, misc.c, thread_local_alloc.c, win32_threads.c: Added intermediate casts to word type when casting from int to pointer (or pointer to int, or data pointer to code pointer) - just to remove the corresponding compiler warning. * ptr_chck.c (GC_is_visible): cast int const to word type to prevent left shift overflow. * os_dep.c: change the type of GC_mem_top_down global variable (containing a flag) to DWORD. * include/gc_config_macros.h: define GC_SOLARIS_THREADS if GC_THREADS is defined on SunOS x86_64. * misc.c (GC_init_size_map): Ifdef out GC_ASSERT as a workaround for VC++ 2008 amd64 (v15.00.21022.08 for x64) compiler bug (the compiler gets hung if invoked with -Ox -D ALL_INTERIOR_POINTERS -D GC_ASSERTIONS) * backgraph.c: cast GC_gc_no value to unsigned short when assigned/compared to height_gc_no field of back_edges. * os_dep.c (GC_remove_protection): Add ARGSUSED. * win32_threads.c (GC_thread_exit_proc): Remove unused local variable. * mark.c (GC_check_dirty): Move declaration out of func body. * doc/gcinterface.html: Improve REDIRECT_MALLOC documentation. * include/gc.h (GC_register_my_thread): Improve comment. * Makefile.direct: Add comment for -DCHECKSUMS. * thread_local_alloc.c, include/private/thread_local_alloc.h: Fix typos in comments. * finalize.c: Declare mark_procs and GC_register_finalizer_inner STATIC. * malloc.c (GC_free): Move size calculation below assertion. * win32_threads.c (GC_get_stack_min, GC_may_be_in_stack): Add one entry VirtualQuery cache, I_HOLD_LOCK assertions. (GC_push_stack_for, GC_get_next_stack) : Hopefully fix WINCE support. * finalize.c (GC_general_register_disappearing_link): Add assertion. * malloc.c (GC_generic_malloc): Round lb to granules, not words. * mallocx.c (GC_generic_malloc_ignore_off_page): Round lb to granules, not words. * mach_dep.c (NO_GETCONTEXT): Define for sparc linux. * configure.ac: Define mach_dep for sparc-linux. * mark_rts.c (GC_approx_sp): Use volatile to avoid common warning. * dyn_load.c (GC_cond_add_roots): Fix GC_get_next_stack argument order. * alloc.c, dbg_mlc.c, dyn_load.c, finalize.c, gcj_mlc.c, include/gc.h, include/gc_config_macros.h, include/gc_cpp.h, include/gc_gcj.h, include/gc_mark.h, include/gc_typed.h, include/javaxfc.h, include/private/gc_locks.h, include/private/gc_priv.h, malloc.c, mallocx.c, mark.c, mark_rts.c, misc.c, obj_map.c, os_dep.c, pthread_support.c, ptr_chck.c, stubborn.c, tests/test.c, thread_local_alloc.c, typd_mlc.c win32_threads.c: Add GC_CALL and GC_CALLBACK macro invocations. * test.c: Remove some old K&R code. * win32_threads.c (GC_may_be_in_stack): New. (GC_Thread_Rep): Add last_stack_min. (GC_push_stack_for): Use last_stack_min. (GC_get_next_stack): Add limit argument, use_last_stack_min. (GC_suspend): make stack_base assignment conditional. * dyn_load.c (win32 GC_cod_add_roots): Pass limit to GC_get_next_stack. * configure_atomic_ops.sh: Remove. * build_atomic_ops.sh, build_atomic_ops.sh.cygwin, doc/README.win32, Makefile.direct: Partially support build directories whose path name contains blanks. * Makefile.am: Support new files (build_atomic_ops.sh, build_atomic_ops.sh.cygwin) * include/private/gc_locks.h, include/private/gc_pmark.h, include/private/gc_priv.h, include/private/gcconfig.h, mach_dep.c, mark_rts.c, misc.c, os_dep.c, pthread_stop_world.c, pthread_support.c, thread_local_alloc.c, typd_mlc.c, win32_threads.c: Fix comments. * pthread_support.c: Comment out LOCK_STATS. * include/gc.h: Fix comments. * misc.c (GC_init_inner): Enable GC_LOG_FILE on Cygwin. * include/private/gcconfig.h: Consider USE_MMAP for Cygwin. * os_dep.c (GC_get_main_stack_base): Use alternate definition with USE_MMAP. * include/private/gc_priv.h: Sometimes define SETJMP on Cygwin. * doc/README: Make it clearer when Makefile.direct is assumed. * cord/cord.am: install include/cord.h. * win32_threads.c (GC_pthread_join, GC_pthread_start_inner): Remove unused variables. * darwin_stop_world.c: Always declare GC_thr_init(). * dbg_mlc.c (GC_debug_free_inner): Don't touch oh_sz if SHORT_DBG_HDRS is defined. * include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET, parallel mark, USE_MARK_BITS version): Refer to correct parameter name. * finalize.c (GC_general_register_disappearing_link): Remove redundant code. * gcj_mlc.c (GC_init_gcj_malloc): Add cast to signed. * os_dep.c: (GC_write_fault_handler): Remove remaining references to deleted variable "code". Remove redundant FREEBSD definitions. * include/private/gcconfig.h (GWW_VDB): Define for X86_64 when defined for X86. (STATIC): Define as "static" with NO_DEBUGGING. * include/private/gc_priv.h: Update MAX_HEAP_SECTS. * dbg_mlc.c (GC_print_smashed_obj): Increase robustness with smashed string, (GC_debug_free_inner): Mark as free. * mallocx.c (GC_malloc_many): Always clear new block if GC_debugging_started. * reclaim.c: Move GC_debugging_started from GC_reclaim_small_nonempty_block() to GC_reclaim_generic(), which is also called directly. * doc/README: Fix spelling error. Update license summary. * include/gc.h (GC_PRE_INCR3, GC_POST_INCR3): add (void **) casts. * tests/test.c: Don't define GC_DEBUG if already defined. * doc/simple_example.html: update --enable-full-debug reference, Make HTML formatting standards compliant. * doc/debugging.html, doc/leak.html: Fix HTML formatting bugs. * doc/gcinterface.html: specify encoding. * doc/simple_example.html: Update thread-local allocation description. * configure.ac: Check for gc-debug earlier; replace remaining full-debug tests. * include/gc.h, ptr_chck.c (GC_pre_incr, GC_post_incr): Use signed offset type. Use ptr_t internally. * doc/gcinterface.html: Update LOCAL_MALLOC description. * doc/README.autoconf, doc/leak.html, doc/README.DGUX386: Fix full-debug reference. * include/gc.h: Rewrite GC_..._INCR and friends. * tests/test.c: Minimally test GC_..._INCR and friends. * mark.c: (GC_push_next_marked, GC_push_next_marked_dirty, GC_push_next_marked_uncollectable): Never invoke GC_push_marked on free hblk. * headers.c: Test COUNT_HDR_CACHE_HITS not USE_HDR_CACHE. (GC_header_cache_miss): Always blacklist pointers for free hblks. Add assertion and comment. * pthread_support.c (GC_register_my_thread): Fix #if indentation. * include/private/gc_hdrs.h: USE_HDR_CACHE is no longer tested. Delete it. * include/private/gc_pmark.h: (PUSH_OBJ): Add assertion. * alloc.c, include/gc_mark.h, Makefile.direct: Improve comments. * configure.ac: Set win32_threads on MinGW. Ivan's description of the patch follows. Note that a few pieces like the GC_malloc(0) patch, were not applied since an alternate had been previously applied. A few differed stylistically from the rest of the code (mostly casts to void * instead of target type), or were classified as too minor to bother. Note that all of Ivan's static declarations which did not correct outright naming bugs (as a few did), where replaced by STATIC, which is ignored by default. - minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for GC_malloc(0)); - addition of missing getter/setter functions for public variables (may be useful if compiled as Win32 DLL); - addition of missing GC_API for some exported functions; - addition of missing "static" declarator for internal functions and variables (where possible); - replacement of all remaining K&R-style definitions with ANSI C ones (__STDC__ macro is not used anymore); - addition of some Win32 macro definitions (that may be missing in the standard headers supplied with a compiler) for GWW_VDB mode; - elimination of most compiler warnings (except for "uninitialized data" warning); - several typos correction; - missing parenthesis addition in macros in some header files of "libatomic_ops" module. My highlights based on reading the patch: * allchblk.c: Remove GC_freehblk_ptr decl. Make free_list_index_of() static. * include/gc.h: Use __int64 on win64, define GC_oom_func, GC_finalizer_notifier_proc, GC_finalizer_notifier_proc, add getter and setters: GC_get_gc_no, GC_get_parallel, GC_set_oom_fn, GC_set_finalize_on_demand, GC_set_java_finalization, GC_set_dont_expand, GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect, GC_set_finalizer_notifier. Always define GC_win32_free_heap. gc_config_macros.h: Define _REENTRANT after processing GC_THREADS. * include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test, handling of operator new[] for old Windows compilers. * include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses around arguments. * dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs. * mark.c (GC_mark_and_push_stack): Fix source argument for blacklist printing. * misc.c: Fix log file naming based on environment variable for Windows. Make GC_set_warn_proc and GC_set_free_space_divisor just return current value with 0 argument. Add DONT_USE_USER32_DLL. Add various getters and setters as in gc.h. * os_dep.c: Remove no longer used GC_disable/enable_signals implementations. (GC_get_stack_base): Add pthread_attr_destroy call. No longer set GC_old_bus_handler in DARWIN workaround. * pthread_support.c: GC_register_my_thread must also call GC_init_thread_local. * Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT. * mach_dep.c: Include signal.h. * gc_priv.h: Factor out INLINE declaration. * include/private/gcconfig.h: Update MIPS/LINUX config. * doc/gcdescr.html: Fix typo. * mach_dep.c (GC_with_callee_saves_pushed): Don't rely on getcontext for MIPS/LINUX. * configure.ac: SPARC fixes. * thread_local_alloc.c(GC_mark_thread_local_fls_for): Include size 0, except for gcj. * doc/gc.man: Expand C++ cautions. * include/gc_inline.h: Fix comments. == [7.1] 2008-05-03 == * doc/gcinterface.html: Improve C++ interface documentation. * allchblk.c (GC_allochblk): Check for overflow during size rounding. * tests/huge_test.c: New. * Makefile.direct, tests/tests.am: Add huge_test.c * pthread_support.c: Fix typo in comment. * os_dep.c (GC_win32_get_mem): Add heap section only if allocation succeeded. * malloc.c: (free replacement) Fix caller address space check. * finalize.c (GC_grow_table): Dereference table in null-check. * win32_threads.c (GC_delete_gc_thread, GC_delete_thread): Consistently call CloseHandle. (GC_suspend): Call GC_delete_gc_thread. * tests/test.c: Don't reference GC_print_stats if not exported. * tests/test.c (run_one_test): Don't mention pthread_self(). * misc.c: Declare GC_thr_init(). * allchblk.c (add_to_fl): disable assertions with USE_MUNMAP, and refine assertions to handle huge unmergable blocks. (GC_allochblk_nth): Add comment. * include/private/gcconfig.h: Add missing FREEBSD macro consistency test. * allchblk.c (GC_enough_large_bytes_left): No longer take parameters; return free list index bound. (GC_merge_unmapped): Don't access nexthdr until after null test. (Fixes bug in 1/29/08 check-in.) (GC_allochblk): Calculate when splitting is allowable only once here, not when considering each block. (GC_allchblk_nth): Accept new may_split parameter. Avoid some redundant tests for exact size matches. * alloc.c (GC_should_collect): Cache min_bytes_allocd. (GC_maybe_gc): Make locking assertion testable. * mark_rts.c: Fix indentation. * pthread_stop_world.c: Replace old GC_err_printf1 reference. * tests/test.c: Remove (void) casts. Optionally print some timing information. * windows-untested/gc.def: Remove CreateThread line. * windows-untested/README: New file. * win32_threads.c (GC_use_DllMain): Force collector initialization. * include/gc.h (GC_use_DllMain): Clarify usage rules in comment. * mark.c (GC_mark_from): Slightly simplify GC_DS_PER_OBJECT code. * include/gc_cpp.h: Add matching placement delete overloads everywhere. * include/private/gc_locks.h (NO_THREAD): Add cast. * include/private/gcconfig.h: Add test for __HP_aCC. * configure.ac, tests/tests.am: Avoid libgccpp on HP/UX. * doc/README.win32: Fix typo. * configure.ac: Fix printing of enable-shared result. * misc.c (GC_init_inner): Assert !GC_need_to_lock only when defined. (GC_call_with_stack_base): Add GC_API. * os_dep.c (GC_get_stack_base): Add GC_API. * win32_threads.c: (GC_register_my_thread, GC_unregister_my_thread): Add GC_API. * include/gc.h: Add GC_API annotations. * include/private/gc_locks.h: Define UNCOND_LOCK etc. also for PCR. * include/private/gc_pmark.h: Fix comments. * include/private/gc_priv.h, mark_rts.c, typd_mlc.c: Add GC_push_typed_structures() to push GC_ext_descriptors. * tests/test.c: Call GC_INIT for DARWIN; test system type using gcconfig.h-defined macros. * allchblk.c (GC_merge_unmapped, GC_freehblk): Refuse to create blocks large enough that their size, when interpreted as a signed value, would be negative. * include/private/gc_priv.h: Comment hb_sz range limit. * mark.c (GC_push_next_marked): correct comment. * Makefile.direct: document NO_PROC_STAT. * include/private/gcconfig.h: Accommodate NO_PROC_STAT. == [7.1alpha2] 2008-01-10 == * Makefile.am: Mention atomic_ops.c and atomic_ops_sysdeps.S again. Refer to build directory as ".". * configure.ac: Ignore --enable-parallel-mark on Darwin for now. * darwin_stop_world.c: Add FIXME comment for parallel marker. * include/private/gc_priv.h: Update MAX_ROOT_SETS and LOG_PHT_ENTRIES to handle larger heaps. * include/gc.h (GC_INIT,GC_init): Update comments. * allchblk.c, alloc.c, include/private/gc_priv.h: Track GC_bytes_dropped and use in GC triggering decisions. * alloc.c (min_bytes_allocd): Weight atomic blocks less. * alloc.c (GC_add_to_heap): Call GC_install_header(p) AFTER adjusting p. * Makefile.am: Add NT_X64_THREADS_MAKEFILE. * NT_X64_STATIC_THREADS_MAKEFILE: Clean up obsolete comment. * alloc.c: Add declaration for GC_add_current_malloc_heap. * win32_threads.c (GC_beginthreadex): Clean up error return code. * doc/README.win64, NT_X64_THREADS_MAKEFILE, Makefile.direct: Add NT_X64_THREADS_MAKEFILE. * alloc.c: Define GC_version instead of in version.h. * version.h: Remove. * include/gc_version.h: Move most of version.h here. * include/gc.h: Include gc_version.h. * gcname.c, add_gc_prefix.c: include gc.h instead of version.h. * Makefile.direct, Makefile.dj, Makefile.am, include/include.am: Adjust for version.h rename. * configure.ac: Put libatomic_ops links in build directory. * Makefile.am: Don't mention atomic_ops.c and atomic_ops_sysdeps.S as nodist sources. * include/gc.h, doc/README.macros: Add GC_NO_THREAD_REDIRECTS, GC_NO_THREAD_DECLS, don't test explicitly for GC_SOLARIS_THREADS. * alloc.c: Deal correctly with address wrapping for GC_greatest_plausible_heap_addr and GC_least_plausible_heap_addr. * finalize.c, include/gc.h (GC_register_disappearing_link, GC_register_finalizer_inner): Improve out-of-memory handling. * include/private/gc_pmark.h: Fix comment spelling. * include/gc_inline.h, include/gc_tiny_fl.h: cleanups to make usable in other contexts. * include/gc.h: Don't define GC_HAVE_BUILTIN_BACKTRACE for uclibc. * gc_cpp.cc: Don't include gc_cpp.h from local directory. * allchblk.c, configure.ac (add --enable-munmap) * dyn_load.c (GC_dyld_image_add): Remove ifdef clause and use the macro GC_GETSECTBYNAME instead. * include/private/gc_priv.h: Define GC_GETSECTBYNAME according to the architecture (Darwin). * reclaim.c (GC_bytes_found): Expand comment. * thread_local_alloc.c (GC_malloc_atomic, GC_gcj_malloc): Pass granules, not bytes, to GC_FAST_MALLOC_GRANS. * include/gc.h: Never include gc_local_alloc.h. * tests/test.c: Add size zero allocation tests. * malloc.c: Update GC_large_allocd_bytes on explicit deallocation. * allchblk.c: Sanity check GC_max_large_allocd_bytes. * Makefile.direct: Invoke $(MAKE) instead of make. * doc/scale.html: Reflect gc7 thread local allocation behavior. * include/extra/gc.h, include/extra/gc_cpp.h: New. * include/include.am: Install gc.h and gc_cpp.h in $(prefix)/include again. * pthread_support.c (GC_thr_init): Use sysconf(_SC_NPROCESSORS_ONLN) for HURD. * include/private/gcconfig.h: Add Linux/mips-64 support. * dbg_mlc.c: Use random() on all glibc systems. * mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext() on HURD. Add comment. * pthread_stop_world.c (GC_suspend_handler, GC_stop_init): Accommodate systems without SA_SIGINFO. * include/gc.h (GC_PTR_STORE): Fix non-DEBUG parentheses. * tests/test.c (run_one_test): Add GC_PTR_STORE test. No longer test for RS6000. * alloc.c, backgraph.c, headers.c, include/private/gc_priv.h: Maintain GC_our_memory and GC_n_memory. * dbg_mlc.c (GC_print_smashed_obj): Improve message. (GC_print_all_smashed_proc): Pass client object address instead of base. * dyn_load.c (sort_heap_sects): New. (GC_register_map_entries): Register sections that are contiguous and merged with our heap. * malloc.c, os_dep.c (GC_text_mapping): Check for just base name of libraries. * malloc.c (calloc): Check for special callers even with USE_PROC_FOR_LIBRARIES. Move assertion. Add rudimentary malloc/free tracing. * misc.c: No longer call GC_init_lib_bounds explicitly. * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Always initialize on demand. * tests/test.c: Call GC_INIT only when required. * Makefile.direct: Remove comment fragment. * tests/tests.am: Add smashtest. * configure.ac: Define GC_USE_DLOPEN_WRAP with redirect-malloc. * pthread_support.c: Fix comment spelling. * include/private/gcconfig.h: Define USE_PROC_FOR_LIBRARIES with GC_LINUX_THREADS and REDIRECT_MALLOC. * tests/smash_test.c: Initial check-in. * obj_map.c: Print log entry to correct file. * include/private/thread_local_alloc.h: Add TlsAlloc error check. * alloc.c (GC_stopped_mark): Call GC_add_current_malloc_heap() while world is still running. * os_dep.c (GC_is_heap_base): Don't call GC_add_current_malloc_heap() with world stopped. * include/gc.h (GC_INIT for cygwin): Always call GC_add_roots. * misc.c (GC_init/GC_init_inner): Perform all work in GC_init_inner. * Makefile.direct: Expand -DUSE_MUNMAP comment. * include/gc.h: Define uintptr_t explicitly for VC++6. * msvc_dbg.c (GetModuleBase): Revert to strcat if strcat_s doesn't exist. == [7.0] 2007-07-02 == * include/gc_config_macros.h: Also check for IA64 when setting GC_HPUX_THREADS. * mallocx.c: Change my_bytes_allocd to signed_word. * include/gc_pthread_redirects.h: Remove obsolete Solaris threads (as opposed to pthreads) support. * mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext() on ARM/Linux. Check getcontext() return value. * backgraph.c (per_object_func): Make argument types consistent. (GC_traverse_back_graph): Mark GC_deepest_obj. * finalize.c (GC_finalize): Change dl_size and fo_size to size_t. * os_dep.c (GC_win32_get_mem): Add GC_mem_top_down option. * doc/README.win32, doc/README, README.QUICK: Fix some of the worst anachronisms. * dyn_load.c: Partially support cygwin, but don't enable it yet. * Makefile.am: Use -no-undefined for libgc. * Makefile.direct: Document USE_PROC_FOR_LIBRARIES. * dyn_load.c (GC_register_map_entries): Rename prot_buf to prot consistently. * misc.c: Fix some WARN calls. Move GC_is_initialized setting and GC_thr_init() call. * os_dep.c: Consistently use WARN where appropriate. * thread_local_alloc.c: Revert change to GC_WIN32_THREADS test. Instead remove inappropriate pthread.h include. * doc/README.linux: Remove some anachronisms. * alloc.c: Also use GC_check_tls on non-Linux systems. * mallocx.c (GC_reclaim_generic): Remove bogus declaration. * include/private/gc_priv.h (GC_reclaim_generic): Declare correctly with prototype. * alloc.c (GC_adj_bytes_allocd): Avoid (long) casts, fix comment. (GC_print_heap_sects): Use size_t instead of unsigned long. * thread_local_alloc.c (GC_lookup_thread): Define in the correct context. * win32_threads.c, include/gc_config_macros.h: The last of Romano Paolo Tenca's patch. Move stdint.h include to gc_config_macros.h. * include/gc_inline.h: Avoid gc_priv.h dependencies. * tests/test.c (check_heap_stats): Replace unsigned long with size_t. * NT_X64_STATIC_THREADS_MAKEFILE: Replace obsolete -debugtype:cv. * mark_rts.c (GC_push_roots): Fix kind type. * doc/README.win64: New file. * doc/doc.am, Makefile.direct: Add README.win64. * Makefile.am, Makefile.direct: Add NT_X64_STATIC_THREADS_MAKEFILE. * NT_X64_STATIC_THREADS_MAKEFILE: Fix warning flags. * allochblk.c, alloc.c, blacklst.c, dbg_mlc.c, dyn_load.c, finalize.c, headers.c, mach_dep.c, malloc.c, mark.c, misc.c, obj_map.c, os_dep.c, ptr_chck.c, reclaim.c, typd_mlc.c, win32_threads.c, cord/de_win.c, include/gc_mark.h, include/private/gc_hdrs.h, include/private/gc_pmark.h, include/private/gc_priv.h, tests/test_cpp.cc: Replace old style function declarations. Clean up integral types. Remove register declarations. The change in malloc.c and the "int descr" declaration in mark.c are the most likely to have been real bugs outside of win64. * msvc_dbg.c: Disable on win64. * win32_threads.c: Add AMD64 support. * include/gc.h: no backtrace on AMD64 for now. * msvc_dbg.c(GetModuleBase): Replace strcat with strcat_s. * include/gc.h: (GC_word, GC_signed_word): Fix win64 definitions. Don't include windows.h in an extern "C" context. * include/private/gcconfig.h: Fix win64/X86_64 configuration. * tests/test.c: Eliminate more old style function definitions. Cleanup pointer and integer casts for win64. * tests/test_cpp.cc: Don't include gc_priv.h. * NT_STATIC_THREADS_MAKEFILE: Restrict suffixes for VC++ 2005. * NT_X64_STATIC_THREADS_MAKEFILE: New. * win32_threads.c: Separate out DEBUG_WIN32_PTHREADS_STACK. Ignore FINISHED threads for suspension. (GC_pthread_join): Add pthread_self() cast. (GC_pthread_start_inner): Execute cleanup handler when popping it. * include/private/gc_locks.h: Inline THREAD_EQUAL for GC_WIN32_PTHREADS. Define USE_PTHREAD_LOCKS only if we have pthreads. * gc_dlopen.c, thread_local_alloc.c, threadlibs.c, win32_threads.c, tests/test.c: Accommodate GC_WIN32_PTHREADS. * include/gc.h: Don't include windows.h for GC_WIN32_PTHREADS. * include/gc_config_macros.h: Define both PTHREADS and GC_WIN32_THREADS. * include/private/gc_locks.h: Nonstandard definitions of NUMERIC_THREAD_ID for GC_WIN32_PTHREADS. * doc/README.win32, Makefile.direct: Include documentation for GC_WIN32_PTHREADS. * Makefile.direct: Remove some anachronisms in the documentation. * Makefile.am: Move includes to bottom. Add better library dependencies. Increment library version. Remove "SUBDIRS += .". * cord/cord.am, tests/tests.am: Add better library dependencies. Remove now unnecessary dependencies. * include/gc.h (GC_beginthreadex, GC_endthreadex, GC_ExitThread): Move to define on all Windows platforms. (_beginthread): define to generate error if used. * include/private/gc_locks.h: Format to 80 columns. * malloc.c(GC_free): Ignore bad frees on MSWIN32 with REDIRECT_MALLOC. * NT_MAKEFILE: msvc_dbg.h is in include/private. Don't use cvars rc. * misc.c (WIN32 GC_write): Define GC_need_to_lock in single-threaded case. * win32_threads.c: Test for __MINGW32__ in addition to _MINGW_VER. (GC_CreateThread, GC_beginthreadex): Deallocate args even if we fail. * include/gc.h: Add GC_reachable_here(). (GC_WinMain): Add GC_API. (GC_beginthreadex, GC_endthreadex, GC_ExitThread): Declare. * tests/test.c: Add GC_reachable_here() call. * alloc.c (GC_try_to_collect): Call GC_init if necessary. * tests/thread_leak_test.c: Don't unconditionally define GC_LINUX_THREADS. * Makefile.am: Remove extra_ldflags_libgc definition. * include/private/gc_priv.h: Define AO_REQUIRE_CAS. * finalize.c (GC_unreachable_finalize_mark_proc): Don't return void value. == [7.0alpha9] 2007-05-15 == * Some gc6.9 changes. * Change FindTopOfStack decl in darwin_stop_world.c. * Move some static tests from misc.c to gcconfig.h. Use #error. * Add GC_print_free_list() function (thanks to Bruce Hoult). * Add GC_GNU_THREADS support on HURD (thanks to Aleksey Demakov, Barry DeFreese, and possibly other Debian maintainers). * __GNUC__ was misspelled as __GNUC in thread_local_alloc.h (thanks to Peter Wang). * Integrated various MacOSX patches and tried to reconcile them (thanks to Allan Hsu, several contributors at Apple, and probably others). * Added some casts to powerpc.h in libatomic_ops to silence warnings. * Makefile.am: Include NT_STSTIC_THREADS_MAKEFILE in dist. * include/private/gc_locks.h: GC_compare_and_exchange, GC_atomic_add: remove. NUMERIC_THREAD_ID, THREAD_EQUAL: New. GC_lock_holder: now unsigned long. I_DONT_HOLD_LOCK, I_HOLD_LOCK: Update. * pthread_stop_world.c, pthread_support.c, win32_threads.c: Use NUMERIC_THREAD_ID, THREAD_EQUAL. * include/private/gcconfig.h: GENERIC_COMPARE_AND_SWAP: Remove. * include/private/thread_local_alloc.h: Don't USE_COMPILER_TLS on ARM. * dbg_mlc.c, include/gc.h, finalize.c: Merge Alexandre Oliva's GC_debug_register_finalizer_unreachable() patch from gcc tree. * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Add assertions to check GC has been initialized. * include/gc_cpp.h: Documentation updates. * include/gc_config_macros.h: Don't check for __ppc__ to set DARWIN_THREADS. * Makefile.am: Include configure_atomic_ops.sh in dist. * Makefile.am: Don't distribute copied atomic_ops files. Include libatomic_ops with "make dist". * configure.ac: Enable THREAD_LOCAL_ALLOC for Cygwin with threads. * win32_threads.c: Report error for Cygwin + GC_DLL. * Makefile.direct: Update THREAD_LOCAL_ALLOC documentation. * cord/de_win.c: Rename and move AboutBox. Call GC_INIT. Remove MakeProcInstance anachronism. * doc/README.macros: Officially remove elif prohibition. Remove documentation for defunct SRC_M3 support. * include/gc.h: Remove more SRC_M3 references. * include/private/gcconfig.h: Remove still more SRC_M3 references. GC_SOLARIS_THREADS no longer needs to be checked separately. * thread_local_alloc.c, include/private/thread_local_alloc.h: Spell __declspec correctly. * NT_STATIC_THREADS_MAKEFILE: Enable thread-local allocation. * doc/README.win32: Adjust GC_win32_dll_threads rules again. * mark.c (GC_mark_some wrapper): Restructure for readability, handle GC_started_thread_while_stopped. * misc.c (Win32 GC_write): Lock GC_write_cs only if needed. * win32_threads.c: (client_has_run): remove, GC_started_thread_while_stopped, GC_attached_thread: add. (GC_push_all_stacks): Add verbose output. (DllMain): Avoid initializing collector or the like. Never update both thread tables. * doc/README.win32: Adjust GC_win32_dll_threads rules. * pthread_stop_world.c (GC_push_all_stacks): Print thread count with GC_PRINT_VERBOSE_STATS. * configure.ac: Comment out redundant AC_DEFINE(NO_EXECUTE_PERMISSION). * sparc_mach_dep.S: Remove single quote in comment. * include/private/gcconfig.h: Fix DATAEND for NONSTOP. * win32_threads.c: Include stdint.h for Mingw. Add GC_API for DllMain. (GC_use_DllMain): Fix assertion. * configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin. * Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc. * include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin targets. Remove comments. Prepare ppc64 support for Darwin. * darwin_stop_world.c (GC_push_all_stacks): Fix compiler warnings. Make i unsigned. (GC_stop_world): Likewise. Remove unused GC_thread p. (GC_start_world): Likewise. * os_dep.c: Define GC_darwin_register_mach_handler_thread extern. Remove double SIG_HNDLR_PTR definition. (GC_forward_exception): Fix compiler warnings, make i unsigned. Initialize thread_state to NULL. (catch_exception_raise): Fix compiler warnings, make i unsigned. * include/private/gc_priv.h (NEED_FIND_LIMIT, FREEBSD variant): also define for X86_64. * configure.ac: Move generic gnu (Hurd) case to below kfreebsd case. * README.changes: Point to ChangeLog. * darwin_stop_world.c: Move THREAD_FLD defines to ... * include/private/gc_priv.h: ... here. Fix THREAD_STATE definitions for ppc64. * os_dep.c (catch_exception_raise): Use THREAD_FLD for exc_state member access. * configure.ac (i586-darwin): Replaced HAS_I386_THREAD_STATE_* with HAS_X86_THREAD_STATE32_*. (x86_64-*-darwin*): Extended the above check for x86_64-*-darwin* with HAS_X86_THREAD_STATE64_*. Added value 1 in the above AC_DEFINE's. Important for the upcoming Leopard. * include/private/gcconfig.h: Modified X86_64 define for Darwin. Removed __x86_64__ check in POWERPC section. Added base definitions for the X86_64 Darwin port. * include/private/gc_priv.h: Added GC_MACH_HEADER and GC_MACH_SECTION to distinguish between 32 and 64-bit applications. Added definitions for X86_64 Darwin. * darwin_stop_world.c: Added HAS_X86_THREAD_STATE64___RAX. And replaced HAS_I386_THREAD_STATE___EAX with HAS_X86_THREAD_STATE32___EAX. (GC_push_all_stacks): Added code for X86_64 Darwin. Even for the !DARWIN_DONT_PARSE_STACK. Maybe obsolete. * dyn_load.c (GC_dyld_name_for_hdr): Use GC_MACH_HEADER. (GC_dyld_image_add): Use GC_MACH_HEADER and GC_MACH_SECTION. Distinguish between getsectbynamefromheader_64 and getsectbynamefromheader. * os_dep.c (catch_exception_raise): Introduce exception definition for X86_64 Darwin. Replaced old i386_EXCEPTION_STATE_* definition with x86_EXCEPTION_STATE32_*. Add X86_64 for exc_state.faultvaddr. == [7.0alpha7] 2006-09-19 == * More 6.7 changes. * Declare GC_dump() in gc.h. * Add --enable-large-config, which just defines the LARGE_CONFIG macro. * Make GlobalAlloc address alignment a bit more intuitive (thanks to Charles Mills). * Use #elif in the definitions of GET_MEM. * Overhaul porting.html. Remove corresponding text from README. * Fix typo in DARWIN section of gcconfig.h. * Fix Darwin thread memory leak (thanks to Bruce Mitchener). * Update x86 AO_test_and_set implementation to use "=q". * Add $(EXEEXT) to many tests in tests/tests.am. (Corresponds to a 6.7 fix, which no longer applied.) * Fix Darwin/PPC port. * Fix Cygwin/threads port. * Fix gcj malloc support. * For GNU-style make, don't build libatomic_ops unless threads are requested. This should allow single-threaded builds on platforms which do not currently support libatomic_ops. * Clean up and hopefully fix the CFLAGS calculation for GNU build. (Substantially improves things on HP/UX.) * Integrated Andrei Polushin's Visual C++ patches. These provide for stack traces, better C++ debug support, and better log file handling. Note that these change the location of the log file to a the path of the executable with a .log extension. To get the old behavior back, define OLD_WIN32_LOG_FILE. For the time being, I'm checking his project files and the like into a windows-untested subdirectory. They are almost certainly already out of date, but better than what we had before. * Fixed some win32 threads bugs, and added support for _beginthreadex. * Fix zero size thread local allocation so that explicit deallocation works correctly. * Removed serious bug in GC_malloc_uncollectable(large size). * Do not try to do thread-local gcj allocation in incremental mode. There are races in setting up the descriptor. * Add GC_INIT() to middle.c, fix some more GC_printfn calls. * Some assertions erroneously used I_HOLD_LOCK() negatively, even though it can now spuriously return TRUE. * Rename SUNOS5 macro and OS name to SOLARIS and SUNOS5DL to SOLARISDL. * On Linux and some Un*x variants, allocate memory by first trying sbrk, and then switching to mmap if that fails. * Fixed /proc/x/maps reading to deal with asynchronous deletions. * Fix REDIRECT_MALLOC with threads on Linux. It now usually seems to work with ugly hacks that include having calloc behave differently when it is called from ld.so or the pthreads library. A reasonable amount of infrastructure was added to support some of this. (Thanks to Roland McGrath for ideas and information.) * Import various updated build scripts. * Add GC_register_has_static_roots_callback (thanks to Andrew Haley). * Fix serious bugs in GC_malloc_atomic_uncollectable(). * Return GC_SUCCESS form GC_get_stack_base(). * Fix several atomic_ops problems on IA64 with HP Compiler. * Update to atomic_ops-1.2. * Fix hb_n_marks description and reclaim.c assertion. * Various additional win32 threads fixes. * Enable GC_ASSERTIONS for Debug build with NT_THREADS_MAKEFILE. == [7.0alpha5] 2005-09-29 == * More 6.6, 6.7 changes. * Some Solaris fixes, including some more general changes in how the assembly pieces of mach_dep.c are handled. * Removed a lot of SOLARIS_THREADS-specific code that was only needed with the old implementation. This included many (mostly no-op) versions of GC_is_fresh. * Don't use atomic_ops in gc_locks.h unless we need threads. * Fixed USE_MARK_BITS, which is once again the default without PARALLEL_MARK. * Removed Solaris GC_INIT hack. It's a workaround for a long dead bug, and it seemed to be wrong anyway. * Changed win32_threads.c to require preprocessor-based interception of thread routines by default. A client call to GC_use_DllMain is now required to get the old behavior in which DllMain is used to implicitly register threads. This was done for uniformity with other platforms, and because the DllMain solution seemed to require very tricky code which, at least in the past, imposed hard bounds on the number of threads. * Many small changes to make thread support work again on Cygwin. * Moved definition of allocator lock etc. to pthread_support.c and win32_threads.c for those two cases. * Got rid of the FASTLOCK() machinery. It doesn't seem useful on modern platforms. * Cleaned up the uncollectible allocation routines, speeding up the slower paths. The code did enough unnecessary work off the critical path that the underlying logic was getting hard to extract. * No longer turn off THREAD_LOCAL_ALLOC with DBG_HDRS_ALL. Indications are it just works, and I think the reasons for it not working disappeared a while ago. * Fixed bugs in hb_n_marks calculation and assertion. * Don't use __builtin_expect for pre-3.0 gcc. * Define GWW_VDB only for recent Microsoft tool chains. * Add overview.html to doc directory. * Fix NT_STATIC_THREADS_MAKEFILE, various compiler warnings. * Made thread local allocation sort of work with Cygwin. The code should be there to deal with other Windows variants, But non-Cygwin Windows threads need more bug fixes. == [7.0alpha4] 2005-08-02 == * Various 6.5, 6.6 changes. * Removed GC_brief_async_signal_safe_sleep and used atomic_ops instead (thanks to Ben Maurer). * Integrated build patches from Davide Angelocola and Petter Urkedal. * Fix dynamic-linker-based pthread call redirection. * Renamed RS6000 to POWERPC/AIX. * Allow recovery from SIGSEGV in marker on Linux. This works around a race in thread stack marking if /proc is used to find roots. We do that by default with malloc redirection and threads. This involved moving some GC_find_limit and SETJMP related declarations to gc_priv.h. * Added doc/porting.html file. * Added ADD_HEAP_GUARD_PAGES for sbrk/*nix platforms to debug extreme memory overwrite errors. * Added trivial NO_INCREMENTAL flag to facilitate debugging. * Added GC_getattr_np-based GC_get_stack_base (untested). * Separated thread local allocation into a separate file and added the beginning of win32 support for that. == [7.0alpha3] 2005-04-28 == * Added support for dlopen-based interception of pthread functions. This is only half done. The gc.h redefinitions currently interfere. * Integrated major automake overhaul from Petter Urkedal. == [7.0alpha2] 2005-04-07 == * GC_bytes_allocd was incremented by a possibly uninitialized variable in GC_generic_malloc_inner. (Bug introduced in gc7.0alpha1. Thanks to Ben Hutchings for tracking it down.) * Win32 fixes (thanks to Ben Hutchings and Maurizio Vairani). * Integrated Ben Hutchings' GetWriteWatch-based virtual dirty bit implementation for win32. * Removed pc_gc.tar and floppy targets in Makefile.direct. Removed pc_excludes file. * No longer include GC_bytes_wasted when evaluating allocation progress. Since we are now counting live memory, it no longer makes sense. * Applied Davide Angelocola's configure patch. There are now separate Makefile.am's in the cord and tests subdirectory, more tests, etc. * Renamed configure.in to configure.ac. * Merged a very small number of Nathanael Nerode's configure.ac cleanups from the gcc tree. Unfortunately, that file is a bit different from ours. * Changed EINTR handling in sem_wait slightly. * Restructure the root marking code. Remove all traces of USE_GENERIC_PUSH_REGS, and effectively make it the default. Make it easier to pass a context pointer to the mark routine, in case we ever want to do precise stack marking. * Replace GC_start_blocking() and GC_end_blocking() with GC_do_blocking(). This remains undocumented, and only implemented for pthreads. But it removes an otherwise unavoidable race with stores of callee-save registers. * Fix GC_n_mark_bits for the default MARK_BIT_PER_GRANULE case. This resulted in bogus complaints in heap dumps. * Upgrade to libatomic_ops-1.0, and update build structure to match. * Remove SRC_M3 support. Clean up lock initialization code in misc.c. * Removed gc_local_alloc.h. If THREAD_LOCAL_ALLOC is defined, the thread local allocation routines are now called automatically. * Renamed gc_inl.h back to gc_inline.h. Changed the interface appreciably since locking has turned into a dominant issue, and in-line allocation only makes sense if it's no worse than thread-local allocation. Gc_inline.h is now also used to implement thread-local allocation. * Finished replacing stubborn allocation with manual write barrier. Untested. * Use thread-local allocation code by default. * Added GC_register_my_thread and friends for Posix and win32. * Patch for GWW_VDB from Ben Hutchings. * Removed explicit THREAD_LOCAL_ALLOC tests, since that now always redefines GC_malloc. * Removed now unused AIX memory allocation code. * Various minor fixes for bugs introduced in 7.0alpha1. == [7.0alpha1] 2004-11-09 == * Remove GC_PROTO, VOLATILE, GC_PTR, and GC_CONST. Assume ANSI C compiler and use ANSI constructs unconditionally. * Introduce #elif and #error in some of the appropriate places. * Remove GC_printf cruft. Use stdargs. * Remove separate Solaris threads support. Use the more generic Posix implementation. * Use atomic_ops for atomic operations and memory barriers. * Clean up MPROTECT_VDB implementation. Use SA_SIGINFO wherever possible. * Remove broken SIGNALS stuff. * Use size_t instead of word, where appropriate. * Add .S.o rule to Makefile.am. * Officially discontinue SunOS4, several old flavors of M68K (SunOS4, A/UX, HP), IBM PC/RTs and RISCOS/Irix4. (I doubt the old code worked. If anyone cares, these should be easy to resurrect.) * Add EXPECT() in some critical places. * Redefined hb_sz and hb_body to deal with bytes rather than words. This affected a great deal of code. I would like to consistently use byte offsets and sizes where there's not a convincing reason to do otherwise. * Redefined several other variables (GC_mem_found, GC_words_allocd) etc. to use units of bytes. Most of these were also renamed to reflect that fact. * Killed as many "register" declarations as possible. * Partially replaced stubborn allocation with manual write barrier. It's currently broken. * Restructured mark code, to allow mark bits to be kept either on a per allocation granule or per object basis. The emphasis is now on the -DUSE_MARK_BYTES option, since individual bits perform quite badly on hyper-threaded P4s, and are probably suboptimal on other architectures. -DUSE_MARK_BITS is currently broken, and may be resurrected only for the single-threaded case. This significantly reduced the cache footprint required by auxiliary GC data structures. It also reduces space overhead for small heaps. It probably slows things down slightly if interior pointers are very common. * As part of the above, we now maintain an approximate count of set mark bits in each heap block. * As part of the above, the semantics of hb_map changed drastically. For MARK_BIT_PER_OBJ, it doesn't exist. For MARK_BIT_PER_GRANULE, it is purely a way to replace a mod instruction with a table lookup. (Somewhat to my surprise, this still wins on modern hardware.) * Removed PRINTSTATS, GATHERSTATS, and SILENT macros. Everything is now controlled by GC_print_stats variable and GC_PRINT_STATS and new GC_PRINT_VERBOSE_STATS environment variables. * Add GC_log_printf and use it consistently for logging output. * Unconditionally count the objects we reclaim in the sweep phase. For thread local allocation, we need that anyway, and we expect that's increasingly the only case that matters. And it simplifies the code. In general expect minor performance hacks that benefit only the single-threaded case to disappear. * Remove GC_quiet from gc.h and elsewhere. * Changed the heap expansion heuristic, and the definition of GC_free_space_divisor, to refer to live data size, instead of total heap size. I believe this is much more robust. It wasn't previously possible, because we didn't have access to live data size. * Thread local allocation added the extra byte in twice: Once in thread_local_alloc, and once in malloc_many. * Removed GC_malloc_words_small and GC_gcj_fast_malloc. A new mechanism based on the thread local allocation data structures is expected to be added instead. This should allow inlined code that is both fast and doesn't rely on collector internals. * Changed both free lists and reclaim lists to be indexed by granules instead of words, norming halving their size. * MERGE_SIZE is now the only option, and the macro was removed. (Without it, we need a memory reference to GC_all_interior_pointers anyway. Thus it costs us nothing.) * Change GC_size_map to map to granules instead of words. Make sure that every possible size up to TINY_FREELISTS is present. * Split of macros need for fast inline allocation into gc_tiny_fl.h in anticipation of a new inline allocator that doesn't rely on GC internals. * Changed thread local allocation to use GRANULE_BYTES and TINY_FREELISTS in anticipation of a merge with the inline allocation code. * Removed ALIGN_DOUBLE. This is mostly handled by GRANULE_BYTES. * Make locking on most platforms conditional on GC_need_to_lock. == [6.9] == * Fix typo in PREFETCH implementation for X86_64 (thanks to Peter Wang). * Fix M68K LINUX port (thanks to Debian packagers). * __GNUC__ was misspelled as __GNUC in new_gc_alloc.h (thanks to Peter Wang). * Integrated Allan Hsu's patch for OS X VM deallocation problems. * Applied FreeBSD/X86_64 patch. == [6.8] 2006-07-08 == * Added some support for Dragonfly BSD (thanks to Joerg Sonnenberger and Thomas Klausner). * Improvements to the HP/UX section of configure.in/configure.ac (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 inspection.) * 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). == [6.7] 2006-03-03 == * 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. * 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__. * 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 McKinlay 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 untested 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. == [6.6] 2005-09-09 == * 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-Ripoll). * 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 problematic 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. == [6.5] 2005-05-22 == * 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 Tommaso Tagliapietra). * 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. == [6.4] 2004-12-21 == * 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. * 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 Ovidius for some further experiments.) * 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 Ovidius). * 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 to 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. == [6.3] 2004-07-08 == * Compile test_cpp.cc with CXXCOMPILE instead of COMPILE. * Very large allocations could cause a collector hang. Correct calculation of GC_collect_at_heapsize. * GC_print_hblkfreelist printed some bogus results if USE_MUNMAP was defined. * Include gc_config_macros.h in threadlibs.c. * Correct MacOSX thread stop code (thanks to Dick Porter). * SMALL_OBJ definition was off by one. This could cause crashes at startup. (Thanks to Zoltan Varga for narrowing this down to a trivial test case.) * Integrate Paolo Molaro's patch to deal with a race in the Darwin thread stopping code. * Changed X86_64 implementation to use SA_SIGINFO in the MPROTECT_VDB implementation. The old approach appears to have been broken by recent kernels. * Added GC_ATTR_UNUSED to eliminate a warning in gc_allocator.h (thanks to Andrew Begel). * Fix GC_task_self declaration in os_dep.c (thanks to Andrew Pinski). * Increase INITIAL_BUF_SZ in os_dep.c for Solaris /proc reads. == [6.3alpha6] 2004-05-06 == * Define USE_GENERIC_PUSH_REGS for NetBSD/M68K. * Fixed the X86_64 PREFETCH macros to correctly handle ia32e (which uses different prefetch instructions from AMD64). (Thanks to H.J. Lu.) * GC_config_macros.h did not correctly define GC_WIN32_THREADS from GC_THREADS. * Added simple_example.html. * Merged Andrew Gray's patch to correctly restore signal handlers on FreeBSD. * Merged a patch from Andreas Jaeger to deal with prefetch-related warnings on x86-64. Added some other casts so that the PREFETCH macros always get a ptr_t argument. Removed some casts in the PREFETCH implementations. * Added a header guard for gc_allocator.h and changed GC_debug_free to clobber contents of deallocated object (suggested by Jesse Jones). * The signal masking code in pthread_stop_world.c contained some errors. In particular SIGSEGV was masked in the handler, in spite of the fact that it wrote to the heap. This could lead to an uncaught SIGSEGV, which apparently became much more likely in Linux 2.6. Also fixed some typos, and reduced code duplication in the same area. * Remove ltconfig, clean up configure messages for DG/UX (thanks to Adrian Bunk for the patches). * Integrated NetBSD/OpenBSD patches from Marc Recht and Matthias Drochner. == [6.3alpha5] 2004-03-30 == * Fix & vs && typo in GC_generic_malloc and GC_generic_malloc_ignore_off_page. (Propagated from the gcc tree.) * Removed SA_NODEFER hack from NetBSD and Solaris write-protect handler. (According to Christian Limpach, the NetBSD problem is fixed. Presumably so is the Solaris 2.3 problem.) * Removed placement delete from gc_cpp.h for the SGI compiler (thanks to Simon Gornall for the patch). * Changed semantics of the GC_IGNORE_FB environment variable, based on experimentation by Nicolas Cannasse pointing out that the old interpretation was useless. We still need help in identifying win32 graphics memory mappings. The current "solution" is a hack. * Removed "MAKEOVERRIDES =" from Makefile.am and thus Makefile.in. It probably made more sense in the gcc context. * Explicitly ensure that NEED_FIND_LIMIT is defined for {Open,Net}BSD/ELF. * Replaced USE_HPUX_TLS macro by USE_COMPILER_TLS, since gcc often supports the same extension on various platforms. * Added some basic (completely untested) defines for win64, in support of future work. * Declared GC_jmp_buf in os_dep.s as JMP_BUF instead of jmp_buf, fixing a memory overwrite bug on Solaris and perhaps other platforms. * Added 0 != __libc_stack_end test to GC_linux_stack_base (thanks to Jakub Jelinek for the patch and explaining the problem). Otherwise pre-linking could cause the collector to fail. * Changed default thread local storage implementation to USE_PTHREAD_SPECIFIC for HP/UX with gcc. The compiler-based implementation appears to work only with the vendor compiler. * Export GC_debug_header_size and GC_USR_PTR_FROM_BASE from gc_mark.h, making client mark code cleaner and less dependent on GC version. * Export several new procedures and GC_generic_malloc from gc_mark.h to support user-defined kinds. Use the new procedures to replace existing code in gcj_mlc.c and typd_mlc.c. * Added support for GC_BACKTRACES. * Fixed a remaining problem in CORD_str with signed characters (thanks to Alexandr Petrosian for the patch). * Removed supposedly redundant, but very buggy, definitions of finalizer macros from javaxfc.h. Fortunately this file probably has no users. The correct declarations were already in gc.h. * Also need to set GC_in_thread_creation while waiting for GC during thread termination, since it is also possible to collect from an unregistered thread in that case. * Define NO_GETENV for Windows CE, since getenv doesn't appear to exist. Plus some other minor WinCE fixes (thanks to Alain Novak). * Added GC_register_describe_type_fn. * Arrange for debugging finalizer registration to ignore non-heap registrations, since the regular version of the routine also behaves that way. * GC_gcj_malloc and friends need to check for finalizers waiting to be run. One of the more obscure allocation routines with missing a LOCK() call. * Fixed cvtres invocations in NT_MAKEFILE and NT_STATIC_THREADS_MAKEFILE to work with VS.NET. * Cleaned up GC_INIT calls in test. Updated gc.man to encourage GC_INIT use in portable code. * Taught the GC to use libunwind if --enable-full-debug is specified on IA64 and libunwind is present. * The USE_MUNMAP code could get confused about the age of a block and prematurely unmap it. GC_unmap_old had a bug related to wrapping of GC_gc_no. GC_freehblk and GC_merge_unmapped didn't maintain hb_last_reclaimed reasonably when blocks were merged. The code was fixed to reflect original intent, but that may not always be an improvement. == [6.3alpha4] 2004-01-01 == * USE_MMAP was broken by confusion in the code dealing with USE_MMAP_ANON. * Darwin support was broken in alpha3 as a result of my mis-integration of Andrew Begel's patches. Fixed with another patch from Andrew Begel. * A new sanity check in pthread_stop_world.c:GC_push_all_stacks() was overly aggressive. We may collect from an unregistered thread during thread creation. Fixed by explicitly checking for that case. (Added GC_in_thread_creation.) == [6.3alpha3] 2003-12-20 == * Removed -DSMALL_CONFIG from BCC_MAKEFILE. * Changed macros to test for an ARM processor (Patch from Richard Earnshaw.) * Mostly applied a DJGPP patch from Doug Kaufman. Especially Makefile.dj had suffered from serious bit rot. * Rewrote GC_apply_to_maps, eliminating an off-by-one subscript error, and a call to alloca (for lcc compatibility). * Changed USE_MUNMAP behavior on POSIX platforms to immediately remap the memory with PROT_NONE instead of unmapping it. The latter risks an intervening mmap grabbing the address space out from underneath us. Updated this code to reflect a cleaner patch from Ulrich Drepper. * Replaced _T with _Tp in new_gc_alloc.h to avoid a MACOS X conflict. (Patch from Andrew Begel.) * Dynamically choose whether or not lock should spin on win32 (thanks to Maurizio Vairani for the patch). This may be a significant performance improvement for win32. * Fix Makefile.direct to actually include NT_STATIC_THREADS_MAKEFILE in the distribution (thanks to Maurizio Vairani). * Maybe_install_looping_handler() was accidentally exported, violating our name space convention. * Made os_dep.c use sigsetjmp and SA_NODEFER for NetBSD. (Thanks to Christian Limpach. I generalized the patch to use sigsetjmp on all UNIX_LIKE platforms, admittedly a slightly risky move. But it may avoid similar problems on some other platforms. I also cleaned up the definition of UNIX_LIKE a bit.) * Integrated Andrew Begel's Darwin threads patch, adjusted according to some of Fergus Hendersons's comments. (Patch didn't apply cleanly, errors are possible.) * Added another test or two for the Intel 8.0 compiler to avoid confusing it with gcc. The single-threaded collector should now build with icc, at least on ia64. == [6.3alpha2] 2003-11-04 == * Re-enabled I_HOLD_LOCK assertion in aix_irix_threads.h. * Put back the WINABI qualifier for GC_CreateThread. (Thanks to Danny Smith for the patch. 6.3alpha1 had the qualifier in one place but not elsewhere, which was clearly wrong.) * Sometimes explicitly define __private_extern__ before DARWIN dyld.h include. (Thanks to Andreas Tobler for posting the patch.) * Included signal.h from pthread_support.c. Removed GC_looping_handler, which was dead code. * GC_find_start was misdeclared by gc_pmark.h if PRINT_BLACK_LIST was defined (thanks to Glauco Masotti for testing and reporting this). Changed GC_find_start to never just return 0. According to its comment it doesn't, and it's unclear that's correct. * GC_alloc_large had several largely compensating bugs in the computation of GC_words_wasted. (It was confused about bytes vs. words in two places.) * Integrated Slava Sysoltsev's patch to support more recent versions of the Intel compiler on IA64/Linux. * Changed win32 spinlock initialization to conditionally set a spin count. (Emmanual Stumpf pointed out that enabling this makes a large performance difference on win32 multiprocessors.) Also cleaned up the win32 spinlock initialization code a bit. * Fixed thread support for HP/UX/IA64. The register backing store base for the main thread was sometimes not set correctly. (Thanks to Laurent Morichetti.) * Added -DEMPTY_GETENV_RESULTS flag to work around Wine problem. * Declare GC_stack_alloc and GC_stack_free in solaris_threads.h to avoid 64-bit size mismatches (thanks to Bernie Solomon). * Fixed GC_generic_push_regs to avoid a potential and very unfortunate tail call optimization. This could lead to prematurely reclaimed objects on configurations that used the generic routine and the new build infrastructure (which potentially optimizes mach_dep.c). This was a serious bug, but it's unclear whether it has resulted in any real failures. * Fixed CORD_str to deal with signed characters (thanks to Alexandr Petrosian for noticing the problem and supplying the patch). * Merged a couple of NOSYS/ECOS tests into os_dep.c from gcj (thanks to Anthony Green). * Partially merged a win32 patch from Ben Hutchings, and substantially revised other parts of win32_threads.c. It had several problems. Under MinGW with a statically linked library, the main thread was not registered. Cygwin detached threads leaked thread descriptors. There were several race conditions. For now, unfortunately the static threads limit remains, though we increased it, and made table traversal cost depend on the actual thread count. There is also still some code duplication with pthread_support.c. (Thread descriptors did become much smaller, since Ben Hutchings removed the thread context from them.) * Integrated a Solaris configure.in patch from Rainer Orth. * Added GC_IGNORE_FB and associated warning to very partially address the issue of the collector treating a mapped frame buffer as part of the root set. (Thanks to David Peroutka for providing some insight. More would be helpful. Is there anything that can be used to at least partially identify such memory segments?) == [6.3alpha1] 2003-07-26 == * Integrated some NetBSD patches by Marc Recht. These were already in the NetBSD package. * GC_pthread_create waited for the semaphore even if pthread_create failed. (Thanks to Dick Porter for the pthread_support.c patch.) Applied the analogous fix for aix_irix_threads.c. * Added Rainer Orth's Tru64 fixes. * The check for exceeding the thread table size in win32 threadDetach was incorrect (thanks to Alexandr Petrosian for the patch). * Applied Andrew Begel's patch to correct some reentrancy issues with dynamic loading on Darwin. * GC_CreateThread() was neglecting to duplicate the thread handle in the table (thanks to Tum Nguyen for the patch). * Pass +ESdbgasm only on PA-RISC machines with vendor compiler (thanks to Roger Sayle for the patch). * Applied more AIX threads patches from Scott Ananian. == [6.2] 2003-06-21 == * Integrated a second round of Irix/AIX patches from Dan Bonachea. Renamed mips_sgi_mach_dep.S back to mips_sgi_mach_dep.s, since it requires the Irix assembler to do the C preprocessing; gcc -E doesn't work. * Fixed Makefile.direct for DARWIN (thanks to Manuel Serrano). * There was a race between GC_pthread_detach and thread exit that could result in a thread structure being deallocated by GC_pthread_detach even though it was still needed by the thread exit code (thanks to Dick Porter for the small test case that allowed this to be debugged). * Fixed version parsing for non-alpha versions in acinclude.m4 and version checking in version.h. * Issues identified (not yet fixed): - 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. - Very large root set sizes (> 16 MB or so) could cause the collector to abort with an unexpected mark stack overflow. (Thanks 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. == [6.2alpha6] 2003-06-05 == * There was an extra underscore in the name of GC_save_registers_in_stack for NetBSD/SPARC (thanks to Jaap Boender for the patch). * Integrated Brian Alliet's patch for Darwin. This restructured the linuxthreads/pthreads support to separate generic pthreads support from more the system-dependent thread-stopping code. I believe this should make it easier to eliminate the code duplication between pthreads platforms in the future. The patch included some other code cleanups. * Integrated Dan Bonachea's patch to support AIX threads. This required substantial manual integration, mostly due to conflicts with other recent threads changes. It may take another iteration to get it to work. * Removed HPUX/PA-RISC support from aix_irix_threads.c. It wasn't used anyway and it cluttered up the code. And anything we can do to migrate towards generic pthreads support is a good thing. * Added a more explicit test for tracing of function arguments to test.c. * Added Akira Tagoh's PowerPC64 patch. * Fixed some bit rot in the Cygwin port (thanks to Dan Bonachea for pointing it out). gc.h now includes just windows.h, not winbase.h. * Declared GC_save_regs_in_stack() in gc_priv.h. Remove other declarations. * Changed --enable-cplusplus to use automake consistently. The old way confused libtool. "Make install" didn't work correctly for the old version. Previously --enable-cplusplus was broken on cygwin. * Changed the C version of GC_push_regs to fail at compile time if it is generated with an empty body. This seems to have been the cause of one or two subtle failures on unusual platforms. Those failures should now occur at build time and be easily fixable. == [6.2alpha5] 2003-05-14 == * GC_invoke_finalizers could, under rare conditions, set GC_finalizer_mem_freed to an essentially random value. This could possibly cause unbounded heap growth for long-running applications under some conditions. (The bug was introduced in 6.1alpha5, and is not in gcc3.3.) * Attempted to sanitize the various DLL macros. GC_USE_DLL disappeared. GC_DLL is used instead. All internal tests are now on GC_DLL. README.macros is now more precise about the intended meaning. * Include DllMain in the multi-threaded win32 version only if the collector is actually built as a dll (thanks to Mohan Embar for a version of the patch). * Hide the cygwin threadAttach/Detach functions. They were violating our namespace rules. * Fixed an assertion in GC_check_heap_proc. Added GC_STATIC_ASSERT (thanks again to Ben Hutchings). * Removed some obsolete definitions for Linux/PowerPC in gcconfig.h. * CORD_cat was not rebalancing unbalanced trees in some cases, violating a CORD invariant. Also tweaked the re-balancing rule for CORD_cat_char_star. (Thanks to Alexandr Petrosian for the bug report and patch.) * Added hand-coded structured exception handling support to mark.c. This should enable support of dynamic libraries under win32 with gcc-compiled code. (Thanks to Ranjit Mathew for the patch.) Turned on dynamic library scanning for win32/gcc. * Removed some remnants of read wrapping (thanks to Kenneth Schalk). GC_USE_LD_WRAP was probably broken in recent versions. * The build could fail on some platforms since gcconfig.h could include declarations mentioning ptr_t, which was not defined, e.g. when if_mach was built (thanks to Yann Dirson for pointing this out). Also cleaned up tests for GC_PRIVATE_H in gcconfig.h a bit. * The GC_LOOP_ON_ABORT environment variable interfered with incremental collection, since the write fault handler was erroneously overridden. Handlers are now set up in the correct order. * It used to be possible to call GC_mark_thread_local_free_lists() while the world was not stopped during an incremental GC. This was not safe. Fortunately, it was also unnecessary. Added GC_world_stopped flag to avoid it. (This caused occasional crashes in GC_set_fl_marks with thread local allocation and incremental GC. This probably happened primarily on old, slow multiprocessors.) * Allowed overriding of MAX_THREADS in win32_threads.c from the build command line (thanks to Yannis Bres for the patch). * Taught the IA64/linux code to determine the register backing store base from /proc/self/maps after checking the __libc symbol, but before guessing. (__libc symbols are on the endangered list, and the guess is likely to not always be right for 2.6 kernels.) Restructured the code to read and parse /proc/self/maps so it only exists in one place (all platforms). * The -DUSE_PROC_FOR_LIBRARIES code was broken on Linux. It claimed that it also registered the main data segment, but didn't actually do so. (I don't think anyone actually uses this configuration, but ...) * Made another attempt to get --enablecplusplus to do the right thing. Since there are unavoidable problems with C programs linking against a dynamic library that includes C++ code, I separated out the c++ code into libgccpp. == [6.2alpha4] 2003-03-10 == * Use LINUX_STACKBOTTOM for >= glibc2.2 on Linux/MIPS. (See Debian bug # 177204) * Integrated Jeff Sturm and Jesse Rosenstock's MACOSX threads patches. * Integrated Grzegorz Jakacki's substantial GNU build patch. "Make dist" should now work for the GNU build process. Documentation files are installed under share/gc. * Tweaked gc_cpp.h to again support the Borland compiler (thanks to Rene Girard for pointing out the problems). * Updated BCC_MAKEFILE (thanks to Rene Girard). * Added GC_ASSERT check for minimum thread stack size. * Added --enable-gc-assertions. * Added some web documentation to the distribution. Updated it in the process. * Separate gc_conf_macros.h from gc.h. * Added generic GC_THREADS client-defined macro to set the appropriate GC_XXX_THREADS internal macro. (gc_config_macros.h.) * Add debugging versions of _ignore_off_page allocation primitives. * Moved declarations of GC_make_closure and GC_debug_invoke_finalizer from gc.h to gc_priv.h. * Reset GC_fail_count even if only a small allocation succeeds. * Integrated Brian Alliet's patch for dynamic library support on Darwin. * gc_cpp.h's gc_cleanup destructor called GC_REGISTER_FINALIZER_IGNORE_SELF when it should have called the lower case version, since it was explicitly computing a base pointer. == [6.2alpha3] 2003-01-30 == * Don't include execinfo.h in os_dep.c when it's not needed, and may not exist. == [6.2alpha2] == * Fixed the completely broken FreeBSD code in 6.2alpha1 (thanks to Hironori Sakamoto for the patch). * Changed IRIX reference in dbg_mlc.c to IRIX5 (thanks to Marcus Herbert). * Attempted to work around the problems with .S filenames and the SGI compiler. (Untested.) * Worked around an HP/UX make issue with the GNU-style build process. * Fixed the --enable-cplusplus build machinery to allow builds without a C++ compiler. (That was always the intent ...) * Changed the debugging allocation macros to explicitly pass the return address for Linux and XXXBSD on hardware for which we can't get stack traces. Use __builtin_return_address(0) to generate it when possible. Some of the configuration work was cleaned up (good) and moved to gc.h (bad, but necessary). This should make leak detection more useful on a number of platforms. (Thanks to Fabian Thylman for the suggestion.) * Fixed compilation problems in dbg_mlc.c with GC_ADD_CALLER. * Bumped revision number for dynamic library. == [6.2alpha1] 2003-01-23 == * Guard the test for GC_DUMP_REGULARLY in misc.c with "#ifndef NO_DEBUGGING". Otherwise it fails to build with NO_DEBUGGING defined. (Thanks to Manuel Serrano.) * Message about retrying suspend signals was incorrectly generated even when flag was not set. * Cleaned up MACOSX/NEXT root registration code. There was apparently a separate ifdef case in GC_register_data_segments() for no reason. * Removed MPROTECT_VDB for MACOSX port, based on one negative report. * Arrange for gc.h and friends to be correctly installed with GNU-style "make install". * Enable the GNU-style build facility include C++ support in the library with --enable-cplusplus (thanks to Thomas Maier for some of the patch). * Mark from GC_thread_key in linux_threads.c, in case that's allocated from the garbage collected heap, as it is with our own thread-specific storage implementation (thanks to Jeff Sturm). * Mark all free list header blocks if they are heap allocated. This avoids some unnecessary tracing. And it remains correct if we clear the root set. (Thanks to Jeff Sturm for identifying the bug.) * Improved S390/Linux support. Add S390/Linux 64-bit support (thanks to Ulrich Weigand). * Corrected the spelling of GC_{M,C}ALLOC_EXPLICTLY_TYPED to GC_{M,C}ALLOC_EXPLICITLY_TYPED in gc_typed.h. This is technically an interface change. Based on the fact that nobody reported this, I suspect/hope there were no clients. * Cleaned up gc_typed.h so that (1) it adds an extern "C" declaration when appropriate, (2) doesn't generate references to undefined internal macros, and (3) allows easier manual construction of descriptors. * Close the file descriptor used by GC_print_address_map(). * Set the "close-on-exec" bit for various file descriptors maintained for the collector's internal use. * Added a hack to find memory segments owned by the system allocator under win32. Based on my tests, this tends to eventually find all segments, though it may take a while. There appear to be cleaner, but slower solutions under NT/XP. But they rely on an API that's unsupported under 9X. * Changed Linux PowerPC stack finding to LINUX_STACKBOTTOM. (Thanks to Akira Tagoh for pointing out that HEURISTIC1 does not work on 64-bit kernels.) * Added GC_set_free_space_divisor to avoid some Windows dll issues. * Added FIXUP_POINTER, POINTER_SHIFT, POINTER_MASK to allow preprocessing of candidate pointers for tagging, etc. * Always lock around GC_notify_full_gc(). Simplified code for invoking GC_notify_full_gc(). * Changed the way DATASTART is defined on FreeBSD to be robust against an unmapped page after etext. (Thanks to Hironori Sakamoto for tracking down the intermittent failure.) * Made GC_enable() and GC_disable() official. Deprecated direct update of GC_dont_gc. Changed GC_gcollect to be a noop when garbage collection is disabled. * Call GC_register_dynamic_libraries before stopping the world on Linux, in order to avoid a potential deadlock due to the dl_iterate_phdr lock. * Introduced a more general mechanism for platform-dependent code to decide whether the main data segment should be handled separately from dynamic libraries, or registered by GC_register_dynamic_libraries. The latter is more reliable and easier on Linux with dl_iterate_phdr. == [6.1] == * Added GC_MAXIMUM_HEAP_SIZE environment variable. * Fix configure.in for MIPS/LINUX (thanks to H.J. Lu). * Double page hash table size for -DLARGE_CONFIG. * Integrated Bo Thorsen's X86-64 support. * STACKBOTTOM definition for LINUX/MIPS was partially changed back (thanks to H.J. Lu and Hiroshi Kawashima for resolving this). * Replaced all occurrences of LINUX_DATA_START in gcconfig.h with SEARCH_FOR_DATA_START. It doesn't hurt to fall back to a search. And __data_start doesn't seem to get defined correctly of the GC library is loaded with LD_PRELOAD, e.g. for leak detection. * If the GC_find_leak environment variable is set, do a atexit(GC_gcollect) to give us at least one chance to detect leaks. This may report some very benign leaks, but ... * Addeded REDIRECT_FREE. It's necessary if we want leak detection with LD_PRELOAD. * Defer printing of leaked objects, as for smashed objects. * Fixed process and descriptor leak in GC_print_callers. Try for line number even if we got function name.) * Ported parallel GC support and thread local allocation to Alpha. Not yet well-tested. * Added GC_DUMP_REGULARLY and added finalization statistics to GC_dump(). * Fixed Makefile.am to mention alpha_mach_dep.S instead of the defunct alpha_mach_dep.s. * Incorporated a change to new_gc_alloc.h, which should make it work with gcc3.1. * Use alpha_mach_dep.S only on Linux. (It's not clear that this is optimal, but it otherwise didn't build on Tru64. Thanks to Fergus Henderson.) * Added ifdef to guard free() in os_dep.c. Otherwise we get a compilation error on Irix (thanks to Dai Sato). * Added an experimental version of GC_memalign to mallocx.c. This can't always work, since we don't handle alignment requests in the hblk-level allocator, and we can't handle arbitrary pointer displacements unless GC_all_interior_pointers is enabled. But it should work for alignment requests up to HBLKSIZE. This is not yet documented in the standard places. * Finally debugged the OSF1/Tru64 thread support. This needs more testing, since I needed to add a somewhat unconvincing workaround for signal delivery issues that I don't yet completely understand. But it does pass my tests, even in parallel GC mode. Incremental GC support is disabled if thread support is enabled, due to the signal issues. * Eliminated name-space-incorrect definition of _cdecl from gc_cpp.h. * Added GC_debug_malloc_replacement and GC_debug_realloc_replacement declarations to gc.h. On IA64, this is required for REDIRECT_MALLOC to work correctly with these. * Fixed Linux USE_PROC_FOR_LIBRARIES to work with a 64-bit /proc format. == [6.1alpha5] 2002-06-19 == * Added GC_finalizer_mem_freed, and changed some of the code that decided on heap expansion to look at it. Memory explicitly deallocated by finalizers essentially needs to be counted as reclaimed by the GC. Otherwise there are cases in which the heap can grow infinitely. (Thanks to Mark Reichert for the test case.) * Integrated Adam Megacz patches to not scan dynamic libraries if we are compiling with gcc on win32. Otherwise we need structured exception handling to deal with asynchronously unmapped root segments, and gcc doesn't directly support that. * Integrated Anthony Green's patch to support Wine. * GC_OPERATOR_NEW_ARRAY was misspelled OPERATOR_NEW_ARRAY in several places, including gc_cpp.cc (thanks to Wink Saville for pointing this out). * Integrated Loren J. Rittle's Alpha FreeBSD patches. These also changed the declarations of symbols like _end on many platforms to that they wouldn't mistakenly be declared as short data symbols (suggested by Richard Henderson). * Integrated changes from the Debian distribution (thanks to Ryan Murray for pointing these out). Fix C++ comments in POWERPC port. Add ARM32 incremental GC support. Get rid of USE_GENERIC_PUSH_REGS for alpha/Linux, this time for real. Use va_copy to get rid of cord printf problems (finally). * Close file descriptor used to count CPUs (thanks to Jeff Sturm for pointing out the omission). * Don't just drop gcj free lists in GC_start_reclaim, since that can eventually cause the marker to see a bogus mark descriptor in the dropped objects. The usual symptom was a very intermittent segmentation fault in the marker. This mattered only if one of the GC_gcj_malloc variants was used (thanks to Michael Smith, Jeff Sturm, Bryce McKinlay and Tom Tromey for helping to track this down). * Fixed Linux and Solaris/64 SPARC configuration (thanks to David Miller, Jeff Sturm, Tom Tromey, and Christian Joensson). * Fixed a typo in strdup definition (thanks to Gerard A Allan). * Changed Makefile.direct to invoke $(CC) to assemble alpha_mach_dep.S. This is needed on Linux. I'm not sure whether it's better or worse on Tru64. * Changed gc_cpp.h once more to declare operator new and friends only in a Microsoft environment. This may need further fine tuning (thanks to Johannes Schmidt for pointing out that the older code breaks on gcc3.0.4). * Don't ever override strdup if it's already macro defined (thanks to Adnan Ali for pointing out the problem). * Changed gc_cpp.h yet again to also overload placement new. Due to the C++ overloading rules, the other overloaded new operations otherwise hide placement new, which causes many STL uses to break (thanks to Reza Shahidi for reporting this, and to Matt Austern for proposing a fix). * Integrated cygwin pthreads support from Dan Bonachea. * Turn on DYNAMIC_LOADING for NetBSD (thanks to Krister Walfridsson). * Changed printing code to print more complete GC times. * Applied Mark Mitchell's Irix patch to correct some bit rot. * Clarified which object-printing routines in dbg_mlc.c should hold the allocation lock. Restructured the code to allow reasonable object printing with -DREDIRECT_MALLOC. * Fix the Linux mmap code to always start with 0x1000 as the initial hint. Minor patches for 64-bit AIX, particularly to STACKBOTTOM (thanks to Jeffrey Mark Siskind). * Renamed "SUSPENDED" flag for Solaris threads support to avoid a conflict with a system header (thanks to Philip Brown). * Cause win32_threads.c to handle an out of range stack pointer correctly, though currently with a warning. (Thanks to Jonathan Clark for observing that win32 applications may temporarily use the stack pointer for other purposes, and suggesting a fix. Unfortunately, it's not clear that there is a complete solution to this problem.) == [6.1alpha4] 2002-06-16 == * Fixed typo in sparc_mach_dep.S, preventing the 64-bit version from building. Increased 64-bit heap size limit in test.c slightly, since a functional SPARC collector seems to slightly exceed the old limits. * Use NPRGREG in solaris_threads.c, thus printing all registers if things go wrong. * Added GC_MARKERS environment variable to allow use of a single marker thread on an MP without confusing the lock implementation. * Collect much less aggressively in incremental mode with GC_TIME_UNLIMITED. This is really a purely generational mode, and we can afford to postpone the collection until the heap is (nearly) full. * Remove read() wrapper for MPROTECT_VDB. It was causing more harm than good. It is often no longer needed if system calls avoid writing to pointerful heap objects. * Fix MACOSX test in gcconfig.h (thanks to John Clements). * Change GC_test_and_set so that it consistently has one argument. Add spaces to ::: in powerpc assembly code in gc_locks.h (thanks to Ryan Murray). * Fixed a formatting error in dbg_mlc.c. Added prototype to GC_abort() declaration (thanks to Michael Smith). * Removed "source" argument to GC_find_start(). Eliminate GC_FIND_START(). * Added win32 recognition code in configure.in. Changed some of the dllimport/export defines in gc.h (thanks to Adam Megacz). * GC_malloc_many didn't set hb_last_reclaimed when it called GC_reclaim_generic. (I'm not sure this matters much, but ...) * Allocating uncollectible objects with debug information sometimes allocated objects that were one byte too small, since uncollectible objects don't have the extra byte added at the end (thanks to Wink Saville for pointing this out). * Added a bit more assertion checking to make sure that gcj objects on free lists never have a nonzero second word. * Replaced BCC_MAKEFILE with an up-to-date one (thanks to Andre Leiradella). * Upgraded libtool, configure.in and some related files to hopefully support NetBSD/SPARC (thanks to Adrian Bunk). Unfortunately, libtool 1.4.2 seemed to be buggy due to missing quotes in several "test" invocations. Fixed those in the ltmain.sh script. * Some win32-specific patches, including the introduction of GC_CreateThread (thanks to Adam Megacz). * Merged in gcj changes from Anthony Green to support embedded systems. * Tried to consistently rename preprocessed assembly files with a capital .S extension. * Use alpha_mach_dep.S on ALPHA again. It doesn't really matter, but this makes our distribution consistent with the gcc one, avoiding future merge problems. * Move GET_MEM definition into gcconfig.h. Include gcconfig.h slightly later in gc_priv.h to avoid forward references to ptr_t. * Add some testing of local allocation to test.c. * Change definition of INVALID_QTID in specific.h. The -1 value was used inconsistently, and too likely to collide with a valid stack address. Some general clean-up of specific.[ch]. Added assertions. (Thanks to Michael Smith for tracking down an intermittent bug to this general area. I'm not sure it has been squashed yet, however.) * On Pthread systems it was not safe to call GC_malloc() between fork() and exec(). According to the applicable standards, it doesn't appear to be safe to call malloc() or many other libc functions either, thus it's not clear this is fixable. Added experimental support for -DHANDLE_FORK in linux_threads.c which tries to support it. It may succeed if libc does the right thing. I'm not sure whether it does. (Thanks to Kenneth Schalk for pointing out this issue.) * Documented thread local allocation primitives to require an explicit GC_init call. GC_init_parallel is no longer declared to be a constructor function, since that isn't portable and often seems to lead to initialization order problems. * Changed gc_cpp.cc and gc_cpp.h in one more attempt to make them compatible with Visual C++ 6 (thanks to Wink Saville for the patch). * Some more patches for Linux on HP PA-RISC. * Added include/gc_allocator.h. It implements (hopefully) standard conforming (as opposed to SGI-style) allocators that allocate collectible (gc_allocator) or GC-traceable, but not collectible (traceable_allocator) objects. This borrows heavily from libstc++, which borrows heavily from the SGI implementation, this part of which was written by Matt Austern. Changed test_cpp.cc to very minimally test this. * On Linux/X86, retry mmap with a different start argument. That should allow the collector to use more (closer to 3GB) of the address space. * Force 64 bit alignment with GCJ support (reflects Bryce McKinlay's patch to the gcc tree). * Refined the choice of sa_handler vs. sa_sigaction in GC_dirty_init to accommodate some glibc5 systems (thanks to Dan Fandrich for the patch). * Compensated for the fact that current versions of glibc set __libc_stack_end incorrectly on Linux/IA64 while initialization code is running. This could cause the collector to miss 16 bytes of the memory stack if GC_malloc or friends where called before main(). * Mostly integrated Takis Psarogiannakopoulos' port to DG/UX Inix 86. This will probably take another iteration to work, since his patch conflicted with the libtool upgrade. * Added README.arm.cross containing some information about cross- compiling to an ARM processor from Margaret Fleck (original code provided by Bradley D. LaRonde; edited by Andrej Cedilnik using some of solutions by Tilman Vogel; also ported for iPAQ by Oliver Kurth). == [6.1alpha3] 2002-02-07 == * Minor cleanup on the gcconfig.h section for SPARC. * Minor fix to support Intel compiler for I386/Linux (thanks to Sven Hartrumpf). * Added SPARC V9 (64-bit) support (thanks to Jeff Sturm). * Restructured the way in which we determine whether or not to keep call stacks for debug allocation. By default SAVE_CALL_COUNT is now zero on all platforms. Added SAVE_CALL_NARGS parameters. If possible, use execinfo.h to capture call stack. (This should add support for a number of new platforms, though often at considerable runtime expense.) * Try to print symbolic information for call stacks. On Linux, we do this with a combination of execinfo.h and running addr2line in a separate process. This is both much more expensive and much more useful. Amazingly, it seems to be fast enough for most purposes. * Redefined strdup if -DREDIRECT_MALLOC is given. * Changed incremental collector and MPROTECT_VDB implementation so that, under favorable conditions, pointer-free objects are not protected. Added GC_incremental_protection_needs() to determine ahead of time whether pointer-free objects may be protected. Replaced GC_write_hint() with GC_remove_protection(). * Added test for GC_ENABLE_INCREMENTAL environment variable. * Made GC_time_limit runtime configurable. Added GC_PAUSE_TIME_TARGET environment variable. * Eliminated GC_page_sz, a duplicate of GC_page_size. * Caused the Solaris and Irix thread creation primitives to call GC_init_inner(). == [6.1alpha2] 2001-12-20 == * No longer wrap read by default in multi-threaded applications. It was pointed out on the libgcj list that this holds the allocation lock for way too long if the read blocks. For now, reads into the heap are broken with incremental collection. It's possible to turn this back on if you make sure that read calls don't block (e.g. by calling select first). * Fix ifdef in Solaris_threads.h to refer to GC_SOLARIS_THREADS. * Added check for environment variable GC_IGNORE_GCJ_INFO. * Added printing of stop-the-world GC times if GC_PRINT_STATS environment variable is set. * The calloc definition in leak_detector.h was missing parentheses, and realloc was missing a second argument to GC_REALLOC (thanks to Elvenlord Elrond). * Added GC_PRINT_BACK_HEIGHT environment variable and associated code, mostly in the new file backgraph.c. See doc/README.environment. * Added -DUSE_GLOBAL_ALLOC to work around a Windows NT issue (thanks to Jonathan Clark). * Integrated port to NEC EWS4800 (MIPS-based workstation, with somewhat different address-space layout). This may help for other machines with holes in the data segment. (Thanks to Hironori Sakamoto.) * Changed the order in which GC_push_roots and friends push things onto the mark stack. GC_push_all calls need to come first, since we can't necessarily recover if those overflow the mark stack. (Thanks to Matthew Flatt for tracking down the problem.) * Some minor cleanups to mostly support the Intel compiler on Linux/IA64. == [6.1alpha1] 2001-09-22 == * Non-debug, atomic allocations could result in bogus smashed object reports with debugging on (thanks to Patrick Doyle for the small test case). * Fixed GC_get_register_stack_base (Itanium only) to work around a glibc 2.2.4 bug. * Initial port to HP/UX on Itanium. Thread support and both 32 and 64 bit ABIs appear to work. Parallel mark support doesn't yet, due to some inline assembly code issues. Thread local allocation does appear to work. * ifdef'ed out glibc2.1/Itanium workaround. I suspect nobody is using that combination anymore. * Added a patch to make new_gc_alloc.h usable with gcc3.0 (thanks to Dimitris Vyzovitis for the patch). * Debugged 64-bit support on HP/UX PA-RISC. * Turned on dynamic loading support for FreeBSD/ELF (thanks to Peter Housel). * Unregistering of finalizers with debugging allocation was broken (thanks to Jani Kajala for the test case). * Old finalizers were not returned correctly from GC_debug_register_finalizer. * Disabled MPROTECT_VDB for Linux/M68K based on a report that it doesn't work. * Cleaned up some statistics gathering code in reclaim.c (thanks to Walter Bright). * Added some support for OpenBSD/ELF/Linux (thanks to Suzuki Toshiya). * Added Jakub Jelinek's patch to use dl_iterate_phdr for dynamic library traversal to dyn_load.c. Changed it to weakly reference dl_iterate_phdr, so that the old code is still used with old versions of glibc. * Cleaned up feature test macros for various threads packages and integrated (partially functional) FreeBSD threads code from Loren J. Rittle. It's likely that the cleanup broke something, since it touched lots of code. It's also likely that it fixed some unreported bugs in the less common thread implementations, since some of the original code didn't stand up to close scrutiny. Support for the next pthreads implementation should be easier to add. == [6.0] 2001-07-26 == * Two more bug fixes for KEEP_BACK_PTRS and DBG_HDRS_ALL. * Fixed a stack clearing problem that resulted in SIGILL with a misaligned stack pointer for multi-threaded SPARC builds. * Integrated another HURD patch (thanks to Igor Khavkine). == [6.0alpha9] == * added README.macros. * Made gc.mak a symbolic link to work around winzip's tendency to ignore hard links. * Simplified the setting of NEED_FIND_LIMIT in os_dep.c, possibly breaking it on untested platforms. * Integrated initial GNU HURD port (thanks to Chris Lingard and Igor Khavkine). * A few more fixes for Digital Mars compiler (by Walter Bright). * Fixed gcc version recognition. Renamed OPERATOR_NEW_ARRAY to GC_OPERATOR_NEW_ARRAY. Changed GC_OPERATOR_NEW_ARRAY to be the default. It can be overridden with -DGC_NO_OPERATOR_NEW_ARRAY (thanks to Cesar Eduardo Barros). * Changed the byte size to free-list mapping in thread local allocation so that size 0 allocations are handled correctly. * Fixed Linux/MIPS stackbottom for new toolchain (thanks to Ryan Murray). * Changed finalization registration to invoke GC_oom_fn when it runs out of memory. * Removed lvalue cast in finalize.c. This caused some debug configurations not to build with some non-gcc compilers. == [6.0alpha8] 2001-06-15 == * Changed GC_debug_malloc_replacement and GC_debug_realloc_replacement so that they compile under Irix (thanks to Dave Love). * Updated powerpc_macosx_mach_dep.s so that it works if the collector is in a dynamic library (thanks to Andrew Begel). * Transformed README.debugging into debugging.html, updating and expanding it in the process. Added gcdescr.html and tree.html from the web site to the GC distribution. * Fixed several problems related to PRINT_BLACK_LIST. This involved restructuring some of the marker macros. * Fixed some problems with the sizing of objects with debug information. Finalization was broken KEEP_BACK_PTRS or PRINT_BLACK_LIST. Reduced the object size with SHORT_DEBUG_HDRS by another word. * The "Needed to allocate blacklisted ..." warning had inadvertently been turned off by default, due to a buggy test in allchblk.c. Turned it back on. * Removed the marker macros to deal with 2 pointers in interleaved fashion. They were messy and the performance improvement seemed minimal. We'll leave such scheduling issues to the compiler. * Changed Linux/PowerPC test to also check for __powerpc__ in response to a discussion on the gcc mailing list. * Removed the "static" from the jmp_buf declaration in GC_generic_push_regs (suggested by Matthew Flatt). This was causing problems in systems that register all of their own roots. It looks far more correct to me without the "static" anyway. * Fixed several problems with thread local allocation of pointer-free or typed objects. The collector was reclaiming thread-local free lists, since it wasn't following the link fields. * There was apparently a long-standing race condition related to multi-threaded incremental collection. A collection could be started and a thread stopped between the memory unprotect system call and the setting of the corresponding dirt bit. I believe this did not affect Solaris or PCR, which use a different dirty-bit implementation. Fixed this by installing signal handlers with sigaction instead of signal, and disabling the thread suspend signal while in the write-protect handler. (It is unclear whether this scenario ever actually occurred.) * Incremental collection did not cooperate correctly with the PARALLEL_MARK implementation of GC_malloc_many or the local_malloc primitives. It still doesn't work well, but it shouldn't lose memory anymore. * Integrated some changes from the gcc source tree that I had previously missed (thanks to Bryce McKinlay for the reminder and patch). * Added Makefile.direct as a copy of the default Makefile, which would normally be overwritten if configure is run. * Changed the gc.tar target in Makefile.direct to embed the version number in the gc directory name. This will affect future tar file distributions. * Changed the Irix dynamic library finding code to no longer try to eliminate writable text segments under Irix6.x, since that is probably no longer necessary, and can apparently be unsafe on occasion (thanks to Shiro Kawai for pointing this out). * GC_cleanup with GC_DEBUG enabled passed a real object base address to GC_debug_register_finalizer_ignore_self, which expected a pointer past the debug header. Call GC_register_finalizer_ignore_self instead, even with debugging enabled (thanks to Jean-Daniel Fekete for catching this). * The collector didn't build with call chain saving enabled but NARGS=0. * Fixed up the GNU-style build files enough so that they work in some obvious cases (thanks to Maarten Thibaut). * Added initial port to Digital Mars compiler for win32 (thanks to Walter Bright). == [6.0alpha7] 2001-04-19 == * Added GC_finalizer_notifier. Fixed GC_finalize_on_demand. (The variable actually wasn't being tested at the right points. The build-time flag was.) * Added Tom Tromey's S390 Linux patch. * Added code to push GC_finalize_now in GC_push_finalizer_structures (thanks to Matthew Flatt). * Added GC_push_gc_structures() to push all GC internal roots. * Integrated some FreeBSD changes from Matthew Flatt. * It looks like USRSTACK is not always correctly defined under Solaris. Hacked gcconfig.h to attempt to work around the problem. The result is not well tested. (Thanks again to Matthew Flatt for pointing this out.) * Added Ji-Yong Chung's win32 threads and C++ fixes. * Arranged for hpux_test_and_clear.s to no longer be needed or built. It was causing build problems with gas, and it's not clear this is better than the pthreads alternative on this platform. * Some MINGW32 fixes from Hubert Garavel. * Added initial Hitachi SH4 port from Kaz Kojima. * Ported thread-local allocation and parallel mark code to HP/UX on PA_RISC. * Made include/gc_mark.h more public and separated out the really private pieces. This is probably still not quite sufficient for clients that want to supply their own kind of type information. But it's a start. This involved lots of identifier renaming to make it namespace clean. * Added GC_dont_precollect for clients that need complete control over the root set. * GC_is_visible didn't do the right thing with gcj objects. (Not that many people are likely to care, but ...) * Don't redefine read with GC_USE_LD_WRAP. * Initial port to LINUX/HP_PA. Incremental collection and threads are not yet supported. (Incremental collection should work if you have the right kernel. Threads may work with a sufficiently patched pthread library.) * Changed gcconfig.h to recognize __i386__ as an alternative to i386 in many places (thanks to Benjamin Lerman). * Made win32_threads.c more tolerant of detaching a thread that it didn't know about (thanks to Paul Nash). * Added Makefile.am and configure.in from gcc to the distribution, with minimal changes. For the moment, those are just placeholders. In the future, we're planning to switch to a GNU-style build environment for Un*x-like systems, though the old Makefile will remain as a backup. * Turned off STUBBORN_ALLOC by default, and added it back as a Makefile option. * Redistributed some functions between malloc.c and mallocx.c, so that simple statically linked apps no longer pull in mallocx.o. * Changed large object allocation to clear the first and last few words of each block before releasing the lock. Otherwise the marker could see objects with nonsensical type descriptors. * Fixed a couple of subtle problems that could result in not recognizing interior pointers from the stack. (I believe these were introduced in 6.0alpha6.) * GC_debug_free_inner called GC_free, which tried to reacquire the allocator lock, and hence deadlocked. (DBG_HDRS_ALL probably never worked with threads.) * Fixed several problems with back traces. Accidental references to a free list could cause the free list pointer to be overwritten by a back pointer. There seemed to be some problems with the encoding of root and finalizer references. == [6.0alpha6] == * Changed the definition of DATASTART on ALPHA and IA64, where data_start and __data_start are not defined by earlier versions of glibc. This might need to be fixed on other platforms as well. * Changed the way the stack base and backing store base are found on IA64. This should now remain reliable on future kernels. But since it relies on /proc, it will no longer work in the simulated NUE environment. * Made the call to random() in dbg_mlc.c with -DKEEP_BACK_PTRS dependent on the OS. On non-Unix systems, rand() should be used instead. Handled small RAND_MAX (thanks to Peter Ross for pointing this out). * Fixed the cord make rules to create the cord subdirectory, if necessary (thanks to Doug Moen). * Changed fo_object_size calculation in finalize.c. Turned finalization of non-heap object into a no-op. Removed anachronism from GC_size() implementation. * Changed GC_push_dirty call in solaris_threads.c to GC_push_selected. It was missed in a previous renaming (thanks to Vladimir Tsichevski for pointing this out). * Arranged to not mask SIGABRT in linux_threads.c (thanks to Bryce McKinlay). * Added GC_no_dls hook for applications that want to register their own roots. * Integrated Kjetil Matheussen's Amiga changes. * Added FREEBSD_STACKBOTTOM. Changed the X86/FreeBSD port to use it (thanks to Matthew Flatt). * Added pthread_detach interception for platforms supported by linux_threads.c and irix_threads.c. * Changed the USE_MMAP code to check for the case in which we got the high end of the address space, i.e. mem_ptr + mem_sz == 0. It appears that this can happen under Solaris 7. It seems to be allowed by what I would claim is an oversight in the mmap specification. (Thanks to Toshio Endo for pointing out the problem.) * Cleanup of linux_threads.c. Some code was originally cloned from irix_threads.c and now unnecessary. Some comments were obviously wrong. * (Mostly) fixed a longstanding problem with setting of dirty bits from a signal handler. In the presence of threads, dirty bits could get lost, since the getting of a bit in the bit vector was not atomic with respect to other updates. The fix is 100% correct only for platforms for which GC_test_and_set is defined. The goal is to make that all platforms with thread support. Matters only if incremental GC and threads are both enabled. * made GC_all_interior_pointers (a.k.a. ALL_INTERIOR_POINTERS) an initialization time, instead of build-time option. This is a nontrivial, high risk change. It should slow down the code measurably only if MERGE_SIZES is not defined, which is a very nonstandard configuration. * Added doc/README.environment, and implemented what it describes. This allows a number of additional configuration options to be set through the environment. It documents a few previously undocumented options. * Integrated Eric Benson's leak testing improvements. * Removed the option to throw away the beginning of each page (DISCARD_WORDS). This became less and less useful as processors enforce stricter alignment. And it hadn't been tested in ages, and was thus probably broken anyway. == [6.0alpha5] == * Changed the definition of GC_pause in linux_threads.c to use a volatile asm. Some versions of gcc apparently optimize away writes to local volatile variables. This caused poor locking behavior starting at about 4 processors. * Added GC_start_blocking(), GC_end_blocking() calls and wrapper for sleep to linux_threads.c. The first two calls could be used to generally avoid sending GC signals to blocked threads, avoiding both premature wakeups and unnecessary overhead. * Fixed a serious bug in thread-local allocation. At thread termination, GC_free could get called on small integers. Changed the code for thread termination to more efficiently return left-over free-lists. * Integrated Kjetil Matheussen's BeOS support. * Rearranged the directory structure to create the doc and tests subdirectories. * Sort of integrated Eric Benson's patch for OSF1. This provided basic OSF1 thread support by suitably extending hpux_irix_threads.c. Based on earlier email conversations with David Butenhof, I suspect that it will be more reliable in the long run to base this on linux_threads.c instead. Thus I attempted to patch up linux_threads.c based on Eric's code. The result is almost certainly broken, but hopefully close enough that someone with access to a machine can pick it up. * Integrated lots of minor changes from the NetBSD distribution. (These were supplied by David Brownlee. I'm not sure about the original authors.) * Hacked a bit more on the HP/UX thread-support in linux_threads.c. It now appears to work in the absence of incremental collection. Renamed hpux_irix_threads.c back to irix_threads.c, and removed the attempt to support HPUX there. * Changed gc.h to define _REENTRANT in cases in which it should already have been defined. It is still safer to also define it on the command line. == [6.0alpha4] == * Moved up the detection of mostly full blocks to the initiation of the sweep phase. This eliminates some lock contention in the PARALLEL_MARK case, as multiple threads try to look at mostly full blocks concurrently. * Restored the code in GC_malloc_many that grabs a prefix of the global free list. This avoids the case in which every GC_malloc_many call tries and fails to allocate a new heap block, and the returns a single object from the global free list. * Some minor fixes in new_hblk.c. (Attempted to build free lists in order of increasing addresses instead of decreasing addresses for cache performance reasons. But this seems to be only a very minor gain with -DEAGER_SWEEP, and a loss in other cases. So the change was backed out.) * Fixed some of the documentation (thanks in large part to Fergus Henderson). * Fixed the Linux USE_PROC_FOR_LIBRARIES code to deal with apps that perform large numbers of mmaps (thanks to Eric Benson). Also fixed that code to deal with short reads. * Added GC_get_total_bytes(). * Fixed leak detection mode to avoid spurious messages under linuxthreads. (This should also now be easy for the other supported threads packages. But the code is tricky enough that I'm hesitant to do it without being able to test. Everything allocated in the GC thread support itself should be explicitly deallocated.) * Made it possible (with luck) to redirect malloc to GC_local_malloc. == [6.0alpha3] 2000-09-26 == * Fixed the /proc/self/maps code to not seek, since that apparently is not reliable across all interesting kernels. * Fixed some compilation problems in the absence of PARALLEL_MARK (introduced in alpha2). * Fixed an algorithmic problem with PARALLEL_MARK. If work needs to be given back to the main mark "stack", the BOTTOM entries of the local stack should be given away, not the top ones. This has substantial performance impact, especially for > 2 processors, from what I can tell. * Extracted gc_lock.h from gc_priv.h. This should eventually make it a bit easier to avoid including gc_priv.h in clients. * Moved all include files to include/ and removed duplicate links to the same file. The old scheme was a bad idea because it was too easy to get the copies out of sync, and many systems don't support hard links. Unfortunately, it's likely that I broke some of the non-Unix Makefiles in the process, although I tried to update them appropriately. * Removed the partial support for a copied nursery. It's not clear that this would be a tremendous win, since we don't consistently lose to generational copying collectors. And it would significantly complicate many things. May be reintroduced if/when it really turns out to win. * Removed references to IRIX_JDK_THREADS, since I believe there never were and never will be any clients. * Added some code to linux_threads.c to possibly support HPUX threads using the Linux code. Unfortunately, it doesn't work yet, and is currently disabled. * Added support under Linux/X86 for saving the call chain, both in (debug) objects for client debugging, and in GC_arrays._last_stack for GC debugging. This was previously supported only under Solaris. It is not enabled by default under X86, since it requires that code be compiled to explicitly gave frame pointers on the call stack. (With gcc this currently happens by default, but is often turned off explicitly.) To turn it on, define SAVE_CALL_CHAIN. == [6.0alpha2] == * Added USE_MARK_BYTES to reduce the need for compare-and-swap on platforms for which that's expensive. * Fixed a locking bug ib GC_gcj_malloc and some locking assertion problems. * Added a missing volatile to OR_WORD and renamed the parameter to GC_compare_and_swap so it's not a C++ reserved word (thanks to Toshio Endo for pointing out both of those). * Changed Linux dynamic library registration code to look at /proc/self/maps instead of the rld data structures when REDIRECT_MALLOC is defined. Otherwise some of the rld data data structures may be prematurely garbage collected. * Fixed USE_LD_WRAP a bit more, so it should now work without threads. * Renamed XXX_THREADS macros to GC_XXX_THREADS for namespace correctness. Temporarily added some backward compatibility definitions. Renamed USE_LD_WRAP to GC_USE_LD_WRAP. * Many MACOSX POWERPC changes, some additions to the gctest output, and a few minor generic bug fixes (thanks to Dietmar Planitzer). == [6.0alpha1] == * Added HP/PA prefetch support. * Added -DDBG_HDRS_ALL and -DSHORT_DBG_HDRS to reduce the cost and improve the reliability of generating pointer backtrace information, e.g. in the Bigloo environment. * Added parallel marking support (-DPARALLEL_MARK). This currently works only under IA32 and IA64 Linux, but it shouldn't be hard to adapt to other platforms. This is intended to be a lighter-weight (less new code, probably not as scalable) solution than the work by Toshio Endo et al, at the University of Tokyo. A number of their ideas were reused, though the code wasn't, and the underlying data structure is significantly different. In particular, we keep the global mark stack as a single shared data structure, but most of the work is done on smaller thread-local mark stacks. * Changed GC_malloc_many to be cheaper, and to require less mutual exclusion with -DPARALLEL_MARK. * Added full support for thread local allocation under Linux (-DTHREAD_LOCAL_ALLOC). This is a thin veneer on GC_malloc_many, and should be easily portable to other platforms, especially those that support pthreads. * CLEAR_DOUBLE was not always getting invoked when it should have been. * GC_gcj_malloc and friends used different out of memory handling than everything else, probably because I forgot about one when I implemented the other. They now both call GC_oom_fn(), not GC_oom_action(). * Integrated Jakub Jelinek's fixes for Linux/SPARC. * Moved GC_objfreelist, GC_aobjfreelist, and GC_words_allocd out of GC_arrays, and separately registered the first two as excluded roots. This makes code compiled with gc_inl.h less dependent on the collector version. (It would be nice to remove the inclusion of gc_priv.h by gc_inl.h completely, but we're not there yet. The locking definitions in gc_priv.h are still referenced.) This change was later conditioned on SEPARATE_GLOBALS, which is not defined by default, since it involves a performance hit. * Register GC_obj_kinds separately as an excluded root region. The attempt to register it with GC_arrays was usually failing. (This wasn't serious, but seemed to generate some confusion.) * Moved backptr.h to gc_backptr.h. == [5.4] == * Fixed a typo that prevented compilation with -DUSE_3DNOW_PREFETCH (thanks to Shawn Wagner for actually testing this). * Fixed GC_is_thread_stack in solaris_threads.c. It forgot to return a value in the common case. * Fixed another silly syntax problem in GC_double_descr (thanks to Fergus Henderson for finding it). * Fixed a GC_gcj_malloc bug: It tended to release the allocator lock twice. == [5.3] 2000-09-24 == * Fixed _end declaration for OSF1. * There were lots of spurious leak reports in leak detection mode, caused by the fact that some pages were not being swept, and hence unmarked objects weren't making it onto free lists. (This bug dated back to 5.0.) * Fixed a typo in the liblinuxgc.so Makefile rule. * Added the GetExitCodeThread to Win32 GC_stop_world to (mostly) work around a Windows 95 GetOpenFileName problem (thanks to Jacob Navia). == [5.2] == * dyn_load.c declared GC_scratch_last_end_ptr as an extern even if it was defined as a macro. This prevented the collector from building on Irix. * We quietly assumed that indirect mark descriptors were never 0. Our own typed allocation interface violated that. This could result in segmentation faults in the marker with typed allocation. * Fixed a _DUSE_MUNMAP bug in the heap block allocation code (thanks to Ben Hutchings for the patch). * Taught the collector about VC++ handling array operator new (thanks to Ben Hutchings for the patch). * The two copies of gc_hdrs.h had diverged. Made one a link to the other again. == [5.1] == * Fixed a gc.h header bug which showed up under Irix (thanks to Dan Sullivan). * Fixed a typo in GC_double_descr in typd_mlc.c. This probably could result in objects described by array descriptors not getting traced correctly (thanks to Ben Hutchings for pointing this out). * The block nearly full tests in reclaim.c were not correct for 64 bit environments. This could result in unnecessary heap growth under unlikely conditions. == [5.0] == * Fixed threadlibs.c for linux threads. -DUSE_LD_WRAP was broken and -ldl was omitted. Fixed Linux stack finding code to handle -DUSE_LD_WRAP correctly. * Added MSWIN32 exception handler around marker, so that the collector can recover from root segments that are unmapped during the collection. This caused occasional failures under Windows 98, and may also be an issue under Windows NT/2000. == [5.0alpha7] == * -DREDIRECT_MALLOC was broken in alpha6. Fixed. * Cleaned up gc_ccp.h slightly, thus also causing the HP C++ compiler to accept it. * Removed accidental reference to dbg_mlc.c, which caused dbg_mlc.o to be linked into every executable. * Added PREFETCH to bitmap marker. Changed it to use the header cache. * GC_push_marked sometimes pushed one object too many, resulting in a segmentation fault in GC_mark_from_mark_stack. This was probably an old bug. It finally showed up in gctest on win32. * Gc_priv.h erroneously #defined GC_incremental to be TRUE instead of FALSE when SMALL_CONFIG was defined. This was no doubt a major performance bug for the default win32 configuration. * Removed -DSMALL_CONFIG from NT_MAKEFILE. It seemed like an anachronism now that the average PC has 64MB or so. * Integrated Bryce McKinlay's patches for linux threads and dynamic loading from the libgcj tree. Turned on dynamic loading support for Linux/PPC. * Changed the stack finding code to use environ on HP/UX (thanks to Gustavo Rodriguez-Rivera for the suggestion). This should probably be done on other platforms, too. Since I can't test those, that'll wait until after 5.0. == [5.0alpha6] == * GC_malloc_explicitly_typed and friends sometimes failed to initialize first word. * Added allocation routines and support in the marker for mark descriptors in a type structure referenced by the first word of an object. This was introduced to support gcj, but hopefully in a way that makes it generically useful. * Added GC_requested_heapsize, and inhibited collections in non-incremental mode if the actual used heap size is less than what was explicitly requested. * The Solaris pthreads version of GC_pthread_create didn't handle a NULL attribute pointer. Solaris thread support used the wrong default thread stack size (thanks to Melissa O'Neill for the patch). * Changed PUSH_CONTENTS macro to no longer modify first parameter. This usually doesn't matter, but it was certainly an accident waiting to happen ... * Added GC_register_finalizer_no_order and friends to gc.h. They're needed by Java implementations. * Integrated a fix for a win32 deadlock resulting from clock() calling malloc (thanks to Chris Dodd). * Integrated Hiroshi Kawashima's port to Linux/MIPS. This was designed for a handheld platform, and may or may not be sufficient for other machines. * Fixed a va_arg problem with the %c specifier in cordprnt.c. It appears that this was always broken, but recent versions of gcc are the first to report the (statically detectable) bug. * Added an attempt at a more general solution to dlopen races/deadlocks. GC_dlopen now temporarily disables collection. Still not ideal, but ... * Added -DUSE_I686_PREFETCH, -DUSE_3DNOW_PREFETCH, and support for IA64 prefetch instructions. May improve performance measurably, but I'm not sure the code will run correctly on processors that don't support the instruction. Won't build except with very recent gcc. * Added caching for header lookups in the marker. This seems to result in a barely measurable performance gain. Added support for interleaved lookups of two pointers, but unconfigured that since the performance gain is currently near zero, and it adds to code size. * Changed Linux DATASTART definition to check both data_start and __data_start, since nothing else seems to be portable. * Added -DUSE_LD_WRAP to optionally take advantage of the GNU ld function wrapping mechanism. Probably currently useful only on Linux. * Moved some variables for the scratch allocator into GC_arrays (suggested by Martin Hirzel). * Fixed a win32 threads bug that caused the collector to not look for interior pointers from one of the thread stacks without ALL_INTERIOR_POINTERS (thanks to Jeff Sturm). * Added Mingw32 support (thanks to Jeff Sturm for the patch). * Changed the alpha port to use the generic register scanning code instead of alpha_mach_dep.s. Alpha_mach_dep.s doesn't look for pointers in fp registers, but gcc sometimes spills pointers there (thanks to Manuel Serrano for helping debug this). Changed the IA64 code to do something similar for similar reasons. == [5.0alpha4] 1999-10-30 == * Added protection fault handling patch for Linux/M68K from Fergus Henderson and Roman Hodek. * Removed the tests for SGI_SOURCE in new_gc_alloc.h. This was causing that interface to fail on non-SGI platforms. * Changed the Linux stack finding code to use /proc, after changing it to use HEURISTIC1 (thanks to David Mossberger for pointing out /proc hook). * Added HP/UX incremental GC support and HP/UX 11 thread support. Thread support is currently still flaky. * Added basic Linux/IA64 support. * Integrated Anthony Green's PicoJava support. * Integrated Scott Ananian's StrongARM/NetBSD support. * Fixed some fairly serious performance bugs in the incremental collector. These have probably been there essentially forever. (Mark bits were sometimes set before scanning dirty pages. The reclaim phase unnecessarily dirtied full small object pages.) * Changed the reclaim phase to ignore nearly full pages to avoid touching them. * Limited GC_black_list_spacing to roughly the heap growth increment. * Changed full collection triggering heuristic to decrease full GC frequency by default, but to explicitly trigger full GCs during heap growth. This doesn't always improve things, but on average it's probably a win. * GC_debug_free(0, ...) failed (thanks to Fergus Henderson for the bug report and fix). == [5.0alpha3] 1999-09-15 == (Also known as 4.15alpha3.) * Added some highly incomplete code to support a copied young generation. Comments on nursery.h are appreciated. * Changed -DFIND_LEAK, -DJAVA_FINALIZATION, and -DFINALIZE_ON_DEMAND, so the same effect could be obtained with a runtime switch. This is a step towards standardizing on a single dynamic GC library. * Significantly changed the way leak detection is handled, as a consequence of the above. == [5.0alpha2] 1999-07-23 == * Fixed bugs introduced in alpha1 (OpenBSD & large block initialization). * Added -DKEEP_BACK_PTRS and backptr.h interface. (The implementation idea came from Alan Demers.) == [5.0alpha1] 1999-06-30 == (Also known as 4.15alpha1.) * Reworked large block allocator. Now uses multiple doubly linked free lists to approximate best fit. * Changed heap expansion heuristic. Entirely free blocks are no longer counted towards the heap size. This seems to have a major impact on heap size stability; the old version could expand the heap way too much in the presence of large block fragmentation. * added -DGC_ASSERTIONS and some simple assertions inside the collector. This is mainlyt for collector debugging. * added -DUSE_MUNMAP to allow the heap to shrink. Supported on only a few UNIX-like platforms for now. * added GC_dump_regions() for debugging of fragmentation issues. * Changed PowerPC pointer alignment under Linux to 4. * Changed the Linux/Alpha port to walk the data segment backwards until it encounters a SIGSEGV. The old way to find the start of the data segment broke with a recent release. * cordxtra.c needed to call GC_REGISTER_FINALIZER instead of GC_register_finalizer, so that it would continue to work with GC_DEBUG. * allochblk sometimes cleared the wrong block for debugging purposes when it dropped blacklisted blocks. This could result in spurious error reports with GC_DEBUG. * added MACOS X Server support (thanks to Andrew Stone). * Changed the Solaris threads code to ignore stack limits > 8 MB with a warning. Empirically, it is not safe to access arbitrary pages in such large stacks. And the dirty bit implementation does not guarantee that none of them will be accessed. * Integrated Martin Tauchmann's Amiga changes. * Integrated James Dominy's OpenBSD/SPARC port. == [4.14] 1999-04-16 == * changed STACKBOTTOM for DJGPP (thanks to Salvador Eduardo Tropea). == [4.14alpha2] 1999-03-26 == * -DSMALL_CONFIG did not work reliably with large (> 4K) pages. Recycling the mark stack during expansion could result in a size zero heap segment, which confused things. (This was probably also an issue with the normal config and huge pages.) * Did more work to make sure that callee-save registers were scanned completely, even with the setjmp-based code. Added USE_GENERIC_PUSH_REGS macro to facilitate testing on machines I have access to. * Added code to explicitly push register contents for win32 threads. This seems to be necessary. (Thanks to Pierre de Rop.) == [4.14alpha1] 1999-03-10 == * Fixed GC_print_source_ptr to not use a prototype. * generalized CYGWIN test. * gc::new did the wrong thing with PointerFreeGC placement (thanks to Rauli Ruohonen). * In the ALL_INTERIOR_POINTERS (default) case, some callee-save register values could fail to be scanned if the register was saved and reused in a GC frame. This showed up in verbose mode with gctest compiled with an unreleased SGI compiler. I vaguely recall an old bug report that may have been related. The bug was probably quite old. (The problem was that the stack scanning could be deferred until after the relevant frame was overwritten, and the new save location might be outside the scanned area. Fixed by more eager stack scanning.) * PRINT_BLACK_LIST had some problems. A few source addresses were garbage. * Replaced Makefile.dj and added -I flags to cord make targets (thanks to Gary Leavens). * GC_try_to_collect was broken with the non-incremental collector. * gc_cleanup destructors could pass the wrong address to GC_register_finalizer_ignore_self in the presence of multiple inheritance (thanks to Darrell Schiebel). * Changed PowerPC Linux stack finding code. == [4.13] 1999-02-19 == * Fixed a crucial bug in the Watcom port. There was a redundant declaration of GC_push_one in gc_priv.h. * Added FINALIZE_ON_DEMAND. * Fixed some pre-ANSI cc problems in test.c. * Removed getpagesize() use for Solaris. It seems to be missing in one or two versions. * Fixed bool handling for SPARCCompiler version 4.2. * Fixed some files in include that had gotten unlinked from the main copy. * Some RS/6000 fixes (missing casts). (Thanks to Toralf Foerster.) * Fixed several problems in GC_debug_realloc, affecting mostly the FIND_LEAK case. * GC_exclude_static_roots contained a buggy unsigned comparison to terminate a loop (thanks to Wilson Ho). * CORD_str failed if the substring occurred at the last possible position. (Only affects cord users.) * Fixed Linux code to deal with RedHat 5.0 and integrated Peter Bigot's os_dep.c code for dealing with various Linux versions. * Added workaround for Irix pthreads sigaction bug and possible signal misdirection problems. == [4.13alpha3] 1998-12-08 == * Fixed MSWIN32 recognition test, which interfered with cygwin. * Removed unnecessary gc_watcom.asm from distribution. Removed some obsolete README.win32 text. * Added Alpha Linux incremental GC support (thanks to Philipp Tomsich for code for retrieving the fault address in a signal handler). Changed Linux signal handler context argument to be a pointer. * Took care of some new warnings generated by the 7.3 SGI compiler. * Integrated Phillip Musumeci's FreeBSD/ELF fixes. * -DIRIX_THREADS was broken with the -o32 ABI (typo in gc_priv.h). == [4.13alpha2] 1998-08-08 == * Fixed more Linux threads problems. * Changed default GC_free_space_divisor to 3 with new large block allocation (thanks to Matthew Flatt for some measurements that suggest the old value sometimes favors space too much over time). * More CYGWIN32 fixes. * Integrated Tyson Dowd's Linux-M68K port. * Minor HP PA and DEC UNIX fixes from Fergus Henderson. * Integrated Christoffe Raffali's Linux-SPARC changes. * Allowed for one more GC fixup iteration after a full GC in incremental mode. Some quick measurements suggested that this significantly reduces pause times even with smaller GC_RATE values. * Moved some more GC data structures into GC_arrays. This decreases pause times and GC overhead, but makes debugging slightly less convenient. * Fixed namespace pollution problem ("excl_table"). * Made GC_incremental a constant for -DSMALL_CONFIG, hopefully shrinking that slightly. * Added some win32 threads fixes. * Integrated Ivan Demakov and David Stes' Watcom fixes. * Various other minor fixes contributed by many people. * Renamed config.h to gcconfig.h, since config.h tends to be used for many other things. * Integrated Matthew Flatt's support for 68K MacOS "far globals". * Fixed up some of the dynamic library Makefile targets for consistency across platforms. * Fixed a USE_MMAP typo that caused out-of-memory handling to fail on Solaris. * Added code to test.c to test thread creation a bit more. * Integrated GC_win32_free_heap (as suggested by Ivan Demakov). * Fixed Solaris 2.7 stack base finding problem. (This may actually have been done in an earlier alpha release.) == [4.13alpha1] 1998-02-17 == * Changed RS6000 STACKBOTTOM. * Integrated Patrick Beard's Mac changes. * Alpha1 didn't compile on Irix m.n, m < 6. * Replaced Makefile.dj with a new one from Gary Leavens. * Added Andrew Stitcher's changes to support SCO OpenServer. * Added PRINT_BLACK_LIST, to allow debugging of high densities of false pointers. * Added code to debug allocator to keep track of return address in GC_malloc caller, thus giving a bit more context. * Changed default behavior of large block allocator to more aggressively avoid fragmentation. This is likely to slow down the collector when it succeeds at reducing space cost. * Integrated Fergus Henderson's CYGWIN32 changes. They are untested, but needed for newer versions. * USE_MMAP had some serious bugs. This caused the collector to fail consistently on Solaris with -DSMALL_CONFIG. * Added Linux threads support (thanks to Fergus Henderson). == [4.12] 1997-08-26 == * Fixed ElfW definition in dyn_load.c. This prevented the dynamic library support from compiling on some older ELF Linux systems. * Fixed UTS4 port (which I apparently mangled during the integration). (Thanks to Alistair Crooks.) * "Make C++" failed on Suns with SC4.0, due to a problem with "bool". Fixed in gc_priv.h. * Added more pieces for GNU win32 (thanks to Timothy N. Newsham). The current state of things should suffice for at least some applications. * Changed the out of memory retry count handling. (This matters only if GC_max_retries > 0, which is no longer the default.) * If a /proc read failed repeatedly, GC_written_pages was not updated correctly (thanks to Peter Chubb for diagnosing this). * Under unlikely circumstances, the allocator could infinite loop in an out of memory situation (thanks to Kenjiro Taura for identifying the problem and supplying a fix). * Fixed a syntactic error in the DJGPP code. Also fixed a test program problem with DJGPP (thanks to Fergus Henderson and Peter Monks). * Atomic uncollectible objects were not treated correctly by the incremental collector. This resulted in weird log statistics and occasional performance problems (thanks to Peter Chubb for pointing this out). * Fixed some problems resulting from compilers that don't define __STDC__. In this case void * and char * were used inconsistently in some cases. (Void * should not have been used at all. If you have an ANSI superset compiler that does not define __STDC__, please compile with -D__STDC__=0. Thanks to Manuel Serrano and others for pointing out the problem.) * Fixed a compilation problem on Irix with -n32 and -DIRIX_THREADS. Also fixed some other IRIX_THREADS problems which may or may not have had observable symptoms. * Fixed an HP PA compilation problem in dyn_load.c (thanks to Philippe Queinnec). * SEGV fault handlers sometimes did not get reset correctly (thanks to David Pickens). * Added a fix for SOLARIS_THREADS on Intel (thanks to David Pickens). This probably needs more work to become functional. * Fixed struct sigcontext_struct in os_dep.c for compilation under Linux 2.1.X (thanks to Fergus Henderson). * Changed the DJGPP STACKBOTTOM and DATASTART values to those ones suggested (by Kristian Kristensen). These may still not be right, but it is it is likely to work more often than what was there before. They may even be exactly right. * Added a #include to test_cpp.cc. This appears to help with HP/UX and gcc (thanks to Assar Westerlund). * Version 4.11 failed to run in incremental mode on recent 64-bit Irix kernels. This was a problem related to page unaligned heap segments. Changed the code to page align heap sections on all platforms. (I had mistakenly identified this as a kernel problem earlier. It was not.) * Version 4.11 did not make allocated storage executable, except on one or two platforms, due to a bug in a #if test (thanks to David Grove for pointing this out). * Added sparc_sunos4_mach_dep.s to support Sun's compilers under SunOS4. * Added GC_exclude_static_roots. * Fixed the object size mapping algorithm. This shouldn't matter, but the old code was ugly. * Heap checking code could die if one of the allocated objects was larger than its base address. (Unsigned underflow problem. Thanks to Clay Spence for isolating the problem.) * Added RS6000 (AIX) dynamic library support and fixed STACK_BOTTOM (thanks to Fred Stearns). * Added Fergus Henderson's patches for improved robustness with large heaps and lots of blacklisting. * Added Peter Chubb's changes to support Solaris Pthreads, to support MMAP allocation in Solaris, to allow Solaris to find dynamic libraries through /proc, to add malloc_typed_ignore_off_page, and a few other minor features and bug fixes. * The Solaris 2 port should not use sbrk. I received confirmation from Sun that the use of sbrk and malloc in the same program is not supported. The collector now defines USE_MMAP by default on Solaris. * Replaced the djgpp makefile with Gary Leavens' version. * Fixed MSWIN32 detection test. * Added Fergus Henderson's patches to allow putting the collector into a DLL under GNU win32. * Added Ivan V. Demakov's port to Watcom C on X86. * Added Ian Piumarta's Linux/PowerPC port. * Added PointerFreeGC to the placement options in gc_cpp.h (suggested by Brian Burton). This is of course unsafe, and may be controversial. On the other hand, it seems to be needed often enough that it's worth adding as a standard facility. * Add Lars Farm's suggestions on building the collector for MacOS. == [4.12alpha2] == (Changes not specified.) == [4.11] 1996-12-03 == * Rationalized (hopefully) GC_try_to_collect in an incremental collection environment. It appeared to not handle a call while a collection was in progress, and was otherwise too conservative. * Merged GC_reclaim_or_delete_all into GC_reclaim_all to get rid of some code. * Added Patrick Beard's Mac fixes, with substantial completely untested modifications. * Fixed the MPROTECT_VDB code to deal with large pages and imprecise fault addresses (as on an UltraSPARC running Solaris 2.5). Note that this was not a problem in the default configuration, which uses PROC_VDB. * The DEC Alpha assembly code needed to restore $gp between calls (thanks to Fergus Henderson for tracking this down and supplying a patch). * The write command for "de" was completely broken for large files. I used the easiest portable fix, which involved changing the semantics so that f.new is written instead of overwriting f. That's safer anyway. * Added README.solaris2 with a discussion of the possible problems of mixing the collector's sbrk allocation with malloc/realloc. * Changed the data segment starting address for SGI machines. The old code failed under IRIX6. * Required double word alignment for MIPS. * Various minor fixes to remove warnings. * Attempted to fix some Solaris threads problems (reported by Zhiying Chen). In particular, the collector could try to fork a thread with the world stopped as part of GC_thr_init. It also failed to deal with the case in which the original thread terminated before the whole process did. * Added -DNO_EXECUTE_PERMISSION. This has a major performance impact on the incremental collector under Irix, and perhaps under other operating systems. * Added some code to support allocating the heap with mmap. This may be preferable under some circumstances. * Integrated dynamic library support for HP (thanks to Knut Tvedten). * Integrated James Clark's win32 threads support, and made a number of changes to it (many of which suggested by Pontus Rydin). This is still not 100% solid. * Integrated Alistair G. Crooks' support for UTS4 running on an Amdahl 370-class machine. * Fixed a serious bug in explicitly typed allocation. Objects requiring large descriptors where handled in a way that usually resulted in a segmentation fault in the marker (thanks to Jeremy Fitzhardinge for helping to track this down). * Added partial support for GNU win32 development (thanks to Fergus Henderson). * Added optional support for Java-style finalization semantics (thanks to Patrick Bridges). This is recommended only for Java implementations. * GC_malloc_uncollectable faulted instead of returning 0 when out of memory (thanks to Daniel R. Grayson for noticing). * Calls to GC_base before the collector was initialized failed on a DEC Alpha (thanks to Matthew Flatt). * Added base pointer checking to GC_REGISTER_FINALIZER in debugging mode (thanks to Jeremy Fitzhardinge). * GC_debug_realloc failed for uncollectible objects (thanks to Jeremy Fitzhardinge). * Explicitly typed allocation could crash if it ran out of memory (thanks to Jeremy Fitzhardinge). * Added minimal support for a DEC Alpha running Linux. * Fixed a problem with allocation of objects whose size overflowed ptrdiff_t. (This now fails unconditionally, as it should.) * Added the beginning of Irix pthread support. * Integrated Xiaokun Zhu's fixes for djgpp 2.01. * Added SGI-style STL allocator support (gc_alloc.h). * Fixed a serious bug in README.solaris2. Multi-threaded programs must include gc.h with SOLARIS_THREADS defined. * Changed GC_free so it actually deallocates uncollectible objects (thanks to Peter Chubb for pointing out the problem). * Added Linux ELF support for dynamic libraries (thanks to Patrick Bridges). * Changed the Borland cc configuration so that the assembler is not required. * Fixed a bug in the C++ test that caused it to fail in 64-bit environments. == [4.10t3] 1996-11-18 == Some changes related to threads support. == [4.10] 1996-02-19 == * Fixed a typo around a call to GC_collect_or_expand in alloc.c. It broke handling of out of memory. (Thanks to Patrick C. Beard for noticing.) == [4.9] 1996-02-12 == * More README.debugging fixes. * Objects ready for finalization, but not finalized in the same GC cycle, could be prematurely collected. This occasionally happened in test_cpp. * Too little memory was obtained from the system for very large objects. That could cause a heap explosion if these objects were not contiguous (e.g. under PCR), and too much of them was blacklisted. * Due to an improper initialization, the collector was too hesitant to allocate blacklisted objects immediately after system startup. * Moved GC_arrays from the data into the bss segment by not explicitly initializing it to zero. This significantly reduces the size of executables, and probably avoids some disk accesses on program startup. It's conceivable that it might break a port that I didn't test. * Fixed EMX_MAKEFILE to reflect the gc_c++.h to gc_cpp.h renaming which occurred a while ago. == [4.8] 1995-11-20 == * Changed a "comment" in a MacOS specific part of mach_dep.c that caused gcc to fail on other platforms. == [4.7] 1995-11-18 == * Fixed some compilation problems with -DCHECKSUMS (thanks to Ian Searle). * Updated some Mac specific files (to synchronize with Patrick C. Beard). * Fixed a serious bug for machines with non-word-aligned pointers. (Thanks to Patrick C. Beard for pointing out the problem. The collector should fail almost any conceivable test immediately on such machines.) == [4.6] 1995-11-09 == * Added Linux ELF support (thanks to Arrigo Triulzi). * GC_base crashed if it was called before any other GC_ routines. This could happen if a gc_cleanup object was allocated outside the heap before any heap allocation. * The heap expansion heuristic was not stable if all objects had finalization enabled. Fixed finalize.c to count memory in finalization queue and avoid explicit deallocation. Changed alloc.c to also consider this count. (This is still not recommended. It's expensive if nothing else. Thanks to John Ellis for pointing this out.) * GC_malloc_uncollectable(0) was broken (thanks to Phong Vo for pointing this out). * The collector didn't compile under Linux 1.3.X (thanks to Fred Gilham for pointing this out). The current workaround is ugly, but expected to be temporary. * Fixed a formatting problem for SPARC stack traces. * Fixed some '=='s in os_dep.c that should have been assignments. Fortunately these were in code that should never be executed anyway (thanks to Fergus Henderson). * Fixed the heap block allocator to only drop blacklisted blocks in small chunks. Made BL_LIMIT self adjusting. (Both of these were in response to heap growth observed by Paul Graham.) * Fixed the Metrowerks/68K Mac code to also mark from a6 (thanks to Patrick C. Beard). * Significantly updated README.debugging. * Fixed some problems with longjmps out of signal handlers, especially under Solaris. Added a workaround for the fact that siglongjmp doesn't appear to do the right thing with -lthread under Solaris. * Added MSDOS/djgpp port (thanks to Mitch Harris). * Added "make reserved_namespace" and "make user_namespace". The first renames ALL "GC_xxx" identifiers as "_GC_xxx". The second is the inverse transformation. Note that doing this is guaranteed to break all clients written for the other names. * descriptor field for kind NORMAL in GC_obj_kinds with ADD_BYTE_AT_END defined should be -ALIGNMENT not WORDS_TO_BYTES(-1). This is a serious bug on machines with pointer alignment of less than a word. * GC_ignore_self_finalize_mark_proc didn't handle pointers to very near the end of the object correctly. Caused failures of the C++ test on a DEC Alpha with g++. * gc_inl.h still had problems. Partially fixed. Added warnings at the beginning to hopefully specify the remaining dangers. * Added DATAEND definition to config.h. * Fixed some of the .h file organization. Fixed "make floppy". == [4.5] 1995-06-14 == * Fixed many minor and one major README bugs (thanks to Franklin Chen for pointing out many of them). * Fixed ALPHA/OSF/1 dynamic library support (thanks to Jonathan Bachrach). * Added incremental GC support (MPROTECT_VDB) for Linux (with some help from Bruno Haible). * Altered SPARC recognition tests in gc.h and config.h (mostly as suggested by Fergus Henderson). * Added basic incremental GC support for win32, as implemented by Windows NT and Windows 95. GC_enable_incremental is a no-op under win32s, which doesn't implement enough of the VM interface. * Added -DLARGE_CONFIG. * Fixed GC_..._ignore_off_page to also function without -DALL_INTERIOR_POINTERS. * (Hopefully) fixed RS/6000 port. (Only the test was broken.) * Fixed a performance bug in the non-incremental collector running on machines supporting incremental collection with MPROTECT_VDB (e.g. SunOS 4, DEC AXP). This turned into a correctness bug under win32s with win32 incremental collection. (Not all memory protection was disabled.) * Fixed some ppcr related bit rot. * Caused dynamic libraries to be unregistered before re-registering. The old way turned out to be a performance bug on some machines. * GC_root_size was not properly maintained under MSWIN32. * Added -DNO_DEBUGGING and GC_dump. * Fixed a couple of bugs arising with SOLARIS_THREADS + REDIRECT_MALLOC. * Added NetBSD/M68K port (thanks to Peter Seebach). * Fixed a serious realloc bug. For certain object sizes, the collector wouldn't scan the expanded part of the object. (Thanks to Clay Spence for noticing the problem, and helping me to track it down.) == [4.4] 1995-02-18 == * ASM_CLEAR_CODE was erroneously defined for HP PA machines, resulting in a compile error. * Fixed OS/2 Makefile to create a library (thanks to Mark Boulter). * Gc_cleanup objects didn't work if they were created on the stack. Fixed. * One copy of Gc_cpp.h in the distribution was out of synch, and failed to document some known compiler problems with explicit destructor invocation. Partially fixed. There are probably other compilers on which gc_cleanup is miscompiled. * Fixed Makefile to pass C compiler flags to C++ compiler. * Added Mac fixes. * Fixed os_dep.c to work around what appears to be a new and different VirtualQuery bug under newer versions of win32S. * GC_non_gc_bytes was not correctly maintained by GC_free. Fixed (thanks to James Clark). * Added GC_set_max_heap_size. * Changed allocation code to ignore blacklisting if it is preventing use of a very large block of memory. This has the advantage that naive code allocating very large objects is much more likely to work. The downside is you might no longer find out that such code should really use GC_malloc_ignore_off_page. * Changed GC_printf under win32 to close and reopen the file between calls. FAT file systems otherwise make the log file useless for debugging. * Added GC_try_to_collect and GC_get_bytes_since_gc. These allow starting an abortable collection during idle times. This facility does not require special OS support. (Thanks to Michael Spertus of Geodesic Systems for suggesting this. It was actually an easy addition. Kumar Srikantan previously added a similar facility to a now ancient version of the collector. At the time this was much harder, and the result was less convincing.) * Added some support for the Borland development environment (thanks to John Ellis and Michael Spertus). * Removed a misfeature from checksums.c that caused unexpected heap growth (thanks to Scott Schwartz). * Changed finalize.c to call WARN if it encounters a finalization cycle. WARN is defined in gc_priv.h to write a message, usually to stdout. In many environments, this may be inappropriate. * Renamed NO_PARAMS in gc.h to GC_NO_PARAMS, thus adhering to my own naming convention. * Added GC_set_warn_proc to intercept warnings. * Fixed Amiga port (thanks to Michel Schinz). * Fixed a bug in mark.c that could result in an access to unmapped memory from GC_mark_from_mark_stack on machines with unaligned pointers. * Fixed a win32 specific performance bug that could result in scanning of objects allocated with the system malloc. * Added REDIRECT_MALLOC. == [4.3] 1994-12-23 == * Fixed SPARC alignment problem with GC_DEBUG. * Fixed Solaris threads /proc workaround. The real problem was an interaction with mprotect. * Incorporated fix from Patrick Beard for gc_c++.h (now gc_cpp.h). * Slightly improved allocator space utilization by fixing the GC_size_map mechanism. * Integrated some Sony News and MIPS RISCos 4.51 patches (thanks to Nobuyuki Hikichi at Software Research Associates, Inc., Japan). * Fixed HP_PA alignment problem (thanks to Brian F. Dennis). * Added GC_same_obj and friends. Changed GC_base to return 0 for pointers past the end of large objects. Improved GC_base performance with ALL_INTERIOR_POINTERS on machines with a slow integer mod operation. Added GC_PTR_ADD, GC_PTR_STORE, etc. to prepare for preprocessor. * changed the default on most UNIX machines to be that signals are not disabled during critical GC operations. This is still ANSI-conforming, though somewhat dangerous in the presence of signal handlers. But the performance cost of the alternative is sometimes problematic. Can be changed back with a minor Makefile edit. * renamed IS_STRING in gc.h, to CORD_IS_STRING, thus following my own naming convention. Added the function CORD_to_const_char_star. * Fixed a gross bug in GC_finalize. Symptom: occasional address faults in that function (thanks to Anselm Baird-Smith). * Added port to ICL DRS6000 running DRS/NX. Restructured things a bit to factor out common code, and remove obsolete code. Collector should now run under SUNOS5 with either mprotect or /proc dirty bits. (Thanks to Douglas Steel.) * More bug fixes and workarounds for Solaris 2.X. (These were mostly related to putting the collector in a dynamic library, which didn't really work before. Also SOLARIS_THREADS didn't interact well with dl_open.) (Thanks to Brian Lewis.) * Fixed a serious performance bug on the DEC Alpha. The text segment was getting registered as part of the root set. (Amazingly, the result was still fast enough that the bug was not conspicuous.) The fix works on OSF/1, version 1.3. Hopefully it also works on other versions of OSF/1 ... * Fixed a bug in GC_clear_roots. * Fixed a bug in GC_generic_malloc_words_small that broke gc_inl.h (reported by Antoine de Maricourt). * Fixed some problems with cord/de under Linux. * Fixed some cord problems, notably with CORD_riter4. * Added DG/UX port (thanks to Ben A. Mesander). * Added finalization registration routines with weaker ordering constraints. (This is necessary for C++ finalization with multiple inheritance, since the compiler often adds self-cycles.) * Filled the holes in the SCO port (thanks to Michael Arnoldus). * Completely rewritten the documentation in the interface gc_c++.h (later renamed gc_cpp.h) making it both clearer and more precise (done by John Ellis). * The definition of accessibility now ignores pointers from a finalizable object (an object with a clean-up function) to itself (done by John Ellis). This allows objects with virtual base classes to be finalizable by the collector. Compilers typically implement virtual base classes using pointers from an object to itself, which under the old definition of accessibility prevented objects with virtual base classes from ever being collected or finalized. * gc_cleanup now includes gc as a virtual base. This was enabled by the change in the definition of accessibility (by John Ellis). * Added support for operator new[] (by John Ellis). Since most compilers don't yet support operator new[], it is conditionalized on -DOPERATOR_NEW_ARRAY. The code is untested, but its trivial and looks correct. * The test program test_gc_c++ (later renamed test_cpp.cc) tries to test for the C++-specific functionality not tested by the other programs. * Added unistd.h include to misc.c. (Needed for ppcr.) * Added PowerMac port (thanks to Patrick C. Beard). * Fixed "srcdir"-related Makefile problems. Changed things so that all externally visible include files always appear in the include subdirectory of the source. Made gc.h directly includable from C++ code (thanks to Per Bothner). * Changed Intel code to also mark from ebp (thanks to Kevin Warne). * Renamed C++ related files so they could live in a FAT file system (thanks to Charles Fiterman). * Changed Windows NT Makefile to include C++ support in gc.lib. Added C++ test as Makefile target. == [4.2] 1994-08-03 == * Multiple bug fixes/workarounds in the Solaris threads version. (It occasionally failed to locate some register contents for marking. It also turns out that thr_suspend and friends are unreliable in Solaris 2.3. Dirty bit reads appear to be unreliable under some weird circumstances. My stack marking code contained a serious performance bug. The new code is extremely defensive, and has not failed in several CPU hours of testing. But no guarantees ...) * Added MacOS support. (Thanks to Patrick C. Beard. David Chase suggested several improvements.) * Fixed several syntactic bugs in gc_c++.h and friends. (These didn't bother g++, but did bother most other compilers.) Fixed gc_c++.h finalization interface. * 64 bit alignment for allocated objects was not guaranteed in a few cases in which it should have been. * Added GC_malloc_atomic_ignore_off_page. * Added GC_collect_a_little. * Added some prototypes to gc.h. * Some other minor bug fixes (notably in Makefile). * Fixed OS/2 / EMX port (thanks to Ari Huttunen). * Fixed AmigaDOS port (thanks to Michel Schinz). * Fixed the DATASTART definition under Solaris. There was a 1 in 16K chance of the collector missing the first 64K of static data (and thus crashing). * Fixed some blatant anachronisms in the README file. * Fixed PCR-Makefile for upcoming PPCR release. == [4.1] 1994-05-20 == * Changed finalization implementation to guarantee that finalization procedures are called outside of the allocation lock, making direct use of the interface a little less dangerous. MAY BREAK EXISTING CLIENTS that assume finalizers are protected by a lock. Since there seem to be few multi-threaded clients that use finalization, this is hopefully not much of a problem. * Fixed a gross bug in CORD_prev. * Fixed a bug in blacklst.c that could result in unbounded heap growth during startup on machines that do not clear memory obtained from the OS (e.g. win32S). * Ported de editor to win32/win32S. (This is now the only version with a mouse-sensitive UI. Thanks to Rob Haack for the implementation based on the generic Windows application template.) * Added GC_malloc_ignore_off_page to allocate large arrays in the presence of ALL_INTERIOR_POINTERS. * Changed GC_call_with_alloc_lock to not disable signals in the single-threaded case. * Reduced retry count in GC_collect_or_expand for garbage collecting when out of memory. * Made uncollectible allocations bypass black-listing, as they should. * Fixed a bug in typed_test in test.c that could cause (legitimate) GC crashes. * Fixed some potential synchronization problems in finalize.c * Fixed a real locking problem in typd_mlc.c. * Worked around an AIX 3.2 compiler feature that results in out of bounds memory references. * Partially worked around an IRIX5.2 beta problem (which may or may not persist to the final release). * Fixed a bug in the heap integrity checking code that could result in explicitly deallocated objects being identified as smashed. Fixed a bug in the dbg_mlc stack saving code that caused old argument pointers to be considered live. * Fixed a bug in CORD_ncmp (and hence CORD_str). * Repaired the OS2 port, which had suffered from bit rot in 4.0. Worked around what appears to be CSet/2 V1.0 optimizer bug. * Fixed a Makefile bug for target "c++". == [4.0] 1994-04-07 == * Added support for Solaris threads (which was possible only by reimplementing some fraction of Solaris threads, since Sun doesn't currently make the thread debugging interface available). * Added non-threads win32 and win32S support. * (Grudgingly, with suitable muttering of obscenities) renamed files so that the collector distribution could live on a FAT file system. Files that are guaranteed to be useless on a PC still have long names. Gc_inline.h and gc_private.h still exist, but now just include gc_inl.h and gc_priv.h. * Fixed a really obscure bug in finalization that could cause undetected mark stack overflows. (I would be surprised if any real code ever tickled this one.) * Changed finalization code to dynamically resize the hash tables it maintains. (This probably does not matter for well- -written code. It no doubt does for C++ code that overuses destructors.) * Added typed allocation primitives. Rewrote the marker to accommodate them with more reasonable efficiency. This change should also speed up marking for GC_malloc allocated objects a little. See gc_typed.h for new primitives. (Thanks to Zhong Shao performed much of the experimentation that led to the current typed allocation facility.) * Improved debugging facilities slightly. Allocation time stack traces are now kept by default on SPARC/SUNOS4. (Thanks to Scott Schwartz.) * Added better support for small heap applications. * Significantly extended cord package. Fixed a bug in the implementation of lazily read files. Printf and friends now have cord variants. Cord traversals are a bit faster. * Made ALL_INTERIOR_POINTERS recognition the default. * Fixed de so that it can run in constant space, independent of file size. Added simple string searching to cords and de. * Added the Hull-Ellis C++ interface (supplied by Jesse Hull and John Ellis). * Added dynamic library support for OSF/1 (thanks to Alan Dosser and Tim Bingham at DEC). * Changed argument to GC_expand_hp to be expressed in units of bytes instead of heap blocks. (Necessary since the heap block size now varies depending on configuration. The old version was never very clean.) * Added GC_get_heap_size(). The previous "equivalent" was broken. * Restructured the Makefile a bit. * Added FreeBSD port (provided by Jeffrey Hsu). == [3.7] 1994-03-15 == * Added a workaround for an HP/UX compiler bug. * Fixed another stack clearing performance bug. Reworked that code once more. == [3.6] 1994-01-14 == * fixed a bug in the mark stack growth code that was introduced in 3.4. * fixed Makefile to work around DEC AXP compiler tail recursion bug. == [3.5] == * Minor collections now mark from roots only once, if that doesn't cause an excessive pause. * The stack clearing heuristic was refined to prevent anomalies with very heavily recursive programs and sparse stacks. * Fixed a bug that prevented mark stack growth in some cases. GC_objects_are_marked should be set to TRUE after a call to GC_push_roots and as part of GC_push_marked, since both can now set mark bits. I think this is only a performance bug, but I wouldn't bet on it. It's certainly very hard to argue that the old version was correct. * Fixed an incremental collection bug that prevented it from working at all when HBLKSIZE != getpagesize() * Changed dynamic_loading.c to include gc_priv.h before testing DYNAMIC_LOADING. SunOS dynamic library scanning must have been broken in 3.4. * Object size rounding now adapts to program behavior. * Added a workaround (provided by Manuel Serrano and colleagues) to a long-standing SunOS 4.X (and 3.X) ld bug that I had incorrectly assumed to have been squished. The collector was broken if the text segment size was within 32 bytes of a multiple of 8K bytes, and if the beginning of the data segment contained interesting roots. The workaround assumes a demand-loadable executable. The original may have have "worked" in some other cases. * Added dynamic library support under IRIX5. * Added support for EMX under OS/2 (thanks to Ari Huttunen). * Added support of Motorola 88K processor running CX/UX (by Brent Benson). == [3.4] == * Fixed a performance bug in GC_realloc. * Updated the amiga port. * Added NetBSD and 386BSD ports (supplied by Alistair G. Crooks). * Added cord library. * Added trivial performance enhancement for ALL_INTERIOR_POINTERS (do not scan last word). == [3.3] 1993-10-02 == * PCR-specific bugs (thanks to Neil Sharman). * Missing locking in GC_free, redundant FASTUNLOCK in GC_malloc_stubborn, and 2 bugs in GC_unregister_disappearing_link (pointed out by Neil Sharman). * Common symbols allocated by the SunOS4.X dynamic loader were not included in the root set. * Bug in GC_finalize (reported by Brian Beuning and Alan Dosser). * Merged Amiga port from Jesper Peterson (untested). * Merged NeXT port from Thomas Funke (significantly modified and untested). (Also thanks to Brian D. Carlstrom for the supplied the NeXT ports.) == [3.2] == Fixed a serious and not entirely repeatable bug in the incremental collector. It appeared only when dirty bit info on the roots was available, which is normally only under Solaris. It also added GC_general_register_disappearing_link, and some testing code. Interface.c disappeared. == [3.1] == * A workaround for a SunOS 4.X SPARC C compiler misfeature that caused problems when the collector was turned into a dynamic library. * A fix for a bug in GC_base that could result in a memory fault. * A fix for a performance bug (and several other misfeatures) pointed out by Dave Detlefs and Alan Dosser. * Use of dirty bit information for static data under Solaris 2.X. * DEC Alpha/OSF1 support (thanks to Alan Dosser). * Incremental collection on more platforms. * A more refined heap expansion policy. Less space usage by default. * Various minor enhancements to reduce space usage, and to reduce the amount of memory scanned by the collector. * Uncollectible allocation without per object overhead. * More conscientious handling of out-of-memory conditions. * Fixed a bug in debugging stubborn allocation. * Fixed a bug that resulted in occasional erroneous reporting of smashed objects with debugging allocation. * Fixed bogus leak reports of size 4096 blocks with FIND_LEAK. == [3.0] == Added generational/incremental collection and stubborn objects. == [2.6] 1993-04-27 == (Changes not specified.) == [2.5] == * Removed an explicit call to exit(1) * Fixed calls to GC_printf and GC_err_printf, so the correct number of arguments are always supplied. The OS/2 C compiler gets confused if the number of actuals and the number of formals differ. (ANSI C doesn't require this to work. The ANSI sanctioned way of doing things causes too many compatibility problems.) == [2.4] 1993-01-26 == Added GC_free_space_divisor as a tuning knob, added support for OS/2 and linux, and fixed the following bugs: * On machines with unaligned pointers (e.g. Sun 3), every 128th word could fail to be considered for marking. * Dynamic_load.c erroneously added 4 bytes to the length of the data and bss sections of the dynamic library. This could result in a bad memory reference if the actual length was a multiple of a page. (Observed on Sun 3. Can probably also happen on a Sun 4.) (Thanks to Robert Brazile for pointing out that the Sun 3 version was broken. Dynamic library handling is still broken on Sun 3s under 4.1.1U1, but apparently not 4.1.1. If you have such a machine, use -Bstatic.) == [2.3] == * Added ALL_INTERIOR_POINTERS. * Missing declaration of etext in the A/UX version. * Some PCR root-finding problems. * Blacklisting was not 100% effective, because the plausible future heap bounds were being miscalculated. * GC_realloc didn't handle out-of-memory correctly. * GC_base could return a nonzero value for addresses inside free blocks. * test.c wasn't really thread safe, and could erroneously report failure in a multi-threaded environment. (The locking primitives need to be replaced for other threads packages.) * GC_CONS was thoroughly broken. * On a SPARC with dynamic linking, signals stayed disabled while the client code was running (thanks to Manuel Serrano). == [2.2] == * GC_realloc could fail to extend the size of the object for certain large object sizes. * A blatant subscript range error in GC_printf, which unfortunately wasn't exercised on machines with sufficient stack alignment constraints. * GC_register_displacement did the wrong thing if it was called after any allocation had taken place. * The leak finding code would eventually break after 2048 byte byte objects leaked. * interface.c didn't compile. * The heap size remained much too small for large stacks. * The stack clearing code behaved badly for large stacks, and perhaps on HP/PA machines. == [2.1] == * The first stable version since 1.9. * Added support for PPCR. == [2.0] == * Introduced a consistent naming convention for collector routines and added support for registering dynamic library data segments in the standard mark_roots.c (original code supporting the SunOS dynamic loader provided by Bill Janssen). Most of the data structures were revamped. The treatment of interior pointers was completely changed. Finalization was added. Support for locking was added. Object kinds were added. We added a black listing facility to avoid allocating at addresses known to occur as integers somewhere in the address space. Much of this was accomplished by adapting ideas and code from the PCR collector. The test program was changed and expanded. == [1.9] 1992-01-29 == * fixed a major bug in gc_realloc. == [1.8] == * added ULTRIX support in gc_private.h. (Robert Brazile originally supplied the ULTRIX code. Alan Dosser and Regis Cridlig subsequently provided updates and information on variation between ULTRIX systems.) == [1.5] == * ensure 8 byte alignment for objects allocated on a sparc based machine. == [1.4] == * Does not use compile time determined values for the stack base. This no longer works on Sun 3s, since Sun 3/80s use a different stack base. We now use a straightforward heuristic on all machines on which it is known to work (incl. Sun 3s) and compile-time determined values for the rest. There should really be library calls to determine such values. == [1.3] == * Fixed spurious assembly language assignments to TMP_SP. Only the assignment in the PC/RT code is necessary. On other machines, with certain compiler options, the assignments can lead to an unsaved register being overwritten. Known to cause problems under SunOS 3.5 WITHOUT the -O option. (With -O the compiler recognizes it as dead code. It probably shouldn't, but that's another story.) The SPARC-specific code was originally contributed by Mark Weiser. The Encore Multimax modifications were supplied by Kevin Kenny. The adaptation to the IBM PC/RT is largely due to Vernon Lee, on machines made available to Rice by IBM. Much of the HP specific code and a number of good suggestions for improving the generic code are due to Walter Underwood. Parag Patel supplied the A/UX code. Manuel Serrano supplied linux and Sony News specific code.