Import boehm-gc snapshot, taken from
[official-gcc.git] / boehm-gc / ChangeLog
blobb2a241e2d6f09319eb07d48d12aae689579522d1
2 == [7.3alpha4] (development) ==
4 * Add GC_push_all/conditional() to GC public API.
5 * Add note about 'pkg-config' solving problem with autoconf 2.68 or older.
6 * Add public GC_set/get_abort_func to replace default GC_on_abort.
7 * Add public setter and getter for GC_push_other_roots.
8 * Add thread suspend/resume signals public setters (POSIX threads).
9 * Call GC_on_abort (with NULL argument) on exit(1).
10 * Check GC_base result in GC_print_all_smashed_proc.
11 * Check traceable_allocator.allocate result before dereference in test_cpp.
12 * Code refactoring of GC_x_printf (move shared code to macro).
13 * Define old_bus_handler static variable only if used (Unix).
14 * Disable find-leak GC_gcollect on GC abnormal EXIT.
15 * Do not define _setjmp/_longjmp macros in mach_dep.c.
16 * Elaborate comment on dependencies in autogen.sh.
17 * Eliminate 'cast from int to pointer' warning in GC_exclude_static_roots.
18 * Eliminate 'missing exception specification' warning in gc_cpp.cc (Clang).
19 * Eliminate 'uninitialized variable use' warning in test_printf (cord).
20 * Eliminate 'unused result' compiler warning in main() of test_cpp.
21 * Eliminate 'unused value' compiler warning in GC_stop_world (Pthreads).
22 * Eliminate Clang warning for GC_pthread_exit attribute.
23 * Eliminate GCC warning in GC_get_main_stack_base (OpenBSD).
24 * Eliminate GCC warnings in setjmp_t.c, test_cpp and cord 'de' app.
25 * Eliminate SIGBUS-related dead code in GC_write_fault_handler (Linux).
26 * Eliminate warning and simplify expression in GC_init_explicit_typing.
27 * Enable 'force GC at every GC_malloc' debug-related functionality.
28 * Fix GC_CreateThread and GC_beginthreadex definition for Cygwin.
29 * Improve staticrootstest checks (tests).
30 * Include "config.h" instead of "private/config.h" on HAVE_CONFIG_H.
31 * Include proper header file in 'tools' for configuration macros.
32 * Include pthread_np.h from pthread_stop_world.c on OpenBSD.
33 * Log error messages to stderr instead of stdout in tests.
34 * Minimize code duplication in GC_mark_and_push.
35 * Move 'include setjmp.h' from mach_dep.c to gc_priv.h.
36 * Move GC_get_suspend/thr_restart_signal to misc.c for NaCl and OpenBSD.
37 * Port BDWGC to Android/x86.
38 * Postpone the suspend signal in GC_dirty_init only if used to stop world.
39 * Put gc_cpp symbols into 'boehmgc' namespace if GC_NAMESPACE defined.
40 * Recognize GC_DONT_GC macro in gc.h (causes GC_INIT to turn off GC).
41 * Recognize GC_SIG_SUSPEND and GC_SIG_THR_RESTART tuning macros in gc.h.
42 * Remove nested EXPECT in GC_core_finalized_malloc.
43 * Remove nested always-false ifdef for HPUX and FREEBSD.
44 * Replace SIG_SUSPEND/THR_RESTART macros to variables in pthread_stop_world.
45 * Replace sprintf with defensive snprintf.
46 * Replace var-args GC_noop with GC_noop6 (to eliminate Clang warning).
47 * Specify GC_malloc result is unused in some tests.
48 * Specify GC_pthread_join result is unused in threadkey_test.
49 * Turn off GC_LOOP_ON_ABORT functionality if GC compiled with NO_DEBUGGING.
50 * Use memcpy (BCOPY) instead of strcpy (to suppress GCC warning).
53 == [7.3alpha2] 2012-05-11 ==
55 * Add 'const' qualifier to pointer argument of some API functions.
56 * Add GC_UNDERSCORE_STDCALL, UNICODE macro templates to configure (Win32).
57 * Add GC_get_thr_restart_signal, GC_thread_is_registered to GC API.
58 * Add GC_is_heap_ptr, GC_move_disappearing_link to GC API.
59 * Add SHORT_DBG_HDRS macro template to configure.
60 * Add Symbian port to mainline.
61 * Add TODO file.
62 * Add assertion ensuring proper alignment of 'pushed' GC symbols.
63 * Add assertion in GC_getspecific on qtid.
64 * Add assertion to GC_incremental_protection_needs, refine documentation.
65 * Add assertion to check GC_large_free_bytes by GC_finish_collection.
66 * Add configure option to compile all library .c files into single gc.o.
67 * Add cordtest to make check.
68 * Add disclaim callbacks for efficient finalization (ENABLE_DISCLAIM).
69 * Add finalization.html to 'doc' folder.
70 * Add javaxfc.h to the installation set of GC header files (configure).
71 * Add on-heap-resize event notification to API.
72 * Adjust GC_log_printf format specifiers (regarding signed/unsigned long).
73 * Adjust GC_requested_heapsize on GC_init if GC_INITIAL_HEAP_SIZE given.
74 * Allow GC_exclude_static_roots() region start to be unaligned.
75 * Allow Win32 DllMain chaining on the client side.
76 * Allow to exclude finalization support by GC_NO_FINALIZATION macro.
77 * Allow to get memory via Win32 VirtualAlloc (USE_WINALLOC) on Cygwin.
78 * Avoid unnecessary GC_find_limit invocation if GC_no_dls.
79 * Avoid use of deprecated GC_dont_gc and GC_stackbottom in gctest.
80 * Cast pointers to word (instead of unsigned long) in specific.h.
81 * Changed the order in autogen.sh so ltmain exists in time for automake.
82 * Declare privately and use handy GC_base_C() for constant object pointers.
83 * Define GC_DLL if DLL_EXPORT at GC build (for Cygwin/MinGW).
84 * Define GC_READ_ENV_FILE in configure for WinCE unless gc-debug is off.
85 * Do not compile backgraph.c unless configure '--enable-gc-debug'.
86 * Do not compile pthread_stop_world.c for Cygwin/Darwin (configure).
87 * Do not install ancient new_gc_alloc.h broken for modern STL (configure).
88 * Enable GC_MIN_MARKERS to set minimal number of pthread-based markers.
89 * Enable PARALLEL_MARK and THREAD_LOCAL_ALLOC for FreeBSD in configure.
90 * Enable parallel mark by default in configure (Darwin/Linux/Solaris/Win32).
91 * Export GC_is_marked, GC_clear/set_mark_bit (for mark-bit manipulation).
92 * Extend thread-related debug messages.
93 * Fix 'configure --enable-cplusplus' for Cygwin/MinGW.
94 * Fix DATASTART (and other minor improvements) for NaCl target.
95 * Fix GC_setspecific to prevent garbage collection inside.
96 * Fix compiler warning in cordtest.
97 * Fix minor warnings reported by GCC with '-pedantic' option.
98 * Fix static data roots registration on Android (if GC is shared).
99 * Implement GC_get_stack_base for Darwin for single-threaded mode.
100 * Improve GC_allochblk algorithm of block splitting when unmapping enabled.
101 * Improve GC_collect_or_expand algorithm for many finalizers registered case.
102 * In tests, print a message in case a test is a no-op.
103 * Instruct configure to hide internal libgc.so symbols if supported by GCC.
104 * Log amount of unmapped memory (if enabled) on marking-for-collection.
105 * Make __data_start a weak symbol to allow loading modules on mips.
106 * Move "cord" library tests to "cord/tests" folder.
107 * Move asm machine-dependent files to "src" folder.
108 * Move build tools sources to "tools" folder.
109 * Move cord_pos.h to public headers folder.
110 * Open log file in APPEND mode on Win32 (similar that on Unix/Cygwin).
111 * Optimize some functions by moving pthread_self calls out of LOCK section.
112 * Place only major per-release changes description to ChangeLog (this file).
113 * Prevent compiler warnings in GC_FindTopOfStack and GC_ports (Darwin).
114 * Recognize GC_LOG_TO_FILE_ALWAYS macro to log to 'gc.log' by default.
115 * Remove all auto-generated files from the repo.
116 * Remove binary icon file for de_win.
117 * Remove cordtest from "cord" library.
118 * Remove duplicate MacOS_Test_config.h file.
119 * Remove gc_amiga_redirects.h (included internally) from public headers.
120 * Remove obsolete Makefile.DLL (superseded by Cygwin/MinGW configure).
121 * Remove obsolete unused asm files for ALPHA, HPUX, SGI, RS6000, ULTRIX.
122 * Remove unsupported MMAP_STACKS (specific to Solaris threads).
123 * Remove unused ancient SILENT, __STDC__, NO_SIGNALS macros.
124 * Replace ARGSUSED comment-based annotation with GCC 'unused' attribute.
125 * Replace GC_ms_entry declaration with opaque definition for public API.
126 * Replace long GC_markers global variable with int GC_markers_m1.
127 * Replace pointer relational comparisons with non-pointer ones.
128 * Replace printf PRIxMAX specifier with '%p' for thread id debug output.
129 * Require autoconf 2.61 instead of v2.64.
130 * Simplify autogen.sh (use autoreconf).
131 * Split GC_abort with GC_on_abort and abort() invoked from ABORT.
132 * Support GC_ATTR_MALLOC for MS VisualStudio.
133 * Tag auxiliary malloc-like API functions with 'malloc' attribute.
134 * Tag deprecated variables in GC API.
135 * Tag must-be-non-null arguments of GC API functions.
136 * Turn on "extra" GCC warnings.
137 * Turn on unused-parameter checking for GCC.
138 * Update AUTHORS file.
139 * Use EXPECT for checking various 'initialized' boolean variables.
140 * Use USE_COMPILER_TLS on Cygwin.
141 * Use pthread_key for thread-local storage on FreeBSD.
142 * Use union of AO_t and word to favor strict-aliasing compiler optimization.
145 == [7.2e] (candidate) ==
147 * Fix GC_clear_stack by declaring 'dummy' local array as volatile.
148 * Fix GC_get_stack_base assembly code (Cygwin/Clang).
149 * Fix GC_unix_mmap_get_mem for open of /dev/zero failure.
150 * Fix min_bytes_allocd preventing potential infinite loop in GC_allocobj.
151 * Fix null-pointer dereference in CORD_substr_closure.
152 * Fix potential double fclose in test_extras (cordtest).
153 * Fix pthread_attr_t resource leak in pthread_create.
154 * Fix sizeof in GC_push_thread_structures.
155 * Fix unportable '==' test operators in configure.
156 * Fix vsprintf_args cleanup in CORD_vsprintf.
159 == [7.2d] 2012-08-09 ==
161 * Fix GC_call_with_stack_base to prevent its tail-call optimization.
162 * Fix all address-of-dummy operations by using GC_approx_sp() instead.
163 * Fix stop_info.stack_ptr assignment in GC_suspend_all for OpenBSD.
164 * Fix test_cpp (ensure the collector recognizes pointers to interiors).
165 * Fix thread-related tests for pthreads-w32.
166 * test_cpp: Fix WinMain to prevent SEGV if zero arguments passed (MinGW).
169 == [7.2c] 2012-06-11 ==
171 * Fix CORD_cat_char_star to prevent SEGV in case of out-of-memory.
172 * Fix GC_FirstDLOpenedLinkMap() for NetBSD 6 release.
173 * Fix GC_scratch_alloc and GC_get_maps invocations to prevent SEGV.
174 * Fix visibility of GC_clear/set_mark_bit (unhide symbols).
175 * Fix visibility of GC_push_all/conditional, GC_push_other_roots symbols.
178 == [7.2b] 2012-05-23 ==
180 * Fix assertion in GC_malloc_[atomic_]uncollectable (THREADS case only).
183 == [7.2] 2012-05-11 ==
185 * Abort in GC_thr_init on pthread_atfork failure (POSIX threads).
186 * Add GC_WIN32_PTHREADS target in configure.
187 * Add GC_is_disabled new function to GC API.
188 * Add info that getcontext() resets FPE mask no longer on Linux/x86_64.
189 * Add public GC_set_handle_fork to control forked child handling support.
190 * Add realloc_test.c test.
191 * Add support for Hexagon target.
192 * Add thread-safe GC_get_heap_usage_safe to GC API.
193 * Change GC_check_fl_marks prototype and implementation.
194 * Check pthread_create/join result in test.
195 * Define GC_DLL (in configure) if building only dynamic libraries.
196 * Define NO_DEBUGGING (in configure) if "--disable-gc-debug" is set.
197 * Disable incremental mode on Darwin if fork handling requested.
198 * Enable parallel marker in configure for Solaris.
199 * Fix "comparison of signed and unsigned values" compiler warnings.
200 * Fix 'volatile' keyword placement in GC_SysVGetDataStart.
201 * Fix ALIGNMENT, CPP_WORDSZ, GC_GRANULE_BYTES/WORDS for x32 target.
202 * Fix GC_READ_ENV_FILE code for Cygwin.
203 * Fix GC_add_roots_inner for Mac OS X (align segment start).
204 * Fix GC_check_fl_marks regarding concurrent access.
205 * Fix GC_finalizer_nested size to workaround alignment problem in Watcom.
206 * Fix GC_find_limit_with_bound to always reset fault handler on return.
207 * Fix GC_init static assertion for clang/x64 (Darwin).
208 * Fix GC_init[_lib_bounds] and GC_get_main_stack_base for malloc redirection.
209 * Fix GC_push_all/selected boundaries check.
210 * Fix GC_register_my_thread marking thread as detached (Cygwin/pthreads-w32).
211 * Fix GC_remove_all_threads_but_me to cleanup thread-specific data storage.
212 * Fix GC_restart_handler to preserve errno if needed.
213 * Fix GC_root_size update in GC_add_roots_inner (Win32).
214 * Fix GC_unregister_my_thread to ensure no ongoing incremental GC (Win32).
215 * Fix GC_with_callee_saves_pushed for clang (disable __builtin_unwind_init).
216 * Fix calloc, GC_generic_malloc to check for allocation size overflows.
217 * Fix compiler warning in GC_dyld_image_add/remove (Darwin).
218 * Fix configure --enable-cplusplus make install.
219 * Fix configure to disable GCC aliasing optimization unless forced to.
220 * Fix duplicate definitions in gcconfig.h for NetBSD.
221 * Fix fork() support on Cygwin and Darwin targets.
222 * Fix gc.h compatibility regression regarding GC_PTR, GC_I_HIDE_POINTERS.
223 * Fix gc_cpp.cc for Cygwin (remove duplicate function definition).
224 * Fix gcconfig.h to define USE_GET_STACKBASE_FOR_MAIN for Android.
225 * Fix gcconfig.h to handle mips64-linux target.
226 * Fix gctest (for Win32) to avoid GC_print_stats internal variable usage.
227 * Fix mach_dep.c to include sys/ucontext.h on Mac OS X 10.6.
228 * Fix tests to check GC_malloc result for NULL (out-of-memory).
229 * Fix thread model in configure for MinGW ("win32" instead of "posix").
230 * Fix various warnings reported by LINT-like tools.
231 * Fix visibility of some GC internal symbols used by GNU GCJ currently.
232 * Port some thread tests to Win32.
233 * Refine API GC setters and getter comments regarding locking.
234 * Refine GC_stackbottom description in gc.h.
235 * Remove duplicate calls in GC_register_dynamic_libraries.
236 * Remove locking in API GC_get_bytes_since_gc and friends.
237 * Remove newly-added GC_get_heap_size/free_bytes_inner from API.
238 * Remove some local variables that are unused.
239 * Support multi-threading for RTEMS target.
240 * Use global GC_noop_sink variable in GC_noop1 to suppress compiler warning.
241 * Use pkg-config to pick up libatomic_ops, etc.
242 * Workaround some Linux/arm kernels bug to get correct GC_nprocs value.
245 == [7.2alpha6] 2011-06-14 ==
247 * configure_atomic_ops.sh: Remove.
248 * Makefile.direct (dist gc.tar): Remove configure_atomic_ops.sh.
249 * Makefile.am (EXTRA_DIST): Add autogen.sh.
251 * NT_STATIC_THREADS_MAKEFILE (.cpp.obj): Remove duplicate .cpp
252 filename passed.
253 * NT_X64_THREADS_MAKEFILE (.cpp.obj): Use lowercase file
254 extension.
255 * NT_X64_STATIC_THREADS_MAKEFILE (.cpp.obj): Likewise.
256 * NT_MAKEFILE (.cpp.obj): Likewise.
258 * alloc.c (GC_add_current_malloc_heap, GC_build_back_graph,
259 GC_traverse_back_graph): Move prototype to gc_priv.h.
260 * checksums.c (GC_page_was_ever_dirty): Likewise.
261 * dbg_mlc.c (GC_default_print_heap_obj_proc): Likewise.
262 * dyn_load.c (GC_parse_map_entry, GC_get_maps,
263 GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base,
264 GC_get_next_stack): Likewise.
265 * finalize.c (GC_reset_finalizer_nested,
266 GC_check_finalizer_nested): Likewise.
267 * gcj_mlc.c (GC_start_debugging, GC_store_debug_info): Likewise.
268 * malloc.c (GC_extend_size_map, GC_text_mapping): Likewise.
269 * mark_rts.c (GC_mark_thread_local_free_lists): Likewise.
270 * misc.c (GC_register_main_static_data, GC_init_win32,
271 GC_setpagesize, GC_init_linux_data_start,
272 GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf,
273 GC_initialize_offsets, GC_bl_init, GC_do_blocking_inner,
274 GC_bl_init_no_interiors): Likewise.
275 * os_dep.c (GC_greatest_stack_base_below, GC_push_all_stacks):
276 Likewise.
277 * reclaim.c (GC_check_leaked): Likewise.
278 * win32_threads.c (GC_gww_dirty_init): Likewise.
279 * darwin_stop_world.c (GC_is_mach_marker, GC_mprotect_stop,
280 GC_mprotect_resume): Move prototype to darwin_stop_world.h.
281 * pthread_support.c (GC_FindTopOfStack): Likewise.
282 * dyn_load.c (GC_cond_add_roots): Merge adjacent definitions.
283 * mark.c (GC_page_was_ever_dirty): Remove (as already declared).
284 * mark_rts.c (GC_roots_present): Change return type to void
285 pointer (to match the prototype); return NULL instead of FALSE.
286 * mark_rts.c (GC_add_roots_inner): Cast GC_roots_present() result.
287 * os_dep.c (NEED_PROC_MAPS): Move definition to gcconfig.h.
288 * os_dep.c (GC_write_fault_handler): Make STATIC.
289 * os_dep.c (GC_set_write_fault_handler): New function (only if
290 GC_WIN32_THREADS).
291 * pthread_start.c (GC_start_rtn_prepare_thread,
292 GC_thread_exit_proc): Move prototype to pthread_support.h.
293 * pthread_support.c (GC_nacl_initialize_gc_thread,
294 GC_nacl_shutdown_gc_thread, GC_unblock_gc_signals):
295 Likewise.
296 * pthread_support.c (GC_stop_init): Move prototype to
297 pthread_stop_world.h.
298 * win32_threads.c (GC_write_fault_handler): Remove prototype.
299 * win32_threads.c (GC_register_my_thread_inner): Call
300 GC_set_write_fault_handler instead of SetUnhandledExceptionFilter
301 (only if MPROTECT_VDB).
302 * doc/README.win32: Add information about DMC.
303 * include/private/gc_priv.h (GC_set_write_fault_handler): New
304 prototype (only if GC_WIN32_THREADS and MPROTECT_VDB).
306 * misc.c (vsnprintf): Redirect to vsprintf() if NO_VSNPRINTF.
308 * win32_threads.c (GC_unregister_my_thread): Use KNOWN_FINISHED()
309 instead of FINISHED macro.
310 * tests/test.c (check_heap_stats): Round up max_heap_sz value for
311 Win32 (same as for USE_MMAP).
313 * tests/test.c (check_heap_stats): Adjust printf format specifier
314 for max_heap_sz; cast max_heap_sz accordingly.
316 * doc/README.solaris2: Add note.
318 * configure.ac (SOLARIS25_PROC_VDB_BUG_FIXED): Don't define for
319 Solaris/x86 2.10+.
321 * tests/threadkey_test.c (SKIP_THREADKEY_TEST): Skip the test if
322 defined; explicitly define for some targets.
324 * mark.c (GC_dirty): Add prototype (only if MANUAL_VDB).
325 * stubborn.c (GC_dirty): Likewise.
326 * include/private/gcconfig.h (GWW_VDB, MPROTECT_VDB, PCR_VDB,
327 PROC_VDB): Undefine if MANUAL_VDB.
328 * include/private/gcconfig.h (DEFAULT_VDB): Don't define if
329 MANUAL_VDB.
330 * os_dep.c (async_set_pht_entry_from_index): Define for
331 MANUAL_VDB.
332 * os_dep.c (GC_read_dirty): Set GC_dirty_maintained only if
333 success; if ioctl() failed then just print warning instead of
334 aborting.
336 * include/private/gc_priv.h (GC_ASSERT): Use "%d" (instead of %ld)
337 for line number printing.
339 * os_dep.c (GC_read_dirty): Add debug logging if DEBUG_DIRTY_BITS
340 (for PROC_VDB only); print errors via GC_err_printf; rename "ps"
341 and "np" local variables to npages and pagesize, respectively;
342 remove "current_addr" local variable.
344 * os_dep.c (GC_get_main_stack_base): Convert to GC_get_stack_base
345 for BeOS and OS/2; define HAVE_GET_STACK_BASE.
346 * os_dep.c (GET_MAIN_STACKBASE_SPECIAL): Define when a specific
347 GC_get_main_stack_base implementation is defined.
348 * os_dep.c (GC_get_main_stack_base): Define that based on
349 GC_get_stack_base() in a single place (only if
350 GET_MAIN_STACKBASE_SPECIAL is unset); check GC_get_stack_base()
351 result.
353 * mark.c (GC_push_selected): Remove "push_fn" argument (use
354 GC_push_all directly); update the documentation.
355 * mark.c (GC_push_conditional): Simplify the code (for better
356 readability).
358 * mark.c (alloc_mark_stack): Use FALSE/TRUE (instead of 0/1) for
359 boolean local variables.
360 * doc/README.macros (GC_PREFER_MPROTECT_VDB): Update.
361 * os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty,
362 GC_remove_protection): Define for GWW_VDB and PROC_VDB in a single
363 place.
364 * os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty): Compute
365 PHT_HASH(h) only once (store result to a local variable).
367 * doc/README.solaris2: Update.
369 * include/private/gcconfig.h (end, InitStackBottom): Declare
370 extern variable for RTEMS.
371 * include/private/gcconfig.h (DATASTART, DATAEND, STACKBOTTOM):
372 Update (for RTEMS).
373 * include/private/gcconfig.h (DATAEND): Fix a typo in the macro
374 name (for RTEMS).
375 * tests/test.c (CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER):
376 Replace with CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER (for RTEMS).
378 * include/private/gcconfig.h (MPROTECT_VDB): Enable for Solaris in
379 single-threaded environment.
381 * include/private/gcconfig.h (MPROTECT_VDB): Undefine if PROC_VDB.
382 * tests/test.c (NUMBER_ROUND_UP): New macro.
383 * tests/test.c (check_heap_stats): Round up total expected heap
384 size to the nearest 4 MiB bound.
385 * tests/test.c (check_heap_stats): Print the current and expected
386 heap sizes in case of failure.
388 * checksums.c (GC_check_blocks, GC_check_dirty): Do log printing
389 only if GC_print_stats; print errors using GC_err_printf.
390 * checksums.c (GC_check_blocks): Join adjacent printf() calls into
391 a single one.
393 * pthread_support.c (pthread_join): Add assertion (check thread is
394 finished).
395 * pthread_support.c (GC_register_my_thread): Don't detach the
396 thread if invoked from the thread destructor.
397 * win32_threads.c (GC_register_my_thread): Likewise.
398 * win32_threads.c (GC_unregister_my_thread): Don't delete the
399 thread (just set FINISHED) if the thread is not detached (only if
400 GC_PTHREADS); add assertion (check the thread is not finished).
401 * tests/threadkey_test.c (main): Join some created threads.
403 * pthread_support.c (GC_delete_gc_thread): Rename "gc_id" local
404 variable to "t".
405 * win32_threads.c (GC_delete_gc_thread): Likewise.
406 * pthread_support.c (pthread_join, pthread_detach,
407 pthread_cancel): Rename "thread_gc_id" local variable to "t".
408 * win32_threads.c (GC_pthread_detach): Likewise.
409 * win32_threads.c (GC_delete_gc_thread): Remove "gc_nvid" local
410 variable.
411 * win32_threads.c (GC_pthread_join): Rename "joinee" local
412 variable to "t".
414 * pthread_stop_world.c (pthread_sigmask): Undefine even if not
415 DEBUG_THREADS.
416 * pthread_stop_world.c (GC_unblock_gc_signals): New function (only
417 if GC_EXPLICIT_SIGNALS_UNBLOCK).
418 * pthread_support.c (GC_unblock_gc_signals): New prototype.
419 * pthread_support.c (GC_register_my_thread_inner,
420 GC_register_my_thread): Call GC_unblock_gc_signals (only if
421 GC_EXPLICIT_SIGNALS_UNBLOCK); add comment.
422 * include/private/gcconfig.h (GC_EXPLICIT_SIGNALS_UNBLOCK): New
423 macro.
425 * pthread_stop_world.c (GC_suspend_handler_inner): Remove "dummy",
426 "sig" local variables; rename my_thread local variable to "self".
428 * tests/threadkey_test.c (LIMIT): Use smaller value (don't create
429 more than 30 in parallel by default).
431 * tests/threadkey_test.c (key_once, main): Work around for Solaris
432 PTHREAD_ONCE_INIT.
433 * tests/threadkey_test.c (LIMIT): Use smaller value for Solaris.
435 * dyn_load.c (GC_FirstDLOpenedLinkMap): Remove unused "r" local
436 variable.
437 * pthread_support.c (GC_unregister_my_thread_inner): Revert back
438 GC_remove_specific invocation; add a comment.
439 * include/private/thread_local_alloc.h (GC_remove_specific):
440 Revert back.
441 * specific.c (slow_getspecific): Cast qtid to AO_t.
442 * include/private/specific.h (key_create, setspecific,
443 remove_specific): Remove "extern" keyword.
444 * include/private/specific.h (getspecific): Change type of "qtid"
445 local variable to unsigned long.
447 * pthread_support.c (GC_check_tls): Fix "#endif" comment.
448 * include/gc.h (GC_REDIRECT_TO_LOCAL): Remove deprecated comment.
449 * include/private/thread_local_alloc.h (THREAD_LOCAL_ALLOC):
450 Remove redundant test of the macro.
452 * backgraph.c (add_edge): Recognize DEBUG_PRINT_BIG_N_EDGES macro.
453 * os_dep.c (GC_set_and_save_fault_handler): Recognize
454 SIGACTION_FLAGS_NODEFER_HACK macro.
455 * pthread_support.c (mark_mutex): Recognize GLIBC_2_1_MUTEX_HACK
456 macro.
457 * pthread_support.c (GC_acquire_mark_lock): Remove commented out
458 code.
459 * include/private/gc_priv.h (SUNOS5SIGS): Don't include
460 sys/siginfo.h on Linux.
461 * include/private/gcconfig.h (FORCE_WRITE_PREFETCH): New macro
462 recognized, force PREFETCH_FOR_WRITE to be defined on x86.
463 * include/private/gcconfig.h (USE_HPUX_FIXED_STACKBOTTOM): New
464 macro recognized (for HP/UX).
466 * os_dep.c (GC_gww_page_was_ever_dirty): Fix comment (for
467 GWW_VDB).
468 * os_dep.c (GC_dirty_init): Use memset() for GC_written_pages
469 resetting (for PROC_VDB).
471 * tests/threadkey_test.c: New file.
472 * tests/tests.am (TESTS, check_PROGRAMS): Add 'threadkey_test'.
473 * tests/tests.am (threadkey_test_SOURCES, threadkey_test_LDADD):
474 New variable.
476 * pthread_support.c (GC_unregister_my_thread_inner): Don't call
477 GC_remove_specific.
478 * include/private/thread_local_alloc.h (GC_remove_specific):
479 Remove (since it is empty for all targets).
480 * pthread_support.c (GC_record_stack_base): New inline function.
481 * win32_threads.c (GC_record_stack_base): Likewise.
482 * pthread_support.c (GC_register_my_thread_inner): Invoke
483 GC_record_stack_base.
484 * win32_threads.c (GC_register_my_thread_inner): Likewise.
485 * pthread_support.c (GC_register_my_thread): If thread is FINISHED
486 then call GC_record_stack_base, clear FINISHED, initialize
487 thread-local list and return success.
488 * win32_threads.c (GC_register_my_thread): Likewise.
489 * include/gc.h (GC_register_my_thread): Update documentation.
490 * include/private/thread_local_alloc.h (GC_thread_key): Likewise.
492 * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Join
493 adjacent "#ifdef".
494 * thread_local_alloc.c (GC_malloc_atomic): Call
495 GC_core_malloc_atomic (instead of GC_core_malloc).
497 * pthread_start.c (GC_start_rtn_prepare_thread): Change return
498 type to GC_thread.
499 * pthread_start.c (GC_inner_start_routine): Pass the current
500 thread descriptor to pthread_cleanup_push (same as in
501 win32_threads.c).
502 * pthread_stop_world.c (GC_push_all_stacks): Rename "me" local
503 variable to "self".
504 * win32_threads.c (GC_push_all_stacks): Likewise.
505 * pthread_stop_world.c (GC_suspend_all, GC_start_world): Rename
506 "my_thread" local variable to "self".
507 * pthread_support.c (GC_unregister_my_thread_inner): New static
508 function.
509 * pthread_support.c (GC_unregister_my_thread,
510 GC_thread_exit_proc): Use GC_unregister_my_thread_inner.
511 * win32_threads.c (GC_register_my_thread, GC_unregister_my_thread,
512 GC_do_blocking_inner): Rename "t" local variable to "thread_id".
513 * win32_threads.c (GC_wait_marker, GC_notify_all_marker): Rename
514 "id" local variable to "thread_id".
516 * pthread_support.c (GC_unregister_my_thread): Call pthread_self
517 only once.
518 * win32_threads.c (GC_pthread_start_inner): Likewise.
519 * pthread_support.c (GC_unregister_my_thread): Add debug output.
520 * win32_threads.c (GC_unregister_my_thread): Likewise.
521 * pthread_support.c (GC_register_my_thread,
522 GC_start_rtn_prepare_thread): Rename "my_pthread" local variable
523 to "self".
525 * include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): Define
526 unconditionally (do not test GC_I_HIDE_POINTERS); update the
527 comment.
528 * include/gc.h (HIDE_POINTER, REVEAL_POINTER): Define as alias to
529 GC_HIDE/REVEAL_POINTER, respectively.
530 * include/private/gc_pmark.h (GC_I_HIDE_POINTERS): Do not define.
531 * include/private/gc_priv.h (GC_I_HIDE_POINTERS): Likewise.
533 * include/gc.h (GC_register_my_thread): Refine the comment.
535 * include/gc_inline.h (GC_MALLOC_WORDS, GC_CONS): Add missing
536 parentheses.
537 * include/gc_typed.h (GC_get_bit, GC_set_bit,
538 GC_CALLOC_EXPLICITLY_TYPED): Likewise.
540 * include/private/gcconfig.h (NO_GETCONTEXT): Add missing ')'.
542 * include/private/gcconfig.h (NO_GETCONTEXT): Do not use
543 getcontext(2) on m68k because it is not implemented there.
545 * alloc.c (GC_clear_a_few_frames): Use BZERO().
546 * mark_rts.c (GC_clear_roots, GC_rebuild_root_index): Likewise.
547 * reclaim.c (GC_start_reclaim): Likewise.
548 * blacklst.c (total_stack_black_listed): Remove "len" local
549 variable.
550 * dbg_mlc.c (GC_generate_random_valid_address): Replace "for"
551 statement with "do-while" one.
552 * dyn_load.c (GC_register_dynamic_libraries,
553 GC_register_dynlib_callback): Remove redundant parentheses.
555 * cord/cordxtra.c (CORD_from_file_lazy_inner): Suppress
556 "unused result" compiler warning for fread().
558 * os_dep.c (GC_write_fault_handler): Break when in_allocd_block
559 is set to true.
561 * dbg_mlc.c (GC_has_other_debug_info): Change return type to int;
562 return -1 if the object has (or had) debugging info but was
563 marked deallocated.
564 * include/private/dbg_mlc.h (GC_has_other_debug_info): Likewise.
565 * dbg_mlc.c (GC_has_other_debug_info): Update documentation;
566 remove "ohdr" local variable.
567 * dbg_mlc.c (GC_debug_free): Don't call GC_free if the object has
568 probably been deallocated.
569 * dbg_mlc.c (GC_debug_free): Don't actually free the object even
570 in the leak-finding mode if GC_findleak_delay_free.
571 * dbg_mlc.c (GC_check_leaked): New function (only unless
572 SHORT_DBG_HDRS).
573 * doc/README.environment (GC_FINDLEAK_DELAY_FREE): Document.
574 * doc/README.macros (GC_FINDLEAK_DELAY_FREE): Likewise.
575 * include/private/dbg_mlc.h (START_FLAG, END_FLAG): Use GC_WORD_C
576 on 64-bit architectures.
577 * include/private/dbg_mlc.h (NOT_MARKED): Remove redundant
578 parentheses.
579 * include/private/dbg_mlc.h (GC_HAS_DEBUG_INFO): Update (due to
580 GC_has_other_debug_info change).
581 * include/private/gc_priv.h (GC_findleak_delay_free): New global
582 variable declaration (unless SHORT_DBG_HDRS).
583 * misc.c (GC_findleak_delay_free): New global variable; recognize
584 GC_FINDLEAK_DELAY_FREE.
585 * misc.c (GC_init): Recognize GC_FINDLEAK_DELAY_FREE environment
586 variable (unless SHORT_DBG_HDRS).
587 * reclaim.c (GC_check_leaked): Declare (unless SHORT_DBG_HDRS).
588 * reclaim.c (GC_add_leaked): Don't add the object to leaked list
589 if marked as deallocated.
591 * dbg_mlc.c (GC_has_other_debug_info): Fix punctuation in the
592 comment.
593 * dbg_mlc.c (GC_FREED_MEM_MARKER): New macro.
594 * dbg_mlc.c (GC_debug_free): Use GC_FREED_MEM_MARKER.
595 * dbg_mlc.c (GC_smashed): Refine documentation.
596 * mark.c (GC_push_selected): Change dirty_fn return type to
597 GC_bool.
598 * os_dep.c (GC_page_was_ever_dirty): Make GC_INNER.
599 * reclaim.c (GC_reclaim_small_nonempty_block): Remove "kind"
600 local  variable.
601 * reclaim.c (GC_reclaim_block): Pass true constant to
602 GC_reclaim_small_nonempty_block (instead of report_if_found).
603 * doc/README.autoconf: Update; fix a typo.
604 * include/private/gcconfig.h (GC_WORD_C): New macro.
606 * dbg_mlc.c (GC_store_debug_info_inner): Cast "linenum".
607 * dbg_mlc.c (GC_check_annotated_obj): Fix punctuation in the
608 comment.
609 * dbg_mlc.c (GC_print_smashed_obj): Add (and print) "msg"
610 argument.
611 * dbg_mlc.c (GC_debug_free, GC_print_all_smashed_proc): Pass
612 message to GC_print_smashed_obj.
613 * dbg_mlc.c (GC_debug_free): Call GC_size once.
614 * dbg_mlc.c (GC_debug_realloc): Calculate old_sz only if
615 allocation succeeded; remove unnecessary check for object is
616 smashed (since this is done in GC_debug_free); remove "clobbered"
617 local variable.
619 * dbg_mlc.c (GC_store_debug_info_inner, GC_store_debug_info):
620 Rename "integer" argument to "linenum"; change the type of the
621 argument to int.
622 * gcj_mlc.c (GC_store_debug_info): Likewise.
623 * dbg_mlc.c (GET_OH_LINENUM): New macro.
624 * dbg_mlc.c (GC_print_obj, GC_print_smashed_obj): Use
625 GET_OH_LINENUM; adjust print format specifier.
626 * dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
627 GC_debug_malloc_atomic_ignore_off_page,
628 GC_debug_generic_malloc_inner,
629 GC_debug_generic_malloc_inner_ignore_off_page,
630 GC_debug_malloc_stubborn, GC_debug_malloc_atomic,
631 GC_debug_malloc_uncollectable,
632 GC_debug_malloc_atomic_uncollectable): Remove unnecessary cast of
633 "i".
634 * gcj_mlc.c (GC_debug_gcj_malloc): Likewise.
636 * os_dep.c (GC_linux_stack_base): Rename to
637 GC_linux_main_stack_base.
638 * os_dep.c (GC_freebsd_stack_base): Rename to
639 GC_freebsd_main_stack_base; adjust error message.
640 * pthread_stop_world.c (GC_stop_init): Use GC_SEM_INIT_PSHARED
641 as an argument for sem_init().
642 * pthread_support.c (pthread_create): Likewise.
643 * pthread_support.c (pthread_create): Abort in case sem_init()
644 fails.
645 * include/private/gc_priv.h (GC_SEM_INIT_PSHARED): Define.
646 * tests/initsecondarythread.c: Include gcconfig.h; call GC_INIT
647 from main() if it should be done from the primordial thread only.
649 * alloc.c: Don't include sys/types.h for ArmCC.
650 * dyn_load.c: Likewise.
651 * os_dep.c: Likewise.
652 * mach_dep.c (_setjmp, _longjmp): Redirect to setjmp/longjmp for
653 ArmCC.
654 * mark.c (GC_noop): Define specially for ArmCC.
655 * include/private/gc_priv.h (GC_noop): Likewise.
656 * misc.c (GC_init): Don't test pointers comparison for ArmCC.
657 * misc.c: Don't include unistd.h for ArmCC.
658 * os_dep.c (pages_executable): Rename to GC_pages_executable;
659 make STATIC.
660 * os_dep.c (GC_unix_mmap_get_mem): Don't define for ArmCC.
661 * ptr_chck.c (GC_is_visible): Explicitly cast
662 (GC_DS_PER_OBJECT-GC_INDIR_PER_OBJ_BIAS) to word (to suppress
663 a compiler warning).
664 * include/private/gcconfig.h: Recognize __arm.
665 * include/private/gcconfig.h (HBLKPTR): Define for ArmCC.
666 * include/private/gcconfig.h (HBLKPTR): Add parentheses for
667 "bytes" argument.
669 * pthread_support.c (GC_get_nprocs): Don't define for Android.
670 * pthread_support.c (GC_dummy_thread_local): Don't test
671 GC_LINUX_THREADS.
672 * include/gc_config_macros.h (GC_ADD_CALLER, GC_RETURN_ADDR):
673 Define for Android.
675 * mach_dep.c (NO_GETCONTEXT): Move to gcconfig.h.
676 * os_dep.c (GC_write_fault_handler): Don't include ucontext.h if
677 NO_GETCONTEXT.
678 * include/private/gcconfig.h (GETPAGESIZE): Define as a sysconf
679 call for Android.
681 * include/private/gc_locks.h (WIN32_LEAN_AND_MEAN, NOSERVICE):
682 Define before including windows.h.
683 * include/private/gc_priv.h (WIN32_LEAN_AND_MEAN, NOSERVICE):
684 Likewise.
685 * include/private/thread_local_alloc.h (WIN32_LEAN_AND_MEAN,
686 NOSERVICE): Likewise.
687 * include/private/gc_priv.h (MS_TIME_DIFF): Avoid floating-point
688 arithmetics; add a comment.
690 * mark.c (GC_clear_hdr_marks): Don't test USE_MARK_BYTES.
691 * extra/setjmp_t.c (main): Don't test USE_MARK_BITS.
692 * include/private/gc_pmark.h (SET_MARK_BIT_EXIT_IF_SET): Likewise.
693 * include/private/gc_pmark.h (SET_MARK_BIT_EXIT_IF_SET): Remove
694 "mark_byte" local variable.
695 * include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET): Add a comment
696 about that AO_or() is not used by GC unless USE_MARK_BITS
697 explicitly set.
698 * include/private/gc_priv.h (OR_WORD): Likewise.
699 * include/private/gc_pmark.h (INCR_MARKS): Remove trailing ';',
700 add parentheses.
701 * include/private/gc_priv.h (ONES): Define before use by
702 MAKE_COOLER.
703 * include/private/gc_priv.h (MARK_BITS_SZ): Define where used.
704 * include/private/gc_priv.h (OR_WORD): Don't define if
705 USE_MARK_BYTES.
706 * include/private/gcconfig.h (USE_MARK_BYTES); Remove duplicate
707 definition; simplify expression.
709 * os_dep.c (GC_get_maps): Always close the file.
710 * pthread_support.c (GC_get_nprocs): Likewise.
711 * os_dep.c (READ): Define similarly across the file (without
712 parameters).
713 * pthread_support.c (GC_get_nprocs): Use signed int type for "i"
714 and "len" local variables (since read() may return -1).
715 * include/private/gc_pmark.h (LONG_MULT): Add prefix/suffix
716 double underscore; add "volatile" for asm.
717 * include/private/gc_pmark.h (LONG_MULT): Add missing
718 parentheses.
719 * include/private/gc_priv.h (OR_WORD): Likewise.
720 * include/private/gc_priv.h (OR_WORD): Remove unnecessary brackets
721 and ';' symbol.
723 * os_dep.c (GC_get_stack_base): Implement for Android (same as
724 for Linux).
725 * pthread_support.c (GC_get_nprocs): Return 1 (instead of -1) if
726 failed to open "stat" file (not to issue a warning twice); update
727 the comment.
728 * pthread_support.c (GC_thr_init): Call sysconf() on Android to
729 get the number of CPUs.
731 * include/private/gc_priv.h (_GNU_SOURCE): Revert one of the
732 recent patches regarding this macro as the macro should be set
733 (to 1) before including any other system header.
735 * doc/README.environment (GC_INITIAL_HEAP_SIZE,
736 GC_MAXIMUM_HEAP_SIZE): Update.
738 * misc.c (GC_parse_mem_size_arg): Allow 'k', 'M', 'G' suffixes in
739 heap size specifier; return 0 if not a valid one.
740 * include/gc_cpp.h: Explicitly define inline one-argument delete
741 operator for Cygwin (as a workaround).
742 * tests/test_cpp.cc (main): Suppress compiler warnings about
743 "assigned value is unused".
745 * misc.c (GC_parse_mem_size_arg): New function.
746 * misc.c (GC_init): Use GC_parse_mem_size_arg().
747 * pthread_stop_world.c (tkill): Declare for Android.
749 * include/private/gc_priv.h (_GNU_SOURCE): Include features.h
750 first (except for NaCl) and then define the macro to 1 if not yet.
752 * tests/tests.am (TESTS, check_PROGRAMS): Add
753 'initsecondarythread'.
754 * tests/tests.am (initsecondarythread_SOURCES,
755 initsecondarythread_LDADD): New variable.
757 * dbg_mlc.c (GC_store_debug_info_inner): Always define; add
758 "const" to its string argument.
759 * dbg_mlc.c (GC_store_debug_info): Call GC_store_debug_info_inner.
760 * dbg_mlc.c (GC_debug_free): Set GC_have_errors in case of
761 smashed or previously deallocated found.
762 * dbg_mlc.c (GC_check_heap_block): Replace while loop with a for
763 one.
764 * reclaim.c (GC_reclaim_check): Likewise.
765 * dbg_mlc.c (GC_check_heap_proc): Remove redundant cast to word.
766 * os_dep.c (GC_get_stack_base): Don't initialize
767 stackbase_main_self/ss_sp on Solaris if thr_main() is zero (thus
768 calling GC_INIT() from a non-primordial thread is possible now).
769 * reclaim.c (GC_add_leaked): Turn into an inline one.
770 * reclaim.c (GC_reclaim_small_nonempty_block):
771 Change report_if_found type from int/word to boolean.
772 * include/private/gc_priv.h (GC_start_reclaim): Likewise.
773 * include/private/gc_priv.h (set_mark_bit_from_hdr,
774 clear_mark_bit_from_hdr): Place closing parenthesis properly.
776 * os_dep.c (GC_get_main_stack_base): Try to use
777 pthread_attr_getstack first for Linux if THREADS.
778 * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Adjust text
779 alignment.
781 * dbg_mlc.c (GC_generate_random_backtrace_no_gc): Fix a message
782 typo.
783 * dbg_mlc.c (GC_debug_malloc): Add a comment (about zero size).
784 * dbg_mlc.c (GC_strdup): Call GC_err_printf instead of WARN (in
785 case of NULL argument).
786 * dbg_mlc.c (GC_free): In case of NULL argument, just return
787 (without any warning printed); eliminate "uncollectable" local
788 variable.
790 * configure.ac (THREADDLLIBS): Use alternate thread library on
791 Solaris 8.
792 * configure.ac (need_atomic_ops_asm): Set to true only for Sparc
793 Solaris.
794 * configure.ac: Don't use libdl on mips-sgi-irix6.
796 * mach_dep.c (NO_GETCONTEXT); Define for RTEMS.
797 * mach_dep.c (GC_with_callee_saves_pushed): Don't call
798 __builtin_unwind_init() for RTEMS; use setjmp() without the
799 leading underscore (for RTEMS).
800 * tests/test.c (BIG): Use smaller value for RTEMS.
801 * tests/test.c (main): Customize for RTEMS.
803 * configure.host: Remove doubled words in comments.
804 * os_dep.c: Likewise.
805 * doc/README: Likewise.
806 * extra/setjmp_t.c: Likewise.
807 * tests/huge_test.c: Likewise.
808 * extra/setjmp_t.c (getpagesize, nested_sp, main, g): Replace the
809 K&R-style function definition with the ANSI C one.
810 * extra/setjmp_t.c (nested_sp): Implement in the same way as
811 GC_approx_sp.
813 * dyn_load.c (GC_dyld_sections): Add more sctions.
814 * dyn_load.c (GC_dyld_add_sect_fmts): New static varaible.
815 * dyn_load.c (L2_MAX_OFILE_ALIGNMENT): New macro.
816 * dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove): Improve
817 logging; add support for on-demand sections.
819 * gcj_mlc.c (GC_gcj_malloc_initialized): Use STATIC unless
820 GC_ASSERTIONS.
821 * include/private/gc_priv.h (GC_gcj_malloc_initialized): Don't
822 declare (as external) unless GC_ASSERTIONS.
823 * os_dep.c (GC_win32_free_heap): Clear GC_heap_bases[] also for
824 Cygwin; add FIXME.
825 * include/private/gcconfig.h: Include <sys/unistd.h> for RTEMS.
826 * include/private/gcconfig.h: Add "#error" for every "-->" mark.
827 * include/private/gcconfig.h (CLEAR_DOUBLE): Turn the code into
828 an expression.
829 * include/private/pthread_support.h (SUSPENDED_EXT): Add new flag
830 (which existed previously as SUSPENDED and still exists in GCJ).
831 * include/private/pthread_support.h (DISABLED_GC): Change the
832 value (as it is already used by SUSPENDED_EXT).
834 * tests/test.c (reverse_test):  Modify count (BIG) for
835 ppc64-darwin.
837 * reclaim.c (GC_print_all_errors): Recognize new GC_ABORT_ON_LEAK
838 macro and environment variable; abort if any error has been
839 printed provided the environment variable (or macro) is set.
840 * doc/README.environment (GC_ABORT_ON_LEAK): Document.
841 * doc/README.macros (GC_ABORT_ON_LEAK): Likewise.
843 * os_dep.c (GC_unix_sbrk_get_mem, GC_unix_get_mem): Don't define
844 for RTEMS.
845 * include/private/gcconfig.h (RTEMS): Add support for.
846 * include/private/gcconfig.h (GET_MEM): Use calloc() for RTEMS.
848 * mallocx.c (GC_malloc_uncollectable): Move to malloc.c (since
849 it is used internally in some places).
851 * dbg_mlc.c (GC_register_finalizer_no_order): Remove redundant
852 declaration.
853 * dbg_mlc.c (GC_debug_malloc_replacement,
854 GC_debug_realloc_replacement): Rename RA to GC_DBG_RA.
855 * malloc.c (GC_debug_malloc_replacement): Likewise.
856 * mallocx.c (GC_debug_realloc_replacement): Likewise.
857 * dbg_mlc.c (GC_store_debug_info): Move proto from dbg_mlc.h.
858 * malloc.c (GC_strdup, GC_strndup, GC_wcsdup): Move to mallocx.c.
859 * malloc.c: Include errno.h only REDIRECT_MALLOC; remove redundant
860 includes of string.h.
861 * mallocx.c: Include string.h (for GC_strdup).
862 * include/private/dbg_mlc.h (GC_store_debug_info): Move declaration
863 to dbg_mlc.c.
864 * include/private/gc_locks.h (UNCOND_LOCK, UNCOND_UNLOCK): Remove
865 redundant trailing ';'.
866 * include/private/gc_priv.h (START_WORLD, COND_DUMP): Likewise.
867 * include/private/gc_locks.h (LOCK, UNLOCK): Place opening '{'
868 properly.
869 * include/private/gc_priv.h (GC_DBG_RA): Move from dbg_mlc.c,
870 malloc.c, mallocx.c.
872 * alloc.c (GC_check_heap, GC_print_all_smashed): Move the
873 definition from misc.c.
874 * dbg_mlc.c (GC_debug_malloc_atomic_uncollectable): Define as
875 public.
876 * include/gc.h (GC_debug_malloc_atomic_uncollectable): Declare.
877 * include/gc.h (GC_MALLOC_ATOMIC_UNCOLLECTABLE): Define new public
878 macro.
879 * dbg_mlc.c (MAX_SMASHED): Don't define if already set.
880 * reclaim.c (MAX_LEAKED): Likewise.
881 * dbg_mlc.c (GC_add_smashed): Add FIXME about the concurrent
882 access to the global array.
883 * reclaim.c (GC_add_leaked): Likewise.
884 * misc.c (GC_print_back_height): Set on if GC_PRINT_BACK_HEIGHT
885 (new macro) is defined.
886 * doc/README.macros (GC_PRINT_BACK_HEIGHT): Document.
887 * misc.c (GC_dump_regularly, GC_init): Replace 0/1 for
888 GC_dump_regularly and GC_print_back_height variables with
889 FALSE/TRUE.
890 * reclaim.c (GC_print_all_errors): Refine the comment.
892 * tests/test.c (reverse_test_inner): Undo one of the previous
893 patches which shifts "c" and "d" pointers only if
894 ALL_INTERIOR_POINTERS (since interior pointers are always
895 recognized in stacks).
897 * misc.c (GC_stdout, GC_stderr): Move the definition to the place
898 where GC_log is defined (Unix only).
899 * misc.c (GC_init): Recognize "GC_ONLY_LOG_TO_FILE" environment
900 variable and the similar macro; redirect GC_stdout and GC_stderr
901 to GC_log if "GC_LOG_FILE" environment variable is set unless
902 prohibited by GC_ONLY_LOG_TO_FILE (Unix only).
903 * doc/README.environment (GC_ONLY_LOG_TO_FILE): Document.
904 * doc/README.macros (GC_ONLY_LOG_TO_FILE): Likewise.
906 * misc.c (GC_stdout, GC_write): Rename GC_stdout to GC_log (Win32
907 only).
908 * misc.c (GC_write): Add for MacOS (and OS/2); change WRITE()
909 accordingly.
910 * misc.c (GC_printf): Check GC_quiet before va_start().
912 * allchblk.c (GC_freehblk): Use GC_log_printf instead of GC_printf
913 inside "if (GC_print_stats)" branch.
914 * alloc.c (GC_collect_or_expand): Likewise.
915 * dyn_load.c (GC_register_dynamic_libraries): Likewise.
916 * headers.c (GC_scratch_alloc): Likewise.
917 * os_dep.c (GC_get_maps, GC_remap, PROTECT,
918 GC_write_fault_handler, GC_dirty_init, GC_mprotect_thread): Likewise.
919 * alloc.c (min_bytes_allocd): Use GC_log_printf instead of
920 GC_printf for DEBUG_THREADS output.
921 * darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list,
922 GC_stop_world, GC_thread_resume, GC_start_world): Likewise.
923 * pthread_start.c (GC_inner_start_routine): Likewise.
924 * pthread_stop_world.c (GC_suspend_handler, GC_restart_handler,
925 GC_push_all_stacks, GC_suspend_all, GC_stop_world,
926 GC_start_world): Likewise.
927 * pthread_support.c (GC_mark_thread, GC_get_nprocs,
928 GC_start_rtn_prepare_thread, pthread_create): Likewise.
929 * checksums.c (GC_update_check_page): Use GC_printf() instead of
930 GC_err_printf() for error printing.
931 * checksums.c (GC_check_blocks, GC_check_dirty): Use GC_log_printf
932 instead of GC_printf for logging purposes.
933 * dyn_load.c (sys_errlist, sys_nerr, errno): Move declaration of
934 external variable outside from GC_register_dynamic_libraries.
935 * dyn_load.c (GC_register_dynamic_libraries): Don't use
936 sys_errlist value if errno equals to sys_nerr.
937 * dyn_load.c (GC_register_dynamic_libraries): Use GC_log_printf
938 instead of GC_printf for DL_VERBOSE output.
939 * dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove,
940 GC_init_dyld): Use GC_log_printf instead of GC_printf for
941 DARWIN_DEBUG output.
942 * os_dep.c (catch_exception_raise): Use GC_log_printf
943 instead of GC_printf for DEBUG_EXCEPTION_HANDLING output.
944 * reclaim.c (GC_print_free_list): Move "n" increment out of
945 GC_printf() call.
947 * win32_threads.c (DEBUG_CYGWIN_THREADS, DEBUG_WIN32_PTHREADS,
948 DEBUG_WIN32_THREADS): Remove.
949 * win32_threads.c (GC_register_my_thread_inner,
950 GC_win32_start_inner): Use GC_log_printf instead of GC_printf
951 inside "if (GC_print_stats)" branch.
952 * win32_threads.c (GC_PTHREAD_PTRVAL): New macro (defined only if
953 GC_PTHREADS).
954 * win32_threads.c (GC_delete_gc_thread, NUMERIC_THREAD_ID,
955 GC_pthread_join, GC_pthread_create): Use GC_PTHREAD_PTRVAL
956 macro.
957 * win32_threads.c (GC_push_stack_for, GC_mark_thread,
958 GC_CreateThread, GC_beginthreadex, GC_pthread_join,
959 GC_pthread_create, GC_pthread_start_inner, GC_thread_exit_proc,
960 GC_mark_thread_local_free_lists): Use GC_log_printf instead of
961 GC_printf for DEBUG_THREADS output.
962 * win32_threads.c (GC_win32_start_inner, GC_CreateThread,
963 GC_beginthreadex, GC_pthread_join, GC_pthread_create,
964 GC_pthread_start_inner, GC_thread_exit_proc): Cast
965 GetCurrentThreadId result to long; don't cast value of pthread_t
966 type to int; adjust printf format specifiers.
967 * doc/README.win32 (DEBUG_WIN32_PTHREADS): Remove obsolete
968 information.
970 * tests/test.c (cons, small_cons, gcj_cons, check_ints,
971 check_uncollectable_ints, print_int_list, check_marks_int_list,
972 fork_a_thread, finalizer, mktree, chktree, alloc8bytes,
973 alloc_small, tree_test, typed_test, check_heap_stats, WinMain,
974 test, main): Remove unnecessary casts of GC_printf calls to void.
976 * allchblk.c (GC_print_hblkfreelist): Adjust (make uniform across
977 BDWGC) printed message (adjust letters case, terminating dot and
978 new line symbols).
979 * alloc.c (GC_check_fl_marks): Likewise.
980 * backgraph.c (new_back_edges): Likewise.
981 * checksums.c (GC_check_dirty): Likewise.
982 * darwin_stop_world.c (GC_push_all_stacks,
983 GC_suspend_thread_list): Likewise.
984 * dbg_mlc.c (GC_print_type, GC_debug_free, GC_debug_realloc,
985 store_old): Likewise.
986 * dyn_load.c (GC_register_dynamic_libraries): Likewise.
987 * mark.c (GC_initiate_gc, GC_mark_some, GC_mark_from, GC_push_all,
988 GC_push_selected, GC_push_next_marked_dirty): Likewise.
989 * mark_rts.c (GC_exclude_static_roots_inner): Likewise.
990 * os_dep.c (GC_remap, GC_default_push_other_roots,
991 GC_push_thread_structures, GC_dirty_init, GC_read_dirty,
992 catch_exception_raise_state, catch_exception_raise_state_identity,
993 GC_mprotect_thread_notify, GC_mprotect_thread,
994 catch_exception_raise): Likewise.
995 * pthread_stop_world.c (GC_print_sig_mask, GC_push_all_stacks,
996 GC_stop_world, GC_stop_init): Likewise.
997 * pthread_support.c (GC_thr_init, GC_register_my_thread_inner,
998 GC_start_routine): Likewise.
999 * win32_threads.c (GC_register_my_thread_inner,
1000 GC_push_all_stacks, GC_win32_start_inner, GC_pthread_join,
1001 GC_pthread_start_inner): Likewise.
1002 * alloc.c (GC_expand_hp_inner): Realign the code.
1003 * mark.c (GC_mark_from, GC_mark_local, GC_do_parallel_mark):
1004 Likewise.
1005 * misc.c (GC_init): Likewise.
1006 * os_dep.c (GC_dirty_init, GC_read_dirty): Likewise.
1007 * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Likewise.
1008 * tests/test.c (run_one_test): Likewise.
1009 * misc.c (GC_err_puts): Document.
1010 * misc.c (GC_err_write): Remove.
1011 * os_dep.c (dump_maps): Likewise.
1012 * include/private/gc_priv.h (GC_err_write): Likewise.
1013 * os_dep.c (GC_print_address_map): Call GC_err_puts() instead of
1014 dump_maps() and GC_err_write().
1015 * os_dep.c (GC_read_dirty): Remove redundant brackets.
1017 * tests/test.c (reverse_test_inner): Test interior pointer
1018 recognition only if ALL_INTERIOR_POINTERS.
1019 * tests/test.c (run_one_test): Replace GC_all_interior_pointers
1020 with GC_get_all_interior_pointers(); simplify the expression.
1021 * tests/test.c (check_heap_stats): Replace GC_bytes_allocd and
1022 GC_bytes_allocd_before_gc with GC_get_total_bytes().
1023 * tests/test.c (main): Replace GC_gc_no with GC_get_gc_no().
1025 * dbg_mlc.c (GC_debug_strdup, GC_debug_free): Output a portability
1026 warning if the argument is NULL and GC is in leaks detection mode.
1027 * dbg_mlc.c (GC_debug_strndup, GC_debug_wcsdup): New public
1028 function definition.
1029 * malloc.c (GC_strndup, GC_wcsdup, strndup): Likewise.
1030 * mallocx.c (GC_posix_memalign): Likewise.
1031 * malloc.c (strdup): Fix string size value; rename "len" to "lb".
1032 * mallocx.c: Include errno.h unless WinCE (otherwise include
1033 windows.h for Win32 error constants).
1034 * win32_threads.c: Define WIN32_LEAN_AND_MEAN and NOSERVICE before
1035 windows.h inclusion.
1036 * misc.c (GC_init): Register at-exit callback if GC_find_leak
1037 (even if GC_FIND_LEAK macro is unset).
1038 * pthread_stop_world.c (NACL_STORE_REGS,
1039 __nacl_suspend_thread_if_needed, GC_nacl_initialize_gc_thread):
1040 Use BCOPY() instead of memcpy().
1041 * pthread_support.c (GC_init_real_syms): Likewise.
1042 * doc/README.macros (GC_DEBUG_REPLACEMENT, GC_REQUIRE_WCSDUP):
1043 Document new macro.
1044 * doc/README.macros (REDIRECT_MALLOC): Update documentation.
1045 * include/gc.h (GC_strndup, GC_posix_memalign, GC_debug_strndup):
1046 New API function prototype.
1047 * include/gc.h (GC_MALLOC, GC_REALLOC): Redirect to
1048 GC_debug_malloc/realloc_replacement() if GC_DEBUG_REPLACEMENT.
1049 * include/gc.h (GC_STRDUP): Remove redundant parentheses.
1050 * include/leak_detector.h (realloc, strdup): Likewise.
1051 * include/gc.h (GC_STRNDUP): New API macro.
1052 * include/gc.h (GC_NEW, GC_NEW_ATOMIC, GC_NEW_STUBBORN,
1053 GC_NEW_UNCOLLECTABLE): Add missing parentheses.
1054 * include/gc.h (GC_wcsdup, GC_debug_wcsdup): New API function
1055 prototype (only if GC_REQUIRE_WCSDUP).
1056 * include/gc.h (GC_WCSDUP): New API macro (only if
1057 GC_REQUIRE_WCSDUP).
1058 * include/leak_detector.h: Include stdlib.h and string.h after gc.h (unless
1059 GC_DONT_INCLUDE_STDLIB).
1060 * include/leak_detector.h (malloc, calloc, free, realloc):
1061 Undefine symbol before its redefinition.
1062 * include/leak_detector.h (strndup, memalign, posix_memalign):
1063 Redefine to the corresponding GC function.
1064 * include/leak_detector.h (wcsdup): Redefine to GC_WCSDUP (only
1065 if GC_REQUIRE_WCSDUP).
1066 * include/leak_detector.h (CHECK_LEAKS): Add comment; don't define
1067 the macro if already defined.
1069 * misc.c (GC_abort): Use _exit() (instead of DebugBreak) on Win32
1070 when doing code static analysis (to inform the tool that the
1071 function is a no-return one).
1072 * os_dep.c (GC_linux_stack_base): Remove a duplicate validation
1073 of the length of "stat" file; use signed int type for "i",
1074 "buf_offset" and "len" local variables (since read() may
1075 return -1).
1077 * blacklst.c (GC_bl_init_no_interiors): New function (the code
1078 moved from GC_bl_init).
1079 * blacklst.c (GC_bl_init): Invoke GC_bl_init_no_interiors unless
1080 GC_all_interior_pointers mode; remove unnecessarily parameter cast
1081 for GC_scratch_alloc call.
1082 * include/private/gc_priv.h (GC_bl_init): Move the function
1083 declaration to misc.c file.
1084 * misc.c (GC_bl_init_no_interiors): Add a prototype.
1085 * misc.c (GC_set_all_interior_pointers): Allow values other than 0
1086 and 1; allow altering GC_set_all_interior_pointers value even
1087 after GC initialization.
1088 * obj_map.c (GC_initialize_offsets): Clear GC_valid_offsets and
1089 GC_modws_valid_offsets if GC_all_interior_pointers is off.
1090 * misc.c (GC_init): Don't call GC_initialize_offsets() unless
1091 GC_all_interior_pointers mode.
1093 * alloc.c (GC_finish_collection): Remove redundant brackets;
1094 adjust code indentation.
1095 * blacklst.c (GC_add_to_black_list_normal): Simplify expression
1096 (to improve code readability).
1097 * blacklst.c (GC_is_black_listed): Join nested "if" (into a single
1098 conditional expression); initialize "nblocks" just before the loop
1099 beginning.
1100 * misc.c (GC_init): Don't compute initial_heap_sz if GC is already
1101 initialized.
1102 * include/private/gc_priv.h (GC_initialize_offsets): Move the
1103 function declaration to misc.c file.
1104 * obj_map.c (GC_initialize_offsets): Remove offsets_initialized
1105 static variable since the function is called only once.
1106 * tests/middle.c (main): Use setter for GC_all_interior_pointers;
1107 adjust printf format specifier (and cast the value passed to).
1109 * doc/README.macros (SMALL_CONFIG, LARGE_CONFIG): Refine the
1110 documentation.
1111 * include/private/gc_hdrs.h (LOG_BOTTOM_SZ): Ignore SMALL_CONFIG
1112 if LARGE_CONFIG is defined.
1113 * include/private/gc_priv.h (CPP_LOG_HBLKSIZE): Likewise.
1115 * alloc.c (GC_finish_collection): Replace "#else #ifdef" with
1116 "#elif".
1117 * include/private/gc_priv.h (CPP_LOG_HBLKSIZE, LOG_PHT_ENTRIES,
1118 MAX_ROOT_SETS, MAX_HEAP_SECTS): Likewise.
1119 * alloc.c (GC_expand_hp_inner): Check for GC_collect_at_heapsize
1120 overflow even if not LARGE_CONFIG.
1121 * dbg_mlc.c (GC_check_heap_proc): Check "oh" size even if
1122 SMALL_CONFIG.
1123 * finalize.c (GC_print_finalization_stats): Fix "#endif" comment.
1124 * doc/README.environment (GC_LOG_FILE, GC_PRINT_VERBOSE_STATS,
1125 GC_FULL_FREQUENCY): Refine the documentation.
1127 * extra/msvc_dbg.c: Test _MSC_VER macro; include "gc.h" (for
1128 GC_word).
1129 * extra/msvc_dbg.c (ULONG_PTR): Replace with GC_ULONG_PTR; define
1130 as word.
1132 * dbg_mlc.c (GC_get_back_ptr_info, GC_print_obj,
1133 GC_print_smashed_obj, GC_debug_free_inner): Add a code for a
1134 LINT-like tool to instruct it that the function is invoked only
1135 with valid parameters (otherwise a SEGV is ok); recognize LINT2
1136 new macro.
1137 * misc.c (GC_abort): Instruct a LINT-like tool that the function
1138 never returns in fact.
1139 * os_dep.c (GC_linux_stack_base): Check for read buffer overflow;
1140 close the file immediately after read; use STRTOULL() instead of
1141 decoding the address number manually.
1142 * include/private/gc_priv.h (EXPECT): Don't specify outcome for a
1143 LINT-like tool.
1144 * include/private/gc_priv.h (GC_all_interior_pointers): Instruct a
1145 LINT-like tool that the value is restricted to zero and one only
1146 (required since the variable is global and its value is used as a
1147 part of array index expression is some places).
1149 * dbg_mlc.c (GC_make_closure): Fix SEGV in case GC_malloc returns
1150 NULL.
1151 * dbg_mlc.c (GC_debug_register_finalizer,
1152 GC_debug_register_finalizer_no_order,
1153 GC_debug_register_finalizer_unreachable,
1154 GC_debug_register_finalizer_ignore_self): Handle out of memory
1155 case properly (similar to GC_register_finalizer_inner).
1156 * headers.c (GC_install_header): Handle the case when alloc_hdr()
1157 returns NULL.
1158 * os_dep.c (GC_get_maps_len): Defend against missing "maps" file.
1159 * pthread_support.c (GC_mark_thread): Place a dummy return
1160 statement (which uses "id" argument) before the actual use of "id"
1161 as an array index (to suppress a warning produced by some static
1162 code analysis tools).
1163 * win32_threads.c (GC_mark_thread): Likewise.
1164 * pthread_support.c (GC_thr_init): Abort (with the appropriate
1165 message) if out of memory.
1167 * finalize.c (GC_register_finalizer_inner): Fix a typo in a
1168 comment.
1169 *include/private/gcconfig.h (STACKBOTTOM): Likewise.
1170 * gcj_mlc.c (GC_core_gcj_malloc): Replace 0/1 with TRUE/FALSE in
1171 EXPECT (the 2nd argument).
1172 * malloc.c (GC_core_malloc_atomic, GC_core_malloc, GC_free):
1173 Likewise.
1174 * mark.c (GC_mark_and_push, GC_mark_and_push_stack): Likewise.
1175 * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Likewise.
1176 * include/private/gc_hdrs.h (HC_GET_HDR): Likewise.
1177 * include/private/gc_priv.h (SMALL_OBJ): Likewise.
1178 * include/private/specific.h (getspecific): Likewise.
1179 * pthread_support.c (LOCK_STATS): Add a comment.
1181 * include/gc_pthread_redirects.h (GC_NO_DLOPEN,
1182 GC_NO_PTHREAD_SIGMASK, GC_PTHREAD_CREATE_CONST,
1183 GC_PTHREAD_EXIT_ATTRIBUTE, GC_NO_PTHREAD_CANCEL): Move the
1184 definition to gc_config_macros.
1186 * pthread_support.c (pthread_cancel, GC_pthread_cancel_t,
1187 GC_pthread_cancel): Test GC_NO_PTHREAD_CANCEL (instead of NACL and
1188 GC_PTHREAD_EXIT_ATTRIBUTE).
1189 * include/gc_pthread_redirects.h (GC_pthread_cancel,
1190 pthread_cancel): Likewise.
1191 * pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
1192 GC_pthread_join, GC_pthread_detach, GC_pthread_cancel): Realign
1193 code.
1194 * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE):
1195 Define as empty for NaCl.
1196 * include/gc_pthread_redirects.h (GC_NO_PTHREAD_CANCEL): New macro
1197 defined.
1199 * dyn_load.c (GC_init_dyld): Do not invoke
1200 _dyld_bind_fully_image_containing_address() if GC_no_dls (as it is
1201 not required to register the main data segment in that case).
1202 * include/gc.h (GC_no_dls): Adjust the comment.
1204 * dyn_load.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Test
1205 GC_NO_DLOPEN.
1206 * gc_dlopen.c: Likewise.
1207 * include/gc_pthread_redirects.h (GC_dlopen, dlopen): Likewise.
1208 * gc_dlopen.c: Don't include dlfcn.h (as it is included in
1209 gc_pthread_redirects.h).
1210 * pthread_support.c (pthread_sigmask, GC_pthread_sigmask_t,
1211 GC_pthread_sigmask): Test GC_NO_PTHREAD_SIGMASK (instead of
1212 GC_DARWIN_THREADS, GC_OPENBSD_THREADS and NACL).
1213 * include/gc_pthread_redirects.h (GC_pthread_sigmask,
1214 pthread_sigmask): Likewise.
1215 * win32_threads.c (pthread_sigmask, GC_pthread_sigmask): Test
1216 GC_NO_PTHREAD_SIGMASK (instead of GC_WIN32_PTHREADS).
1217 * pthread_support.c (pthread_create, GC_pthread_create_t,
1218 GC_pthread_create): Rename GC_PTHREAD_CONST to
1219 GC_PTHREAD_CREATE_CONST.
1220 * win32_threads.c (GC_pthread_create): Likewise.
1221 * include/gc_pthread_redirects.h: Likewise.
1222 * include/gc_pthread_redirects.h (GC_NO_DLOPEN,
1223 GC_NO_PTHREAD_SIGMASK): New macro defined.
1224 * include/gc_pthread_redirects.h (GC_PTHREAD_CREATE_CONST): Set to
1225 empty for NaCl.
1226 * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): Do
1227 not define for Android (as CANCEL_SAFE is not defined).
1229 * include/gc.h (GC_ADD_CALLER, GC_RETURN_ADDR,
1230 GC_HAVE_BUILTIN_BACKTRACE, GC_CAN_SAVE_CALL_STACKS): Move
1231 definition to gc_config_macros.h file.
1232 * include/gc_config_macros.h: Check the file is included from gc.h
1233 file.
1234 * include/gc_version.h: Likewise.
1236 * gc_dlopen.c: Empty unit for NaCl.
1237 * os_dep.c: Include fcntl.h for NaCl.
1238 * os_dep.c (GC_get_main_stack_base): Ignore
1239 USE_GET_STACKBASE_FOR_MAIN macro for NaCl.
1240 * os_dep.c (GC_get_stack_base): Return GC_UNIMPLEMENTED for NaCl.
1241 * os_dep.c (GC_remap): Use mmap (instead of mprotect) for NaCl.
1242 * pthread_start.c (GC_inner_start_routine): Don't invoke
1243 pthread_cleanup_push/pop for NaCl.
1244 * pthread_stop_world.c (GC_nacl_num_gc_threads,
1245 GC_nacl_thread_idx, GC_nacl_park_threads_now,
1246 GC_nacl_thread_parker, GC_nacl_gc_thread_self,
1247 GC_nacl_thread_parked, GC_nacl_thread_used,
1248 GC_nacl_thread_parking_inited, GC_nacl_thread_alloc_lock): New
1249 variable (fo NaCl only).
1250 * pthread_stop_world.c (GC_remove_allowed_signals,
1251 suspend_handler_mask, GC_stop_count, GC_world_is_stopped,
1252 GC_retry_signals, SIG_THR_RESTART, GC_suspend_ack_sem,
1253 GC_restart_ack_sem, GC_suspend_handler_inner, GC_suspend_handler,
1254 GC_restart_handler): Don't define for NaCl.
1255 * pthread_support.c (GC_get_nprocs): Likewise.
1256 * include/private/gc_priv.h (SIG_SUSPEND): Likewise.
1257 * include/private/gcconfig.h (LINUX): Likewise.
1258 * pthread_stop_world.c (GC_push_all_stacks): Push register storage
1259 for NaCl.
1260 * pthread_stop_world.c (GC_suspend_all, GC_stop_world,
1261 GC_start_world): Implement for NaCl.
1262 * pthread_stop_world.c (GC_stop_world): Don't define unused "i"
1263 local variable for OpenBSD (and NaCl).
1264 * pthread_stop_world.c (NACL_STORE_REGS): New macro definition for
1265 NaCl.
1266 * pthread_stop_world.c (nacl_pre_syscall_hook,
1267 __nacl_suspend_thread_if_needed, nacl_post_syscall_hook,
1268 GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread): New
1269 function (for NaCl only).
1270 * pthread_stop_world.c (GC_stop_init): Empty for NaCl.
1271 * pthread_support.c (pthread_cancel, pthread_sigmask): Don't
1272 redirect for NaCl.
1273 * include/gc_pthread_redirects.h (pthread_cancel,
1274 pthread_sigmask): Likewise.
1275 * pthread_support.c (GC_nacl_initialize_gc_thread,
1276 GC_nacl_shutdown_gc_thread): New internal prototype (NaCl only).
1277 * pthread_support.c (GC_new_thread, GC_delete_thread): Initialize
1278 and shutdown thread for NaCl.
1279 * pthread_support.c (GC_thr_init): Call sysconf for NaCl.
1280 * pthread_support.c (GC_pthread_exit): Call GC_thread_exit_proc
1281 for NaCl.
1282 * include/gc.h: Don't include features.h for NaCl.
1283 * include/gc_pthread_redirects.h (GC_PTHREAD_CONST): New macro.
1284 * include/gc_pthread_redirects.h (GC_pthread_create): Use
1285 GC_PTHREAD_CONST instead of const.
1286 * win32_threads.c (GC_pthread_create): Likewise.
1287 * pthread_support.c (GC_pthread_create_t, GC_pthread_create,
1288 pthread_create): Likewise.
1289 * include/private/gcconfig.h (NACL): Recognize NaCl.
1290 * include/private/gcconfig.h (GC_LINUX_THREADS): Valid for NaCl.
1291 * include/private/pthread_stop_world.h (thread_stop_info): Add
1292 reg_storage member; define NACL_GC_REG_STORAGE_SIZE macro (for
1293 NaCl only).
1294 * include/private/pthread_support.h (GC_nacl_gc_thread_self):
1295 Declare internal variable (for NaCl only).
1297 * mach_dep.c (GC_with_callee_saves_pushed): Fix FE_ALL_EXCEPT
1298 macro.
1300 * mark.c (GC_mark_some): Prefix and suffix "asm" and "volatile"
1301 keywords with double underscore.
1302 * os_dep.c (catch_exception_raise, catch_exception_raise_state,
1303 catch_exception_raise_state_identity): Add GC_API_OSCALL to
1304 function definition.
1305 * os_dep.c (catch_exception_raise_state,
1306 catch_exception_raise_state_identity): Move definition to be
1307 before GC_ports.
1308 * os_dep.c (catch_exception_raise): Declare to have the symbol
1309 defined before GC_ports.
1310 * os_dep.c (GC_ports): Store references to catch_exception_raise,
1311 catch_exception_raise_state, catch_exception_raise_state_identity
1312 (to prevent stripping these symbols as dead).
1313 * os_dep.c (catch_exception_raise, catch_exception_raise_state,
1314 catch_exception_raise_state_identity): Mark these symbols as
1315 "referenced dynamically" via an assembler directive (unless
1316 NO_DESC_CATCH_EXCEPTION_RAISE).
1317 * include/private/gc_priv.h (GC_API_OSCALL): New macro (defined
1318 similar to GC_API but as if GC_DLL is always defined).
1320 * os_dep.c: Don't include signal.h for GC_write_fault_handler on
1321 Win32.
1322 * os_dep.c (SIG_OK): Don't return true unless SIGSEGV or SIGBUS on
1323 FreeBSD.
1324 * os_dep.c (CODE_OK): Use SEGV_ACCERR on FreeBSD (define
1325 SEGV_ACCERR for older FreeBSD releases).
1327 * dyn_load.c (GC_register_map_entries,
1328 GC_register_dynamic_libraries_dl_iterate_phdr): Calculate
1329 DATASTART only once if DATASTART_IS_FUNC.
1330 * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr):
1331 Calculate DATAEND only once if DATAEND_IS_FUNC.
1332 * dyn_load.c: Add comment to some endif; realign some code.
1333 * dyn_load.c (GC_init_dyld): Don't use
1334 _dyld_bind_fully_image_containing_address if
1335 NO_DYLD_BIND_FULLY_IMAGE defined; add FIXME.
1336 * include/private/gcconfig.h (GC_data_start, GC_find_limit):
1337 Declare if used by DATASTART/DATAEND, respectively.
1338 * include/private/gcconfig.h (DATASTART_IS_FUNC, DATAEND_IS_FUNC):
1339 Define if DATASTART/DATAEND is a function, respectively.
1340 * include/private/gcconfig.h (GETPAGESIZE, NO_PTHREAD_TRYLOCK,
1341 NO_DYLD_BIND_FULLY_IMAGE): Define for Darwin/arm as well; include
1342 unistd.h.
1344 * os_dep.c (GC_setpagesize, GC_task_self, PROTECT, UNPROTECT):
1345 Reorder to remove redundant ifdef for Win32.
1346 * os_dep.c: Add comment to some endif.
1347 * os_dep.c: Include pthread.h (for Linux even if single-threaded)
1348 if USE_GET_STACKBASE_FOR_MAIN; also include it for Darwin.
1349 * os_dep.c (STACKBOTTOM): Redefine for Darwin (unless prohibited
1350 for some reason).
1351 * os_dep.c (GC_get_main_stack_base): Allow
1352 USE_GET_STACKBASE_FOR_MAIN for Linux even if single-threaded; add
1353 assertion for the returned result.
1354 * os_dep.c (GC_get_stack_base): Define for Darwin if
1355 multi-threaded.
1356 * os_dep.c (SIG_OK, CODE_OK): Add comment (for FreeBSD).
1357 * os_dep.c (ID_STOP, ID_RESUME): Define only if threads.
1358 * os_dep.c (catch_exception_raise): Remove redundant parentheses;
1359 refine the documentation.
1361 * NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE for C++ files as
1362 well.
1363 * NT_STATIC_THREADS_MAKEFILE: Likewise.
1364 * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Refine.
1365 * include/gc.h (GC_INIT): Document.
1366 * include/private/gc_priv.h (GC_MACH_HEADER, GC_MACH_SECTION,
1367 GC_GETSECTBYNAME): Define depending only on the word size (i.e.,
1368 define these macros also for ARM).
1369 * tests/test.c (check_heap_stats): Print main thread stack bottom
1370 as well (only if verbose mode is on).
1372 * mach_dep.c (GC_with_callee_saves_pushed): Fix and improve code
1373 introduced by the previous patch (if GETCONTEXT_FPU_EXCMASK_BUG
1374 and X86_64).
1376 * darwin_stop_world.c (GC_FindTopOfStack): Prefix and suffix
1377 "volatile" keyword with double underscore.
1378 * mach_dep.c (GETCONTEXT_FPU_EXCMASK_BUG): Recognize new macro and
1379 include fenv.h if defined (unless NO_GETCONTEXT or HAVE_PUSH_REGS).
1380 * mach_dep.c (GC_with_callee_saves_pushed): Restore FPU exception
1381 mask corrupted by getcontext if GETCONTEXT_FPU_EXCMASK_BUG.
1382 * include/private/gcconfig.h (GETCONTEXT_FPU_EXCMASK_BUG): Define
1383 for Linux/amd64 (since its GLibc getcontext currently has the bug).
1385 * allchblk.c (GC_use_entire_heap): Change type to int (as declared
1386 in gc.h); set the default value depending on new GC_USE_ENTIRE_HEAP
1387 macro.
1388 * misc.c (GC_init): Test GC_USE_ENTIRE_HEAP environment variable to
1389 alter the default value of GC_use_entire_heap.
1390 * doc/README.environment (GC_USE_ENTIRE_HEAP): Document.
1391 * doc/README.macros (GC_USE_ENTIRE_HEAP): Likewise.
1393 * include/private/gcconfig.h (PARALLEL_MARK): Do not make it cause
1394 MPROTECT_VDB undefining.
1396 * include/private/gcconfig.h (DYNAMIC_LOADING): Fix filename in
1397 the comment.
1399 * include/private/gc_priv.h (_GC_arrays): Move the conditional
1400 macro definitions (shortcuts for GC_arrays members) into the
1401 structure body.
1403 * darwin_stop_world.c (GC_mach_handler_thread,
1404 GC_use_mach_handler_thread,
1405 GC_darwin_register_mach_handler_thread): Define only if
1406 MPROTECT_VDB.
1407 * darwin_stop_world.c (GC_suspend_thread_list): Use
1408 GC_mach_handler_thread and GC_use_mach_handler_thread only if
1409 MPROTECT_VDB.
1410 * darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count
1411 only if defined (i.e. unless GC_NO_THREADS_DISCOVERY).
1412 * misc.c (GC_init): Fix comment for GWW_VDB.
1413 * os_dep.c (DARWIN_EXC_STATE, DARWIN_EXC_STATE_COUNT,
1414 DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR): New macros.
1415 * os_dep.c (catch_exception_raise): Use DARWIN_EXC_STATE,
1416 DARWIN_EXC_STATE_COUNT, DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR.
1417 * pthread_support.c (GC_thr_init): Define "dummy" local variable
1418 only unless GC_DARWIN_THREADS.
1419 * include/private/gcconfig.h (MPROTECT_VDB): Define for Darwin
1420 even in the single-threaded mode; define for iPhone/iPad.
1421 * include/private/gcconfig.h (IA64): Remove unnecessary "ifdef"
1422 around "undef".
1423 * include/private/gcconfig.h (HEURISTIC1): Remove unused for
1424 Cygwin.
1425 * include/private/gcconfig.h (STACKBOTTOM): Use fixed address for
1426 Darwin/arm (instead of HEURISTIC1).
1428 * misc.c (GC_write): Replace multiple "ifdef/endif" with "elif"
1429 (for ECOS and NOSYS).
1430 * os_dep.c (GC_get_main_stack_base): Likewise.
1431 * os_dep.c (GC_get_main_stack_base): Check
1432 USE_GET_STACKBASE_FOR_MAIN macro before checking STACKBOTTOM one;
1433 remove "dummy" variable (use result one instead).
1434 * doc/README.macros (SN_TARGET_PS3): Document.
1435 * extra/threadlibs.c (main): Don't output "-lpthread" (and "-ldl")
1436 for Android.
1437 * include/private/pthread_support.h: Fix comment for "endif".
1439 * misc.c (GC_allocate_ml): Define global variable if SN_TARGET_PS3.
1440 * misc.c (GC_init): Initialize GC_allocate_ml if SN_TARGET_PS3.
1441 * os_dep.c (SIGSEGV): Define to dummy zero if SN_TARGET_PS3.
1442 * os_dep.c (GC_unix_mmap_get_mem): Don't define if SN_TARGET_PS3.
1443 * os_dep.c (GC_default_push_other_roots,
1444 GC_push_thread_structures): Define for SN_TARGET_PS3.
1445 * include/private/gc_locks.h (GC_allocate_ml, LOCK, UNLOCK): Define
1446 for SN_TARGET_PS3.
1447 * include/private/gcconfig.h (SN_TARGET_PS3): Recognize new macro
1448 (Sony PS/3 target).
1449 * include/private/gcconfig.h (THREADS): Define unconditionally if
1450 SN_TARGET_PS3.
1451 * include/private/gcconfig.h (GET_MEM): Define for SN_TARGET_PS3.
1453 * alloc.c (GC_collect_or_expand): Replace NIL with NULL in message.
1454 * dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
1455 GC_debug_malloc_atomic_ignore_off_page,
1456 GC_debug_generic_malloc_inner,
1457 GC_generic_malloc_inner_ignore_off_page, GC_debug_malloc_stubborn,
1458 GC_debug_malloc_atomic, GC_debug_malloc_uncollectable,
1459 GC_debug_malloc_atomic_uncollectable): Likewise.
1460 * gcj_mlc.c (GC_debug_gcj_malloc): Likewise.
1461 * dbg_mlc.c (GC_check_annotated_obj): Replace NIL with NULL in a
1462 comment.
1463 * dyn_load.c (GC_FirstDLOpenedLinkMap): Likewise.
1464 * mark_rts.c (GC_roots_present): Likewise.
1465 * doc/README: Likewise.
1466 * include/private/gc_hdrs.h (IS_FORWARDING_ADDR_OR_NIL): Likewise.
1467 * include/private/gc_priv.h (_GC_arrays): Likewise.
1469 * configure.ac: Use AC_CHECK_LIB() to check for pthread instead of
1470 just blindly linking to -lpthread, as Android includes pthread
1471 support within libc and does not provide a separate libpthread.
1472 * dyn_load.c (GC_register_dynamic_libraries): Skip current link map
1473 entry if l_addr is NULL (Android/bionic only).
1474 * pthread_stop_world.c (android_thread_kill): New internal function
1475 (Android only).
1476 * pthread_stop_world.c (GC_suspend_all, GC_start_world): Call
1477 android_thread_kill (based on tkill) instead of pthread_kill on
1478 Android (since pthread_kill cannot be used safely on the platform).
1479 * pthread_support.c (GC_new_thread): Store thread Id (obtained from
1480 gettid) for use by android_thread_kill (Android only).
1481 * include/private/pthread_support.h (GC_Thread_Rep): Add kernel_id
1482 structure member (Android only).
1483 * include/private/gcconfig.h: Recognize __x86_64 macro as a synonym
1484 of __x86_64__ (Darwin); define __environ macro (Android on M68K).
1486 * allchblk.c (GC_freehblk): Print extended error message (done via
1487 GC_printf() before aborting with a short message) only if
1488 GC_print_stats.
1489 * dyn_load.c (GC_register_dynamic_libraries): Likewise.
1490 * os_dep.c (GC_get_maps, GC_register_data_segments, GC_remap,
1491 PROTECT, GC_write_fault_handler, GC_mprotect_thread): Likewise.
1492 * pthread_stop_world.c (GC_start_world): Likewise.
1493 * win32_threads.c (GC_register_my_thread_inner): Likewise.
1494 * os_dep.c (GC_get_main_stack_base, GC_register_data_segments,
1495 GC_dirty_init): Remove redundant print of an error message before
1496 aborting with the same message.
1497 * os_dep.c (GC_register_data_segments): Remove format specifier
1498 from the string passed to GC_err_puts(); use ABORT instead of EXIT
1499 (if invalid executable type).
1500 * os_dep.c (GC_remap): Adjust printf format specifier (for long
1501 type).
1502 * os_dep.c (GC_dirty_init): Print a message about SIG_IGN detected
1503 (for SIGSEGV/BUS) only if GC_print_stats.
1504 * os_dep.c (catch_exception_raise): Join 2 adjacent GC_err_printf
1505 calls.
1507 * tests/test.c (main): Print the relevant message if GWW_VDB.
1508 * include/private/gcconfig.h: Don't define MPROTECT_VDB for Win32
1509 on x64 if compiled by GCC.
1511 * tests/staticrootstest.c: Include string.h for memset() prototype.
1512 * tests/thread_leak_test.c (main): Fix printf() format specifiers.
1514 * CMakeLists.txt: Check enable_parallel_mark on Darwin.
1515 * configure.ac: Likewise.
1516 * darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS,
1517 DARWIN_QUERY_TASK_THREADS): Rename to GC_NO_THREADS_DISCOVERY and
1518 GC_DISCOVER_TASK_THREADS, respectively.
1519 * os_dep.c (DARWIN_SUSPEND_GC_THREADS): Likewise.
1520 * pthread_support.c (DARWIN_SUSPEND_GC_THREADS): Likewise.
1521 * darwin_stop_world.c (DARWIN_QUERY_TASK_THREADS): Don't define
1522 (and remove FIXME).
1523 * darwin_stop_world.c (GC_use_threads_discovery): Add GC_API;
1524 comment; remove FIXME.
1525 * win32_threads.c (GC_NO_DLLMAIN): Rename to
1526 GC_NO_THREADS_DISCOVERY.
1527 * tests/test.c (GC_NO_DLLMAIN): Likewise.
1528 * doc/README.macros (GC_NO_DLLMAIN): Likewise.
1529 * doc/README.win32 (GC_NO_DLLMAIN): Likewise.
1530 * doc/README.macros (GC_NO_THREADS_DISCOVERY): Update the comment.
1531 * win32_threads.c (GC_win32_dll_threads): Define as macro to true
1532 if GC_DISCOVER_TASK_THREADS (and not GC_NO_THREADS_DISCOVERY);
1533 update the comment.
1534 * win32_threads.c (GC_use_DllMain): Rename to
1535 GC_use_threads_discovery; do not set GC_win32_dll_threads if
1536 GC_DISCOVER_TASK_THREADS.
1537 * win32_threads.c (GC_started_thread_while_stopped,
1538 GC_lookup_thread_inner, UNPROTECT_THREAD, GC_lookup_pthread,
1539 GC_thr_init, GC_pthread_create, DllMain): Rewrite some expressions
1540 which use GC_win32_dll_threads to minimize the possibility of
1541 an "unreachable code" compiler warning when GC_win32_dll_threads
1542 is defined as a macro.
1543 * win32_threads.c (GC_unregister_my_thread): Don't call
1544 GC_delete_thread() if GC_win32_dll_threads and THREAD_LOCAL_ALLOC
1545 (since can't happen); use "t" local variable only if not
1546 GC_win32_dll_threads.
1547 * doc/README.macros (GC_DISCOVER_TASK_THREADS): Document.
1548 * include/gc.h (GC_use_DllMain): Rename to
1549 GC_use_threads_discovery but keep old name as a macro definition.
1550 * include/gc.h (GC_use_threads_discovery): Declare also for
1551 Darwin; update the comment.
1552 * tests/test.c (main): Call GC_use_threads_discovery for Darwin
1553 (to test the mode if possible).
1555 * darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS,
1556 DARWIN_QUERY_TASK_THREADS): New macro recognized.
1557 * darwin_stop_world.c (GC_query_task_threads): add STATIC;
1558 initialize to false; define as macro if DARWIN_SUSPEND_GC_THREADS
1559 or DARWIN_QUERY_TASK_THREADS; remove FIXME.
1560 * darwin_stop_world.c (GC_use_threads_discovery): New function
1561 (for setting GC_query_task_threads value).
1562 * darwin_stop_world.c (GC_mach_handler_thread,
1563 GC_use_mach_handler_thread, GC_mach_thread, GC_MAX_MACH_THREADS,
1564 GC_mach_threads, GC_mach_threads_count, GC_suspend_thread_list,
1565 GC_darwin_register_mach_handler_thread): Define only if not
1566 DARWIN_SUSPEND_GC_THREADS.
1567 * darwin_stop_world.c (GC_stop_world, GC_start_world): Exclude
1568 the code for GC_query_task_threads case from compilation unless
1569 DARWIN_SUSPEND_GC_THREADS.
1570 * os_dep.c (GC_darwin_register_mach_handler_thread): Declared only
1571 if Darwin threads and not DARWIN_SUSPEND_GC_THREADS.
1572 * os_dep.c (GC_mprotect_thread): Call
1573 GC_darwin_register_mach_handler_thread only if THREADS and not
1574 DARWIN_SUSPEND_GC_THREADS.
1575 * pthread_support.c (marker_mach_threads): Don't define if
1576 DARWIN_SUSPEND_GC_THREADS.
1577 * pthread_support.c (GC_mark_thread): Don't fill in
1578 marker_mach_threads if DARWIN_SUSPEND_GC_THREADS.
1579 * include/private/gc_locks.h (GC_need_to_lock): Always declare for
1580 THREADS case.
1582 * darwin_stop_world.c (GC_query_task_threads): Don't define to
1583 false for DARWIN_DONT_PARSE_STACK case; unconditionally initialize
1584 the variable to false (for now).
1585 * darwin_stop_world.c (GC_push_all_stacks): Call task_threads()
1586 only if not DARWIN_DONT_PARSE_STACK.
1587 * darwin_stop_world.c (GC_stop_world, GC_start_world): Use the
1588 approach based on task_threads() only if GC_query_task_threads
1589 else use GC_threads table.
1591 * darwin_stop_world.c (GC_mach_threads): Remove static qualifier.
1592 * darwin_stop_world.c (GC_stop_init): Remove (as we do not need to
1593 really clear GC_mach_threads[]).
1594 * darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count
1595 (instead of calling GC_stop_init).
1596 * include/private/pthread_support.h (GC_stop_init): Remove proto.
1597 * pthread_support.c (GC_stop_init): Add proto (unless Darwin).
1598 * pthread_support.c (GC_thr_init): Don't call GC_stop_init() if
1599 GC_DARWIN_THREADS.
1601 * darwin_stop_world.c (GC_stack_range_for): New static function
1602 (move the code from GC_push_all_stacks).
1603 * darwin_stop_world.c (GC_push_all_stacks): Call
1604 GC_stack_range_for(); rename kern_return local variable to
1605 kern_result.
1606 * darwin_stop_world.c (GC_is_mach_marker): Change argument type
1607 from mach_port_t to thread_act_t.
1608 * pthread_support.c (GC_is_mach_marker): Likewise.
1610 * darwin_stop_world.c (GC_push_all_stacks): Fix "my_task" local
1611 variable initialization (always call current_task()).
1612 * pthread_support.c (GC_thr_init, GC_register_my_thread_inner):
1613 Don't set thread's stop_info.stack_ptr value for Darwin.
1614 * include/private/darwin_stop_world.h (thread_stop_info): Update
1615 the comment for stack_ptr.
1617 * darwin_stop_world.c (GC_push_all_stacks): Rename "r", "me" local
1618 variables to "kern_return" and "my_thread" ones, respectively;
1619 call mach_port_deallocate() unconditionally.
1620 * darwin_stop_world.c (GC_stop_world): Don't call mach_thread_self
1621 if DEBUG_THREADS.
1623 * darwin_stop_world.c (GC_mach_thread): Move from
1624 darwin_stop_world.h.
1625 * include/private/darwin_stop_world.h (GC_mach_thread): Remove.
1626 * win32_threads.c (GC_start_world): Define "thread_id" local
1627 variable only if GC_ASSERTIONS; decide whether to resume a thread
1628 based on its "suspended" field value; assert that suspended thread
1629 stack_base is non-zero and the thread is not our one.
1631 * darwin_stop_world.c (GC_thread_resume): New inline function
1632 (move code from GC_thread_resume).
1633 * darwin_stop_world.c (GC_start_world): Check result of
1634 task_threads(); call GC_thread_resume().
1635 * os_dep.c (GC_malloc_heap_l, GC_is_malloc_heap_base): Define
1636 only if not CYGWIN32.
1637 * os_dep.c (GC_is_heap_base): Call GC_is_malloc_heap_base() only
1638 if not CYGWIN32.
1640 * darwin_stop_world.c (FindTopOfStack): Change return type to
1641 ptr_t (from long); make GC_INNER; add GC_ prefix.
1642 * darwin_stop_world.c (GC_push_all_stacks): Add thread_blocked
1643 local variable (initialized from the corresponding GC_thread
1644 field unless GC_query_task_threads); add assertion that our
1645 thread is not blocked; prefix FindTopOfStack with GC_ and remove
1646 no longer needed cast to ptr_t of the result; handle thread
1647 blocked case (and remove FIXME); use GC_push_all_stack_sections
1648 unless GC_query_task_threads (and remove FIXME).
1649 * pthread_support.c (GC_FindTopOfStack): Declare (if needed).
1650 * pthread_support.c (GC_do_blocking_inner): Call
1651 GC_save_regs_in_stack (if needed) before acquiring the lock.
1652 * win32_threads.c (GC_do_blocking_inner): Likewise.
1653 * pthread_support.c (GC_do_blocking_inner): Set/clear topOfStack
1654 field of GC_thread (Darwin only).
1655 * include/private/pthread_support.h (GC_thread): Add topOfStack
1656 field for Darwin (unless DARWIN_DONT_PARSE_STACK).
1658 * finalize.c (GC_check_finalizer_nested): Change return type to
1659 char pointer (instead of int pointer); use explicit cast for
1660 GC_finalizer_nested assignment.
1661 * pthread_support.c (GC_check_finalizer_nested): Likewise.
1662 * win32_threads.c (GC_check_finalizer_nested): Likewise.
1663 * finalize.c (GC_finalizer_nested): Change type to unsigned char.
1664 * finalize.c (GC_notify_or_invoke_finalizers): Change type of
1665 "pnested" local variable to char pointer.
1666 * pthread_support.c (GC_do_blocking_inner,
1667 GC_call_with_gc_active): Use explicit cast for "thread_blocked"
1668 field assignment.
1669 * win32_threads.c (GC_lookup_pthread): Use explicit cast for
1670 "suspended" field assignment.
1671 * win32_threads.c (GC_Thread_Rep): Use short type for
1672 finalizer_skipped; use char type for finalizer_nested and flags
1673 fields and reorder some fields (to minimize GC_Thread_Rep
1674 structure size).
1675 * include/private/pthread_support.h (GC_Thread_Rep): Likewise.
1676 * win32_threads.c (GC_Thread_Rep): Use char type for suspended
1677 field (instead of GC_bool).
1678 * include/private/pthread_support.h (GC_Thread_Rep): Use char type
1679 for thread_blocked field (instead of short).
1681 * darwin_stop_world.c (GC_query_task_threads): New variable (or
1682 macro).
1683 * darwin_stop_world.c (GC_push_all_stacks): Use
1684 GC_query_task_threads (to choose between algorithms based on
1685 kernel task_threads and based on GC_threads table); update FIXME;
1686 remove commented out GC_push_one statements.
1687 * pthread_support.c (GC_thr_init, GC_do_blocking_inner,
1688 GC_call_with_gc_active, GC_register_my_thread_inner): Initialize
1689 stack_ptr field for all platforms.
1690 * pthread_support.c (GC_call_with_gc_active): Initialize
1691 saved_stack_ptr field for all platforms.
1692 * include/private/darwin_stop_world.h (thread_stop_info): Add
1693 stack_ptr field; change type of already_suspended from int to
1694 GC_bool.
1696 * darwin_stop_world.c (GC_MAX_MACH_THREADS): New macro.
1697 * darwin_stop_world.c (GC_mach_threads, GC_stop_init): Use
1698 GC_MAX_MACH_THREADS instead of THREAD_TABLE_SZ.
1699 * darwin_stop_world.c (GC_mach_threads): Add FIXME.
1700 * darwin_stop_world.c (GC_stop_init, GC_suspend_thread_list,
1701 GC_stop_world): Use FALSE and TRUE for already_suspended field and
1702 "changed", "found" variables.
1703 * darwin_stop_world.c (GC_is_mach_marker): New prototype (only if
1704 PARALLEL_MARK).
1705 * darwin_stop_world.c (GC_suspend_thread_list): Change return type
1706 to GC_bool; change type of "changed", "found" to GC_bool; make
1707 "my_thread" as an argument (instead of acquiring/deallocating it
1708 locally); do not add my_thread, GC_mach_handler_thread and marker
1709 threads to GC_mach_threads table; check for overflow of
1710 GC_mach_threads table; increase GC_mach_threads_count if "found"
1711 is true and info.suspend_count is non-zero.
1712 * darwin_stop_world.c (GC_suspend_thread_list, GC_start_world):
1713 Adjust "thread" format specifiers for GC_printf(); search thread
1714 in "old_list" starting from the previous found one.
1715 * darwin_stop_world.c (GC_stop_world): Rename "changes" to
1716 "changed" local variable; remove "result" variable; adjust
1717 GC_printf debugging message.
1718 * darwin_stop_world.c (GC_start_world): Do not check for
1719 my_thread and GC_use_mach_handler_thread (since they are not added
1720 to GC_mach_threads table); call thread_info() only if
1721 DEBUG_THREADS or GC_ASSERTIONS.
1722 * pthread_support.c (marker_mach_threads): New static variable (if
1723 Darwin).
1724 * pthread_support.c (GC_is_mach_marker): New function (if Darwin).
1725 * pthread_support.c (GC_mark_thread): Fill in marker_mach_threads
1726 table (if Darwin).
1728 * alloc.c (GC_parallel): Define only if THREADS.
1729 * misc.c (GC_get_parallel): Likewise.
1730 * include/gc.h (GC_parallel, GC_get_parallel,
1731 GC_get_suspend_signal, GC_allow_register_threads,
1732 GC_register_my_thread, GC_unregister_my_thread): Define only if
1733 GC_THREADS.
1734 * include/gc.h (GC_get_heap_size): Fix a typo in a comment.
1736 * configure.ac: Use `AC_C_INLINE'.
1737 * include/private/gc_priv.h (GC_INLINE): Use "inline" keyword
1738 (determined by configure AC_C_INLINE) if HAVE_CONFIG_H is defined.
1740 * dyn_load.c (DL_ITERATE_PHDR_STRONG): New macro (define for
1741 FreeBSD).
1742 * dyn_load.c (GC_register_main_static_data): Move the definition
1743 above GC_register_dynamic_libraries_dl_iterate_phdr one (FreeBSD
1744 case); unconditionally return FALSE if DL_ITERATE_PHDR_STRONG.
1745 * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Test
1746 GC_register_main_static_data() result (instead of direct testing
1747 of dl_iterate_phdr (to prevent a compiler warning).
1748 * os_dep.c (CODE_OK): Test si_code also for the value of 2
1749 (FreeBSD case; required for FreeBSD v7+).
1750 * os_dep.c (CODE_OK): Properly use parentheses (HPUX case).
1751 * include/private/gcconfig.h (DATASTART): Cast etext argument in
1752 GC_FreeBSDGetDataStart() call; remove unnecessary "&" (FreeBSD
1753 case).
1755 * include/private/specific.h (quick_thread_id): Define thru
1756 GC_approx_sp(); define as a macro.
1757 * include/private/specific.h (getspecific): Use GC_INLINE instead
1758 of __inline__ (to work around Sun CC which does not recognize
1759 inline keyword surrounded with underscores).
1761 * darwin_stop_world.c (FindTopOfStack): Simplify condition
1762 expressions.
1763 * darwin_stop_world.c (GC_push_all_stacks): Merge two variants
1764 of this function (DARWIN_DONT_PARSE_STACK).
1765 * darwin_stop_world.c (GC_push_all_stacks): Add a check for our
1766 thread is found (same as in pthread_stop_world.c).
1767 * darwin_stop_world.c (GC_push_all_stacks): Print the number of
1768 scanned threads if verbose (same as in pthread_stop_world.c).
1770 * darwin_stop_world.c (GC_push_all_stacks): Reset
1771 thread_state_count value before every thread_get_state call;
1772 refine the comment for thread_state_count.
1773 * darwin_stop_world.c (GC_push_all_stacks): Ignore rsp, rip/eip,
1774 rflags, cs, fs, gs, ss, ds, es, __pc registers; uncomment ebp
1775 register pushing.
1776 * darwin_stop_world.c (GC_push_all_stacks): Set outCount to
1777 GC_MACH_THREAD_STATE_COUNT (instead of THREAD_STATE_MAX).
1778 * darwin_stop_world.c (GC_push_all_stacks): Remove FIXME and WARN
1779 for i386.
1781 * doc/README.macros (DARWIN_DONT_PARSE_STACK): Fix a typo.
1782 * darwin_stop_world.c (GC_use_mach_handler_thread): Change type
1783 to GC_bool.
1784 * darwin_stop_world.c (GC_suspend_thread_list, GC_start_world):
1785 Simplify the expressions involving GC_use_mach_handler_thread.
1786 * darwin_stop_world.c (GC_darwin_register_mach_handler_thread):
1787 Initialize GC_use_mach_handler_thread to TRUE (instead of 1).
1789 * include/gc_pthread_redirects.h (GC_pthread_sigmask, GC_dlopen,
1790 pthread_sigmask, dlopen): Don't define for Win32 pthreads (and
1791 don't include signal.h and dlfcn.h).
1793 * dyn_load.c (GC_register_dynlib_callback): Add FIXME.
1795 * include/private/gcconfig.h: Add support for FreeBSD on ppc64.
1797 * os_dep.c (PROTECT, UNPROTECT): Correct VM_PROT_EXEC to
1798 VM_PROT_EXECUTE.
1800 * os_dep.c (os2_alloc): Don't set PAG_EXECUTE unless
1801 pages_executable is on.
1802 * os_dep.c (os2_alloc): Add FIXME (for recursion).
1803 * os_dep.c (UNPROTECT): Abort with a more informative message if
1804 pages_executable is on ("mprotect" case).
1805 * os_dep.c (PROTECT, UNPROTECT): Set VM_PROT_EXEC if
1806 pages_executable is on (Darwin case).
1807 * pthread_support.c (GC_init_real_syms): Abort with an informative
1808 message if libgc is linked after libpthread.
1810 * dyn_load.c (GC_register_dynlib_callback): Adjust "start" pointer
1811 for 64-bit targets.
1812 * pthread_support.c (start_mark_threads): Expand PTHREAD_CREATE
1813 macro.
1814 * pthread_support.c (start_mark_threads): Call INIT_REAL_SYMS()
1815 since REAL(pthread_create) is used.
1816 * pthread_support.c (PTHREAD_CREATE): Remove unused.
1818 * extra/threadlibs.c (main): Remove --wrap for "read" (since not
1819 wrapped anymore).
1820 * doc/README.linux (GC_USE_LD_WRAP): Likewise.
1821 * os_dep.c (__wrap_read): Likewise.
1823 * include/gc_pthread_redirects.h: Test GC_PTHREADS and GC_H at the
1824 beginning of the file.
1825 * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): New
1826 macro (defined only for Linux and Solaris).
1827 * include/gc_pthread_redirects.h (GC_pthread_cancel,
1828 GC_pthread_exit): Declare new API function (only if
1829 GC_PTHREAD_EXIT_ATTRIBUTE).
1830 * include/gc_pthread_redirects.h (pthread_cancel, pthread_exit):
1831 Redirect (if GC_PTHREAD_EXIT_ATTRIBUTE).
1832 * include/private/pthread_support.h (DISABLED_GC): New macro.
1833 * pthread_support.c (pthread_cancel, pthread_exit): Restore
1834 original definition or declare "real" function (if needed and
1835 GC_PTHREAD_EXIT_ATTRIBUTE).
1836 * pthread_support.c (GC_pthread_cancel_t, GC_pthread_exit_t):
1837 Declare new types if needed.
1838 * pthread_support.c (GC_pthread_cancel, GC_pthread_exit): New
1839 function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE).
1840 * pthread_support.c (GC_init_real_syms): Initialize pointers to
1841 the "real" pthread_cancel and pthread_exit (only if
1842 GC_PTHREAD_EXIT_ATTRIBUTE).
1843 * pthread_support.c (GC_unregister_my_thread): Enable collections
1844 if DISABLED_GC was set (only if GC_PTHREAD_EXIT_ATTRIBUTE).
1845 * pthread_support.c (pthread_cancel, pthread_exit): New wrapped
1846 function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE defined).
1847 * pthread_support.c (GC_start_routine): Refine the comment.
1848 * extra/threadlibs.c (main): Adjust --wrap (add "read",
1849 "pthread_exit", "pthread_cancel" but remove "sleep").
1850 * doc/README.linux (GC_USE_LD_WRAP): Likewise.
1852 * include/gc.h (GC_MALLOC_STUBBORN): Remove trailing ';' in the
1853 macro definition.
1854 * include/gc.h (GC_reachable_here): Likewise.
1855 * include/gc.h (GC_reachable_here): Prefix and postfix "volatile"
1856 with double '_'.
1858 * pthread_start.c: New file.
1859 * CMakeLists.txt (SRC): Add pthread_start.c.
1860 * Makefile.am (libgc_la_SOURCES): Likewise.
1861 * Makefile.direct (CSRCS): Likewise.
1862 * Makefile.direct (OBJS): Add pthread_start.obj.
1863 * extra/gc.c: Add a comment; include pthread_start.c.
1864 * pthread_support.c (start_info): Move the struct definition down
1865 closer to its usage.
1866 * pthread_support.c (GC_thread_exit_proc): Replace STATIC with
1867 GC_INNER.
1868 * pthread_support.c (GC_inner_start_routine): Move to the
1869 definition to pthread_start.c; leave only the prototype; remove
1870 STATIC.
1871 * pthread_support.c (GC_start_rtn_prepare_thread): New function
1872 (contains parts of the original GC_inner_start_routine).
1874 * configure.ac (NO_EXECUTE_PERMISSION): Add comment.
1875 * doc/README.macros (NO_EXECUTE_PERMISSION): Update the
1876 documentation.
1877 * include/gc.h (GC_set_pages_executable, GC_get_pages_executable):
1878 New API function declaration.
1879 * os_dep.c (OPT_PROT_EXEC): Remove (superseded by
1880 pages_executable).
1881 * os_dep.c (pages_executable): New static variable.
1882 * os_dep.c (IGNORE_PAGES_EXECUTABLE): New macro (used by
1883 GC_get_pages_executable only).
1884 * os_dep.c (GC_unix_mmap_get_mem, GC_remap, PROTECT, UNPROTECT):
1885 Replace OPT_PROT_EXEC with pages_executable.
1886 * os_dep.c (GC_unix_mmap_get_mem, GC_remap, GC_win32_get_mem,
1887 GC_wince_get_mem, UNPROTECT): Undefine IGNORE_PAGES_EXECUTABLE.
1888 * os_dep.c (GC_win32_get_mem, GC_wince_get_mem, GC_remap, PROTECT,
1889 UNPROTECT): Use PAGE_EXECUTE_... only if pages_executable is on.
1890 * os_dep.c (GC_set_pages_executable, GC_get_pages_executable): New
1891 API function definition.
1893 * tests/test.c (check_heap_stats): Increase max_heap_sz by 20% for
1894 64-bit CPUs (to prevent "Unexpected heap growth" failure on Win64,
1895 at least).
1897 * tests/test.c (check_heap_stats): Increase max_heap_sz by 25% for
1898 32-bit CPUs (to prevent "Unexpected heap growth" failure).
1900 * gc_dlopen.c (dlopen): Prototype REAL_DLFUNC if GC_USE_LD_WRAP.
1901 * pthread_support.c (pthread_create, pthread_join, pthread_detach,
1902 pthread_sigmask): Likewise.
1903 * gc_dlopen.c (dlopen): Remove cast (redundant since the prototype
1904 is added).
1905 * gc_dlopen.c (GC_dlopen): Fix return type.
1906 * pthread_support.c (GC_init_real_syms): Don't define
1907 LIBPTHREAD_NAME, LIBPTHREAD_NAME_LEN, len, namebuf and
1908 libpthread_name if RTLD_NEXT.
1910 * gc_dlopen.c (disable_gc_for_dlopen): Update the comment.
1911 * gc_dlopen.c (dlopen): Likewise.
1912 * include/gc.h (GC_enable_incremental): Refine the comment.
1913 * include/gc.h (DECLSPEC_NORETURN): Define macro as empty if
1914 missing (only for Win32).
1915 * include/gc.h (GC_ExitThread): Use DECLSPEC_NORETURN.
1916 * win32_threads.c (GC_ExitThread): Likewise.
1917 * include/gc.h (GC_endthreadex): Add a comment.
1919 * include/cord.h: Fix typos.
1921 * Makefile.am (EXTRA_DIST): Add "CMakeLists.txt" and
1922 "tests/CMakeLists.txt".
1923 * doc/doc.am (dist_pkgdata_DATA): Add "doc/README.cmake".
1925 * mach_dep.c (NO_GETCONTEXT): Also define if AVR32.
1926 * include/private/gcconfig.h (AVR32): New macro (also define the
1927 supplementary macros for the target).
1928 * include/private/thread_local_alloc (USE_COMPILER_TLS): Don't
1929 define for AVR32.
1931 * tests/leak_test.c (main): Explicitly define as returning int
1932 (to prevent a spurious test failure on some Linux/alpha targets).
1933 * tests/thread_leak_test.c (main): Likewise.
1934 * tests/thread_leak_test.c: Initialize GC_find_leak in the main
1935 thread (before GC_INIT) only.
1936 * tests/leak_test.c (main): Use GC_set_find_leak() instead of
1937 accessing GC_find_leak directly.
1938 * tests/thread_leak_test.c (main): Likewise.
1940 * include/gc.h (GC_find_leak, GC_finalize_on_demand,
1941 GC_java_finalization, GC_dont_expand, GC_no_dls,
1942 GC_dont_precollect): Simplify the comment (remove the information
1943 about data races since the value is boolean).
1945 * os_dep.c (GC_get_stack_base, GC_get_main_stack_base): New
1946 Solaris-specific implementation (based on thr_stksegment).
1947 * os_dep.c (stackbase_main_self, stackbase_main_ss_sp): New static
1948 variable used by the Solaris-specific GC_get_stack_base().
1950 * pthread_support.c (GC_mark_thread_local_free_lists,
1951 GC_check_tls): Mark (and check) only for live threads (in case of
1952 GC_destroy_thread_local() is called already but GC_delete_thread()
1953 is not yet).
1954 * win32_threads.c (GC_mark_thread_local_free_lists, GC_check_tls):
1955 Likewise.
1957 * NT_MAKEFILE: Remove the comment about DLL and Win32S.
1958 * NT_STATIC_THREADS_MAKEFILE: Likewise.
1959 * NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
1960 * NT_MAKEFILE: Add ".SUFFIXES" directive (to handle gc_cpp.cc
1961 properly on VS 2005+).
1962 * NT_MAKEFILE: Update GC log file name in comments.
1963 * NT_STATIC_THREADS_MAKEFILE: Likewise.
1964 * NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
1965 * NT_X64_THREADS_MAKEFILE: Likewise.
1966 * doc/README.win32: Likewise.
1967 * NT_MAKEFILE: Remove ":full" for "-debug" option (since no
1968 longer supported by VS).
1969 * NT_STATIC_THREADS_MAKEFILE: Likewise.
1970 * NT_MAKEFILE: Commented out copying of gc_cpp.cc to gc_cpp.cpp.
1971 * NT_STATIC_THREADS_MAKEFILE: Likewise.
1972 * NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
1973 * NT_X64_THREADS_MAKEFILE: Likewise.
1974 * NT_STATIC_THREADS_MAKEFILE: Add -D PARALLEL_MARK option.
1975 * NT_STATIC_THREADS_MAKEFILE: Increase stack size for gctest.exe.
1976 * NT_X64_STATIC_THREADS_MAKEFILE: Remove "-stack" option (use the
1977 default stack size limit).
1978 * NT_X64_THREADS_MAKEFILE: Rename "gc64_dll.dll" to "gc64.dll".
1979 * win32_threads.c (GC_get_next_stack): Always define (since it is
1980 also used for Cygwin now).
1982 * alloc.c (GC_maybe_gc): Move GC_notify_full_gc() call upper to
1983 be just before GC_clear_marks() call.
1984 * include/gc_mark.h (GC_start_callback_proc): Refine the comment.
1986 * Makefile.am (check_LTLIBRARIES): Initialize to empty.
1987 * tests/tests.am (TESTS, check_PROGRAMS): Add staticrootstest.
1988 * tests/tests.am (staticrootstest_SOURCES, staticrootstest_LDADD,
1989 libstaticrootslib_la_SOURCES, libstaticrootslib_la_LIBADD,
1990 libstaticrootslib_la_LDFLAGS, libstaticrootslib_la_DEPENDENCIES):
1991 Define.
1992 * tests/tests.am (check_LTLIBRARIES): Add libstaticrootslib.la.
1994 * tests/staticrootstest.c: New file.
1995 * tests/staticrootslib.c: Likewise.
1997 * dyn_load.c (GC_get_next_stack, GC_cond_add_roots): Define for
1998 Cygwin as well as other win32 targets.
1999 * dyn_load.c (GC_wnt): Define to constant true.
2000 * dyn_load.c (GC_register_dynamic_libraries): Define for Cygwin as
2001 well as other win32 targets.
2002 * mark_rts.c (rt_hash, GC_roots_present, add_roots_to_index):
2003 Don't define for Cygwin, as on other win32.
2004 * mark_rts.c (GC_add_roots_inner, GC_clear_roots): Handle on
2005 Cygwin as for other win32 targets.
2006 * mark_rts.c (GC_rebuild_root_index): Don't declare on Cygwin, as
2007 other win32.
2008 * mark_rts.c (GC_remove_tmp_roots): Do declare on Cygwin as on
2009 other win32.
2010 * mark_rts.c (GC_remove_roots, GC_remove_roots_inner): Don't
2011 declare on Cygwin as on other win32.
2012 * mark_rts.c (GC_is_tmp_root): Do declare on Cygwin when
2013 !NO_DEBUGGING, as on other win32 targets.
2014 * mark_rts.c (GC_cond_register_dynamic_libraries): Handle on
2015 Cygwin as for other win32 targets.
2016 * os_dep.c (GC_setpagesize): Handle on Cygwin as on other win32.
2017 * os_dep.c (GC_get_main_stack_base): Don't declare on Cygwin, as
2018 other win32.
2019 * os_dep.c (GC_sysinfo): Declare on Cygwin, as other win32.
2020 * os_dep.c (GC_win32_get_mem): Declare on Cygwin, as on other
2021 Win32, but call GC_unix_get_mem instead of GlobalAlloc.
2022 * os_dep.c (GC_win32_free_heap): Declare on Cygwin (as empty).
2023 * ptr_chck.c (GC_is_visible): Register dynamic libraries on Cygwin
2024 as on other win32 platforms.
2025 * win32_threads.c (GC_get_next_stack): Define on Cygwin as well as
2026 for dynamic loading targets.
2027 * include/private/gc_priv.h (GC_INNER): Don't try to use
2028 visibility on Cygwin which does not support it.
2029 * include/private/gc_priv.h (struct roots): Don't declare r_next
2030 member on Cygwin as on other windows hosts.
2031 * include/private/gc_priv.h (LOG_RT_SIZE, RT_SIZE): Don't define
2032 likewise.
2033 * include/private/gc_priv.h (struct _GC_arrays): Do declare
2034 _heap_bases[] member and don't declare _root_index likewise.
2035 * include/private/gc_priv.h (GC_heap_bases): Do define likewise.
2036 * include/private/gc_priv.h (_SYSTEM_INFO): Do forward-declare
2037 likewise.
2038 * include/private/gc_priv.h (GC_sysinfo): Do declare extern
2039 likewise.
2040 * include/private/gcconfig.h (GC_win32_get_mem, GET_MEM): Do
2041 prototype on Cygwin as other win32 platforms.
2043 * os_dep.c (GC_get_main_stack_base): Use pthread_getattr_np() and
2044 pthread_attr_getstack() instead of GC_get_stack_base() (and check
2045 returned stackaddr for NULL); output a warning on failure.
2047 * alloc.c (GC_start_call_back): Replace the definition type to
2048 GC_start_callback_proc.
2049 * alloc.c (GC_set_start_callback, GC_get_start_callback): New
2050 setter/getter function.
2051 * alloc.c (GC_try_to_collect_inner): Call GC_notify_full_gc()
2052 unconditionally (because GC_try_to_collect_inner always does full
2053 GC).
2054 * include/gc_mark.h (GC_start_callback_proc): New type.
2055 * include/gc_mark.h (GC_set_start_callback,
2056 GC_get_start_callback): New API function declaration.
2058 * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Document.
2059 * os_dep.c (GC_get_main_stack_base): Recognize
2060 USE_GET_STACKBASE_FOR_MAIN (only if THREADS and LINUX_STACKBOTTOM)
2061 and use GC_get_stack_base() in this case.
2063 * os_dep.c (GC_get_stack_base): Add LOCK/UNLOCK() (since
2064 GC_find_limit_with_bound() should be called with the lock held).
2065 * backgraph.c (FOR_EACH_PRED): Fix a typo.
2067 * alloc.c (GC_set_stop_func, GC_get_stop_func): Add
2068 DCL_LOCK_STATE.
2069 * finalize.c (GC_notify_or_invoke_finalizers): Likewise.
2070 * gc_dlopen.c (disable_gc_for_dlopen): Likewise.
2071 * gcj_mlc.c (maybe_finalize, GC_debug_gcj_malloc): Likewise.
2072 * mark.c (GC_print_trace): Likewise.
2073 * misc.c (GC_set_warn_proc, GC_get_warn_proc, GC_enable,
2074 GC_disable, GC_new_free_list, GC_new_kind, GC_new_proc,
2075 GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier,
2076 GC_get_finalizer_notifier): Likewise.
2077 * os_dep.c (GC_get_stack_base, GC_print_callers): Likewise.
2078 * pthread_support.c (GC_is_thread_tsd_valid,
2079 GC_wait_for_gc_completion, GC_init_parallel, GC_do_blocking_inner,
2080 GC_call_with_gc_active, GC_unregister_my_thread, pthread_join,
2081 pthread_detach, GC_register_my_thread, GC_inner_start_routine,
2082 pthread_create): Likewise.
2083 * reclaim.c (GC_print_all_errors): Likewise.
2084 * win32_threads.c (GC_is_thread_tsd_valid, GC_register_my_thread,
2085 GC_unregister_my_thread, GC_do_blocking_inner,
2086 GC_call_with_gc_active, GC_lookup_pthread, GC_pthread_join,
2087 GC_pthread_start_inner, GC_thread_exit_proc, GC_pthread_detach,
2088 GC_init_parallel): Likewise.
2090 * doc/README.darwin: Update.
2092 * CMakeLists.txt: Adjust INCLUDE_DIRECTORIES and SRC (to make it
2093 usable on Mac OS X).
2094 * doc/README.cmake: Update.
2096 * CMakeLists.txt: New file (adding CMake support).
2097 * tests/CMakeLists.txt: Likewise.
2098 * doc/README.cmake: Likewise.
2100 * configure.ac (darwin): Don't define HAS_PPC_THREAD_STATE...
2101 macros.
2102 * include/private/gc_priv.h (THREAD_FLD): Recognize
2103 __DARWIN_UNIX03 instead of HAS_PPC_THREAD_STATE... macros.
2105 * pthread_support.c: Include <sys/param.h> and <sys/sysctl.h> for
2106 OpenBSD.
2107 * pthread_support.c (get_ncpu): Define also for Darwin, NetBSD and
2108 OpenBSD.
2109 * pthread_support.c (GC_thr_init): Use get_ncpu() for Darwin,
2110 NetBSD and OpenBSD.
2112 * mallocx.c (GC_generic_malloc_many, GC_malloc_many): Define even
2113 if THREADS is undefined.
2114 * include/gc.h (GC_malloc_many): Update the comment.
2116 * include/gc_cpp.h (GC_PLACEMENT_DELETE): Define for Embarcadero
2117 (formerly known as Borland) C++ compiler v6.21+.
2118 * include/gc_cpp.h (GC_NO_OPERATOR_NEW_ARRAY): Define for ancient
2119 VC++ compilers.
2121 * win32_threads.c (GC_register_my_thread_inner,
2122 GC_pthread_start_inner): Undo the previous commit changes for
2123 the thread flags and DETACHED state (since the state is only
2124 tested in GC_thread_exit_proc).
2126 * include/gc.h (GC_unregister_my_thread): Fix a typo; update the
2127 comment.
2128 * pthread_support.c (GC_delete_thread): Allow to delete the main
2129 thread (don't call GC_INTERNAL_FREE for it); update the comment.
2130 * win32_threads.c (GC_delete_thread): Likewise.
2131 * pthread_support.c (GC_unregister_my_thread): Add an assertion
2132 for FINISHED flag is unset.
2133 * tests/test.c (check_heap_stats): Test the main thread
2134 unregistering (only if THREADS).
2135 * win32_threads.c (GC_register_my_thread_inner): Set flags to
2136 DETACHED (only if GC_PTHREADS).
2137 * win32_threads.c (GC_unregister_my_thread): Add FIXME (for
2138 GC_wait_for_gc_completion).
2139 * win32_threads.c (GC_pthread_start_inner): Clear flags detached
2140 state if needed; set pthread_id and flags while holding the lock.
2142 * include/private/gc_priv.h (SIG_SUSPEND): Don't define for
2143 OpenBSD and Darwin.
2145 * include/gc.h: Recognize _M_X64 (as an alias for _AMD64_).
2147 * test.c (main, WinMain): Consistently don't invoke
2148 GC_enable_incremental() if MAKE_BACKGRAPH is defined, but
2149 do invoke it even if parallel marking is enabled.
2151 * tests/test.c (reverse_test): Comment out a check for MSWIN32
2152 (when determing BIG value) assuming outdated win32S.
2153 * tests/test.c (reverse_test): Rename to reverse_test_inner;
2154 change the declaration (to be of GC_fn_type); call itself thru
2155 GC_call_with_gc_active() if the argument is zero.
2156 * tests/test.c (reverse_test): New function added calling
2157 reverse_test_inner thru GC_do_blocking (to test GC_do_blocking and
2158 GC_call_with_gc_active).
2160 * doc/README.macros (IGNORE_DYNAMIC_LOADING, PLATFORM_ANDROID):
2161 Document.
2162 * dyn_load.c: Don't include <elf.h> if PLATFORM_ANDROID.
2163 * dyn_load.c: Include bionic <linker.h> (instead of <link.h>) if
2164 PLATFORM_ANDROID.
2165 * include/private/gcconfig.h (LINUX): Define also if
2166 PLATFORM_ANDROID (for the windows-based toolkit).
2167 * include/private/gcconfig.h (SEARCH_FOR_DATA_START): Explicitly
2168 define for Android/x86 platform.
2169 * include/private/gcconfig.h (IGNORE_DYNAMIC_LOADING): Recognize
2170 new macro (undefine DYNAMIC_LOADING in this case).
2171 * include/private/gcconfig.h (CANCEL_SAFE): Don't define if
2172 PLATFORM_ANDROID.
2173 * include/private/gcconfig.h (IF_CANCEL): Fix definition for the
2174 explicitly defined CANCEL_SAFE.
2176 * allchblk.c (GC_allochblk_nth): Don't call GC_remove_protection()
2177 if GC_DISABLE_INCREMENTAL.
2178 * reclaim.c (GC_reclaim_generic): Likewise.
2179 * checksums.c (GC_page_was_ever_dirty): Add prototype.
2180 * include/private/gc_locks.h (GC_mark_lock_holder): Don't declare
2181 unless PARALLEL_MARK.
2182 * include/private/gc_priv.h (GC_dirty_maintained,
2183 GC_page_was_dirty, GC_remove_protection, GC_dirty_init): Don't
2184 declare if GC_DISABLE_INCREMENTAL.
2185 * include/private/gc_priv.h (GC_print_finalization_stats): Don't
2186 declare if SMALL_CONFIG.
2187 * include/private/gcconfig.h (CHECKSUMS): Explicitly undefine if
2188 GC_DISABLE_INCREMENTAL (since nothing to check).
2189 * include/private/gcconfig.h (DEFAULT_VDB): Don't define if
2190 GC_DISABLE_INCREMENTAL.
2191 * os_dep.c (GC_dirty_maintained): Likewise.
2192 * mark.c (GC_initiate_gc): Don't call GC_read_dirty() if
2193 GC_DISABLE_INCREMENTAL.
2194 * os_dep.c (GC_gww_page_was_ever_dirty, GC_page_was_ever_dirty):
2195 Uncomment; define only if CHECKSUMS.
2197 * darwin_stop_world.c (GC_push_all_stacks): Fix a bug (call
2198 GC_push_all_stack() instead of GC_push_all_stack_frames()).
2199 * include/private/gc_priv.h (GC_push_all_stack_frames,
2200 GC_push_all_register_frames): Rename to
2201 GC_push_all_stack_sections and GC_push_all_register_sections,
2202 respectively.
2203 * mark_rts.c (GC_push_all_stack_frames,
2204 GC_push_all_register_frames, GC_push_all_stack_part_eager_frames,
2205 GC_push_current_stack): Likewise.
2206 * pthread_stop_world.c (GC_push_all_stacks): Likewise.
2207 * win32_threads.c (GC_push_stack_for): Likewise.
2208 * misc.c (GC_call_with_gc_active): Rename "frame" local variable
2209 to "stacksect".
2210 * pthread_support.c (GC_call_with_gc_active): Likewise.
2211 * win32_threads.c (GC_call_with_gc_active): Likewise.
2212 * pthread_support.c (GC_call_with_gc_active): Update FIXME for
2213 Darwin.
2214 * win32_threads.c (GC_Thread_Rep): Update the comment for
2215 traced_stack_sect.
2217 * darwin_stop_world.c (GC_push_all_stacks): Rename
2218 activation_frame to traced_stack_sect.
2219 * include/private/gc_priv.h (GC_push_all_stack_frames,
2220 GC_push_all_register_frames): Likewise.
2221 * include/private/pthread_support.h (GC_Thread_Rep): Likewise.
2222 * mark_rts.c (GC_push_all_register_frames,
2223 GC_push_all_stack_frames, GC_push_all_stack_part_eager_frames,
2224 GC_push_current_stack): Likewise.
2225 * pthread_stop_world.c (GC_push_all_stacks): Likewise.
2226 * pthread_support.c (GC_call_with_gc_active): Likewise.
2227 * win32_threads.c (GC_Thread_Rep, GC_call_with_gc_active,
2228 GC_push_stack_for): Likewise.
2229 * include/private/gc_priv.h (GC_activation_frame_s): Rename to
2230 GC_traced_stack_sect_s.
2231 * include/private/gc_priv.h (GC_activation_frame): Rename to
2232 GC_traced_stack_sect.
2233 * misc.c (GC_activation_frame, GC_call_with_gc_active): Likewise.
2234 * doc/README.macros (UNICODE): Document.
2236 * doc/README.macros (GC_READ_ENV_FILE): Document (new macro).
2237 * include/private/gc_priv.h (GETENV): Recognize GC_READ_ENV_FILE;
2238 declare and use GC_envfile_getenv().
2239 * misc.c (GC_envfile_content, GC_envfile_length): New static
2240 variable (only if GC_READ_ENV_FILE).
2241 * misc.c (GC_ENVFILE_MAXLEN): New macro (used in GC_envfile_init).
2242 * misc.c (GC_envfile_init, GC_envfile_getenv): New function (only
2243 if GC_READ_ENV_FILE).
2244 * misc.c (GC_init): Call GC_envfile_init() (before using GETENV)
2245 if GC_READ_ENV_FILE.
2246 * misc.c (GC_init): Move GC_setpagesize() and GC_init_win32()
2247 calls to be just before GC_envfile_init() one (since the latter
2248 uses GET_MEM).
2249 * misc.c (GC_abort): use ExitProcess() (instead of DebugBreak) for
2250 WinCE if NO_DEBUGGING; add a comment for DebugBreak() (for WinCE).
2251 * mark_rts.c (GC_add_roots_inner): Remove redundant trailing '\n'
2252 from the ABORT message.
2253 * misc.c (GC_init): Likewise.
2254 * os_dep.c (GC_get_main_stack_base, GC_register_data_segments):
2255 Likewise.
2256 * pthread_stop_world.c (GC_push_all_stacks): Likewise.
2257 * pthread_support.c (GC_init_real_syms, start_mark_threads):
2258 Likewise.
2260 * win32_threads.c (GC_get_next_stack): Don't define for Cygwin
2261 (since unused for now).
2263 * dyn_load.c (HAVE_REGISTER_MAIN_STATIC_DATA): Don't define unless
2264 GC_register_main_static_data() is defined.
2265 * dyn_load.c (GC_register_dynamic_libraries): Define only if used
2266 (if DYNAMIC_LOADING or PCR or Win32/CE).
2267 * dyn_load.c (GC_register_main_static_data): Define the default
2268 one only if DYNAMIC_LOADING.
2269 * include/private/gc_priv.h (GC_register_dynamic_libraries):
2270 Declare only if used (to prevent compiler warning).
2272 * mark_rts.c (GC_approx_sp): Add a comment (for GCC).
2275 == [7.2alpha4] 2009-12-01 ==
2277 * configure.ac (AC_CONFIG_COMMANDS): Quote srcdir value.
2279 * include/gc.h (GC_get_suspend_signal): New function declaration.
2280 * misc.c (GC_get_suspend_signal): New API function (only if
2281 THREADS).
2283 * alloc.c (min_bytes_allocd): Multiply GC_free_space_divisor by
2284 two if GC_incremental (instead of TRUE_INCREMENTAL).
2286 * sparc_mach_dep.S (GC_push_regs): Remove the reference.
2288 * os_dep.c (SIZE_T, PULONG_PTR): Remove.
2289 * os_dep.c (ULONG_PTR): Replace with GC_ULONG_PTR (defined as GC
2290 "word"); add the comment.
2291 * os_dep.c (GetWriteWatch_type, detect_GetWriteWatch,
2292 GC_gww_read_dirty): Prefix ULONG_PTR with "GC_".
2294 * win32_threads.c (THREAD_TABLE_SZ): Change back to a power-of-two
2295 const value (for speed).
2296 * win32_threads.c (THREAD_TABLE_INDEX): New macro.
2297 * win32_threads.c (GC_new_thread, GC_lookup_thread_inner,
2298 GC_delete_gc_thread, GC_delete_thread, GC_lookup_pthread): Use
2299 THREAD_TABLE_INDEX instead of THREAD_TABLE_SZ.
2300 * win32_threads.c (PTHREAD_MAP_HASH): Rename to PTHREAD_MAP_INDEX.
2302 * win32_threads.c (THREAD_TABLE_SZ): Make the const value prime.
2304 * backgraph.c: Remove apostrophe char from "#error".
2306 * doc/README.macros (GC_DISABLE_INCREMENTAL): Document.
2307 * include/private/gcconfig.h (GC_DISABLE_INCREMENTAL): Recognize
2308 new macro; implicitly define it if SMALL_CONFIG.
2309 * alloc.c (GC_incremental, GC_timeout_stop_func): Check for
2310 GC_DISABLE_INCREMENTAL instead of SMALL_CONFIG.
2311 * include/private/gc_priv.h (GC_incremental, TRUE_INCREMENTAL,
2312 GC_push_conditional): Likewise.
2313 * mark.c (GC_push_next_marked_dirty, GC_push_selected,
2314 GC_push_conditional, GC_block_was_dirty): Likewise.
2315 * misc.c (GC_enable_incremental): Likewise.
2316 * misc.c (GC_init): Likewise.
2318 * dyn_load.c (WIN32_LEAN_AND_MEAN): Guard with ifndef.
2319 * misc.c (WIN32_LEAN_AND_MEAN): Likewise.
2320 * os_dep.c (WIN32_LEAN_AND_MEAN): Likewise.
2321 * allchblk.c (GC_allochblk_nth): Fix a minor typo (don't/doesn't)
2322 in a comment.
2323 * backgraph.c: Likewise.
2324 * dyn_load.c (GC_register_dynamic_libraries): Likewise.
2325 * extra/threadlibs.c (main): Likewise.
2326 * pthread_support.c (pthread_join): Likewise.
2327 * tests/test.c (main): Likewise.
2329 * mach_dep.c (GC_push_regs): Remove STATIC (just to catch
2330 a duplicate symbol definition linker error).
2331 * misc.c (GC_clear_stack_inner): Likewise.
2332 * sparc_mach_dep.S (GC_push_regs): Comment out the reference.
2334 * include/private/gc_priv.h (GC_write_disabled): New variable
2335 declaration (only if GC_ASSERTIONS and Win32 threads).
2336 * misc.c (GC_write): Add assertion for GC_write_disabled value is
2337 not on (only if THREADS).
2338 * win32_threads.c (GC_write_disabled): New variable (only if
2339 GC_ASSERTIONS and not Cygwin).
2340 * win32_threads.c (GC_stop_world): Set and clear GC_write_disabled
2341 (while holding GC_write_cs).
2343 * win32_threads.c (GC_please_stop): If DllMain-based thread
2344 registration is not compiled in then define GC_please_stop as
2345 a non-volatile variable for assertion only.
2346 * win32_threads.c (GC_stop_world): Set and clear only if defined.
2347 * win32_threads.c (GC_stop_world): Add the comment for GC_printf()
2348 usage (while holding GC_write_cs).
2349 * win32_threads.c (GC_delete_gc_thread): Likewise.
2350 * os_dep.c (GC_remove_protection): Likewise.
2352 * pthread_support.c (GC_inner_start_routine): Join 3 sequential
2353 GC_printf() calls into a single one (for DEBUG_THREADS).
2355 * include/private/gc_priv.h (GC_total_stacksize): New variable
2356 declaration (only if THREADS).
2357 * alloc.c (GC_total_stacksize): New variable (only if THREADS).
2358 * alloc.c (min_bytes_allocd): Calculate stack_size using
2359 GC_stackbottom only in the single-threaded case; otherwise use
2360 GC_total_stacksize; print GC_total_stacksize value if
2361 DEBUG_THREADS.
2362 * darwin_stop_world.c (GC_push_all_stacks): Use "%p" printf type
2363 specifier for lo/hi values (instead of "%lx").
2364 * darwin_stop_world.c (GC_push_all_stacks): Use
2365 GC_push_all_stack_frames() instead of GC_push_all_stack().
2366 * darwin_stop_world.c (GC_push_all_stacks): Recalculate
2367 GC_total_stacksize value.
2368 * pthread_stop_world.c (GC_push_all_stacks): Likewise.
2369 * win32_threads.c (GC_push_all_stacks): Likewise.
2370 * win32_threads.c (GC_push_stack_for): Pass "me" argument; return
2371 stack size; don't check for non-zero value of thread->stack_base.
2372 * win32_threads.c (GC_push_all_stacks): Don't call
2373 GC_push_stack_for() and don't check for "t->id == me" if
2374 thread->stack_base is zero.
2376 * dyn_load.c (GC_dump_meminfo): Prefix "%lx" printf type specifier
2377 with "0x".
2378 * os_dep.c (PROTECT): Likewise.
2379 * win32_threads.c (GC_mark_thread_local_free_lists): Cast p->id to
2380 int (to match printf type specifier).
2382 * tests/test.c (check_heap_stats): Take into account the unmapped
2383 memory size when checking for "Unexpected heap growth"; remove
2384 FIXME.
2386 * alloc.c: Revert last change.
2388 * include/private/gcconfig.h (STACKBOTTOM): Add a presence check
2389 for eCos/NOSYS.
2390 * misc.c (GC_write): Comment out _Jv_diag_write() call (since no
2391 longer defined in GCJ).
2393 * os_dep.c (brk): Rename to ecos_gc_brk.
2395 * alloc.c (min_bytes_allocd): Use GC_stackbottom value to compute
2396 stack_size even if THREADS.
2397 * doc/README.macros (DEBUG_THREADS): Document.
2398 * pthread_support.c (DEBUG_THREADS): Remove the commented out
2399 definition.
2400 * win32_threads.c (DEBUG_WIN32_THREADS): Remove duplicate
2401 definition.
2402 * win32_threads.c: Include errno.h (except for WinCE).
2403 * win32_threads.c (GC_win32_start_inner): Copy "start" and "param"
2404 to local variables, and free "arg" parameter before "start"
2405 invocation.
2406 * win32_threads.c (GC_beginthreadex): Set errno to EAGAIN on error
2407 (instead of calling SetLastError(ERROR_NOT_ENOUGH_MEMORY)).
2408 * win32_threads.c (GC_beginthreadex): Return 0 on error (instead
2409 of -1).
2411 * darwin_stop_world.c (GC_darwin_register_mach_handler_thread):
2412 Use GC_INNER for the function definition.
2413 * include/private/darwin_stop_world.h
2414 (GC_darwin_register_mach_handler_thread): Remove the prototype.
2415 * os_dep.c (GC_darwin_register_mach_handler_thread): Use GC_INNER
2416 for the function prototype.
2417 * include/private/gc_priv.h (NDEBUG): Explicitly define if
2418 NO_DEBUGGING and not GC_ASSERTIONS (before the standard headers
2419 inclusion).
2421 * include/private/gcconfig.h: Move DebugBreak() workaround (for
2422 x86mingw32ce toolchain) to gc_priv.h (after windows.h inclusion).
2424 * allchblk.c (GC_unmap_old, GC_merge_unmapped, GC_allochblk,
2425 GC_freehblk): Use GC_INNER for the function definition.
2426 * alloc.c (GC_never_stop_func, GC_should_collect,
2427 GC_try_to_collect_inner, GC_collect_a_little_inner,
2428 GC_set_fl_marks, GC_add_to_our_memory, GC_add_to_heap,
2429 GC_expand_hp_inner, GC_collect_or_expand, GC_allocobj): Likewise.
2430 * backgraph.c (GC_build_back_graph, GC_traverse_back_graph):
2431 Likewise.
2432 * blacklst.c (GC_default_print_heap_obj_proc, GC_bl_init,
2433 GC_promote_black_lists, GC_unpromote_black_lists,
2434 GC_add_to_black_list_normal, GC_add_to_black_list_stack,
2435 GC_is_black_listed): Likewise.
2436 * darwin_stop_world.c (GC_push_all_stacks, GC_push_all_stacks,
2437 GC_stop_init, GC_stop_world, GC_start_world): Likewise.
2438 * dbg_mlc.c (GC_has_other_debug_info, GC_store_back_pointer,
2439 GC_marked_for_finalization, GC_generate_random_backtrace_no_gc,
2440 GC_store_debug_info, GC_start_debugging,
2441 GC_debug_generic_malloc_inner,
2442 GC_debug_generic_malloc_inner_ignore_off_page,
2443 GC_debug_malloc_uncollectable, GC_debug_free_inner): Likewise.
2444 * dyn_load.c (GC_register_dynamic_libraries,
2445 GC_register_main_static_data, GC_init_dyld): Likewise.
2446 * finalize.c (GC_push_finalizer_structures, GC_finalize,
2447 GC_notify_or_invoke_finalizers, GC_print_finalization_stats):
2448 Likewise.
2449 * gcj_mlc.c (GC_core_gcj_malloc): Likewise.
2450 * headers.c (GC_find_header, GC_header_cache_miss,
2451 GC_scratch_alloc, GC_init_headers, GC_install_header,
2452 GC_install_counts, GC_remove_header, GC_remove_counts,
2453 GC_next_used_block, GC_prev_block): Likewise.
2454 * mach_dep.c (GC_with_callee_saves_pushed): Likewise.
2455 * malloc.c (GC_collect_or_expand, GC_alloc_large,
2456 GC_generic_malloc_inner, GC_generic_malloc_inner_ignore_off_page,
2457 GC_core_malloc_atomic, GC_core_malloc, GC_free_inner): Likewise.
2458 * mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.
2459 * mark.c (GC_collection_in_progress, GC_clear_hdr_marks,
2460 GC_set_hdr_marks, GC_set_mark_bit, GC_clear_mark_bit,
2461 GC_clear_marks, GC_initiate_gc, GC_mark_some,
2462 GC_mark_stack_empty, GC_invalidate_mark_state,
2463 GC_signal_mark_stack_overflow, GC_mark_from, GC_help_marker,
2464 GC_mark_init, GC_push_all, GC_push_conditional,
2465 GC_mark_and_push_stack, GC_push_all_eager, GC_push_all_stack):
2466 Likewise.
2467 * mark_rts.c (GC_is_static_root, GC_roots_present, GC_approx_sp,
2468 GC_exclude_static_roots_inner, GC_push_all_register_frames,
2469 GC_push_all_stack_frames, GC_cond_register_dynamic_libraries,
2470 GC_push_roots): Likewise.
2471 * misc.c (GC_extend_size_map, GC_clear_stack, GC_err_write):
2472 Likewise.
2473 * new_hblk.c (GC_build_fl, GC_new_hblk): Likewise.
2474 * obj_map.c (GC_register_displacement_inner, GC_add_map_entry,
2475 GC_initialize_offsets): Likewise.
2476 * os_dep.c (GC_get_maps, GC_parse_map_entry, GC_text_mapping,
2477 GC_init_linux_data_start, GC_init_netbsd_elf, GC_setpagesize,
2478 GC_set_and_save_fault_handler, GC_setup_temporary_fault_handler,
2479 GC_reset_fault_handler, GC_get_register_stack_base, GC_init_win32,
2480 GC_add_current_malloc_heap, GC_is_heap_base, GC_unmap, GC_remap,
2481 GC_unmap_gap, GC_push_all_stacks, GC_gww_dirty_init,
2482 GC_dirty_init, GC_read_dirty, GC_page_was_dirty,
2483 GC_page_was_ever_dirty, GC_remove_protection,
2484 GC_write_fault_handler, GC_mprotect_stop, GC_mprotect_resume,
2485 GC_save_callers, GC_print_callers): Likewise.
2486 * pthread_stop_world.c (GC_push_all_stacks, GC_stop_world,
2487 GC_start_world, GC_stop_init): Likewise.
2488 * pthread_support.c (GC_mark_thread_local_free_lists,
2489 GC_lookup_thread, GC_reset_finalizer_nested,
2490 GC_check_finalizer_nested, GC_segment_is_thread_stack,
2491 GC_greatest_stack_base_below, GC_thr_init, GC_init_parallel,
2492 GC_do_blocking_inner, GC_lock, GC_acquire_mark_lock,
2493 GC_release_mark_lock, GC_wait_for_reclaim, GC_notify_all_builder,
2494 GC_wait_marker, GC_notify_all_marker): Likewise.
2495 * reclaim.c (GC_print_all_errors, GC_block_empty,
2496 GC_reclaim_generic, GC_start_reclaim, GC_continue_reclaim,
2497 GC_reclaim_all): Likewise.
2498 * thread_local_alloc.c (GC_init_thread_local,
2499 GC_destroy_thread_local, GC_mark_thread_local_fls_for): Likewise.
2500 * win32_threads.c (GC_reset_finalizer_nested,
2501 GC_check_finalizer_nested, GC_do_blocking_inner, GC_stop_world,
2502 GC_start_world, GC_push_all_stacks, GC_get_next_stack,
2503 GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_for_reclaim,
2504 GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker,
2505 GC_thr_init, GC_init_parallel, GC_lock,
2506 GC_mark_thread_local_free_lists): Likewise.
2507 * alloc.c (GC_add_current_malloc_heap, GC_build_back_graph,
2508 GC_traverse_back_graph): Use GC_INNER for the function prototype.
2509 * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
2510 Likewise.
2511 * dbg_mlc.c (GC_default_print_heap_obj_proc): Likewise.
2512 * dyn_load.c (GC_parse_map_entry, GC_get_maps,
2513 GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base,
2514 GC_get_next_stack): Likewise.
2515 * finalize.c (GC_reset_finalizer_nested,
2516 GC_check_finalizer_nested): Likewise.
2517 * gcj_mlc.c (GC_start_debugging): Likewise.
2518 * include/private/dbg_mlc.h (GC_save_callers, GC_print_callers,
2519 GC_has_other_debug_info, GC_store_debug_info): Likewise.
2520 * include/private/gc_hdrs.h (GC_header_cache_miss): Likewise.
2521 * include/private/gc_locks.h (GC_lock): Likewise.
2522 * include/private/gc_pmark.h (GC_signal_mark_stack_overflow,
2523 GC_mark_from): Likewise.
2524 * include/private/pthread_support.h (GC_lookup_thread,
2525 GC_stop_init): Likewise.
2526 * include/private/thread_local_alloc.h (GC_init_thread_local,
2527 GC_destroy_thread_local, GC_mark_thread_local_fls_for): Likewise.
2528 * malloc.c (GC_extend_size_map, GC_text_mapping): Likewise.
2529 * mark.c (GC_page_was_ever_dirty): Likewise.
2530 * mark_rts.c (GC_mark_thread_local_free_lists): Likewise.
2531 * misc.c (GC_register_main_static_data, GC_init_win32,
2532 GC_setpagesize, GC_init_linux_data_start,
2533 GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf,
2534 GC_do_blocking_inner): Likewise.
2535 * os_dep.c (GC_greatest_stack_base_below): Likewise.
2536 * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init):
2537 Likewise.
2538 * include/private/gc_priv.h: Likewise.
2539 * include/private/gc_priv.h (GC_INNER): Update the comment.
2540 * doc/README.macros (GC_DLL): Update.
2542 * alloc.c (GC_collection_in_progress): Move the prototype to
2543 gc_priv.h.
2544 * gc_dlopen.c (GC_collection_in_progress): Likewise.
2545 * pthread_support.c (GC_collection_in_progress): Likewise.
2546 * misc.c (GC_init_parallel): Likewise.
2547 * pthread_support.c (GC_init_parallel): Likewise.
2548 * win32_threads.c (GC_init_parallel): Likewise.
2549 * darwin_stop_world.c (GC_thr_init): Likewise.
2550 * misc.c (GC_thr_init): Likewise.
2551 * pthread_stop_world.c (GC_thr_init): Likewise.
2552 * pthread_support.c (GC_thr_init): Likewise.
2553 * blacklst.c (GC_clear_bl, GC_copy_bl,
2554 GC_number_stack_black_listed): Make STATIC.
2555 * dbg_mlc.c (GC_print_obj, GC_make_closure,
2556 GC_debug_invoke_finalizer): Likewise.
2557 * malloc.c (GC_alloc_large_and_clear): Likewise.
2558 * mark.c (GC_push_selected, GC_push_marked1, GC_push_marked2,
2559 GC_push_marked4, GC_push_marked, GC_push_next_marked,
2560 GC_push_next_marked_dirty, GC_push_next_marked_uncollectable):
2561 Likewise.
2562 * misc.c (GC_clear_stack_inner): Likewise.
2563 * os_dep.c (GC_repeat_read, GC_default_push_other_roots): Likewise.
2564 * darwin_stop_world.c (FindTopOfStack): Make static; define only
2565 if not DARWIN_DONT_PARSE_STACK.
2566 * dbg_mlc.c (GC_debug_free_inner): Define only if DBG_HDRS_ALL.
2567 * dyn_load.c (GC_repeat_read): Remove unused prototype.
2568 * include/private/gc_pmark.h (GC_find_start): Likewise.
2569 * misc.c (GC_read, GC_register_finalizer_no_order): Likewise.
2570 * dyn_load.c (GC_segment_is_thread_stack): Add prototype (only if
2571 THREADS).
2572 * dyn_load.c (GC_register_main_static_data): Define only if
2573 DYNAMIC_LOADING.
2574 * finalize.c (GC_enqueue_all_finalizers): Remove unnecessary tail
2575 "return" statement.
2576 * gc_dlopen.c (GC_SOLARIS_THREADS): Don't recognize (since implies
2577 GC_PTHREADS).
2578 * include/gc.h: Fix a typo.
2579 * include/gc_inline.h (GC_ASSERT): Define (if not defined) since
2580 the header is public.
2581 * include/gc_inline.h (GC_generic_malloc_many): New public
2582 function declaration.
2583 * mallocx.c (GC_generic_malloc_many): Make public.
2584 * include/private/gc_priv.h (GC_INNER): Use visibility attribute
2585 (if available).
2586 * include/private/gc_priv.h (GC_EXTERN): Define using GC_INNER.
2587 * include/private/gc_priv.h: Include atomic_ops.h if THREADS and
2588 MPROTECT_VDB.
2589 * os_dep.c: Don't include atomic_ops.h
2590 * win32_threads.c: Likewise.
2591 * include/private/gc_priv.h (GC_push_selected, GC_push_regs,
2592 GC_push_marked, GC_number_stack_black_listed,
2593 GC_alloc_large_and_clear, GC_reclaim_or_delete_all,
2594 GC_generic_malloc_many, GC_make_closure,
2595 GC_debug_invoke_finalizer, GC_print_obj, GC_page_was_ever_dirty):
2596 Remove the prototype.
2597 * mark.c (GC_page_was_ever_dirty): Add prototype (only if
2598 PROC_VDB).
2599 * include/private/gc_priv.h (GC_push_next_marked_dirty,
2600 GC_push_next_marked, GC_push_next_marked_uncollectable): Move
2601 the prototype to mark.c.
2602 * include/private/gc_priv.h (GC_is_static_root): Declare only if
2603 not THREADS.
2604 * include/private/gc_priv.h (GC_free_inner): Declare only if
2605 THREADS.
2606 * include/private/gc_priv.h (GC_debug_free_inner): Declare only if
2607 THREADS and DBG_HDRS_ALL.
2608 * include/private/gc_priv.h (GC_markers): Declare GC_markers only
2609 if PARALLEL_MARK.
2610 * include/private/gc_priv.h (GC_register_main_static_data): Move
2611 the prototype to misc.c.
2612 * mach_dep.c (GC_push_regs): Make STATIC; define only along with
2613 HAVE_PUSH_REGS definition.
2614 * mach_dep.c (GC_clear_stack_inner): Replace K&R-style function
2615 definition with the ANSI C one.
2616 * mark.c (GC_started_thread_while_stopped): Declared only if not
2617 GNU C.
2618 * win32_threads.c (GC_started_thread_while_stopped): Don't define
2619 if GNU C.
2620 * mark.c (GC_mark_from): Avoid unbalanced brackets in
2621 #if-#else-#endif blocks.
2622 * mark_rts.c (GC_is_static_root): Define only if not THREADS.
2623 * os_dep.c (GC_get_stack_base): Make public (for OpenBSD).
2624 * os_dep.c (GC_page_was_ever_dirty): Comment out the function
2625 except for PROC_VDB.
2626 * tests/test.c (main): Don't reference GC_print_obj,
2627 GC_make_closure, GC_debug_invoke_finalizer,
2628 GC_page_was_ever_dirty, GC_is_fresh (in GC_noop).
2629 * thread_local_alloc.c: Don't include "gc_inline.h".
2630 * win32_threads.c (GC_write_fault_handler): Declare only if
2631 MPROTECT_VDB.
2633 * allchblk.c (DEBUG): Remove macro (since unused).
2634 * allchblk.c: Include private/gc_priv.h before other includes and
2635 definitions.
2636 * alloc.c: Likewise.
2637 * gc_dlopen.c: Likewise.
2638 * headers.c: Likewise.
2639 * mallocx.c: Likewise.
2640 * mark_rts.c: Likewise.
2641 * new_hblk.c: Likewise.
2642 * reclaim.c: Likewise.
2643 * mark.c: Include private/gc_pmark.h before other includes.
2644 * misc.c: Likewise.
2645 * dyn_load.c (_GNU_SOURCE): Move the definition to gc_priv.h.
2646 * pthread_support.c (_USING_POSIX4A_DRAFT10): Likewise.
2647 * pthread_support.c (_POSIX4A_DRAFT10_SOURCE): Remove (since
2648 already defined in gc_config_macros.h).
2649 * dyn_load.c (GC_init_dyld): Remove parameter cast for
2650 _dyld_register_func_for_add_image() and
2651 _dyld_register_func_for_remove_image(); add the comment about
2652 possible warnings; add FIXME for the deprecated
2653 _dyld_bind_fully_image_containing_address().
2654 * include/private/gc_priv.h: Include gc.h before the standard
2655 headers inclusion.
2656 * tests/test.c: Likewise.
2657 * include/private/gcconfig.h (DebugBreak): Update the comment.
2658 * typd_mlc.c (ED_INITIAL_SIZE): Remove ';'.
2660 * configure.ac (openbsd): Define GC_OPENBSD_THREADS.
2661 * configure.ac: Add AM_CONDITIONAL(OPENBSD_THREADS).
2662 * configure.ac: Add sparc-openbsd case.
2663 * doc/README.macros (GC_NETBSD_THREADS, GC_OPENBSD_THREADS):
2664 Document.
2665 * tests/test.c (main): Handle OpenBSD case.
2666 * include/private/pthread_stop_world.h: Likewise.
2667 * extra/threadlibs.c (main): Replace K&R-style function definition
2668 with the ANSI C one.
2669 * extra/threadlibs.c (main): Handle GC_OPENBSD_THREADS case.
2670 * dyn_load.c (OPENBSD): Recognize (similar to NETBSD).
2671 * include/gc_config_macros.h (GC_SOLARIS_THREADS): Recognize;
2672 define it for OpenBSD.
2673 * include/gc_pthread_redirects.h (GC_pthread_sigmask,
2674 pthread_sigmask): Don't declare and redefine for OpenBSD.
2675 * include/private/gcconfig.h: Handle OpenBSD (on arm, sh, i386,
2676 amd64, powerpc).
2677 * mach_dep.c (NO_GETCONTEXT): Likewise.
2678 * include/private/pthread_stop_world.h (thread_stop_info): Don't
2679 define last_stop_count field if OpenBSD.
2680 * misc.c (GC_init_dyld): Add declaration (if NetBSD).
2681 * misc.c (GC_init): Don't call GC_init_netbsd_elf() for OpenBSD.
2682 * os_dep.c (GC_init_netbsd_elf): Don't define for OpenBSD.
2683 * os_dep.c (old_segv_act, GC_jmp_buf_openbsd): New static variable
2684 (only if OpenBSD).
2685 * os_dep.c (GC_fault_handler_openbsd, GC_find_limit_openbsd,
2686 GC_skip_hole_openbsd): New static function (only if OpenBSD).
2687 * os_dep.c (GC_get_stack_base, GC_get_main_stack_base,
2688 GC_register_data_segments): Define specially for OpenBSD case.
2689 * os_dep.c (GC_fault_handler_lock): Initialize to
2690 AO_TS_INITIALIZER (instead of 0).
2691 * pthread_support.c (GC_allocate_lock): Likewise.
2692 * pthread_stop_world.c (NSIG, GC_print_sig_mask,
2693 GC_remove_allowed_signals, suspend_handler_mask, GC_stop_count,
2694 GC_world_is_stopped, GC_retry_signals, SIG_THR_RESTART,
2695 GC_suspend_ack_sem, GC_suspend_handler_inner, GC_suspend_handler,
2696 GC_restart_handler): Don't define and use if OpenBSD.
2697 * pthread_stop_world.c (GC_suspend_all, GC_stop_world,
2698 GC_start_world): Handle OpenBSD case.
2699 * pthread_stop_world.c (GC_stop_init): Define as empty if OpenBSD.
2700 * pthread_support.c (pthread_sigmask): Don't undefine the macro and
2701 don't define the wrapper function if OpenBSD.
2702 * pthread_support.c (GC_thr_init): Handle OpenBSD case.
2704 * dyn_load.c: Move the inclusion of private/gc_priv.h below
2705 definition of a feature macro (_GNU_SOURCE).
2707 * include/gc.h (REVEAL_POINTER): Remove redundant parentheses.
2708 * include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): New macros
2709 (only if GC_I_HIDE_POINTERS).
2710 * backgraph.c (GET_OH_BG_PTR): Prefix REVEAL_POINTER() with "GC_".
2711 * dbg_mlc.c (GC_get_back_ptr_info): Likewise.
2712 * finalize.c (GC_grow_table, GC_dump_finalization, GC_finalize,
2713 GC_enqueue_all_finalizers): Likewise.
2714 * backgraph.c (SET_OH_BG_PTR): Prefix HIDE_POINTER() with "GC_".
2715 * finalize.c (GC_general_register_disappearing_link,
2716 GC_unregister_disappearing_link, GC_register_finalizer_inner,
2717 GC_finalize): Likewise.
2718 * include/private/dbg_mlc.h (HIDE_BACK_PTR): Likewise.
2719 * include/private/dbg_mlc.h (GC_I_HIDE_POINTERS): Define instead
2720 of I_HIDE_POINTERS.
2721 * include/private/gc_priv.h (GC_I_HIDE_POINTERS): Likewise.
2722 * include/gc.h (_GC_H): Strip leading underscore.
2723 * include/gc_backptr.h (_GC_H): Likewise.
2724 * include/gc_gcj.h (_GC_H): Likewise.
2725 * include/gc_mark.h (_GC_H): Likewise.
2726 * include/gc_typed.h (_GC_TYPED_H, _GC_H): Likewise.
2727 * include/javaxfc.h (_GC_H): Likewise.
2728 * include/new_gc_alloc.h (__GC_SPECIALIZE): Likewise.
2729 * include/private/dbg_mlc.h (_GC_H): Likewise.
2730 * include/private/gc_priv.h (_GC_H): Likewise.
2732 * gc_cpp.cc: Include "gc_cpp.h" instead of <gc_cpp.h>.
2734 * include/private/gc_priv.h (GC_INNER): New macro (for GC-scope
2735 variable definitions).
2736 * include/private/gc_priv.h (GC_EXTERN): Update the comment.
2737 * allchblk.c (GC_unmap_threshold): Define as GC_INNER.
2738 * alloc.c (GC_incremental, GC_world_stopped, GC_n_heap_sects,
2739 GC_n_memory, GC_fail_count): Likewise.
2740 * blacklst.c (GC_black_list_spacing, GC_print_heap_obj): Likewise.
2741 * gcj_mlc.c (GC_gcj_malloc_initialized, GC_gcjobjfreelist): Likewise.
2742 * mach_dep.c (GC_save_regs_ret_val): Likewise.
2743 * mark.c (GC_n_mark_procs, GC_obj_kinds, GC_n_kinds,
2744 GC_mark_stack, GC_mark_stack_limit, GC_mark_stack_size,
2745 GC_mark_stack_top, GC_mark_state, GC_mark_stack_too_small,
2746 GC_mark_no, GC_markers): Likewise.
2747 * mark_rts.c (GC_root_size, GC_push_typed_structures): Likewise.
2748 * misc.c (GC_allocate_ml, GC_debugging_started, GC_check_heap,
2749 GC_print_all_smashed, GC_print_back_height, GC_dump_regularly,
2750 GC_backtraces, GC_force_unmap_on_gcollect,
2751 GC_large_alloc_warn_interval, GC_is_initialized, GC_write_cs,
2752 GC_current_warn_proc, GC_blocked_sp, GC_activation_frame): Likewise.
2753 * os_dep.c (GC_page_size, GC_dont_query_stack_min,
2754 GC_no_win32_dlls, GC_wnt, GC_sysinfo, GC_push_other_roots,
2755 GC_dirty_maintained, GC_fault_handler_lock): Likewise.
2756 * pthread_support.c (GC_allocate_ml, GC_lock_holder,
2757 GC_need_to_lock, GC_thr_initialized, GC_threads,
2758 GC_in_thread_creation, GC_collecting, GC_allocate_lock,
2759 GC_mark_lock_holder): Likewise.
2760 * reclaim.c (GC_bytes_found, GC_fl_builder_count, GC_have_errors):
2761 Likewise.
2762 * win32_threads.c (GC_allocate_ml, GC_lock_holder,
2763 GC_need_to_lock, GC_mark_lock_holder, GC_collecting): Likewise.
2764 * extra/gc.c (GC_INNER, GC_EXTERN): Define as STATIC.
2765 * mach_dep.c (GC_with_callee_saves_pushed): Remove redundant {}.
2767 * include/private/gc_priv.h (GC_bytes_allocd, GC_objfreelist,
2768 GC_aobjfreelist): Replace GC_EXTERN to extern for SEPARATE_GLOBALS
2769 case (since they are not defined inside GC at present).
2770 * include/private/gc_priv.h (GC_objects_are_marked): Remove the
2771 declaration (since made static).
2772 * mark.c (GC_objects_are_marked): Define as STATIC.
2773 * win32_threads.c (GC_thr_initialized, GC_in_thread_creation):
2774 Likewise.
2775 * mark.c (GC_N_KINDS_INITIAL_VALUE): New macro (defined and used
2776 to initialize GC_n_kinds).
2777 * win32_threads.c (start_mark_threads): Adjust the comment.
2779 * alloc.c (GC_notify_full_gc): Use GC_INLINE for a tiny static
2780 function.
2781 * backgraph.c (pop_in_progress, GC_apply_to_each_object): Likewise.
2782 * mark_rts.c (add_roots_to_index): Likewise.
2784 * extra/gc.c: New file.
2785 * Makefile.am (EXTRA_DIST): Add "extra/gc.c".
2787 * misc.c (GC_log): Remove the declaration; move the definition (to
2788 the place where it is used); make STATIC.
2789 * misc.c (GC_init): Use GC_err_printf() instead of GC_log_printf()
2790 to print open log failure.
2791 * misc.c (GC_write): Don't abort on open log failure if the GC is
2792 compiled with GC_PRINT_VERBOSE_STATS (useful for WinCE).
2794 * include/private/gcconfig.h (USE_MMAP): Guard with ifndef.
2796 * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Move
2797 the variable declaration to gc_priv.h.
2798 * alloc.c (GC_bytes_found, GC_unmap_threshold,
2799 GC_force_unmap_on_gcollect): Likewise.
2800 * dyn_load.c (GC_no_win32_dlls, GC_wnt): Likewise.
2801 * finalize.c (GC_fail_count): Likewise.
2802 * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
2803 GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Likewise.
2804 * include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size,
2805 GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack,
2806 GC_mark_stack_too_small, GC_mark_state): Likewise.
2807 * include/private/pthread_support.h (GC_threads,
2808 GC_thr_initialized, GC_in_thread_creation): Likewise.
2809 * mallocx.c (GC_bytes_found): Likewise.
2810 * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Likewise.
2811 * misc.c (GC_unmap_threshold): Likewise.
2812 * os_dep.c (GC_unmap_threshold): Likewise.
2813 * pthread_support.c (GC_markers): Likewise.
2814 * thread_local_alloc.c (GC_gcjobjfreelist,
2815 GC_gcj_malloc_initialized, GC_gcj_kind): Likewise.
2816 * win32_threads.c (GC_fault_handler_lock, GC_write_cs,
2817 GC_dont_query_stack_min, GC_markers, GC_wnt): Likewise.
2818 * include/private/gc_priv.h (GC_EXTERN): New macro (used mostly as
2819 a tag for now); defined after "gcconfig.h" inclusion.
2820 * include/private/gc_priv.h: Use GC_EXTERN instead of "extern"
2821 keyword for most global variables.
2822 * alloc.c (GC_copyright): Add the comment about the symbol
2823 visibility.
2824 * finalize.c (GC_fo_entries): Likewise.
2825 * include/private/gc_priv.h (GC_print_stats): Likewise.
2826 * misc.c (GC_quiet): Likewise.
2827 * mallocx.c (GC_bytes_allocd_tmp): Make the volatile variable
2828 STATIC.
2829 * pthread_support.c (GC_threads): Add explicit zero initializer
2830 (to make the variable definition differ from the declaration).
2832 * backgraph.c (GC_quiet): Remove the declaration (not needed
2833 anymore since gc_priv.h is always included).
2834 * checksums.c (GC_quiet): Likewise.
2835 * gcj_mlc.c (GC_quiet): Likewise.
2836 * headers.c (GC_hdr_cache_hits, GC_hdr_cache_misses): Add the
2837 comment.
2838 * include/private/gc_hdrs.h (GC_hdr_cache_hits,
2839 GC_hdr_cache_misses): Likewise.
2840 * mark.c (GC_first_nonempty): Make the volatile variable STATIC.
2841 * pthread_stop_world.c (GC_stop_count, GC_world_is_stopped):
2842 Likewise.
2843 * win32_threads.c (GC_please_stop, GC_max_thread_index,
2844 GC_mark_mutex_waitcnt): Likewise.
2846 * pthread_support.c (GC_USE_LD_WRAP): Fix a typo (swapped 'L' and
2847 'D') in the name.
2849 * gc_dlopen.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Define if dlopen
2850 redirection is turned off; turn it on later when dlopen real
2851 symbol is no longer needed (according to the comment and the same
2852 as in dyn_load.c).
2853 * gc_dlopen.c (WRAP_FUNC, REAL_FUNC): Rename to WRAP_DLFUNC and
2854 REAL_DLFUNC, respectively (to have unique names since the
2855 definitions may differ from that of the similar ones in
2856 pthread_support.c).
2857 * mark.c (source): Undefine the macro when no longer needed.
2858 * os_dep.c (handler): Rename the type to GC_fault_handler_t (to
2859 have the unique name across the project).
2860 * os_dep.c (STAT_BUF_SIZE, STAT_READ); Guard with ifndef; add the
2861 comment.
2862 * pthread_support.c (STAT_BUF_SIZE, STAT_READ): Likewise.
2863 * os_dep.c (sbrk): Undo sbrk() redirection (for ECOS) when no
2864 longer needed.
2866 * pthread_stop_world.c (pthread_sigmask): Undefine before using
2867 in GC_print_sig_mask() (only if DEBUG_THREADS); add the comment.
2868 * win32_threads.c (dlopen, _beginthread): Don't undefine (since
2869 neither redirected nor used here).
2870 * win32_threads.c (GC_Thread_Rep): Rename "table_management" to
2871 "tm" for short; remove "tm_" prefix.
2872 * win32_threads.c (in_use, next): Don't define the macros; use
2873 tm.in_use and tm.next fields, respectively (to ease debugging).
2874 * win32_threads.c (HASH): Rename to PTHREAD_MAP_HASH (to have
2875 unique name across the project).
2877 * include/private/gc_priv.h (I_HIDE_POINTERS): Define before gc.h
2878 inclusion.
2879 * include/private/gc_pmark.h (I_HIDE_POINTERS): Define if gc.h is
2880 not included yet.
2881 * finalize.c (I_HIDE_POINTERS): Don't define.
2882 * include/private/dbg_mlc.h (I_HIDE_POINTERS): Likewise.
2883 * misc.c (I_HIDE_POINTERS): Likewise.
2884 * include/private/dbg_mlc.h (HIDE_POINTER, REVEAL_POINTER,
2885 GC_hidden_pointer): Don't define if HIDE_POINTER is undefined.
2886 * include/private/gc_pmark.h: Remove the comment about gc_priv.h
2887 inclusion order.
2889 * dyn_load.c: Include gc_priv.h before using configuration
2890 information (MACOS).
2891 * dyn_load.c (GC_must_restore_redefined_dlopen): Rename to
2892 GC_MUST_RESTORE_REDEFINED_DLOPEN.
2894 * backgraph.c (SET_OH_BG_PTR): Place outermost parenthesis
2895 properly.
2896 * darwin_stop_world.c: Replace "if DEBUG_THREADS" with
2897 "ifdef DEBUG_THREADS".
2898 * pthread_stop_world.c: Likewise.
2899 * pthread_support.c: Likewise.
2900 * include/gc_inline.h: Guard with GC_INLINE_H.
2902 * alloc.c (GC_copyright): Define as const.
2903 * alloc.c (GC_collect_at_heapsize): Replace "static" with "STATIC"
2904 (since the name starts with "GC_" prefix).
2905 * dbg_mlc.c (GC_describe_type_fns): Likewise.
2906 * dyn_load.c (GC_FirstDLOpenedLinkMap,
2907 GC_register_dynlib_callback, GC_dyld_sections,
2908 GC_dyld_name_for_hdr, GC_dyld_image_add, GC_dyld_image_remove):
2909 Likewise.
2910 * malloc.c (GC_libpthread_start, GC_libpthread_end,
2911 GC_libld_start, GC_libld_end): Likewise.
2912 * mark_rts.c (GC_remove_root_at_pos, GC_rebuild_root_index):
2913 Likewise.
2914 * os_dep.c (GC_gww_read_dirty, GC_gww_page_was_dirty,
2915 GC_gww_page_was_ever_dirty, GC_mprotect_thread_notify,
2916 GC_mprotect_thread_reply, GC_mprotect_thread, GC_darwin_sigbus,
2917 GC_forward_exception): Likewise.
2918 * pthread_support.c (GC_syms_initialized): Likewise.
2919 * typd_mlc.c (GC_push_typed_structures_proc): Likewise.
2920 * win32_threads.c (GC_win32_dll_threads,
2921 GC_register_my_thread_inner, GC_lookup_pthread, GC_get_stack_min,
2922 GC_waitForSingleObjectInfinite): Likewise.
2923 * darwin_stop_world.c (GC_use_mach_handler_thread,
2924 GC_use_mach_handler_thread, GC_mach_threads_count): Replace
2925 "static" with "STATIC" and add zero initializer.
2926 * os_dep.c (GC_task_self, GC_ports, GC_mprotect_state,
2927 GC_sigbus_count): Likewise.
2928 * headers.c (free_hdr): Replace "static" with GC_INLINE.
2929 * misc.c (GC_tmp): Rename static variable to fwrite_gc_res.
2930 * os_dep.c (memory): Rename static variable to ecos_gc_memory.
2931 * os_dep.c (async_set_pht_entry_from_index): Make static (for
2932 MPROTECT_VDB case).
2933 * pthread_support.c (GC_real_pthread_create,
2934 GC_real_pthread_sigmask, GC_real_pthread_join,
2935 GC_real_pthread_detach, GC_init_real_syms): Use REAL_FUNC() macro
2936 for static GC_real_XXX symbols.
2937 * win32_threads.c (GC_may_be_in_stack): Remove "GC_" prefix.
2939 * alloc.c (GC_finish_collection): Replace getenv() with GETENV().
2940 * dyn_load.c (GC_init_dyld): Likewise.
2941 * os_dep.c (GC_print_callers): Likewise.
2942 * dyn_load.c (GC_dyld_name_for_hdr): Cast _dyld_get_image_name()
2943 result (since it's always of "struct mach_header" type).
2944 * dyn_load.c (GC_init_dyld): Cast GC_dyld_image_add and
2945 GC_dyld_image_remove (to always have the first argument of
2946 "struct mach_header" pointer type).
2948 * configure.ac: Add threads support for OpenBSD case (threads may
2949 not work correctly for it).
2951 * acinclude.m4: Rename to m4/gc_set_version.m4.
2952 * m4/libtool.m4: Delete the file.
2953 * m4/lt~obsolete.m4: Likewise.
2954 * m4/ltoptions.m4: Likewise.
2955 * m4/ltsugar.m4: Likewise.
2956 * m4/ltversion.m4: Likewise.
2958 * include/private/gcconfig.h: Define DebugBreak() as _exit(-1) for
2959 x86mingw32ce toolchain to workaround the incorrect DebugBreak()
2960 declaration in winbase.h (the workaround would turn into a no-op
2961 when DebugBreak() will be defined as a macro in the toolchain).
2963 * include/private/gcconfig.h: Recognize __i386__ if WinCE (for
2964 x86mingw32ce toolchain).
2965 * include/private/gcconfig.h (NO_GETENV): Don't define for CeGCC
2966 toolchain (or if already defined).
2967 * include/private/gcconfig.h (NO_GETENV_WIN32): New macro (always
2968 defined for WinCE or if NO_GETENV is defined).
2969 * misc.c (GC_CreateLogFile): Use NO_GETENV_WIN32 macro instead of
2970 NO_GETENV one.
2972 * configure.ac: Add AC_CONFIG_MACRO_DIR([m4]).
2973 * Makefile.am: Add "ACLOCAL_AMFLAGS = -I m4".
2974 * libtool.m4: Remove.
2975 * m4/libtool.m4: New file (generated).
2976 * m4/lt~obsolete.m4: Likewise.
2977 * m4/ltoptions.m4: Likewise.
2978 * m4/ltsugar.m4: Likewise.
2979 * m4/ltversion.m4: Likewise.
2981 * include/gc.h (GC_UNDERSCORE_STDCALL): Recognize new macro;
2982 prefix GC_CreateThread and GC_ExitThread with '_' if defined.
2983 * doc/README.macros (GC_UNDERSCORE_STDCALL): Document.
2985 * alloc.c (GC_collect_or_expand): Add "retry" argument; add the
2986 comments; don't use "default" stop_func on a retry if
2987 GC_dont_expand.
2988 * alloc.c (GC_allocobj): Pass "retry" argument to
2989 GC_collect_or_expand().
2990 * malloc.c (GC_alloc_large): Likewise.
2991 * include/private/gc_priv.h (GC_collect_or_expand): Move the
2992 declaration to malloc.c; add "retry" argument.
2994 * alloc.c (GC_start_call_back): Move the variable definition from
2995 misc.c.
2996 * include/private/gc_priv.h (GC_start_call_back): Remove the
2997 declaration.
2998 * alloc.c (GC_notify_full_gc): Remove unnecessary cast of 0.
2999 * alloc.c (GC_try_to_collect_inner): Also call stop_func at the
3000 beginning of the function.
3001 * include/gc.h (GC_try_to_collect): Refine the comment about
3002 stop_func.
3004 * alloc.c (GC_default_stop_func, GC_try_to_collect_general,
3005 GC_gcollect): Add the comment.
3006 * alloc.c (GC_try_to_collect_general): Move the assertion on
3007 stop_func != 0 to GC_try_to_collect().
3008 * alloc.c (GC_try_to_collect_general): If stop_func == 0 then use
3009 GC_default_stop_func instead (holding the lock).
3010 * alloc.c (GC_gcollect): Pass 0 as stop_func instead of
3011 GC_default_stop_func (to prevent data races).
3013 * Makefile.direct: Move "define arguments" documentation to
3014 doc/README.macros; add reference to doc/README.macros.
3015 * Makefile.dj: Change the documentation reference to
3016 doc/README.macros.
3017 * README.QUICK: Likewise.
3018 * configure.ac: Likewise.
3019 * allchblk.c: Remove unnecessary "-D" from the comment.
3020 * doc/README.macros: Likewise.
3021 * README.environment: Likewise.
3022 * include/gc.h: Likewise.
3023 * include/gc_inline.h: Likewise.
3024 * include/private/gcconfig.h: Likewise.
3025 * README.QUICK: Fix a typo.
3027 * misc.c (GC_CreateLogFile): Use FILE_ATTRIBUTE_NORMAL for
3028 CreateFile(); don't immediately flush every write if very verbose.
3030 * doc/README.win32: Replace ".exe.log" to ".gc.log".
3031 * doc/README.win64: Likewise.
3032 * doc/README.win64: Fix a typo.
3033 * misc.c (GC_CreateLogFile): Strip executable file extension for
3034 the log file; use ".gc.log" extension (instead of ".log").
3036 * include/gc_config_macros.h: Avoid the redefinition of
3037 GC_xxx_THREADS macros.
3039 * alloc.c (GC_try_to_collect_general): Change the type of "result"
3040 local variable to GC_bool.
3042 * include/gc_config_macros.h: Use old behavior for FreeBSD and
3043 NetBSD platform detection code (check that other GC_xxx_THREADS
3044 are undefined); add FIXME.
3046 * include/gc_config_macros.h: Rearrange the platform detection
3047 code (GC_WIN32_PTHREADS implies GC_WIN32_THREADS; define
3048 GC_THREADS first if GC_XXX_THREADS already set; define proper
3049 GC_XXX_THREADS if GC_THREADS; define GC_PTHREADS in a single
3050 place; define _REENTRANT if posix threads except for Win32).
3052 * alloc.c (GC_try_to_collect_general): New function (move the code
3053 from GC_try_to_collect, pass force_unmap argument).
3054 * alloc.c (GC_try_to_collect, GC_gcollect): Call
3055 GC_try_to_collect_general().
3056 * alloc.c (GC_gcollect_and_unmap): New public function.
3057 * include/gc.h (GC_gcollect_and_unmap): New function declaration.
3058 * tests/test.c (window_proc): Call GC_gcollect_and_unmap() on
3059 WM_HIBERNATE event (instead of GC_set_force_unmap_on_gcollect()
3060 and GC_gcollect()).
3062 * include/gc.h (GC_allow_register_threads, GC_register_my_thread,
3063 GC_unregister_my_thread, GC_malloc_many): Refine the comment.
3064 * include/gc.h (GC_malloc_many, GC_NEXT): Declare unconditionally
3065 (that is, don't depend on GC_THREADS macro).
3066 * include/gc.h: Don't check for __CYGWIN32__ and __CYGWIN__ along
3067 with a check for GC_PTHREADS (since the former implies the
3068 latter).
3070 * include/gc.h (GC_SOLARIS_THREADS): Don't check for.
3071 * include/gc.h (GC_MIN, GC_MAX): Don't define.
3072 * mallocx.c (GC_malloc_many): Add comment to #endif.
3074 * configure.ac: Drop the subdir-objects Automake option, since
3075 it's incompatible with picking source files from libatomic_ops.
3077 * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Add
3078 "extern" keyword to a global variable declaration (some compilers
3079 require it).
3080 * alloc.c (GC_bytes_found, GC_unmap_threshold,
3081 GC_force_unmap_on_gcollect): Likewise.
3082 * dyn_load.c (GC_no_win32_dlls, GC_wnt): Likewise.
3083 * finalize.c (GC_fail_count): Likewise.
3084 * include/private/gc_hdrs.h (GC_hdr_cache_hits,
3085 GC_hdr_cache_misses): Likewise.
3086 * mallocx.c (GC_bytes_found): Likewise.
3087 * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Likewise.
3088 * misc.c (GC_unmap_threshold): Likewise.
3089 * os_dep.c (GC_unmap_threshold, GC_old_allocator): Likewise.
3090 * pthread_support.c (GC_markers): Likewise.
3091 * thread_local_alloc.c (GC_gcjobjfreelist,
3092 GC_gcj_malloc_initialized, GC_gcj_kind): Likewise.
3093 * win32_threads.c (GC_fault_handler_lock, GC_write_cs,
3094 GC_dont_query_stack_min, GC_markers, GC_wnt): Likewise.
3096 * tests/huge_test.c: Define GC_IGNORE_WARN (if not defined) to
3097 suppress misleading GC "Out of Memory!" warning printed on every
3098 GC_MALLOC(LONG_MAX) call.
3099 * tests/huge_test.c: Include "gc.h" instead of <gc.h>.
3100 * tests/huge_test.c (main): Replace K&R-style function definition
3101 with the ANSI C one.
3103 * dyn_load.c (GC_register_dynamic_libraries): Always use
3104 lpMaximumApplicationAddress value for WinCE (even for old
3105 versions).
3106 * os_dep.c (VER_PLATFORM_WIN32_CE): Define if not in winbase.h.
3107 * os_dep.c (GC_dont_query_stack_min): New global variable (only if
3108 WinCE and THREADS).
3109 * os_dep.c (GC_setpagesize): Adjust lpMaximumApplicationAddress
3110 for WinCE (prior to version 6) if not _WIN32_WCE_EMULATION; set
3111 GC_dont_query_stack_min for older WinCE (prior to version 5).
3112 * win32_threads.c (GC_dont_query_stack_min): Declare.
3113 * win32_threads.c (GC_get_stack_min): Rename the macro to
3114 GC_wince_evaluate_stack_min for WinCE; update the comment.
3115 * win32_threads.c (GC_push_stack_for, GC_get_next_stack): Use
3116 GC_wince_evaluate_stack_min() instead of GC_get_stack_min() for
3117 WinCE and don't update thread's last_stack_min value (only if
3118 GC_dont_query_stack_min).
3119 * win32_threads.c (GC_push_stack_for): Skip assertion for WinCE if
3120 GC_dont_query_stack_min (since the evaluated stack_min value may
3121 be incorrect if the stack is bigger than 64 KiB).
3123 * gc_dlopen.c (GC_dlopen): Add function redirector (only if
3124 GC_USE_LD_WRAP).
3125 * include/gc.h: Include "gc_pthread_redirects.h" even if
3126 GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS.
3127 * include/gc_pthread_redirects.h (GC_PTHREAD_REDIRECTS_H): Don't
3128 define and check for (since included only from gc.h).
3129 * include/gc_pthread_redirects.h: Declare "GC_" symbols even if
3130 GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS.
3131 * include/gc_pthread_redirects.h: Include signal.h only to get
3132 sigset_t definition.
3134 * Makefile.direct: Document GC_REGISTER_MEM_PRIVATE.
3135 * mark_rts.c (GC_is_tmp_root): Define also for WinCE unless
3136 NO_DEBUGGING (that is, replace _WIN32_WCE_EMULATION with MSWINCE).
3137 * os_dep.c (GC_sysinfo): Remove explicit global variable
3138 initialization to "{0}" (revert back the previous change) since it
3139 might produce a warning.
3141 * allchblk.c (GC_large_alloc_warn_interval): Move declaration from
3142 gc_priv.h.
3143 * allchblk.c (GC_large_alloc_warn_suppressed): Move definition
3144 from misc.c; define as STATIC.
3145 * include/private/gc_priv.h (GC_large_alloc_warn_interval,
3146 GC_large_alloc_warn_suppressed): Remove declaration.
3147 * alloc.c (GC_bytes_found): Add "defined in" comment.
3148 * mallocx.c (GC_bytes_found): Likewise.
3149 * misc.c (GC_unmap_threshold): Likewise.
3150 * os_dep.c (GC_old_allocator): Likewise.
3151 * pthread_support.c (GC_markers): Likewise.
3152 * thread_local_alloc.c (GC_gcjobjfreelist,
3153 GC_gcj_malloc_initialized, GC_gcj_kind): Likewise.
3154 * win32_threads.c (GC_markers): Likewise.
3155 * alloc.c (GC_start_time): Explicitly initialize to 0 or NULL (to
3156 be distinctive from a variable declaration).
3157 * backgraph.c (GC_max_height, GC_deepest_obj): Likewise.
3158 * blacklst.c (GC_old_normal_bl, GC_incomplete_normal_bl,
3159 GC_old_stack_bl, GC_incomplete_stack_bl): Likewise.
3160 * checksums.c (GC_faulted, GC_n_dirty_errors,
3161 GC_n_faulted_dirty_errors, GC_n_changed_errors, GC_n_clean,
3162 GC_n_dirty, GC_bytes_in_used_blocks): Likewise.
3163 * dbg_mlc.c (GC_smashed): Likewise.
3164 * finalize.c (GC_old_dl_entries): Likewise.
3165 * gcj_mlc.c (GC_gcj_kind, GC_gcj_debug_kind, GC_gcjobjfreelist,
3166 GC_gcjdebugobjfreelist): Likewise.
3167 * mach_dep.c (GC_save_regs_ret_val): Likewise.
3168 * mark.c (GC_n_rescuing_pages, GC_mark_stack, GC_mark_stack_limit,
3169 GC_mark_stack_top): Likewise.
3170 * misc.c (GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset):
3171 Likewise.
3172 * os_dep.c (GC_data_start, GC_page_size, GC_sysinfo,
3173 GC_old_segv_handler, GC_old_bus_handler,
3174 GC_old_bus_handler_used_si, GC_old_segv_handler_used_si,
3175 GC_proc_buf, GC_proc_fd, GC_vd_base): Likewise.
3176 * pthread_stop_world.c (GC_stop_count, GC_stopping_pid): Likewise.
3177 * reclaim.c (GC_leaked): Likewise.
3178 * typd_mlc.c (GC_explicit_kind, GC_array_kind, GC_ext_descriptors,
3179 GC_typed_mark_proc_index, GC_array_mark_proc_index,
3180 GC_eobjfreelist, GC_arobjfreelist): Likewise.
3181 * win32_threads.c (GC_pthread_map_cache, GC_marker_cv,
3182 GC_marker_Id): Likewise.
3183 * dbg_mlc.c (GC_smashed, GC_n_smashed): Define as STATIC.
3184 * gcj_mlc.c (GC_gcjdebugobjfreelist): Likewise.
3185 * os_dep.c (GC_vd_base): Likewise.
3186 * pthread_support.c (GC_mark_threads): Likewise.
3187 * reclaim.c (GC_leaked): Likewise.
3188 * typd_mlc.c (GC_bm_table): Likewise.
3189 * mark_rts.c (GC_save_regs_ret_val): Change declaration type to
3190 that of definition; add "defined in" comment.
3191 * mark_rts.c (GC_push_current_stack): Remove unnecessary cast for
3192 GC_save_regs_ret_val.
3193 * misc.c (GC_check_heap, GC_print_all_smashed,
3194 GC_start_call_back): Remove unnecessary cast (of 0).
3195 * misc.c (GC_LARGE_ALLOC_WARN_INTERVAL): New tuning macro.
3196 * misc.c (GC_large_alloc_warn_interval): Initialize to
3197 GC_LARGE_ALLOC_WARN_INTERVAL value.
3198 * misc.c (GC_tmp): Change to "static".
3199 * os_dep.c (GC_mprotect_state): Define as static.
3200 * pthread_support.c (dummy_thread_local): Prefix with "GC_".
3201 * win32_threads.c (WinMain): Remove FIXME for WinCE.
3203 * os_dep.c (PROTECT, UNPROTECT): Use distinct ABORT messages.
3205 * configure.ac: Rewrite the tests for external or internal
3206 libatomic_ops.
3207 * configure.ac: In particular, drop the symbolic links. Add option
3208 --with-libatomic-ops for forced selection.
3209 * Makefile.am: Adjust the path of source files from libatomic_ops
3210 to not use the links.
3211 * Makefile.am (libgc_la_LIBADD): Add $(ATOMIC_OPS_LIBS). This will
3212 be empty if we use the bundled AO sources.
3214 * Makefile.am: Strip version suffix for libatomic_ops directory.
3215 * build_atomic_ops.sh: Likewise.
3216 * build_atomic_ops.sh.cygwin: Likewise.
3217 * configure_atomic_ops.sh: Likewise.
3218 * Makefile.direct: Remove AO_VERSION definition; strip version
3219 suffix for libatomic_ops directory.
3220 * NT_STATIC_THREADS_MAKEFILE: Likewise.
3221 * NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
3222 * NT_X64_THREADS_MAKEFILE: Likewise.
3223 * gc.mak: Likewise.
3225 * libatomic_ops: Rename from "libatomic_ops-1.2".
3227 * alloc.c (GC_version): Add "const" keyword.
3228 * alloc.c (GC_get_version): New public function.
3229 * include/gc.h (GC_get_version): New function declaration; update
3230 the comment for the GC version.
3232 * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
3233 GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Use "extern"
3234 (for the global variable declaration) again.
3235 * include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size,
3236 GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack,
3237 GC_mark_stack_too_small, GC_mark_state): Likewise.
3238 * include/private/gcconfig.h (GC_register_stackbottom): Likewise.
3239 * include/private/pthread_support.h (GC_threads,
3240 GC_thr_initialized, GC_in_thread_creation): Likewise.
3241 * include/private/gc_priv.h: Likewise.
3243 * real_malloc.c: Include private/config.h if HAVE_CONFIG_H.
3245 * allchblk.c (GC_hblkfreelist): Define as STATIC.
3246 * blacklst.c (GC_total_stack_black_listed): Likewise.
3247 * include/private/gc_priv.h (GC_hblkfreelist, GC_stopped_mark,
3248 GC_total_stack_black_listed, GC_push_stubborn_structures): Remove
3249 declaration.
3250 * mark_rts.c (GC_stopped_mark): Add declaration (only if
3251 THREAD_LOCAL_ALLOC).
3252 * allchblk.c (GC_fail_count): Move the declaration out of
3253 GC_allochblk_nth(); remove "extern".
3254 * alloc.c (IF_THREADS): Remove unused macro.
3255 * alloc.c (GC_world_stopped): Define only if THREAD_LOCAL_ALLOC.
3256 * alloc.c (GC_stopped_mark): Set GC_world_stopped value only if
3257 THREAD_LOCAL_ALLOC.
3258 * alloc.c (GC_bytes_found, GC_collection_in_progress,
3259 GC_check_tls, GC_unmap_threshold, GC_force_unmap_on_gcollect):
3260 Remove K&R-style "extern" for the declaration.
3261 * dbg_mlc.c (GC_free_inner): Likewise.
3262 * dyn_load.c (GC_repeat_read, GC_roots_present, GC_is_heap_base,
3263 GC_get_next_stack, GC_no_win32_dlls, GC_wnt): Likewise.
3264 * finalize.c (GC_fail_count): Likewise.
3265 * include/private/gc_hdrs.h (GC_hdr_cache_hits,
3266 GC_hdr_cache_misses): Likewise.
3267 * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
3268 GC_lock, GC_collecting, GC_mark_lock_holder, GC_need_to_lock):
3269 Likewise.
3270 * include/private/gc_pmark.h (GC_mark_procs, GC_n_mark_procs,
3271 GC_mark_stack_size, GC_mark_stack_limit, GC_mark_stack_top,
3272 GC_mark_stack, GC_mark_stack_too_small, GC_mark_state): Likewise.
3273 * include/private/gc_priv.h (GC_current_warn_proc, GC_obj_kinds,
3274 GC_n_kinds, GC_fo_entries, GC_n_heap_sects, GC_n_memory,
3275 GC_page_size, GC_sysinfo, GC_black_list_spacing,
3276 GC_objects_are_marked, GC_incremental, GC_dirty_maintained,
3277 GC_root_size, GC_debugging_started, GC_large_alloc_warn_interval,
3278 GC_large_alloc_warn_suppressed, GC_blocked_sp,
3279 GC_activation_frame, GC_push_other_roots,
3280 GC_push_finalizer_structures, GC_push_thread_structures,
3281 GC_push_typed_structures, GC_start_call_back, GC_is_initialized,
3282 GC_check_heap, GC_print_all_smashed, GC_print_all_errors,
3283 GC_print_heap_obj, GC_have_errors, GC_print_stats,
3284 GC_dump_regularly, GC_backtraces, GC_print_back_height,
3285 GC_debug_generic_malloc_inner,
3286 GC_debug_generic_malloc_inner_ignore_off_page,
3287 GC_fl_builder_count, GC_mark_no, GC_help_marker,
3288 GC_setup_temporary_fault_handler, GC_reset_fault_handler): Likewise.
3289 * include/private/gcconfig.h (GC_SysVGetDataStart,
3290 GC_FreeBSDGetDataStart, GC_register_stackbottom,
3291 GC_MacTemporaryNewPtr, GC_amiga_get_mem): Likewise.
3292 * include/private/pthread_support.h (GC_threads,
3293 GC_thr_initialized, GC_in_thread_creation): Likewise.
3294 * malloc.c (GC_text_mapping): Likewise.
3295 * mallocx.c (GC_bytes_found): Likewise.
3296 * mark.c (GC_check_dirty, GC_started_thread_while_stopped): Likewise.
3297 * mark_rts.c (GC_save_regs_ret_val): Likewise.
3298 * misc.c (GC_clear_stack_inner, GC_init_parallel, GC_init_win32,
3299 GC_setpagesize, GC_init_linux_data_start,
3300 GC_set_and_save_fault_handler, GC_unmap_threshold): Likewise.
3301 * os_dep.c (GC_unmap_threshold, GC_push_all_stacks,
3302 GC_darwin_register_mach_handler_thread): Likewise.
3303 * pthread_support.c (GC_markers, GC_collection_in_progress):
3304 Likewise.
3305 * tests/test.c (GC_amiga_free_all_mem): Likewise.
3306 * thread_local_alloc.c (GC_gcjobjfreelist,
3307 GC_gcj_malloc_initialized, GC_gcj_kind): Likewise.
3308 * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init,
3309 GC_fault_handler_lock, GC_write_cs, GC_markers): Likewise.
3310 * misc.c (GC_read, GC_register_finalizer_no_order, GC_init_dyld):
3311 Move the declaration out of GC_init(); remove "extern".
3312 * os_dep.c (GC_abort): Add the comment; add workaround to suppress
3313 compiler "unreachable code" warnings for ABORT callers (where
3314 ABORT is followed by a dummy return statement).
3315 * os_dep.c (GC_old_allocator): Move the declaration out of
3316 GC_default_push_other_roots(); remove "extern".
3317 * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
3318 Move the declaration out of GC_stop_world() and GC_start_world()
3319 (only if MPROTECT_VDB); remove "extern".
3321 * win32_threads.c (GC_get_stack_min, GC_push_stack_for,
3322 GC_get_next_stack): Recognize _WIN32_WCE_EMULATION macro (used for
3323 WinCE emulation and for custom WinCE 6 devices); add the comment.
3324 * win32_threads.c (GC_get_stack_min): Cast pointer to word instead
3325 of DWORD.
3326 * win32_threads.c (GC_get_next_stack): Don't use and maintain the
3327 latest known stack_min value for WinCE (if GC_get_stack_min is
3328 defined as a macro); update the comments.
3329 * win32_threads.c (GC_wnt): Don't declare for WinCE.
3331 * Makefile.direct: Document EMPTY_GETENV_RESULTS.
3332 * gcj_mlc.c (GC_clear_stack): Remove declaration.
3333 * malloc.c (GC_clear_stack): Likewise.
3334 * mallocx.c (GC_clear_stack): Likewise.
3335 * typd_mlc.c (GC_clear_stack): Likewise.
3336 * gcj_mlc.c (GENERAL_MALLOC, GENERAL_MALLOC_IOP): Rename to
3337 GENERAL_MALLOC_INNER and GENERAL_MALLOC_INNER_IOP, respectively;
3338 remove "lb" unnecessary cast to word.
3339 * include/private/gc_priv.h (GC_clear_stack): Add declaration.
3340 * include/private/gc_priv.h (GENERAL_MALLOC, GENERAL_MALLOC_IOP):
3341 Move common declaration from typd_mlc.c and malloc.c; remove
3342 unnecessary result and "lb" parameter casts.
3343 * include/private/thread_local_alloc.h: Guard against duplicate
3344 header file inclusion.
3345 * os_dep.c (USE_MUNMAP): Replace "-->" with an error directive for
3346 the case when USE_MMAP is not defined.
3347 * pthread_support.c (GC_is_thread_tsd_valid): New internal
3348 function (only if GC_ASSERTIONS and THREAD_LOCAL_ALLOC); move the
3349 code from thread-local GC_malloc(); add FIXME for the condition.
3350 * win32_threads.c (GC_is_thread_tsd_valid): Likewise.
3351 * thread_local_alloc.c (GC_gcjobjfreelist): Change the type (to
3352 match that of its definition).
3353 * thread_local_alloc.c (GC_destroy_thread_local): Add a cast for
3354 GC_gcjobjfreelist.
3355 * thread_local_alloc.c (GC_lookup_thread, GC_lookup_thread_inner):
3356 Remove unused declaration; don't include pthread.h.
3357 * thread_local_alloc.c (GC_is_thread_tsd_valid): New declaration
3358 (only if GC_ASSERTIONS).
3359 * thread_local_alloc.c (GC_malloc): Use GC_is_thread_tsd_valid()
3360 instead of GC_lookup_thread().
3361 * win32_threads.c (GC_lookup_thread_inner): Define as STATIC.
3362 * win32_threads.c (UNPROTECT): Rename to UNPROTECT_THREAD (to have
3363 id different from that in os_dep.c).
3365 * allchblk.c (GC_enough_large_bytes_left): Replace "inline static"
3366 with GC_INLINE.
3367 * include/private/gc_priv.h (fixed_getenv): Likewise.
3368 * alloc.c (GC_max, GC_min): Replace "static INLINE" with
3369 GC_INLINE.
3370 * mark_rts.c (rt_hash): Likewise.
3371 * win32_threads.c (GC_get_max_thread_index): Likewise.
3372 * include/private/gc_priv.h (INLINE): Prefix with "GC_"; include
3373 "static"; define for Sun CC; define for VC++ (and other
3374 compilers).
3375 * pthread_support.c: Don't define __inline__ for non-GNU compilers
3376 (not needed anymore).
3378 * NT_THREADS_MAKEFILE: Remove file (since it duplicates gc.mak).
3379 * Makefile.in: Remove reference to NT_THREADS_MAKEFILE.
3380 * Makefile.am: Likewise.
3381 * Makefile.dj: Likewise.
3382 * Makefile.direct: Likewise.
3383 * doc/README.win32: Add reference to gc.mak.
3384 * NT_X64_THREADS_MAKEFILE: Likewise.
3386 * Makefile.direct: Remove references to acinclude.m4, libtool.m4.
3388 * autogen.sh: Update.
3390 * Makefile.am: Don't add libtool.m4 to EXTRA_DIST.
3391 * acinclude.m4: Fix underquoting of GC_SET_VERSION.
3392 * README.QUICK: Update information for Makefile.
3393 * Makefile.am: Do not distribute the substituted bdw-gc.pc.
3394 * configure.ac: Add AM conditional analog to KEEP_BACK_PTRS.
3395 * tests/tests.am: Use it here to conditionally enable tracetest
3396 when possible.
3398 * dyn_load.c (GC_wnt): Update the comment.
3399 * dyn_load.c (GC_register_dynamic_libraries): Add the comment for
3400 _WIN32_WCE_EMULATION; recognize GC_REGISTER_MEM_PRIVATE (new
3401 macro); call GC_is_heap_base() only if check for Type succeeded.
3403 * mark_rts.c (GC_is_tmp_root): Don't define unless NO_DEBUGGING;
3404 update the comment.
3405 * include/private/gc_priv.h (GC_is_tmp_root): Remove declaration.
3407 * include/private/gcconfig.h (CANCEL_SAFE, IF_CANCEL): new macros.
3408 * include/private/gc_priv.h (DISABLE_CANCEL, RESTORE_CANCEL,
3409 ASSERT_CANCEL_DISABLED): New macros.
3410 * alloc.c (GC_maybe_gc): Assert cancellation disabled.
3411 (GC_collect_a_little_inner,GC_try_to_collect, GC_collect_or_expand):
3412 Disable cancellation.
3413 (GC_add_to_our_memory): Check for overflow.
3414 * misc.c (GC_cancel_disable_count): declare.
3415 (GC_init, GC_write): Disable cancellation.
3416 (GC_init): Remove redundant GC_is_initialized test.
3417 * os_dep.c (GC_repeat_read): Assert cancellation disabled.
3418 (GC_get_stack_base): Disable cancellation.
3419 * pthread_stop_world.c (GC_suspend_handler_inner): Disable
3420 cancellation.
3421 * pthread_support.c (GC_mark_thread): Permanently disable
3422 cancellation.
3423 (GC_wait_for_gc_completion, GC_wait_builder, GC_wait_marker):
3424 Assert cancellation disabled.
3425 (fork handling): Disable cancellation, fix comment.
3426 (GC_pthread_create): Disable cancellation.
3427 (GC_unregister_my_thread): Disable cancellation.
3428 * Makefile.direct: Document NO_CANCEL_SAFE.
3430 * Makefile: Remove outdated file (Makefile.direct should be used
3431 instead).
3433 * include/gc.h (GC_use_DllMain): Refine the comment.
3435 * configure.ac: Add documentation to AC_DEFINE for GC_THREADS and
3436 EMPTY_GETENV_RESULTS.
3437 * configure.ac: Fix a typo.
3438 * Makefile.am: Likewise.
3440 * checksums.c (GC_checksum, GC_update_check_page): Remove
3441 "register" keyword in local variable declarations (for the code
3442 used only for debugging or which is not time-critical).
3443 * dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info,
3444 GC_store_debug_info_inner, GC_check_annotated_obj, GC_print_obj,
3445 GC_print_smashed_obj, GC_debug_end_stubborn_change,
3446 GC_debug_invoke_finalizer): Likewise.
3447 * dyn_load.c (GC_register_dynamic_libraries): Likewise.
3448 * mallocx.c (GC_realloc): Likewise.
3449 * mark_rts.c (GC_print_static_roots, GC_is_static_root,
3450 GC_clear_roots): Likewise.
3451 * misc.c (GC_write): Likewise.
3452 * os_dep.c (GC_print_callers): Likewise.
3453 * dyn_load.c (GC_register_dynamic_libraries): Rename "i" local
3454 variable to "j" for the nested loop (just not to hide the similar
3455 variable in the outer one).
3456 * mark_rts.c (GC_print_static_roots): Output an error message
3457 using GC_err_printf() (instead of GC_printf()).
3459 * configure.ac: Move include flag from ${INCLUDE} ...
3460 * Makefile.am: ... to AM_CPPFLAGS and also add the build directory.
3461 * configure.ac: Call AM_CONFIG_HEADER([include/private/config.h]).
3462 * configure.ac: Add documentation to all AC_DEFINE either directly
3463 or using AH_TEMPLATE.
3465 * win32_threads.c (GC_waitForSingleObjectInfinite): New static
3466 function (only if GC_WINMAIN_REDIRECT).
3467 * win32_threads.c (WinMain): Call GC_waitForSingleObjectInfinite()
3468 thru GC_do_blocking() instead of calling WaitForSingleObject()
3469 directly.
3471 * pthread_support.c (start_mark_threads): Refine printed message.
3472 * win32_threads.c (GC_thr_init): Likewise.
3474 * Makefile.direct (GC_WINMAIN_REDIRECT): Add the comment for.
3475 * Makefile.direct (NO_GETENV): Update the comment.
3476 * include/gc.h (GC_WINMAIN_WINCE_LPTSTR): Remove macro.
3477 * include/gc.h (GC_WinMain): Remove declaration.
3478 * include/gc.h (WinMain): Define (as GC_WinMain) if and only if
3479 GC_WINMAIN_REDIRECT.
3480 * tests/test.c (GC_COND_INIT): Define as GC_INIT() also in case of
3481 WinCE target unless GC_WINMAIN_REDIRECT is defined.
3482 * tests/test.c (WINMAIN_LPTSTR): New macro.
3483 * tests/test.c (WinMain): Use WINMAIN_LPTSTR instead of LP[W]STR
3484 and GC_WINMAIN_WINCE_LPTSTR.
3485 * win32_threads.c (start_mark_threads): Add the comment for
3486 MARK_THREAD_STACK_SIZE.
3487 * win32_threads.c: Recognize new GC_WINMAIN_REDIRECT macro.
3488 * win32_threads.c (WINMAIN_LPTSTR, WINMAIN_THREAD_STACK_SIZE): New
3489 macro (only if GC_WINMAIN_REDIRECT).
3490 * win32_threads.c: Undefine WinMain macro if GC_WINMAIN_REDIRECT.
3491 * win32_threads.c (GC_WinMain): Add prototype (only if
3492 GC_WINMAIN_REDIRECT).
3493 * win32_threads.c (main_thread_args, WinMain): Rename
3494 GC_WINMAIN_WINCE_LPTSTR to WINMAIN_LPTSTR.
3495 * win32_threads.c (WinMain): Call GC_INIT() instead of GC_init();
3496 use WINMAIN_THREAD_STACK_SIZE.
3497 * win32_threads.c (WinMain): Call GC_deinit() and
3498 DeleteCriticalSection() only if WinCE; add FIXME.
3500 * os_dep.c (GC_get_main_stack_base): add assertion for mem_base
3501 value returned by GC_get_stack_base().
3503 * Makefile.direct (MUNMAP_THRESHOLD, GC_FORCE_UNMAP_ON_GCOLLECT):
3504 Add the comment for.
3505 * alloc.c (GC_unmap_threshold, GC_force_unmap_on_gcollect):
3506 Declare external variable (only if USE_MUNMAP).
3507 * alloc.c (GC_try_to_collect): Temporarily set GC_unmap_threshold
3508 value to 1 if GC_force_unmap_on_gcollect and restore it before
3509 unlocking (only if USE_MUNMAP).
3510 * doc/README.environment (GC_FORCE_UNMAP_ON_GCOLLECT): Add
3511 information for.
3512 * include/gc.h (GC_set_force_unmap_on_gcollect,
3513 GC_get_force_unmap_on_gcollect): New public function prototype.
3514 * include/gc.h (GC_FORCE_UNMAP_ON_GCOLLECT): New macro is
3515 recognized.
3516 * misc.c (GC_FORCE_UNMAP_ON_GCOLLECT): Likewise.
3517 * include/gc.h (GC_INIT_CONF_FORCE_UNMAP_ON_GCOLLECT): New
3518 internal macro (used by GC_INIT only).
3519 * misc.c (GC_force_unmap_on_gcollect): New global variable.
3520 * misc.c (GC_init): Recognize new "GC_FORCE_UNMAP_ON_GCOLLECT"
3521 environment variable (and set GC_force_unmap_on_gcollect).
3522 * misc.c (GC_set_force_unmap_on_gcollect,
3523 GC_get_force_unmap_on_gcollect): New public function.
3524 * tests/test.c (window_proc): Call GC_set_force_unmap_on_gcollect
3525 to force the mode on if WM_HIBERNATE; restore the mode after
3526 GC_gcollect().
3528 * Makefile.direct (LARGE_CONFIG): Update information.
3529 * include/gc.h (GC_stop_func): Refine the comment.
3531 * configure.ac: Use EMPTY_GETENV_RESULTS instead of NO_GETENV for
3532 Win32 (workaround for Wine bug).
3534 * allchblk.c (GC_freehblk): Adjust local variables indentation.
3535 * mallocx.c (GC_generic_malloc_many): Likewise.
3536 * typd_mlc.c (GC_malloc_explicitly_typed_ignore_off_page,
3537 GC_calloc_explicitly_typed): Likewise.
3538 * typd_mlc.c (GC_make_array_descriptor): Remove unnecessary
3539 brackets.
3541 * configure.ac: Replace GC_WIN32_THREADS with GC_THREADS.
3542 * configure.ac: Process enable_parallel_mark option for Cygwin and
3543 Win32; define THREAD_LOCAL_ALLOC for Win32.
3545 * include/private/gc_priv.h: Define AO_ASSUME_WINDOWS98 if
3546 PARALLEL_MARK (required for VC++ x86).
3548 * dbg_mlc.c (GC_generate_random_backtrace): Call
3549 GC_try_to_collect(GC_never_stop_func) instead of GC_gcollect();
3550 if GC is disabled then print error message and return.
3551 * include/gc.h (GC_try_to_collect): Refine the comment.
3552 * include/private/gc_priv.h (GC_never_stop_func): Fix return type;
3553 refine the comment.
3555 * add_gc_prefix.c: Move the file to the new "extra" directory.
3556 * AmigaOS.c: Likewise.
3557 * gcname.c: Likewise.
3558 * if_mach.c: Likewise.
3559 * if_not_there.c: Likewise.
3560 * MacOS.c: Likewise.
3561 * msvc_dbg.c: Likewise.
3562 * setjmp_t.c: Likewise.
3563 * threadlibs.c: Likewise.
3564 * EMX_MAKEFILE: Prepend setjmp_t.c with "extra" directory.
3565 * Makefile: Prepend AmigaOS.c, MacOS.c, add_gc_prefix.c, gcname.c,
3566 if_mach.c, if_not_there.c, msvc_dbg.c, setjmp_t.c, threadlibs.c
3567 with "extra" directory.
3568 * Makefile.am: Likewise.
3569 * Makefile.direct: Likewise.
3570 * Makefile.dj: Likewise.
3571 * Makefile.in: Likewise.
3572 * NT_MAKEFILE: Prepend msvc_dbg.obj with "extra" directory.
3573 * NT_STATIC_THREADS_MAKEFILE: Likewise.
3574 * NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
3575 * NT_X64_THREADS_MAKEFILE: Likewise.
3576 * NT_THREADS_MAKEFILE: Prepend msvc_dbg.c with "extra" directory.
3577 * gc.mak: Likewise.
3578 * PCR-Makefile: Prepend if_mach.c, if_not_there.c with "extra"
3579 directory.
3580 * SMakefile.amiga: Prepend AmigaOS.c, setjmp_t.c with "extra"
3581 directory.
3582 * doc/simple_example.html: Update for threadlibs.c.
3583 * os_dep.c: Prepend included AmigaOS.c with "extra" directory.
3585 * include/gc.h (GC_do_blocking, GC_call_with_gc_active): New
3586 function prototype.
3587 * include/private/gc_priv.h (STOP_WORLD): Replace a no-op (for the
3588 single-threaded case) with an assertion check for the state to be
3589 not a "do-blocking" one.
3590 * include/private/gc_priv.h (blocking_data): Move the structure
3591 definition from pthread_support.c; change "fn" return type to void
3592 pointer.
3593 * include/private/gc_priv.h (GC_activation_frame_s): New structure
3594 type.
3595 * include/private/gc_priv.h (GC_push_all_stack_frames): New
3596 function declaration (only if THREADS).
3597 * include/private/gc_priv.h (GC_world_stopped): Don't declare
3598 unless THREADS.
3599 * include/private/gc_priv.h (GC_blocked_sp,
3600 GC_activation_frame_s): New declaration (only if not THREADS).
3601 * include/private/gc_priv.h (GC_push_all_register_frames): New
3602 function declaration (only for IA-64).
3603 * include/private/gc_priv.h (NURSERY, GC_push_proc): Remove
3604 obsolete (unused) symbols.
3605 * include/private/gc_priv.h (GC_push_all_stack_partially_eager):
3606 Remove declaration (since it is static now).
3607 * mark_rts.c (GC_push_all_stack_partially_eager): Move from mark.c
3608 (for code locality) and make STATIC.
3609 * mark_rts.c (GC_push_all_register_frames): New function (only for
3610 IA-64).
3611 * mark_rts.c (GC_push_all_stack_frames): New function (only if
3612 THREADS).
3613 * mark_rts.c (GC_add_trace_entry): New function prototype (used by
3614 GC_push_all_stack_partially_eager(), only if TRACE_BUF).
3615 * mark_rts.c (GC_push_all_stack_part_eager_frames): New function.
3616 * mar_rts.c (GC_save_regs_ret_val): Move the declaration out of a
3617 function body (only for IA-64).
3618 * mark_rts.c (GC_push_current_stack): Call
3619 GC_push_all_stack_part_eager_frames() instead of
3620 GC_push_all_stack_partially_eager().
3621 * mark_rts.c (GC_push_current_stack): Call
3622 GC_push_all_register_frames() instead of GC_push_all_eager() for
3623 IA-64 backing store.
3624 * misc.c (GC_do_blocking_inner): Declare function (if THREADS
3625 only).
3626 * misc.c (GC_blocked_sp, GC_blocked_register_sp,
3627 GC_activation_frame): New global variables (only if not THREADS).
3628 * misc.c (GC_call_with_gc_active, GC_do_blocking_inner): New API
3629 function (only if not THREADS).
3630 * misc.c (GC_do_blocking): Move the function from
3631 pthread_support.c.
3632 * include/private/pthread_support.h (GC_Thread_Rep): Add
3633 "activation_frame" field.
3634 * pthread_stop_world.c (GC_push_all_stacks): Call
3635 GC_push_all_stack_frames() and GC_push_all_register_frames instead
3636 of GC_push_all_stack() and/or GC_push_all_eager(); don't check for
3637 STACK_GROWS_UP here.
3638 * pthread_support.c (GC_do_blocking_inner): Remove "static"; store
3639 "fn" result back to "client_data" field.
3640 * pthread_support.c (GC_call_with_gc_active): New API function.
3641 * win32_threads.c (GC_call_with_gc_active): Likewise.
3642 * win32_threads.c (GC_Thread_Rep): Add "thread_blocked_sp" and
3643 "activation_frame" fields.
3644 * win32_threads.c (GC_new_thread): Add assertion checking for
3645 thread_blocked_sp is NULL.
3646 * win32_threads.c (GC_do_blocking_inner): New function.
3647 * win32_threads.c (GC_stop_world): Don't suspend a thread if its
3648 thread_blocked_sp is non-NULL.
3649 * win32_threads.c (GC_push_stack_for): Use thread
3650 "activation_frame" (if non-NULL); use "thread_blocked_sp" if
3651 non-NULL (instead of calling GetThreadContext()); "UNPROTECT" the
3652 thread before modifying its last_stack_min; call
3653 GC_push_all_stack_frames() instead of GC_push_all_stack(); update
3654 the comments.
3656 * alloc.c (GC_default_stop_func): New static variable (initialized
3657 to GC_never_stop_func).
3658 * alloc.c (GC_set_stop_func, GC_get_stop_func): New function.
3659 * alloc.c (GC_timeout_stop_func): Define as GC_default_stop_func
3660 (instead of GC_never_stop_func) if SMALL_CONFIG (or NO_CLOCK),
3661 else call GC_default_stop_func() before getting "current_time".
3662 * alloc.c (GC_maybe_gc): Expand GC_gcollect_inner() macro (for
3663 FIXME comment).
3664 * alloc.c (GC_maybe_gc, GC_collect_a_little_inner): add FIXME for
3665 replacing GC_never_stop_func with GC_default_stop_func (if
3666 possible).
3667 * alloc.c (GC_gcollect): Use GC_default_stop_func.
3668 * alloc.c (GC_collect_or_expand): Use GC_default_stop_func
3669 (instead of GC_never_stop_func) unless it is trigged due to out of
3670 memory; don't increment GC_fail_count and don't output warning
3671 (before trying to collect again) in case the collection has been
3672 interrupted (by GC_default_stop_func) and the heap expansion has
3673 failed too.
3674 * include/gc.h (GC_set_stop_func, GC_get_stop_func): New function
3675 prototypes.
3677 * os_dep.c (GC_get_stack_base): Add FIXME; add assertion for
3678 GC_get_writable_length() result.
3680 * configure.ac: Don't use -lpthread -ldl for Cygwin.
3682 * NT_THREADS_MAKEFILE: Make it back equal to gc.mak.
3684 * include/private/gcconfig.h (GWW_VDB): Undefine if
3685 USE_GLOBAL_ALLOC (since incompatible).
3686 * os_dep.c (GetWriteWatch_alloc_flag): Define as 0 unless GWW_VDB
3687 is defined.
3688 * os_dep.c (GC_unmap_threshold): Declare (for use in
3689 GC_init_win32) if USE_MUNMAP.
3690 * os_dep.c (GC_init_win32): Turn off memory unmapping if
3691 GlobalAlloc() is used.
3692 * os_dep.c (GC_win32_get_mem): Define and use new
3693 VIRTUAL_ALLOC_PAD macro; don't waste a extra memory page unless
3694 MPROTECT_VDB is in use.
3696 * Makefile: Replace "version.h" with "include/gc_version.h".
3697 * include/gc_version.h: Likewise.
3699 * alloc.c (GC_collect_or_expand): Output heap size in WARN()
3700 (before returning FALSE) for convenience.
3702 * allchblk.c (GC_allochblk_nth): Use GC_PRIdPTR in WARN() format
3703 string.
3704 * pthread_support.c (start_mark_threads, GC_thr_init): Likewise.
3705 * win32_threads.c (GC_delete_thread): Likewise.
3706 * include/private/gc_priv.h (GC_PRIdPTR): New macro.
3707 * pthread_stop_world.c (GC_suspend_handler_inner): Remove
3708 unnecessary cast for WARN argument.
3709 * pthread_support.c (start_mark_threads): if pthread_create()
3710 failed then don't try to create other marker threads and (after
3711 printing a warning) adjust GC_markers and GC_parallel values; log
3712 GC_markers value (possibly adjusted) after that.
3714 * win32_threads.c (start_mark_threads): if pthread_create() is
3715 failed then don't try to create other marker threads and (after
3716 printing a warning) adjust GC_markers and GC_parallel values.
3717 * win32_threads.c (mark_mutex_event, builder_cv, mark_cv): Move
3718 the definition upper (to be visible in start_mark_threads()).
3719 * win32_threads.c (start_mark_threads): if CreateThread() or
3720 _beginthreadex() is failed then don't try to create other marker
3721 threads and (after printing a warning) adjust GC_markers,
3722 GC_parallel values, and destroy the event objects (either only
3723 some for the uncreated threads if DONT_USE_SIGNALANDWAIT or all if
3724 not a single thread is created).
3725 * win32_threads.c (GC_thr_init): Log GC_markers value (possibly
3726 adjusted) after start_mark_threads() call.
3728 * Makefile.am: Back remove "GC_" prefix for PTHREADS,
3729 DARWIN_THREADS, WIN32_THREADS (for configure.ac).
3731 * include/private/gc_priv.h: Change include of config.h to
3732 private/config.h.
3733 * include/private/gc_pmark.h: Likewise.
3734 * gc_cpp.cc: Likewise.
3735 * tests/test.c: Likewise.
3736 * tests/test_cpp.cc: Include private/config.h (if HAVE_CONFIG_H);
3737 undefine GC_BUILD.
3739 * finalize.c (GC_general_register_disappearing_link): Return
3740 GC_SUCCESS, GC_DUPLICATE, GC_NO_MEMORY (instead of 0, 1 and 2,
3741 respectively).
3742 * include/gc.h (GC_NO_MEMORY): New macro (defined as 2).
3743 * include/gc.h (GC_register_disappearing_link,
3744 GC_general_register_disappearing_link): Update the comment.
3745 * typd_mlc.c (GC_calloc_explicitly_typed): Use GC_NO_MEMORY macro.
3746 * finalize.c (GC_general_register_disappearing_link,
3747 GC_register_finalizer_inner): Recalculate the hash table index
3748 after GC_oom_fn succeeded (since the table may grow while not
3749 holding the lock) and check again that the entry is still not in
3750 the table (free the unused entry otherwise unless DBG_HDRS_ALL).
3751 * finalize.c (GC_register_finalizer_inner): Initialize "hhdr"
3752 local variable (to prevent a compiler warning).
3753 * finalize.c (GC_register_finalizer_inner): Don't modify the data
3754 pointed by "ocd" and "ofn" in GC_register_finalizer_inner() failed
3755 (due to out of memory).
3757 * alloc.c (GC_set_fl_marks, GC_clear_fl_marks): Transform loop to
3758 suppress compiler "variable might be uninitialized" warnings.
3760 * Makefile.direct (DONT_USE_SIGNALANDWAIT): Add the comment for.
3761 * win32_threads.c (DONT_USE_SIGNALANDWAIT): Always define for
3762 WinCE.
3763 * win32_threads.c (THREAD_HANDLE): Cast Id (of DWORD type) to
3764 HANDLE thru word type (to avoid a compiler warning) for WinCE.
3765 * win32_threads.c (GC_marker_cv, GC_marker_Id): New static array
3766 (only if DONT_USE_SIGNALANDWAIT).
3767 * win32_threads.c (start_mark_threads): Initialize GC_marker_Id
3768 and GC_marker_cv for each helper thread (only if
3769 DONT_USE_SIGNALANDWAIT).
3770 * win32_threads.c (GC_mark_mutex_state): New static variable (only
3771 if DONT_USE_SIGNALANDWAIT).
3772 * win32_threads.c (GC_mark_mutex_waitcnt,
3773 signalObjectAndWait_func): Don't define if DONT_USE_SIGNALANDWAIT.
3774 * win32_threads.c (GC_acquire_mark_lock, GC_release_mark_lock):
3775 Use InterlockedExchange() over GC_mark_mutex_state (instead of
3776 AO_fetch_and_add()) if DONT_USE_SIGNALANDWAIT.
3777 * win32_threads.c (GC_wait_marker, GC_notify_all_marker):
3778 Implement wait/broadcast primitives using Win32 multiple events
3779 (one for each marker thread) if DONT_USE_SIGNALANDWAIT (instead of
3780 using Win32 SignalObjectAndWait).
3781 * win32_threads.c (GC_thr_init): Don't declare hK32 local
3782 variable, don't check for GC_wnt, and don't initialize
3783 signalObjectAndWait_func if DONT_USE_SIGNALANDWAIT.
3785 * alloc.c (GC_finish_collection): Call GC_print_finalization_stats
3786 if GC_print_stats (after getting "done_time").
3787 * finalize.c (GC_old_dl_entries): New static variable (only if not
3788 SMALL_CONFIG).
3789 * finalize.c (GC_finalize): Save current GC_dl_entries value (only
3790 if not SMALL_CONFIG).
3791 * finalize.c (GC_print_finalization_stats): Define if and only if
3792 not SMALL_CONFIG; use GC_old_dl_entries value; use GC_log_printf()
3793 instead of GC_printf(); use "%lu" (instead of "%u") print format
3794 specifier; use unsigned long type for "ready" counter (for LP64
3795 targets).
3796 * misc.c (GC_dump): No longer call GC_print_finalization_stats()
3797 here (since it is called from GC_finish_collection()).
3798 * misc.c (STACKBASE): Remove unused macro undef (for NOSYS and
3799 ECOS).
3801 * alloc.c (GC_expand_hp): Replace GC_init_inner() call with
3802 GC_init() one.
3803 * malloc.c (GC_alloc_large, GC_generic_malloc_inner): Likewise.
3804 * mallocx.c (GC_generic_malloc_many): Likewise.
3805 * misc.c (GC_enable_incremental): Likewise.
3806 * alloc.c (GC_expand_hp): Update the comment.
3807 * mark.c (GC_obj_kinds): Likewise.
3808 * win32_threads.c (GC_allow_register_threads): Likewise.
3809 * private/gc_priv.h (GC_init_inner): Remove function declaration.
3810 * misc.c (GC_init_inner): Replace with public GC_init().
3812 * gcj_mlc.c (GC_gcj_fake_mark_proc): New static function.
3813 * gcj_mlc.c (GC_init_gcj_malloc): If mp is 0 then supply
3814 GC_gcj_fake_mark_proc (aborting with the appropriate message)
3815 instead.
3817 * os_dep.c (GC_wince_get_mem): If VirtualAlloc() returns NULL (due
3818 to out of memory) then don't increment GC_n_heap_bases and don't
3819 call VirtualAlloc() again (with MEM_COMMIT).
3820 * os_dep.c (GC_remap): Abort with a more informatory message if
3821 VirtualAlloc() fails due to out of memory; update FIXME.
3823 * Makefile: Fix typo for msvc_dbg.c.
3824 * Makefile.direct: Likewise.
3825 * Makefile.am: Prefix PTHREADS, DARWIN_THREADS, WIN32_THREADS with
3826 "GC_".
3827 * Makefile.dj: Don't reference remove files (nursery.c,
3828 gc_nursery.h, gc_copy_descr.h).
3829 * NT_MAKEFILE: Don't define __STDC__ macro (no longer used).
3830 * NT_STATIC_THREADS_MAKEFILE: Likewise.
3831 * NT_THREADS_MAKEFILE: Likewise.
3832 * NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
3833 * NT_X64_THREADS_MAKEFILE: Likewise.
3834 * gc.mak: Likewise.
3835 * NT_MAKEFILE: Remove unnecessary -DGC_BUILD (since it is always
3836 defined in the source files).
3837 * NT_THREADS_MAKEFILE: Likewise.
3838 * NT_X64_THREADS_MAKEFILE: Likewise.
3839 * gc.mak: Likewise.
3840 * NT_X64_THREADS_MAKEFILE: Fix typo for -DGC_NOT_DLL.
3841 * NT_STATIC_THREADS_MAKEFILE: Replace GC_WIN32_THREADS with
3842 GC_THREADS.
3843 * NT_THREADS_MAKEFILE: Likewise.
3844 * NT_X64_STATIC_THREADS_MAKEFILE: Likewise.
3845 * NT_X64_THREADS_MAKEFILE: Likewise.
3846 * gc.mak: Likewise.
3847 * NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE to suppress the
3848 compiler warnings.
3849 * NT_STATIC_THREADS_MAKEFILE: Likewise.
3850 * NT_X64_STATIC_THREADS_MAKEFILE: Place -D_CRT_SECURE_NO_DEPRECATE
3851 before "$*.C" (and "$*.CPP").
3852 * NT_X64_THREADS_MAKEFILE: Likewise.
3854 * doc/README.solaris2: Replace GC_SOLARIS_THREADS with GC_THREADS.
3855 * doc/README.win32: Replace GC_WIN32_THREADS with GC_THREADS.
3856 * doc/README.win64: Add info about mingw-w64; add note for VC++
3857 warnings suppression.
3859 * os_dep.c (GC_forward_exception): Fix logic in several places.
3860 (OSX-specific)
3862 * include/private/gc_priv.h (MAX_HEAP_SECTS): Guard with ifndef.
3864 * Makefile.direct: Copy missing information for -DSHORT_DBG_HDRS
3865 from Makefile.
3866 * Makefile: Remove the information about "define arguments" (which
3867 is incomplete and outdated compared to that in Makefile.direct);
3868 add help reference to Makefile.direct.
3869 * Makefile.dj: Likewise.
3871 * alloc.c (world_stopped_total_time, world_stopped_total_divisor):
3872 Replace "STATIC" with "static" in the definition (since the
3873 symbols aren't prefixed with "GC_").
3874 * win32_threads.c (marker_sp, marker_bsp, marker_last_stack_min,
3875 start_mark_threads, mark_mutex, builder_cv, mark_cv,
3876 mark_mutex_event, signalObjectAndWait_func, main_thread_start):
3877 Likewise.
3878 * pthread_support.c (GC_wait_builder): Define as STATIC.
3879 * win32_threads.c (GC_wait_builder): Likewise.
3881 * misc.c (GC_get_heap_size_inner, GC_get_free_bytes_inner): New
3882 API function.
3883 * include/gc_pmark.h (GC_get_heap_size_inner,
3884 GC_get_free_bytes_inner): New function declaration.
3886 * include/gc.h: Recognize __CEGCC__ (as a synonym for _WIN32_WCE).
3887 * include/gc_config_macros.h: Likewise.
3888 * include/gc.h (GC_MAXIMUM_HEAP_SIZE): Recognize new macro.
3889 * include/gc.h (GC_INIT_CONF_MAXIMUM_HEAP_SIZE): New macro (for
3890 internal use).
3891 * include/gc_config_macros.h: Always include stddef.h if GCC.
3892 * include/gc_config_macros.h (GC_API): Define for CeGCC in the
3893 same way as for MinGW.
3894 * include/gc_config_macros.h (GC_API): Group the definition for
3895 all cases together (check for GC_DLL only once).
3896 * include/gc_pthread_redirects.h: Group non-Darwin code together.
3897 * tests/test.c: Recognize GC_PRINT_VERBOSE_STATS (only if GC_DLL).
3899 * Makefile.direct (GC_PTHREADS_PARAMARK, GC_IGNORE_GCJ_INFO,
3900 GC_PRINT_VERBOSE_STATS, GC_DONT_EXPAND, GC_INITIAL_HEAP_SIZE,
3901 GC_FREE_SPACE_DIVISOR, GC_TIME_LIMIT, GC_FULL_FREQ): Add the
3902 comment for.
3903 * misc.c (GC_init_inner): Recognize GC_PRINT_VERBOSE_STATS (new
3904 macro).
3905 * dyn_load.c (GC_wnt): Change definition to TRUE for WinCE; add
3906 FIXME and the comment for WinCE.
3907 * gcj_mlc.c (GC_init_gcj_malloc): Recognize GC_IGNORE_GCJ_INFO
3908 (new macro).
3909 * include/gc.h (GC_HAVE_BUILTIN_BACKTRACE): Don't define for VC++
3910 WinCE (since backtrace() is unimplemented).
3911 * include/private/gc_priv.h (GC_n_heap_bases): Remove declaration
3912 (since static).
3913 * os_dep.c (GC_n_heap_bases): Define as STATIC; move the
3914 definition to be above GC_is_heap_base().
3915 * include/private/gcconfig.h: Don't define NOSYS for WinCE on ARM
3916 (both for MinGW and CeGCC toolchains).
3917 * include/private/gcconfig.h: Recognize __CEGCC__ and
3918 __MINGW32CE__ (as synonyms for __WIN32_WCE).
3919 * include/private/gcconfig.h: If SH4 then don't set config
3920 parameters for SH.
3921 * include/private/thread_local_alloc.h (GC_key_create): Don't
3922 abort on failures, just return -1 in these cases (this also
3923 prevents compilation error for targets where ABORT is defined
3924 indirectly as an inline assembler sequence).
3925 * mark.c (WRAP_MARK_SOME): Also define for WinCE; add FIXME for
3926 the GCC-based cross-compiler.
3927 * mark.c (ext_ex_regn, mark_ex_handler): Don't define unless
3928 WRAP_MARK_SOME is defined; define also for WinCE case; don't
3929 check for _WIN64 (since WRAP_MARK_SOME is undefined for it).
3930 * mark.c (GC_mark_some): Use __try/__except also for WinCE; update
3931 the comment.
3932 * misc.c: Include signal.h after gc_pmark.h included; check for
3933 MSWINCE instead of _WIN32_WCE.
3934 * misc.c (GC_init_inner): Remove duplicate GC_setpagesize() call.
3935 * misc.c: Don't include <crtdbg.h> for WinCE targets.
3936 * misc.c (GC_write): Define _MAX_PATH if undefined (workaround for
3937 CeGCC toolchain).
3938 * misc.c (GC_write): Use OutputDebugStringW() instead of
3939 _CrtDbgReport() for WinCE targets.
3940 * os_dep.c (GC_least_described_address): Define as STATIC.
3941 * os_dep.c (GC_register_data_segments): Fix code indentation.
3942 * os_dep.c (GC_wince_get_mem): Initialize "result" local variable
3943 (to prevent a compiler warning).
3944 * os_dep.c (GC_dirty_init): Add comment for WinCE target.
3945 * tests/test.c: Don't include winbase.h directly if GCC for WinCE,
3946 include assert.h instead.
3947 * tests/test.c (tiny_reverse_test): Define and use
3948 TINY_REVERSE_UPPER_VALUE macro (4 if VERY_SMALL_CONFIG else 10);
3949 useful for WinCE.
3950 * win32_threads.c (GC_Thread_Rep): Don't declare "handle" field
3951 for WinCE (since thread Id is used as a "real" thread handle).
3952 * win32_threads.c (THREAD_HANDLE): New macro.
3953 * win32_threads.c (GC_register_my_thread_inner): Don't recognize
3954 DONT_IMPORT_GETCURTHREAD anymore; don't record thread handle on
3955 WinCE.
3956 * Makefile.direct (DONT_IMPORT_GETCURTHREAD): Remove comment for.
3957 * win32_threads.c (UNPROTECT, GC_fault_handler_lock): Don't check
3958 for MSWINCE.
3959 * win32_threads.c (GC_delete_gc_thread, GC_delete_thread): Don't
3960 close thread handle on WinCE (since it's a thread Id).
3961 * win32_threads.c (GC_suspend): Don't check for MSWINCE in the
3962 MPROTECT-related code (for the case if MPROTECT_VDB would be
3963 implemented for WinCE).
3964 * win32_threads.c (GC_suspend, GC_start_world, GC_push_stack_for):
3965 Use THREAD_HANDLE(t) to obtain thread handle.
3966 * win32_threads.c (GC_PTHREADS_PARAMARK): New macro recognized;
3967 implicitly define GC_PTHREADS_PARAMARK if GC_PTHREADS; include
3968 pthread.h; define NUMERIC_THREAD_ID(id) if undefined yet; replace
3969 GC_PTHREADS with GC_PTHREADS_PARAMARK where appropriate (for the
3970 parallel mark support).
3971 * win32_threads.c (start_mark_threads): Use int type for "i" local
3972 variable (instead of "unsigned") to prevent a compiler warning.
3973 * win32_threads.c (start_mark_threads): Don't check CreateThread()
3974 result for -1; call CloseHandle() for the handle created by
3975 CreateThread() (on WinCE); don't use errno (since errno.h is
3976 missing on some targets like WinCE) when printing warning on a
3977 marker thread creation failure.
3978 * win32_threads.c (signalObjectAndWait_func): Define for WinCE.
3979 * win32_threads.c (GC_wait_marker): Remove unnecessary assertion
3980 for non-zero signalObjectAndWait_func (to make the code compilable
3981 for WinCE).
3982 * win32_threads.c (GC_thr_init): Allow PARALLEL_MARK for WinCE;
3983 use GC_sysinfo to get processors count if WinCE; don't check for
3984 SignalObjectAndWait() if WinCE; replace GC_PTHREADS with
3985 GC_PTHREADS_PARAMARK.
3986 * win32_threads.c (GC_thr_init): Recognize GC_MIN_MARKERS new
3987 macro (useful for testing parallel marking on WinCE).
3988 * win32_threads.c (GC_win32_start, main_thread_start): Define as
3989 STATIC.
3990 * win32_threads.c: Don't define main_thread_args,
3991 main_thread_start(), WinMain() for WinCE if GC_DLL.
3992 * win32_threads.c (WINCE_MAIN_STACK_SIZE): Remove useless macro
3993 (since the stack size parameter is ignored on WinCE).
3994 * win32_threads.c (main_thread_start): Remove forward declaration;
3995 place its definition before WinMain() one.
3996 * win32_threads.c (WinMain): Abort if GC_CreateThread() or
3997 WaitForSingleObject() failed (for the main thread).
3999 * allchblk.c (MUNMAP_THRESHOLD): Move macro definition out of
4000 a function.
4001 * allchblk.c (GC_unmap_threshold): New global variable definition
4002 (initialized to MUNMAP_THRESHOLD).
4003 * allchblk.c (GC_unmap_old): Use GC_unmap_threshold instead of
4004 MUNMAP_THRESHOLD; skip unmapping if GC_unmap_threshold is 0.
4005 * doc/README.environment (GC_UNMAP_THRESHOLD): Add information.
4006 * misc.c (GC_unmap_threshold): New variable declaration.
4007 * misc.c (GC_init_inner): Recognize "GC_UNMAP_THRESHOLD"
4008 environment variable to set GC_unmap_threshold value (only if
4009 USE_MUNMAP).
4011 * dbg_mlc.c (OFN_UNSET): New macro (to detect
4012 GC_register_finalizer() failures).
4013 * dbg_mlc.c (store_old): Add a check for register_finalizer()
4014 failure caused by an out-of-memory event (leave *ofn and *ocd
4015 unmodified in that case).
4016 * dbg_mlc.c (GC_debug_register_finalizer,
4017 GC_debug_register_finalizer_no_order,
4018 GC_debug_register_finalizer_unreachable,
4019 GC_debug_register_finalizer_ignore_self): Initialize my_old_fn
4020 to OFN_UNSET; clear *ocd and *ofn for non-heap objects (the same
4021 as in GC_register_finalizer_inner()).
4023 * Makefile.direct (GC_DLL): Add the comment for.
4024 * doc/README.macros: Fix a typo.
4025 * doc/README.macros (_DLL, GC_DLL, GC_NOT_DLL): Update info.
4026 * doc/README.macros (__STDC__): Remove info.
4027 * dbg_mlc.c (GC_get_back_ptr_info, GC_generate_random_heap_address,
4028 GC_generate_random_valid_address, GC_print_backtrace,
4029 GC_generate_random_backtrace, GC_register_describe_type_fn): Add
4030 GC_API and GC_CALL to function definition.
4031 * malloc.c (GC_generic_malloc): Likewise.
4032 * mallocx.c (GC_incr_bytes_allocd, GC_incr_bytes_freed): Likewise.
4033 * mark.c (GC_mark_and_push): Likewise.
4034 * misc.c (GC_new_free_list_inner, GC_new_free_list,
4035 GC_new_kind_inner, GC_new_kind, GC_new_proc_inner, GC_new_proc):
4036 Likewise.
4037 * include/gc_backptr.h (GC_get_back_ptr_info,
4038 GC_generate_random_heap_address, GC_generate_random_valid_address,
4039 GC_generate_random_backtrace, GC_print_backtrace): Add GC_API and
4040 GC_CALL to function prototype.
4041 * include/gc_mark.h (GC_mark_and_push, GC_new_free_list,
4042 GC_new_free_list_inner, GC_new_kind, GC_new_kind_inner,
4043 GC_new_proc, GC_new_proc_inner, GC_generic_malloc,
4044 GC_register_describe_type_fn): Likewise.
4045 * include/new_gc_alloc.h (GC_incr_bytes_allocd, GC_incr_mem_freed,
4046 GC_generic_malloc_words_small): Likewise.
4047 * gc_cpp.cc: Include "config.h" (if HAVE_CONFIG_H defined).
4048 * include/private/gc_pmark.h: Likewise.
4049 * include/private/gc_priv.h: Likewise.
4050 * tests/test.c: Likewise.
4051 * gc_cpp.cc: Define GC_BUILD.
4052 * include/private/gc_pmark.h: Likewise.
4053 * include/private/gc_priv.h: Likewise.
4054 * gc_dlopen.c (WRAP_FUNC, REAL_FUNC): New macro.
4055 * gc_dlopen.c (dlopen): Add GC_API to the wrapper function
4056 definition.
4057 * pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
4058 GC_pthread_join, GC_pthread_detach, pthread_sigmask, pthread_join,
4059 pthread_detach, pthread_create): Likewise.
4060 * win32_threads.c (GC_pthread_join, GC_pthread_create,
4061 GC_pthread_sigmask, GC_pthread_detach): Likewise.
4062 * gc_dlopen.c (dlopen): Use WRAP_FUNC and REAL_FUNC macros.
4063 * include/gc_backptr.h: Include "gc.h".
4064 * include/gc_backptr.h: Use extern "C" for the exported functions.
4065 * include/gc_mark.h: Likewise.
4066 * include/gc_config_macros.h (GC_THREADS): Define the macro if any
4067 GC_XXX_THREADS is defined.
4068 * include/gc_config_macros.h (_PTHREADS, _POSIX4A_DRAFT10_SOURCE):
4069 Move the definitions below the place where GC_NETBSD_THREADS and
4070 GC_DGUX386_THREADS are defined.
4071 * include/gc_config_macros.h (GC_DLL): Don't define (even if _DLL
4072 is defined) for GCC.
4073 * include/gc_config_macros.h (GC_API): Define for Cygwin (in the
4074 same way as for VC++); define for GCC v4+ (other than already
4075 recognized MinGW/Cygwin) as a "default" visibility attribute if
4076 GC_DLL is defined.
4077 * include/gc_config_macros.h (GC_ATTR_MALLOC, GC_ATTR_ALLOC_SIZE):
4078 New macro.
4079 * include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup,
4080 GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign,
4081 GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page,
4082 GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
4083 GC_debug_malloc_atomic, GC_debug_strdup,
4084 GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn,
4085 GC_debug_malloc_ignore_off_page,
4086 GC_debug_malloc_atomic_ignore_off_page,
4087 GC_debug_malloc_replacement): Add GC_ATTR_MALLOC attribute.
4088 * include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc,
4089 GC_gcj_malloc_ignore_off_page): Likewise.
4090 * include/gc.h (GC_malloc, GC_malloc_atomic,
4091 GC_malloc_uncollectable, GC_malloc_stubborn,
4092 GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page,
4093 GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
4094 GC_debug_malloc_atomic, GC_debug_malloc_uncollectable,
4095 GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page,
4096 GC_debug_malloc_atomic_ignore_off_page,
4097 GC_debug_malloc_replacement: Add GC_ATTR_ALLOC_SIZE attribute
4098 (for the first argument).
4099 * include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc,
4100 GC_gcj_malloc_ignore_off_page): Likewise.
4101 * include/gc.h (GC_memalign, GC_realloc, GC_debug_realloc,
4102 GC_debug_realloc_replacement): Add GC_ATTR_ALLOC_SIZE attribute
4103 (for the second argument).
4104 * include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup,
4105 GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign,
4106 GC_malloc_atomic_uncollectable, GC_free, GC_base, GC_size,
4107 GC_realloc, GC_expand_hp, GC_set_max_heap_size,
4108 GC_exclude_static_roots, GC_add_roots, GC_remove_roots,
4109 GC_register_displacement, GC_debug_register_displacement,
4110 GC_try_to_collect, GC_malloc_ignore_off_page,
4111 GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
4112 GC_debug_malloc_atomic, GC_debug_strdup,
4113 GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn,
4114 GC_debug_malloc_ignore_off_page,
4115 GC_debug_malloc_atomic_ignore_off_page, GC_debug_free,
4116 GC_debug_realloc, GC_debug_malloc_replacement,
4117 GC_debug_realloc_replacement, GC_finalization_proc,
4118 GC_register_finalizer, GC_debug_register_finalizer,
4119 GC_register_finalizer_ignore_self,
4120 GC_debug_register_finalizer_ignore_self,
4121 GC_register_finalizer_no_order,
4122 GC_debug_register_finalizer_no_order,
4123 GC_register_finalizer_unreachable,
4124 GC_debug_register_finalizer_unreachable,
4125 GC_register_disappearing_link,
4126 GC_general_register_disappearing_link,
4127 GC_unregister_disappearing_link, GC_noop1, GC_warn_proc,
4128 GC_set_warn_proc, GC_ignore_warn_proc, GC_fn_type,
4129 GC_call_with_alloc_lock, GC_stack_base_func,
4130 GC_call_with_stack_base, GC_same_obj, GC_pre_incr, GC_post_incr,
4131 GC_is_visible, GC_is_valid_displacement, GC_same_obj_print_proc,
4132 GC_is_valid_displacement_print_proc, GC_is_visible_print_proc,
4133 GC_malloc_many, GC_CreateThread, GC_beginthreadex,
4134 GC_endthreadex): Comment out (or remove if single and meaningless)
4135 function argument names (to avoid identifiers out of the name
4136 space).
4137 * include/gc_gcj.h (GC_init_gcj_malloc, GC_gcj_malloc,
4138 GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise.
4139 * include/gc.h (GC_try_to_collect): Update the comment.
4140 * include/gc.h (GC_size, GC_register_my_thread): Add const
4141 qualifier for the argument referent.
4142 * misc.c (GC_size): Likewise.
4143 * pthread_support.c (GC_register_my_thread_inner,
4144 GC_register_my_thread): Likewise.
4145 * win32_threads.c (GC_register_my_thread_inner,
4146 GC_register_my_thread): Likewise.
4147 * include/gc.h (GC_INIT_CONF_ROOTS): New macro for internal use
4148 (define instead of GC_INIT() for Cygwin and AIX).
4149 * include/gc.h (GC_DONT_EXPAND, GC_MAX_RETRIES,
4150 GC_FREE_SPACE_DIVISOR, GC_FULL_FREQ, GC_TIME_LIMIT, GC_IGNORE_WARN,
4151 GC_INITIAL_HEAP_SIZE): Recognize new macro.
4152 * include/gc.h (GC_INIT_CONF_DONT_EXPAND, GC_INIT_CONF_MAX_RETRIES,
4153 GC_INIT_CONF_FREE_SPACE_DIVISOR, GC_INIT_CONF_FULL_FREQ,
4154 GC_INIT_CONF_TIME_LIMIT, GC_INIT_CONF_IGNORE_WARN,
4155 GC_INIT_CONF_INITIAL_HEAP_SIZE): New macro for internal use.
4156 * include/gc.h (GC_INIT): Use GC_INIT_CONF_XXX macros.
4157 * include/gc_mark.h: Prefix GC_H with '_'.
4158 * include/gc_mark.h (GC_least_plausible_heap_addr,
4159 GC_greatest_plausible_heap_addr, GC_debug_header_size): Use GC_API
4160 for the public variable declaration.
4161 * include/new_gc_alloc.h (GC_objfreelist_ptr, GC_aobjfreelist_ptr,
4162 GC_uobjfreelist_ptr, GC_auobjfreelist_ptr): Likewise.
4163 * include/gc_pthread_redirects.h (GC_pthread_create,
4164 GC_pthread_sigmask, GC_dlopen, GC_pthread_join, GC_pthread_detach):
4165 Use GC_API for the wrapper prototype.
4166 * include/gc_pthread_redirects.h (pthread_create, pthread_join,
4167 pthread_detach, pthread_sigmask, dlopen): Undefine unconditionally
4168 before redirecting.
4169 * include/new_gc_alloc.h: Replace GC_incr_mem_freed() with
4170 GC_incr_bytes_freed(); remove FIXME.
4171 * include/private/gc_priv.h (GC_make_closure,
4172 GC_debug_invoke_finalizer, GC_noop): Remove GC_API for the private
4173 function.
4174 * tests/test.c (GC_print_stats): Handle GC_DLL case regardless of
4175 the target.
4177 * finalize.c (GC_general_register_disappearing_link,
4178 GC_register_finalizer_inner): Remove unnecessary "ifdef THREADS"
4179 guard for LOCK/UNLOCK().
4180 * finalize.c (GC_general_register_disappearing_link,
4181 GC_register_finalizer_inner): Get GC_oom_fn value before releasing
4182 the lock (to prevent data races).
4183 * gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc,
4184 GC_gcj_malloc_ignore_off_page): Likewise.
4185 * mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.
4186 * include/gc_inline.h (GC_FAST_MALLOC_GRANS): Use GC_get_oom_fn()
4187 instead of GC_oom_fn (to prevent data races).
4188 * malloc.c (GC_generic_malloc): Likewise.
4189 * mallocx.c (GC_memalign): Likewise.
4190 * pthread_support.c (pthread_create): Likewise.
4191 * gcj_mlc.c (maybe_finalize): Acquire the lock before setting
4192 last_finalized_no value to prevent data races.
4193 * include/gc.h (GC_gc_no, GC_get_gc_no, GC_oom_fn, GC_set_oom_fn,
4194 GC_set_find_leak, GC_set_finalize_on_demand,
4195 GC_set_java_finalization, GC_set_finalizer_notifier,
4196 GC_set_dont_expand, GC_set_full_freq, GC_set_non_gc_bytes,
4197 GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries,
4198 GC_set_dont_precollect, GC_set_time_limit, GC_warn_proc): Refine
4199 the comment.
4200 * misc.c (GC_set_oom_fn): Likewise.
4201 * include/gc.h (GC_general_register_disappearing_link): Refine the
4202 comment (replace "soft" word with "weak").
4203 * misc.c (GC_oom_fn, GC_get_gc_no, GC_get_parallel,
4204 GC_set_finalizer_notifier, GC_set_find_leak): Add the comment.
4205 * misc.c (GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier,
4206 GC_get_finalizer_notifier): Use LOCK/UNLOCK to prevent data races.
4208 * dbg_mlc.c: Guard include <errno.h> with ifndef MSWINCE; include
4209 "private/dbg_mlc.h" before it.
4210 * malloc.c: Likewise.
4211 * dbg_mlc.c (GC_debug_strdup): Use memcpy() instead of strcpy()
4212 for WinCE (since deprecated); evaluate strlen() only once; don't
4213 set errno for WinCE.
4214 * malloc.c (GC_strdup): Likewise.
4215 * dyn_load.c (GC_wnt): Define as macro (FALSE) for WinCE.
4216 * include/gc.h (GC_unregister_my_thread): Refine the comment.
4217 * include/gc.h (GC_uintptr_t, GC_beginthreadex, GC_endthreadex):
4218 Don't declare for WinCE.
4219 * include/gc.h (GC_WINMAIN_WINCE_LPTSTR): New macro (WinCE only).
4220 * include/gc.h (GC_WinMain): Remove GC_API.
4221 * include/gc.h (GC_WinMain): Use GC_WINMAIN_WINCE_LPTSTR for
4222 lpCmdLine.
4223 * tests/test.c (GC_WinMain): Likewise.
4224 * win32_threads.c (main_thread_args, GC_WinMain): Likewise.
4225 * include/gc_config_macros.h (ptrdiff_t): Guard with
4226 ifndef _PTRDIFF_T_DEFINED; define _PTRDIFF_T_DEFINED macro.
4227 * include/private/gc_locks.h: Guard include "atomic_ops.h" with
4228 ifdef GC_PTHREADS (and not GC_WIN32_THREADS).
4229 * mark.c: Include "atomic_ops.h" if PARALLEL_MARK.
4230 * thread_local_alloc.c: Include "atomic_ops.h" if GC_GCJ_SUPPORT.
4231 * win32_threads.c: Include "atomic_ops.h" if MPROTECT_VDB.
4232 * include/private/gc_locks.h: Use include "atomic_ops.h" instead
4233 of include <atomic_ops.h>.
4234 * include/private/gc_priv.h: Likewise.
4235 * include/private/gc_locks.h (GC_allocate_ml, GC_need_to_lock):
4236 Don't export (replace GC_API to "extern").
4237 * win32_threads.c (GC_allocate_ml): Don't export.
4238 * include/private/gc_priv.h (DebugBreak): Define as macro for
4239 WinCE (if not UNDER_CE and DebugBreak is not defined yet).
4240 * include/private/gc_priv.h (UNALIGNED): Rename to UNALIGNED_PTRS
4241 (since "UNALIGNED" is defined in winnt.h of WinCE).
4242 * mark.c (UNALIGNED): Likewise.
4243 * include/private/gcconfig.h (ARM32): Recognize _M_ARM and _ARM_.
4244 * include/private/gcconfig.h (ALIGNMENT): Check always defined.
4245 * include/private/gcconfig.h: Allow GC_WIN32_THREADS for WinCE.
4246 * include/private/thread_local_alloc.h: Define USE_WIN32_SPECIFIC
4247 for WinCE (since __declspec(thread) is unsupported).
4248 * include/private/thread_local_alloc.h (TLS_OUT_OF_INDEXES):
4249 Define for WinCE (if undefined).
4250 * malloc.c (GC_malloc): Remove outdated comment about disabling
4251 signals.
4252 * misc.c: Don't include <tchar.h> (since not used anymore and may
4253 break TEXT() macro defined in winnt.h).
4254 * misc.c (GC_init_inner): Don't use GetModuleHandle() and
4255 InitializeCriticalSectionAndSpinCount() for WinCE.
4256 * misc.c (GC_init_inner): Replace GetModuleHandleA() with
4257 GetModuleHandle() (and use TEXT() macro controlled by UNICODE).
4258 * misc.c (LOG_FILE): Remove unused macro; don't use _T() macro.
4259 * misc.c (GC_CreateLogFile): New static function (Win32/WinCE
4260 only); move the code from GC_write(); replace GETENV() with
4261 GetEnvironmentVariable(); replace CreateFileA() with
4262 CreateFile(); use TEXT() macro (for Unicode support); replace
4263 strcat() with memcpy() (since deprecated in WinCE).
4264 * misc.c (GC_write): Define as STATIC.
4265 * win32_threads.c (GC_attached_thread): Likewise.
4266 * misc.c (GC_write): Use GC_CreateLogFile().
4267 * misc.c: Define vsnprintf macro as StringCchVPrintfA for WinCE.
4268 * misc.c (GC_abort): Try to invoke MessageBoxA() dynamically
4269 (Win32 only) if DONT_USE_USER32_DLL is defined.
4270 * misc.c (GC_abort): Duplicate msg to GC log file (for Win32 and
4271 WinCE).
4272 * misc.c (GC_abort): Use a more user-friendly abort if
4273 NO_DEBUGGING (Win32 only).
4274 * os_dep.c: Include "atomic_ops.h" only if MPROTECT_VDB (and
4275 THREADS).
4276 * os_dep.c (detect_GetWriteWatch): Use TEXT() for GetModuleHandle
4277 (for Unicode support); check GetModuleHandle() result.
4278 * tests/test.c: Don't define assert for WinCE (since may be
4279 redefined by "assert.h" included from libatomic_ops).
4280 * tests/test.c (FAIL): Define as ABORT for all targets (except
4281 for PCR).
4282 * tests/test.c (n_tests): Don't use AO_t.
4283 * tests/test.c (check_heap_stats): Don't cast n_tests.
4284 * tests/test.c (inc_int_counter): New function (for n_tests atomic
4285 incrementation).
4286 * tests/test.c (run_one_test): Test GC_memalign() for all targets.
4287 * tests/test.c (run_one_test): Avoid unbalanced brackets in
4288 #if-#else-#endif blocks.
4289 * tests/test.c (run_one_test): Replace AO_fetch_and_add1() and
4290 private LOCK/UNLOCK with GC_call_with_alloc_lock(inc_int_counter).
4291 * tests/test.c (check_heap_stats): Replace
4292 "if (sizeof(char *) > 4)" with "#if CPP_WORDSZ == 64" to suppress
4293 "unreachable code" compiler warning.
4294 * tests/test.c (WinMain): Set cmd type to LPWSTR (for WinCE
4295 "UNDER_CE" mode); else use LPSTR type (for Win32 and WinCE).
4296 * tests/test.c (thr_window): Replace "L" string prefix with
4297 TEXT().
4298 * thread_local_alloc.c: Check THREADS is defined (to prevent other
4299 compiler errors and warnings otherwise).
4300 * tests/test.c (WinMain): Recognize GC_NO_DLLMAIN macro (for
4301 GC_use_DllMain()).
4302 * Makefile.direct (GC_NO_DLLMAIN, DONT_IMPORT_GETCURTHREAD): Add
4303 the comments for.
4304 * win32_threads.c (GC_register_my_thread_inner): Recognize
4305 DONT_IMPORT_GETCURTHREAD macro.
4306 * win32_threads.c: Recognize GC_NO_DLLMAIN macro (to exclude
4307 DllMain support if needed).
4308 * win32_threads.c (GC_NO_DLLMAIN): Define implicitly if DllMain
4309 thread registration is unsupported for a given configuration.
4310 * win32_threads.c (GC_use_DllMain): Update the comment; refine
4311 ABORT message.
4312 * win32_threads.c (GC_use_DllMain,
4313 GC_started_thread_while_stopped, GC_register_my_thread_inner,
4314 GC_lookup_thread_inner, GC_delete_gc_thread,
4315 GC_allow_register_threads, GC_lookup_pthread,
4316 GC_push_thread_structures, GC_stop_world, GC_push_all_stacks):
4317 Check for GC_NO_DLLMAIN.
4318 * win32_threads.c (GC_Thread_Rep.tm_in_use, GC_attached_thread,
4319 DllMain): Don't define if GC_NO_DLLMAIN.
4320 * win32_threads.c (GC_stop_world): Declare "i" and "max" local
4321 variables only if not GC_NO_DLLMAIN (to suppress compiler
4322 warning).
4323 * win32_threads.c (GC_mark_thread, start_mark_threads): Use
4324 CreateThread() instead of _beginthreadex() for WinCE.
4325 * win32_threads.c (MARK_THREAD_STACK_SIZE, WINCE_MAIN_STACK_SIZE):
4326 New macros defined (used by start_mark_threads(), WinMain()).
4327 * win32_threads.c (GC_thr_init): Exclude parallel-specific code on
4328 WinCE for now (since getenv(), GetProcessAffinityMask() and
4329 SignalObjectAndWait() are missing on WinCE).
4330 * win32_threads.c (GC_thr_init): replace GetModuleHandleA() with
4331 GetModuleHandle(); replace CreateEventA() with CreateEvent(); use
4332 TEXT() macro (for Unicode support).
4334 * include/gc.h (GC_has_static_roots_func): New typedef (user filter
4335 callback).
4336 * include/gc.h (GC_register_has_static_roots_callback): Use
4337 GC_has_static_roots_func type.
4338 * dyn_load.c (GC_has_static_roots,
4339 GC_register_has_static_roots_callback): Likewise.
4340 * dyn_load.c (GC_has_static_roots,
4341 GC_register_has_static_roots_callback): Define on all platforms.
4342 * dyn_load.c (GC_register_dynlib_callback,
4343 GC_register_dynamic_libraries, GC_init_dyld): Replace K&R-style
4344 functions definition with the ANSI C one.
4345 * dyn_load.c (GC_register_dynlib_callback): Use new local variable
4346 "callback" (initialized from GC_has_static_roots) to minimize data
4347 races.
4348 * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr,
4349 GC_cond_add_roots): Define as STATIC.
4350 * mark_rts.c (GC_remove_roots_inner): Likewise.
4351 * dyn_load.c (GC_dyld_image_add): Don't call GC_add_roots() for
4352 sections smaller than pointer size (just to avoid acquiring the
4353 lock unnecessarily).
4354 * dyn_load.c (GC_dyld_name_for_hdr): Define unconditionally (not
4355 only for DARWIN_DEBUG).
4356 * dyn_load.c (GC_dyld_image_add): Replace GC_add_roots() call with
4357 LOCK + GC_add_roots_inner() + UNLOCK.
4358 * dyn_load.c (GC_dyld_image_add): Call GC_has_static_roots() user
4359 callback (if set) holding the lock; if it returns 0 then don't call
4360 GC_add_roots_inner() for that region.
4361 * dyn_load.c (GC_register_has_static_roots_callback): Put
4362 "callback" value to GC_has_static_roots on all platforms.
4363 * dyn_load.c (GC_has_static_roots): Update the comments.
4364 * include/gc.h (GC_exclude_static_roots, GC_add_roots,
4365 GC_remove_roots, GC_register_has_static_roots_callback): Likewise.
4366 * include/private/gc_priv.h (struct roots): Likewise.
4367 * include/private/gc_priv.h (GC_remove_roots_inner): Move prototype
4368 to mark_rts.c and declare it as STATIC.
4369 * include/private/gc_priv.h (GC_exclude_static_roots_inner): New
4370 prototype.
4371 * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Use
4372 GC_exclude_static_roots_inner() instead of GC_exclude_static_roots.
4373 * misc.c (GC_init_inner): Likewise.
4374 * mark_rts.c (GC_exclude_static_roots_inner): New function (move
4375 all the code from GC_exclude_static_roots(); add the comment.
4376 * mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots_inner):
4377 add alignment assertion for the lower bound; add assertion for the
4378 lower bound to be less than the upper one.
4379 * mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots): Adjust
4380 the upper bound (round down to be of a pointer-aligned value);
4381 return in case of an empty range.
4382 * mark_rts.c (GC_exclude_static_roots): Acquire the lock and call
4383 GC_exclude_static_roots_inner().
4384 * mark_rts.c (GC_remove_roots): Quickly check the bounds and return
4385 in case of a do-nothing case (before acquiring the lock).
4387 * finalize.c (GC_fail_count): New external variable declaration.
4388 * finalize.c (GC_reset_finalizer_nested,
4389 GC_check_finalizer_nested): New function declarations (if THREADS
4390 only).
4391 * finalize.c (GC_finalizer_nested, GC_finalizer_skipped): New
4392 static global variables (used internally by GC_finalize() and
4393 GC_check_finalizer_nested()).
4394 * finalize.c (GC_check_finalizer_nested): New static function
4395 definition (only if not THREADS, used internally by
4396 GC_notify_or_invoke_finalizers() to minimize the probability of
4397 a deep recursion when a client finalizer tries to allocate GC
4398 memory).
4399 * finalize.c (GC_finalize): Reset GC_finalizer_nested value (or
4400 call GC_reset_finalizer_nested()) if last heap expansion failed.
4401 * finalize.c (GC_notify_or_invoke_finalizers): Access GC_gc_no,
4402 GC_finalizer_now, GC_finalize_on_demand, GC_finalizer_notifier,
4403 last_finalizer_notification variables holding the lock (to avoid
4404 data races).
4405 * finalize.c (GC_finalizer_notifier): Add comment.
4406 * finalize.c (GC_notify_or_invoke_finalizers): Add "quick" check
4407 for an empty finalization queue (only if THREADS and not
4408 KEEP_BACK_PTRS/MAKE_BACK_GRAPH).
4409 * finalize.c (GC_notify_or_invoke_finalizers): Call
4410 GC_check_finalizer_nested() and skip GC_invoke_finalizers() call
4411 if appropriate.
4412 * include/private/pthread_support.h (GC_Thread_Rep): Add unsigned
4413 finalizer_nested and finalizer_skipped fields (for internal use
4414 by the multi-threaded GC_check_finalizer_nested()).
4415 * win32_threads.c (GC_Thread_Rep): Likewise.
4416 * pthread_support.c (GC_reset_finalizer_nested,
4417 GC_check_finalizer_nested): New function definitions (the
4418 multi-threaded variants of that in finalize.c).
4419 * win32_threads.c (GC_reset_finalizer_nested,
4420 GC_check_finalizer_nested): Likewise.
4422 * alloc.c (GC_stopped_mark): Remove GC_log_printf("") (not needed
4423 anymore and GCC produces a warning for it).
4424 * alloc.c (GC_stopped_mark): Adjust printf argument type
4425 specifier.
4426 * backgraph.c: Include dbg_mlc.h before ifdef MAKE_BACK_GRAPH (for
4427 the case when the configuration information comes from aconfig
4428 file).
4429 * checksums.c: Likewise.
4430 * include/gc_allocator.h (GC_ATTR_UNUSED): Use "__unused__"
4431 keyword instead of "unused".
4432 * include/gc_allocator.h: Fix typos in comments.
4433 * thread_local_alloc.c: Likewise.
4434 * include/javaxfc.h (GC_finalize_all): Update comment.
4435 * include/private/gc_priv.h (GC_API_PRIV): New macro (defined as
4436 GC_API and serves only as a marker for the private but exported
4437 symbols used by test.c only).
4438 * include/private/gc_priv.h (GC_abort, GC_arrays, GC_is_marked,
4439 GC_printf, GC_err_printf, GC_log_printf): Replace GC_API decl with
4440 GC_API_PRIV one.
4441 * include/private/gc_priv.h (GC_fo_entries): Don't export it
4442 outside a DLL.
4443 * include/private/gc_priv.h (GC_ATTR_FORMAT_PRINTF): New macro
4444 designated to check the arguments correctness of printf-like
4445 functions (currently works only for GCC v3+).
4446 * include/private/gc_priv.h (GC_printf, GC_err_printf,
4447 GC_log_printf): Use GC_ATTR_FORMAT_PRINTF attribute.
4449 * dyn_load.c (HAVE_DL_ITERATE_PHDR): Break definition from use.
4450 Define for FreeBSD 7.0+.
4452 * mach_dep.c: Don't include ucontext.h with NO_GETCONTEXT.
4454 * include/gc_gcj.h (GC_init_gcj_malloc): Improve descriptive
4455 comment.
4457 * allchblk.c (GC_merge_unmapped): Don't assume that adjacent
4458 free blocks have different mapping status.  Correctly handle gap
4459 between blocks.
4460 (GC_split_block): Remove dead code setting hb_flags.  Add comment.
4461 (GC_allochblk): Split blocks also in generational-only mode.
4462 * os_dep.c (GC_unmap_gap): Don't really use munmap.
4464 * include/private/gc_priv.h (GC_unmapped_bytes): Define as 0 for
4465 not USE_MUNMAP case.
4467 * Makefile.direct (MARK_BIT_PER_OBJ, PRINT_BLACK_LIST,
4468 USE_PROC_FOR_LIBRARIES): Fix typo in the comments.
4469 * Makefile.direct (USE_MMAP, USE_MUNMAP, THREAD_LOCAL_ALLOC,
4470 PARALLEL_MARK, STATIC): Update the comments.
4471 * include/private/gcconfig.h (GC_PREFER_MPROTECT_VDB): New macro
4472 recognized (only if MPROTECT_VDB).
4473 * Makefile.direct (DONT_USE_USER32_DLL, GC_PREFER_MPROTECT_VDB):
4474 Add the comments for.
4475 * os_dep.c (detect_GetWriteWatch): Recognize "GC_USE_GETWRITEWATCH"
4476 environment variable (only if MPROTECT_VDB, if the variable is
4477 unset when GC_PREFER_MPROTECT_VDB macro controls the strategy).
4478 * doc/README.environment (GC_USE_GETWRITEWATCH): New variable.
4479 * include/private/gcconfig.h (MPROTECT_VDB): Add FIXME for
4480 USE_MUNMAP and PARALLEL_MARK cases (to relax the conditions in
4481 the future).
4482 * misc.c (GC_get_heap_size, GC_get_free_bytes): Ignore the memory
4483 space returned to OS (GC_unmapped_bytes).
4484 * include/gc.h (GC_get_heap_size, GC_get_free_bytes): Update the
4485 comments.
4486 * misc.c (GC_get_unmapped_bytes): New API function.
4487 * include/gc.h (GC_get_unmapped_bytes): New API prototype.
4488 * os_dep.c (GC_dirty_init): Move "ifdef GWW_VDB" block out of
4489 "ifdef MSWIN32" one (for Cygwin).
4491 * pthread_support.c (GC_allow_register_threads): New API function.
4492 * win32_threads.c (GC_allow_register_threads): Likewise.
4493 * include/gc.h (GC_allow_register_threads): New API prototype.
4494 * include/gc.h (GC_register_my_thread, GC_unregister_my_thread):
4495 Update the comments.
4496 * pthread_support.c (GC_register_my_thread): Check the collector
4497 is in the multi-threaded mode.
4498 * win32_threads.c (GC_register_my_thread): Likewise.
4500 * finalize.c (GC_finalize_all): Always call GC_invoke_finalizers
4501 instead, following Ivan's original patch.
4503 * allchblk.c (GC_allochblk_nth): Add assertion.
4504 * checksums.c: Add GC_record_fault, GC_was_faulted,
4505 CC_n_faulted_dirty_errors.
4506 (GC_check_dirty): Remove register declarations, print
4507 dirty bit errors on faulted pages.
4508 * os_dep.c (GC_write_fault_handler): Call GC_record_fault().
4509 * os_dep.c (GC_remove_protection): Compute index correctly.
4512 == [7.2alpha2] 2009-06-12 ==
4514 * dbg_mlc.c (GC_print_smashed_obj): Convert a group of printf()
4515 calls into a single one (for output atomicity).
4516 * typd_mlc.c (GC_calloc_explicitly_typed): Don't declare and use
4517 GC_finalization_failures variable; check the result of
4518 GC_general_register_disappearing_link() (for lack of memory)
4519 instead.
4520 * finalize.c (GC_finalization_failures): Remove unused global
4521 variable.
4522 * finalize.c (GC_general_register_disappearing_link,
4523 GC_general_register_disappearing_link): Don't update the value of
4524 GC_finalization_failures (since unused).
4525 * include/private/gc_pmark.h (PUSH_ONE_CHECKED_STACK,
4526 GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP): The first parameter is of
4527 word type now (as FIXUP_POINTER requires numeric argument).
4528 * finalize.c (GC_ignore_self_finalize_mark_proc): GC_PUSH_ONE_HEAP
4529 requires the first parameter of word type.
4530 * mark.c (PUSH_GRANULE): Likewise.
4531 * mark.c (GC_push_one, GC_push_all_eager): Likewise.
4532 * finalize.c (GC_finalize_all): Call GC_invoke_finalizers() or
4533 GC_finalizer_notifier directly, instead
4534 of GC_INVOKE_FINALIZERS() to prevent infinite looping.
4535 * include/javaxfc.h: Clarify GC_finalize_all comment.
4536 * gcj_mlc.c: Include gc_pmark.h before "ifdef GC_GCJ_SUPPORT" (not
4537 after) for configuration information.
4538 * gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Add comment.
4539 * gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Check "op" local
4540 variable for NULL before dereferencing it, return GC_oom_fn() in
4541 this case.
4542 * typd_mlc.c (GC_malloc_explicitly_typed,
4543 GC_malloc_explicitly_typed_ignore_off_page): Transform the code to
4544 suppress compiler warning (for uninitialized "lg" variable).
4546 * win32_threads.c (GC_unregister_my_thread): add false assertion
4547 in unreachable code.
4549 * pthread_support.c (GC_inner_start_routine): Don't release the
4550 GC lock between GC_register_my_thread_inner() and
4551 GC_init_thread_local() calls (post the "registered" even after
4552 calling GC_init_thread_local()).
4553 * win32_threads.c (GC_register_my_thread, GC_unregister_my_thread):
4554 Use GC_lookup_thread_inner() instead of GC_lookup_thread() and
4555 acquire the GC lock only once.
4556 * win32_threads.c (GC_thr_init): Call GC_register_my_thread_inner()
4557 directly instead of GC_register_my_thread() since I_HOLD_LOCK
4558 and our (main) thread is not registered yet (add assertion for it).
4559 * win32_threads.c (GC_init_parallel): Call GC_lookup_thread_inner()
4560 directly instead of GC_lookup_thread() (since I_HOLD_LOCK).
4561 * win32_threads.c (GC_lookup_thread): Remove unused function.
4562 * win32_threads.c: Remove "#error GC_DLL untested with Cygwin".
4563 * win32_threads.c (GC_win32_dll_threads): Define as FALSE macro
4564 also if THREAD_LOCAL_ALLOC or GC_PTHREADS.
4565 * win32_threads.c (GC_use_DllMain): Call ABORT also if GC_PTHREADS
4566 (for Cygwin).
4567 * win32_threads.c (GC_push_stack_for): Add parentheses around "&&"
4568 (inside GC_ASSERT) to prevent compiler warning.
4569 * win32_threads.c (GC_push_all_stacks): Remove FIXME for
4570 PARALLEL_MARK.
4571 * win32_threads.c (MAX_MARKERS, GC_markers): Move the definitions
4572 to a place before GC_get_next_stack().
4573 * win32_threads.c (marker_sp, marker_bsp): New static arrays (same
4574 as in pthread_support.c).
4575 * win32_threads.c (marker_last_stack_min): New static arrays (the
4576 same semantics as for last_stack_min of GC_Thread_Rep).
4577 * win32_threads.c (GC_get_next_stack): Handle marker threads.
4578 * win32_threads.c (GC_mark_thread): Save the current stack pointer
4579 to marker_[b]sp.
4580 * win32_threads.c (start_mark_threads): Initialize
4581 marker_last_stack_min elements (to "unset" value).
4583 * misc.c (GC_set_oom_fn, GC_set_all_interior_pointers,
4584 GC_set_finalize_on_demand, GC_set_java_finalization,
4585 GC_set_finalizer_notifier, GC_set_dont_expand, GC_set_full_freq,
4586 GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries,
4587 GC_set_dont_precollect, GC_set_time_limit, GC_set_warn_proc):
4588 Change return type to void (these API functions no longer return
4589 the old value).
4590 * include/gc.h: Likewise.
4591 * tests/test.c (main, WinMain, test): Remove explicit cast to void
4592 for GC_set_warn_proc().
4593 * misc.c (GC_get_oom_fn, GC_get_all_interior_pointers,
4594 GC_get_finalize_on_demand, GC_get_java_finalization,
4595 GC_get_finalizer_notifier, GC_get_dont_expand, GC_get_full_freq,
4596 GC_get_no_dls, GC_get_free_space_divisor, GC_get_max_retries,
4597 GC_get_dont_precollect, GC_get_time_limit, GC_get_warn_proc): New
4598 API functions (to get the current value of the corresponding R/W
4599 public variables).
4600 * include/gc.h: Likewise.
4601 * include/gc.h (GC_set_warn_proc, GC_set_free_space_divisor):
4602 Update the comment.
4603 * misc.c (GC_ignore_warn_proc): New API call-back function.
4604 * include/gc.h (GC_ignore_warn_proc): Likewise.
4605 * misc.c (GC_set_find_leak, GC_get_find_leak, GC_set_non_gc_bytes,
4606 GC_get_non_gc_bytes): New API setter and getter functions (for the
4607 public GC_find_leak and GC_non_gc_bytes variables, respectively).
4608 * include/gc.h: Likewise.
4609 * include/gc.h (GC_memalign): Add proto to GC API.
4610 * mallocx.c (GC_memalign): Use GC_API, GC_CALL for the definition.
4611 * tests/test.c (run_one_test): Test GC_memalign() on Win32 too,
4612 remove GC_memalign() proto.
4613 * misc.c (GC_write): Use multi-byte (A) variants of Win32
4614 GetModuleFileName() and CreateFile().
4615 * tests/test.c (main): Replace K&R-style function definition with the
4616 ANSI C one.
4618 * include/private/gcconfig.h (PLATFORM_ANDROID): New macro
4619 recognized (for Linux on ARM32 without glibc).
4620 * include/private/gcconfig.h (STRTOULL): Define for all targets
4621 (define as "strtoul" for most targets except for LLP64/Win64).
4622 * misc.c (GC_init_inner): Use STRTOULL instead of atoi/atol()
4623 (cast the result to word type) to decode values of "GC_TRACE",
4624 "GC_INITIAL_HEAP_SIZE", "GC_MAXIMUM_HEAP_SIZE" environment
4625 variables.
4627 * include/gc_allocator.h: Add gc_allocator_ignore_off_page.
4628 * tests/test_cpp.cc: Add call to gc_allocator_ignore_off_page.
4630 * win32_threads.c (GC_release_mark_lock): Correct misspelling of
4631 AO_load in assertion.
4633 * win32_threads.c (MAX_THREADS): Define as 1 if GC_win32_dll_threads
4634 is defined as FALSE (otherwise the size of dll_thread_table is near
4635 200 KiB for 32-bit).
4636 * win32_threads.c (GC_use_DllMain): Optimize for THREAD_LOCAL_ALLOC.
4637 * win32_threads.c (GC_Thread_Rep): Add backing_store_end and
4638 backing_store_ptr fields for IA64 support.
4639 * win32_threads.c (GC_register_my_thread_inner): Set
4640 backing_store_end field to reg_base value for IA64 (same as in
4641 pthread_support.c).
4642 * win32_threads.c (SET_PTHREAD_MAP_CACHE): Put parentheses in the
4643 "right" places, remove ';'.
4644 * win32_threads.c (GC_fault_handler_lock): Declare only
4645 if MPROTECT_VDB (and not WinCE).
4646 * win32_threads.c (GC_suspend): Acquire and release
4647 GC_fault_handler_lock only if MPROTECT_VDB (and not WinCE).
4648 * win32_threads.c (GC_suspend): Define as STATIC.
4649 * win32_threads.c (GC_push_stack_for): Fix WARN() format specifier
4650 (should be word-compliant, "%p" is used w/o "0x"), don't cast sp.
4651 * win32_threads.c (GC_push_all_stacks): Convert a group of printf()
4652 calls into a single one (for output atomicity).
4653 * win32_threads.c (GC_get_next_stack): Unprotect thread descriptor
4654 before altering its last_stack_min ("thread" variable is added).
4655 * win32_threads.c (GC_get_next_stack): Remove unnecessary checks for
4656 "s" is non-NULL.
4657 * win32_threads.c (GC_get_next_stack): Don't call GC_may_be_in_stack
4658 if WinCE.
4659 * win32_threads.c (GC_get_next_stack): Pass current_min value to
4660 GC_get_stack_min as-is (without -1).
4661 * win32_threads.c (GC_wait_marker): Remove FIXME and use "release"
4662 version of AO_fetch_and_sub1().
4663 * win32_threads.c (GC_win32_start_inner, GC_win32_start): convert int
4664 to pointer (and vice versa) thru word type to suppress warnings.
4665 * win32_threads.c (GC_mark_mutex_waitcnt): Fix comment, always
4666 access atomically.
4667 * misc.c: Change GC_THREADS tests back to THREADS.
4669 * allchblk.c (GC_print_hblkfreelist, GC_dump_regions): Convert
4670 a group of printf() calls into a single one (for output atomicity).
4671 * include/gc.h (GC_set_all_interior_pointers, GC_set_full_freq,
4672 GC_set_time_limit): New prototypes.
4673 * misc.c (GC_set_all_interior_pointers, GC_set_full_freq,
4674 GC_set_time_limit): New public setter/getter functions.
4675 * include/gc.h: Fix (and remove outdated) comments for thread-local
4676 allocation.
4677 * include/gc.h: Fix typos in comments.
4678 * misc.c (GC_init_inner, GC_printf): Likewise.
4679 * include/gc.h (GC_unregister_disappearing_link): Refine comment.
4680 * include/gc.h (GC_stack_base): Recognize _M_IA64 macro.
4681 * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
4682 GC_bytes_allocd_at_reset, DEGRADE_RATE): Define only if THREADS.
4683 * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
4684 GC_bytes_allocd_at_reset): Define as STATIC.
4685 * misc.c (GC_get_heap_size, GC_get_free_bytes,
4686 GC_get_bytes_since_gc, GC_get_total_bytes): Acquire the GC lock to
4687 avoid data races.
4688 * misc.c (GC_write_cs): Define only if THREADS (Win32/WinCE only).
4689 * misc.c (GC_init_inner): Initialize GC_write_cs only if THREADS.
4690 * misc.c (GC_init_inner): Use GC_INITIAL_HEAP_SIZE (if available) to
4691 set the default initial value of initial_heap_sz.
4692 * misc.c (GC_deinit): Destroy GC_write_cs only if THREADS.
4693 * misc.c (GC_init_inner): Fix WARN() format specifier (should be
4694 word-compliant, "%p" is used w/o "0x").
4695 * misc.c (GC_init_inner): Don't recognize "GC_PAUSE_TIME_TARGET"
4696 environment variable if SMALL_CONFIG.
4697 * misc.c (GC_init_inner): Recognize "GC_FULL_FREQUENCY" environment
4698 variable to set initial GC_full_freq value (if not SMALL_CONFIG).
4699 * doc/README.environment (GC_FULL_FREQUENCY): Add information.
4700 * doc/README.environment (GC_MARKERS): Refine information.
4701 * misc.c (GC_init_inner): Change GC_ASSERT to GC_STATIC_ASSERT where
4702 possible.
4703 * misc.c (IF_NEED_TO_LOCK): New macro (instead of GC_need_to_lock).
4704 * misc.c (GC_write): Use IF_NEED_TO_LOCK for handling GC_write_cs.
4705 * misc.c (GC_abort): Don't define if SMALL_CONFIG.
4706 * misc.c (GC_abort): Directly use WRITE() instead of GC_err_printf()
4707 (to prevent possible infinite recursion).
4709 * finalize.c (finalization_mark_proc): Replace K&R-style declaration
4710 with ANSI C one.
4711 * finalize.c (GC_grow_table, GC_register_finalizer_inner,
4712 GC_enqueue_all_finalizers): Remove outdated comments about disabling
4713 signals.
4714 * finalize.c (GC_general_register_disappearing_link): Fix assertion
4715 to catch NULL "obj" value.
4716 * finalize.c (GC_unregister_disappearing_link): Check "link"
4717 alignment before gaining the lock.
4718 * finalize.c (GC_finalize): Refine comment.
4719 * finalize.c (GC_finalize): Fix WARN() format specifier (should be
4720 word-compliant, "%p" is used w/o "0x").
4721 * finalize.c (GC_invoke_finalizers): Initialize "bytes_freed_before"
4722 variable (to 0) to suppress compiler warning.
4723 * include/gc_gcj.h (MARK_DESCR_OFFSET): Move to private/gc_pmark.h.
4724 * include/gc_gcj.h: add "extern C" header and tail.
4725 * include/private/gc_pmark.h: Remove GC_do_parallel_mark(),
4726 GC_help_wanted, GC_helper_count, GC_active_count declarations (move
4727 the comments to the place where these symbols are defined in mark.c).
4728 * mark.c: Add STATIC GC_do_parallel_mark() declaration (for use by
4729 GC_mark_some_inner, if PARALLEL_MARK only).
4730 * mark.c (GC_mark_some_inner, GC_help_wanted, GC_helper_count,
4731 GC_active_count, GC_do_parallel_mark): Define as STATIC.
4732 * pthread_support.c (GC_mark_thread): Likewise.
4733 * typd_mlc.c (GC_explicit_typing_initialized, GC_explicit_kind,
4734 GC_array_kind, GC_ext_descriptors, GC_ed_size, GC_avail_descr,
4735 GC_typed_mark_proc_index, GC_array_mark_proc_index, GC_eobjfreelist,
4736 GC_arobjfreelist): Likewise.
4737 * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Change GC_ASSERT
4738 for HBLKSIZE to GC_STATIC_ASSERT.
4739 * mark.c (GC_noop): Define for Borland C the same as for Watcom.
4740 * mark.c (GC_noop, GC_mark_and_push): Add ARGSUSED tag.
4741 * pthread_support.c (GC_do_blocking_inner): Likewise.
4742 * mark.c (GC_mark_from): Initialize "limit" (to 0) in the default
4743 switch branch to suppress compiler warning.
4744 * mark.c (GC_return_mark_stack): Append new-line to printf message.
4745 * mark.c: Remove unused GC_true_func(), GC_PUSH_ALL().
4746 * pthread_support.c (GC_mark_thread): Add dummy "return 0" to
4747 suppress compiler warning.
4748 * pthread_support.c (start_mark_threads): Move the code limiting
4749 "GC_markers" value (and printing a warning) to GC_thr_init().
4750 * pthread_support.c (GC_thr_init): Silently limit "GC_markers" value
4751 if based on the number of CPUs.
4752 * pthread_support.c (GC_thr_init): Treat incorrect "GC_markers"
4753 values as one.
4754 * pthread_support.c (GC_register_my_thread_inner): Add a check for
4755 "stack_end" is non-NULL (the same as in win32_threads.c).
4756 * pthread_support.c (pthread_create): Call GC_oom_fn before giving up
4757 with ENOMEM.
4758 * thread_local_alloc.c (return_single_freelist): Convert "for" loop
4759 to "while" one to suppress "possible extraneous ';'" warning.
4761 * darwin_stop_world.c (GC_push_all_stacks): Recognize ARM32.
4762 * include/private/gc_priv.h (GC_THREAD_STATE_T): Define for ARM32
4763 (Darwin only).
4764 * include/private/gcconfig.h: Add machine-specific part for DARWIN.
4765 * include/private/gcconfig.h (ARM32): Define config parameters for
4766 DARWIN (iPhone).
4768 * alloc.c (GC_FULL_FREQ, GC_DONT_EXPAND, GC_FREE_SPACE_DIVISOR,
4769 GC_TIME_LIMIT): New macros (used to control the default initial
4770 values of GC_full_freq variable, GC_dont_expand,
4771 GC_free_space_divisor, GC_time_limit respectively).
4772 * include/private/gc_priv.h (TIME_LIMIT): Remove macro (replaced
4773 with GC_TIME_LIMIT in alloc.c).
4774 * alloc.c (GC_need_full_gc, GC_stopped_mark, GC_finish_collection):
4775 Define as STATIC.
4776 * mark_rts.c (GC_push_current_stack, GC_push_gc_structures): Likewise.
4777 * include/private/gc_priv.h (GC_stopped_mark, GC_finish_collection):
4778 Move the prototypes to alloc.c, make STATIC.
4779 * include/private/gc_priv.h (GC_push_current_stack,
4780 GC_push_gc_structures, GC_push_regs_and_stack): Remove prototypes
4781 (move the comments to the places where these functions are defined).
4782 * mach_dep.c (GC_push_regs_and_stack): Move to mark_rts.c and define
4783 as STATIC.
4784 * alloc.c (GC_timeout_stop_func, GC_stopped_mark,
4785 GC_print_heap_sects): Convert a group of printf() calls into
4786 a single one (for output atomicity).
4787 * mark_rts.c (GC_print_static_roots): Likewise.
4788 * alloc.c (GC_stopped_mark): Output blank line (when logging) for
4789 convenience to delimit collections.
4790 * alloc.c (GC_clear_a_few_frames): Rename NWORDS to CLEAR_NWORDS;
4791 make "frames" local variable volatile (to prevent optimization).
4792 * alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
4793 GC_finish_collection, GC_allocobj): Remove outdated comments about
4794 disabling signals.
4795 * include/private/gc_priv.h (GC_register_displacement_inner,
4796 GC_gcollect_inner): Likewise.
4797 * alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
4798 GC_finish_collection): Initialize "start_time" local variable (to 0)
4799 to suppress compiler warning.
4800 * mark_rts.c (GC_add_roots_inner): Likewise.
4801 * alloc.c (GC_RATE, MAX_PRIOR_ATTEMPTS): Guard with "ifndef".
4802 * include/private/gc_priv.h (clock, GC_stop_world, GC_start_world,
4803 GC_acquire_mark_lock, GC_release_mark_lock, GC_notify_all_builder,
4804 GC_wait_for_reclaim, GC_notify_all_marker, GC_wait_marker): Replace
4805 K&R-style function prototypes with ANSI C one.
4806 * include/private/gc_priv.h (ABORT): Define as DebugBreak() for
4807 Win32/WinCE if SMALL_CONFIG (the same as in GC_abort()).
4808 * include/private/gc_priv.h (ROUNDED_UP_WORDS, abs): Remove unused
4809 macros.
4810 * include/private/gc_priv.h (GC_noop): Declare for Borland C the
4811 same as for Watcom.
4812 * mark_rts.c (GC_push_conditional_with_exclusions): Add ARGSUSED tag.
4814 * dbg_mlc.c (GC_store_debug_info, GC_store_debug_info_inner): Remove
4815 outdated comment about disabling signals.
4816 * mallocx.c (GC_malloc_uncollectable,
4817 GC_malloc_atomic_uncollectable): Likewise.
4818 * os_dep.c: Likewise.
4819 * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change):
4820 Add ARGSUSED tag.
4821 * pthread_stop_world.c (GC_suspend_handler,
4822 GC_suspend_handler_inner): Likewise.
4823 * dbg_mlc.c (GC_debug_free, GC_debug_realloc): Fix printf message.
4824 * dbg_mlc.c (GC_debug_realloc): Set "result" to NULL in the default
4825 switch branch to suppress compiler warning.
4826 * dyn_load.c (GC_init_dyld): Use ABORT() instead of GC_abort().
4827 * include/private/darwin_semaphore.h (sem_init): Likewise.
4828 * include/javaxfc.h: Replace "GC_H" with "_GC_H".
4829 * include/private/dbg_mlc.h (GC_has_other_debug_info,
4830 GC_store_debug_info): Replace K&R-style function prototypes with ANSI
4831 C one.
4832 * include/private/gcconfig.h (GC_FreeBSDGetDataStart, real_malloc,
4833 GC_win32_get_mem, GC_wince_get_mem, GC_unix_get_mem): Likewise.
4834 * include/private/pthread_support.h (GC_stop_init): Likewise.
4835 * include/private/gcconfig.h: Refine comment about setting
4836 GC_stackbottom.
4837 * include/private/gcconfig.h (FIXUP_POINTER): Put parentheses in the
4838 "right" places.
4839 * include/private/pthread_support.h (GC_Thread_Rep): Refine comment
4840 for "stack_end" field.
4841 * mallocx.c (GC_malloc_uncollectable,
4842 GC_malloc_atomic_uncollectable): Remove cast to undefined "hbklk".
4843 * os_dep.c (GC_USE_MEM_TOP_DOWN): New macro (for setting
4844 GC_mem_top_down to MEM_TOP_DOWN for debug purposes).
4845 * os_dep.c (GC_gww_read_dirty, catch_exception_raise): Fix WARN()
4846 format specifier (should be word-compliant, "%p" is used w/o "0x").
4847 * pthread_stop_world.c (GC_suspend_handler_inner): Likewise.
4848 * os_dep.c (GC_dirty_init): Append new-line to printf messages.
4849 * os_dep.c (GC_mprotect_thread): Fix GC_err_printf message.
4850 * os_dep.c (GC_save_callers): Change GC_ASSERT to GC_STATIC_ASSERT.
4851 * pthread_stop_world.c (GC_retry_signals, GC_suspend_ack_sem): Define
4852 as STATIC.
4853 * pthread_stop_world.c (GC_push_all_stacks): Add assertion for that
4854 "thread_blocked" is not set for the current thread.
4855 * real_malloc.c: Add "extern GC_quiet" to suppress compiler warning.
4856 * reclaim.c (GC_reclaim_all): Initialize "start_time" (to 0) to
4857 suppress compiler warning.
4859 * tests/test.c (check_heap_stats): Avoid unbalanced brackets in ifdef.
4861 * win32_threads.c: restructure parallel marking mutex initialization.
4862 * win32_threads.c, alloc.c, darwin_stop_world.c, mallocx.c, mark.c,
4863 pthread_stop_world.c, pthread_support.c: Add runtime conditions
4864 on GC_parallel were appropriate.
4865 * pthread_support.c: Condition marker_bsp on ia64.
4866 (GC_segment_is_thread_stack): Fix loop upper bound.
4867 * reclaim.c: Limit some assertions to PARALLEL_MARK.
4868 * pthread_support.c: Don't acquire mark lock for thread-local
4869 allocation.
4870 * include/private/gc_priv.h: Don't define parallel mark sync
4871 support just for THREAD_LOCAL_ALLOC.
4873 * include/private/gcconfig.h: refine MINGW32 test.
4874 * mark.c: Add win64/gcc tests.
4876 * test.c (fork_a_thread, reverse_test, alloc8bytes, tree_test,
4877 typed_test, run_one_test, check_heap_stats, main, test): Replace
4878 all K&R-style function definitions with ANSI C ones.
4879 * trace_test.c (main): Likewise.
4880 * test.c (GC_COND_INIT): Define as GC_INIT() also in case of
4881 THREAD_LOCAL_ALLOC.
4882 * test.c (reverse_test): Call fork_a_thread() only if GC_PTHREADS
4883 or GC_WIN32_THREADS; remove fork_a_thread() macros definition.
4884 * test.c (reverse_test): Use "volatile" when clearing "b" and "c"
4885 local variables (to suppress "assigned value is never used"
4886 compiler warning).
4887 * test.c (tree_test): Use public GC_noop1() instead of private
4888 GC_noop().
4889 * test.c (typed_test): Likewise.
4890 * test.c (check_heap_stats): Define and assign value to
4891 "late_finalize_count" local variable only if its value is used
4892 (if FINALIZE_ON_DEMAND defined).
4893 * test.c (main): Remove DJGPP-specific initialization of
4894 GC_stackbottom (not needed anymore, handled in gcconfig.h).
4895 * trace_test.c: Guard #define GC_DEBUG with #ifndef.
4896 * trace_test.c: Include "gc_backptr.h".
4897 * trace_test.c (main): Call GC_INIT().
4898 * trace_test.c (main): Add "return 0" statement.
4900 * dyn_load.c (GC_register_dynlib_callback): Use new index j
4901 instead of i in the inner loop.
4903 * tests/test.c: Increment n_tests with fetch_and_add when possible,
4904 avoiding need to export lock.
4906 * include/gc_pthread_redirects.h:
4907 - dlfcn.h is included for dlopen() proto before undefining
4908 "dlopen" (so, it's possible now to include dlfcn.h after
4909 gc.h from user code);
4910 - GC_dlopen() proto is added (except for Darwin as
4911 it's missing there);
4912 - "dlopen" is explicitly undefined (before its redefinition).
4913 * include/gc.h:
4914 - "process.h" is included besides "windows.h"
4915 (for _beginthreadex/_endthreadex); win32 only.
4916 - GC_NO_THREAD_DECLS is moved to the right place
4917 (before closing "extern C").
4918 * pthread_support.c: Fix out of memory handling for Thread_Reps.
4919 * win32_threads.c: Don't include process.h on winCE,
4920 improve out of memory handling for thread structures, don't
4921 define GC_beginthreadex and GC_endthreadex for winCE.
4923 * tests/test.c: Change gcj vtable decriptor type from size_t to
4924 GC_word.
4926 * gcj_mlc.c: Add comment.
4927 * tests/test.c: Change NTEST to NTHREADS.  Fork 5 threads by default.
4928 Run reverse_test a second time in each thread.Add comments.
4929 Don't rely on AO_fetch_and_add.
4931 * dyn_load.c (GC_register_dynlib_callback,
4932 GC_register_dynamic_libraries_dl_iterate_phdr): Add support
4933 for GNU_PT_RELRO relocations.
4935 * Makefile, Makefile.direct: GC_SOLARIS_PTHREADS was replaced
4936 by GC_SOLARIS_THREADS.
4937 * include/gc.h: Improve finalizer documentation.
4938 * mips_sgi_mach_dep.s: Replace _MIPS_SIM_ABI32 with _ABIO32.
4939 * pthread_stop_world.c, Makefile.dj: Fix typos.
4941 * win32_threads.c (GC_new_thread): Make first_thread
4942 visible to the whole file.
4943 (UNPROTECT): New macro.
4944 (GC_push_stack_for, GC_suspend, GC_start_world): unprotect
4945 thread structures before writing.
4946 (GC_suspend): Acquire GC_fault_handler_lock before suspending
4947 thread.
4948 * os_dep.c: export GC_fault_handler_lock.
4949 (GC_remove_protection): Check if already unprotected.
4951 * doc/README.win32: Add OpenWatcom warning.
4952 * include/private/gcconfig.h: Really check it in.
4954 * os_dep.c (GC_get_stack_base, windows): Replace with Dave Korn's
4955 code from gcc version.
4956 * os_dep.c: make gc compilable (optionally) for Cygwin with
4957 GetWriteWatch-based virtual dirty bit implementation ("os_dep.c" file).
4958 * os_dep.c: Make non-win32 GC_write_fault_handler STATIC.
4959 * mark.c (GC_noop): fix declaration definition mismatch for DMC.
4960 * include/private/gcconfig.h: Enable MPROTECT_VDB and GWW_VDB for
4961 Watcom (Win32 only).  It works.
4963 * mach_dep.c: Don't use __builtin_unwind_init for register
4964 state on PowerPC/Darwin.
4966 * doc/gcdescr.html: Improve description of object freelist
4967 structure.
4968 * include/private/gc_priv.h: Fix comment for _size_map.
4970 * os_dep.c (GC_linux_stack_base): Relax sanity test.
4972 * include/private/gc_pmark.h (PUSH_CONTENTS_HDR for
4973 MARK_BIT_PER_OBJ): Add missing backslash before eoln.
4975 * misc.c (GC_set_warn_proc): Implicitly intialize GC on
4976 non-Cygwin win32.
4978 * configure.ac: Enable thread-local allocation for sparc-linux.
4980 * alloc.c (GC_try_to_collect): Remove duplicate initialization
4981 check.
4982 * malloc.c (GC_generic_malloc): Remove lw to eliminate single-
4983 threaded warnings.
4984 * mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.
4986 * allchblk.c, backgraph.c, dbg_mlc.c, dyn_load.c,
4987 finalize.c, include/private/gc_pmark.h, malloc.c, mark.c,
4988 os_dep.c, pthread_stop_world.c, pthread_support.c, reclaim.c,
4989 thread_local_alloc.c.
4990 * misc.c: Refine comment.
4992 * os_dep.c: Define GC_GWW_BUF_LEN more intelligently.  Add FIXME
4993 comment.
4995 * win32_threads.c (GC_push_stack_for): Yet another attempt
4996 at the stack_min finding logic.  Try to clean up the existing code
4997 while minimizing VirtualQuery calls.
4998 (GC_win32_start_inner): Register thread before GC_printf.
4999 Produce more output with DEBUG_THREADS.
5000 *include/gc.h: Update obsolete comments.
5002 * tests/test.c:
5003 (gcj_class_struct2): Use cast instead of l suffix.
5004 Cast GetLastError to int in various places.
5005 Avoid unused result warning from incr/decr macros.
5006 Add cast for fake_gcj_mark_proc.
5007 Cast GC_gc_no to unsigned in printf.
5009 * include/gc.h: Fix two typos in comments.
5011 * finalize.c: Fix typo in comment.
5013 * blacklst.c (GC_print_source_pointer): Don't call GC_print_heap_obj
5014 with lock.
5016 * reclaim.c: (GC_reclaim_block): Scan even nearly full blocks
5017 if we are checking for leaks.
5019 * win32_threads.c: Remove mark lock spinning.
5020 * win32_threads.c, pthread_support.c: Update GC_unlocked_count,
5021 GC_spin_count, and GC_block_count using atomic operations.
5022 * tests/test.c: Declare n_tests as AO_t only if we have threads.
5024 * win32_threads.c: Support PARALLEL_MARK.  Make printf arg
5025 types agree with format specifiers.
5026 Add STATIC for GC_threads.
5027 * include/private/gcconfig.h: Add FIXME comment.
5028 * tests/test.c (run_ine_test): Replace LOCK/UNLOCK use with
5029 AO_fetch_and_add1_full.  Declare n_tests as AO_t.
5030 (WinMain): Don't call GC_use_DllMain.
5031 with PARALLEL_MARK or THREAD_LOCAL_ALLOC.
5033 * alloc.c (GC_try_to_collect_inner): Don't print redundant
5034 GC_bytes_allocd and GC_gc_no.
5035 (GC_stopped_mark): Print average world stop time.
5036 * include/private/gc_priv.h (MS_TIME_DIFF): Add cast.
5038 * misc.c, doc/README.environment: Add support  for
5039 GC_FREE_SPACE_DIVISOR and GC-disable-incremental.
5040 * include/gc.h: Make GC_set_free_space_divisor correspond to
5041 (somewhat unfortunate) reality.
5043 (Mostly improves LLP64 support.)
5044 * backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c,
5045 misc.c, reclaim.c: Changed some int and long type to word or size_t
5046 (and vice versa where appropriate)
5047 * gcj_mlc.c, include/private/dbg_mlc.h, include/private/gcconfig.h,
5048 include/private/thread_local_alloc.h, mark.c,
5049 misc.c, thread_local_alloc.c, win32_threads.c: Added intermediate
5050 casts to word type when casting from int to pointer (or pointer
5051 to int, or data pointer to code pointer) - just to remove the
5052 corresponding compiler warning.
5053 * ptr_chck.c (GC_is_visible): cast int const to word type to
5054 prevent left shift overflow.
5055 * os_dep.c: change the type of GC_mem_top_down global variable
5056 (containing a flag) to DWORD.
5057 * include/gc_config_macros.h: define GC_SOLARIS_THREADS if GC_THREADS
5058 is defined on SunOS x86_64.
5059 * misc.c (GC_init_size_map): Ifdef out GC_ASSERT as a workaround
5060 for VC++ 2008 amd64 (v15.00.21022.08 for x64) compiler bug
5061 (the compiler gets hung if invoked with -Ox -D
5062 ALL_INTERIOR_POINTERS -D GC_ASSERTIONS)
5063 * backgraph.c: cast GC_gc_no value to unsigned short when
5064 assigned/compared to height_gc_no field of back_edges.
5065 * os_dep.c (GC_remove_protection): Add ARGSUSED.
5066 * win32_threads.c (GC_thread_exit_proc): Remove unused local
5067 variable.
5068 * mark.c (GC_check_dirty): Move declaration out of func body.
5070 * doc/gcinterface.html: Improve REDIRECT_MALLOC documentation.
5071 * include/gc.h (GC_register_my_thread): Improve comment.
5073 * Makefile.direct: Add comment for -DCHECKSUMS.
5075 * thread_local_alloc.c, include/private/thread_local_alloc.h:
5076 Fix typos in comments.
5077 * finalize.c: Declare mark_procs and GC_register_finalizer_inner
5078 STATIC.
5079 * malloc.c (GC_free): Move size calculation below assertion.
5081 * win32_threads.c (GC_get_stack_min, GC_may_be_in_stack):
5082 Add one entry VirtualQuery cache, I_HOLD_LOCK assertions.
5083 (GC_push_stack_for, GC_get_next_stack) : Hopefully fix WINCE support.
5085 * finalize.c (GC_general_register_disappearing_link): Add
5086 assertion.
5087 * malloc.c (GC_generic_malloc): Round lb to granules, not words.
5088 * mallocx.c (GC_generic_malloc_ignore_off_page): Round lb to
5089 granules, not words.
5091 * mach_dep.c (NO_GETCONTEXT): Define for sparc linux.
5092 * configure.ac: Define mach_dep for sparc-linux.
5094 * mark_rts.c (GC_approx_sp): Use volatile to avoid common
5095 warning.
5097 * dyn_load.c (GC_cond_add_roots): Fix GC_get_next_stack argument
5098 order.
5100 * alloc.c, dbg_mlc.c, dyn_load.c, finalize.c, gcj_mlc.c,
5101 include/gc.h, include/gc_config_macros.h, include/gc_cpp.h,
5102 include/gc_gcj.h, include/gc_mark.h, include/gc_typed.h,
5103 include/javaxfc.h, include/private/gc_locks.h,
5104 include/private/gc_priv.h, malloc.c, mallocx.c, mark.c, mark_rts.c,
5105 misc.c, obj_map.c, os_dep.c, pthread_support.c, ptr_chck.c,
5106 stubborn.c, tests/test.c, thread_local_alloc.c, typd_mlc.c
5107 win32_threads.c: Add GC_CALL and GC_CALLBACK macro invocations.
5108 * test.c: Remove some old K&R code.
5110 * win32_threads.c (GC_may_be_in_stack): New.  (GC_Thread_Rep):
5111 Add last_stack_min.  (GC_push_stack_for): Use last_stack_min.
5112 (GC_get_next_stack): Add limit argument, use_last_stack_min.
5113 (GC_suspend): make stack_base assignment conditional.
5114 * dyn_load.c (win32 GC_cod_add_roots): Pass limit to
5115 GC_get_next_stack.
5116 * configure_atomic_ops.sh: Remove.
5117 * build_atomic_ops.sh, build_atomic_ops.sh.cygwin, doc/README.win32,
5118 Makefile.direct: Partially support build directories whose path
5119 name contains blanks.
5120 * Makefile.am: Support new files (build_atomic_ops.sh,
5121 build_atomic_ops.sh.cygwin)
5123 * include/private/gc_locks.h, include/private/gc_pmark.h,
5124 include/private/gc_priv.h, include/private/gcconfig.h,
5125 mach_dep.c, mark_rts.c, misc.c, os_dep.c, pthread_stop_world.c,
5126 pthread_support.c, thread_local_alloc.c, typd_mlc.c, win32_threads.c:
5127 Fix comments.
5129 * pthread_support.c: Comment out LOCK_STATS.
5130 * include/gc.h: Fix comments.
5132 * misc.c (GC_init_inner): Enable GC_LOG_FILE on Cygwin.
5133 * include/private/gcconfig.h: Consider USE_MMAP for Cygwin.
5134 * os_dep.c (GC_get_main_stack_base): Use alternate definition
5135 with USE_MMAP.
5136 * include/private/gc_priv.h: Sometimes define SETJMP on Cygwin.
5138 * doc/README: Make it clearer when Makefile.direct is assumed.
5139 * cord/cord.am: install include/cord.h.
5141 * win32_threads.c (GC_pthread_join, GC_pthread_start_inner):
5142 Remove unused variables.
5143 * darwin_stop_world.c: Always declare GC_thr_init().
5144 * dbg_mlc.c (GC_debug_free_inner): Don't touch oh_sz if
5145 SHORT_DBG_HDRS is defined.
5146 * include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET, parallel
5147 mark, USE_MARK_BITS version): Refer to correct parameter name.
5149 * finalize.c (GC_general_register_disappearing_link): Remove
5150 redundant code.
5151 * gcj_mlc.c (GC_init_gcj_malloc): Add cast to signed.
5152 * os_dep.c: (GC_write_fault_handler): Remove remaining
5153 references to deleted variable "code".  Remove redundant
5154 FREEBSD definitions.
5155 * include/private/gcconfig.h (GWW_VDB): Define for X86_64 when
5156 defined for X86. (STATIC): Define as "static" with NO_DEBUGGING.
5158 * include/private/gc_priv.h: Update MAX_HEAP_SECTS.
5160 * dbg_mlc.c (GC_print_smashed_obj): Increase robustness with
5161 smashed string, (GC_debug_free_inner): Mark as free.
5162 * mallocx.c (GC_malloc_many): Always clear new block if
5163 GC_debugging_started.
5164 * reclaim.c: Move GC_debugging_started from
5165 GC_reclaim_small_nonempty_block() to GC_reclaim_generic(),
5166 which is also called directly.
5167 * doc/README: Fix spelling error.  Update license summary.
5168 * include/gc.h (GC_PRE_INCR3, GC_POST_INCR3): add (void **) casts.
5169 * tests/test.c: Don't define GC_DEBUG if already defined.
5171 * doc/simple_example.html: update --enable-full-debug reference,
5172 Make HTML formatting standards compliant.
5173 * doc/debugging.html, doc/leak.html: Fix HTML formatting bugs.
5174 * doc/gcinterface.html: specify encoding.
5176 * doc/simple_example.html: Update thread-local allocation
5177 description.
5179 * configure.ac: Check for gc-debug earlier; replace remaining
5180 full-debug tests.
5181 * include/gc.h, ptr_chck.c (GC_pre_incr, GC_post_incr):
5182 Use signed offset type.  Use ptr_t internally.
5183 * doc/gcinterface.html: Update LOCAL_MALLOC description.
5184 * doc/README.autoconf, doc/leak.html, doc/README.DGUX386:
5185 Fix full-debug reference.
5186 * include/gc.h: Rewrite GC_..._INCR and friends.
5187 * tests/test.c: Minimally test GC_..._INCR and friends.
5189 * mark.c: (GC_push_next_marked, GC_push_next_marked_dirty,
5190 GC_push_next_marked_uncollectable): Never invoke GC_push_marked
5191 on free hblk.
5192 * headers.c: Test COUNT_HDR_CACHE_HITS not USE_HDR_CACHE.
5193 (GC_header_cache_miss): Always blacklist pointers for free
5194 hblks.  Add assertion and comment.
5195 * pthread_support.c (GC_register_my_thread): Fix #if indentation.
5196 * include/private/gc_hdrs.h: USE_HDR_CACHE is no longer tested.
5197 Delete it.
5198 * include/private/gc_pmark.h: (PUSH_OBJ): Add assertion.
5200 * alloc.c, include/gc_mark.h, Makefile.direct: Improve comments.
5202 * configure.ac: Set win32_threads on MinGW.
5204 Ivan's description of the patch follows. Note that a few pieces like
5205 the GC_malloc(0) patch, were not applied since an alternate had been
5206 previously applied.  A few differed stylistically from the rest of
5207 the code (mostly casts to void * instead of target type),
5208 or were classified as too minor to bother.  Note that
5209 all of Ivan's static declarations which did not correct outright
5210 naming bugs (as a few did), where replaced by STATIC, which is
5211 ignored by default.
5213 - minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for
5214 GC_malloc(0));
5215 - addition of missing getter/setter functions for public variables
5216 (may be useful if compiled as Win32 DLL);
5217 - addition of missing GC_API for some exported functions;
5218 - addition of missing "static" declarator for internal functions
5219 and variables (where possible);
5220 - replacement of all remaining K&R-style definitions with ANSI
5221 C ones (__STDC__ macro is not used anymore);
5222 - addition of some Win32 macro definitions (that may be missing in
5223 the standard headers supplied with a compiler) for GWW_VDB mode;
5224 - elimination of most compiler warnings (except for
5225 "uninitialized data" warning);
5226 - several typos correction;
5227 - missing parenthesis addition in macros in some header files of
5228 "libatomic_ops" module.
5230 My highlights based on reading the patch:
5232 * allchblk.c: Remove GC_freehblk_ptr decl.
5233 Make free_list_index_of() static.
5234 * include/gc.h: Use __int64 on win64, define GC_oom_func,
5235 GC_finalizer_notifier_proc, GC_finalizer_notifier_proc,
5236 add getter and setters: GC_get_gc_no, GC_get_parallel,
5237 GC_set_oom_fn, GC_set_finalize_on_demand,
5238 GC_set_java_finalization, GC_set_dont_expand,
5239 GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect,
5240 GC_set_finalizer_notifier.  Always define GC_win32_free_heap.
5241 gc_config_macros.h: Define _REENTRANT after processing
5242 GC_THREADS.
5243 * include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test,
5244 handling of operator new[] for old Windows compilers.
5245 * include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses
5246 around arguments.
5247 * dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs.
5248 * mark.c (GC_mark_and_push_stack): Fix source argument for
5249 blacklist printing.
5250 * misc.c: Fix log file naming based on environment variable
5251 for Windows.  Make GC_set_warn_proc and GC_set_free_space_divisor
5252 just return current value with 0 argument.  Add DONT_USE_USER32_DLL.
5253 Add various getters and setters as in gc.h.
5254 * os_dep.c: Remove no longer used GC_disable/enable_signals
5255 implementations.  (GC_get_stack_base): Add pthread_attr_destroy
5256 call.  No longer set GC_old_bus_handler in DARWIN workaround.
5257 * pthread_support.c: GC_register_my_thread must also
5258 call GC_init_thread_local.
5260 * Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
5261 * mach_dep.c: Include signal.h.
5262 * gc_priv.h: Factor out INLINE declaration.
5264 * include/private/gcconfig.h: Update MIPS/LINUX config.
5265 * doc/gcdescr.html: Fix typo.
5266 * mach_dep.c (GC_with_callee_saves_pushed): Don't rely on getcontext
5267 for MIPS/LINUX.
5269 * configure.ac: SPARC fixes.
5270 * thread_local_alloc.c(GC_mark_thread_local_fls_for): Include
5271 size 0, except for gcj.
5272 * doc/gc.man: Expand C++ cautions.
5273 * include/gc_inline.h: Fix comments.
5276 == [7.1] 2008-05-03 ==
5278 * doc/gcinterface.html: Improve C++ interface documentation.
5280 * allchblk.c (GC_allochblk): Check for overflow during size
5281 rounding.
5282 * tests/huge_test.c: New.
5283 * Makefile.direct, tests/tests.am: Add huge_test.c
5285 * pthread_support.c: Fix typo in comment.
5286 * os_dep.c (GC_win32_get_mem): Add heap section only if
5287 allocation succeeded.
5289 * malloc.c: (free replacement) Fix caller address space check.
5291 * finalize.c (GC_grow_table): Dereference table in null-check.
5293 * win32_threads.c (GC_delete_gc_thread, GC_delete_thread):
5294 Consistently call CloseHandle. (GC_suspend): Call
5295 GC_delete_gc_thread.
5296 * tests/test.c: Don't reference GC_print_stats if not exported.
5298 * tests/test.c (run_one_test): Don't mention pthread_self().
5299 * misc.c: Declare GC_thr_init().
5301 * allchblk.c (add_to_fl): disable assertions with USE_MUNMAP,
5302 and refine assertions to handle huge unmergable blocks.
5303 (GC_allochblk_nth): Add comment.
5305 * include/private/gcconfig.h: Add missing FREEBSD macro
5306 consistency test.
5308 * allchblk.c (GC_enough_large_bytes_left): No longer take
5309 parameters; return free list index bound.
5310 (GC_merge_unmapped): Don't access nexthdr until after null test.
5311 (Fixes bug in 1/29/08 check-in.)  (GC_allochblk): Calculate
5312 when splitting is allowable only once here, not when considering each
5313 block. (GC_allchblk_nth): Accept new may_split parameter.
5314 Avoid some redundant tests for exact size matches.
5315 * alloc.c (GC_should_collect): Cache min_bytes_allocd.
5316 (GC_maybe_gc): Make locking assertion testable.
5317 * mark_rts.c: Fix indentation.
5318 * pthread_stop_world.c: Replace old GC_err_printf1 reference.
5319 * tests/test.c: Remove (void) casts.  Optionally print some
5320 timing information.
5322 * windows-untested/gc.def: Remove CreateThread line.
5323 * windows-untested/README: New file.
5324 * win32_threads.c (GC_use_DllMain): Force collector initialization.
5325 * include/gc.h (GC_use_DllMain): Clarify usage rules in comment.
5326 * mark.c (GC_mark_from): Slightly simplify GC_DS_PER_OBJECT code.
5327 * include/gc_cpp.h: Add matching placement delete overloads
5328 everywhere.
5329 * include/private/gc_locks.h (NO_THREAD): Add cast.
5330 * include/private/gcconfig.h: Add test for __HP_aCC.
5331 * configure.ac, tests/tests.am:  Avoid libgccpp on HP/UX.
5333 * doc/README.win32: Fix typo.
5334 * configure.ac: Fix printing of enable-shared result.
5336 * misc.c (GC_init_inner): Assert !GC_need_to_lock only when
5337 defined.  (GC_call_with_stack_base): Add GC_API.
5338 * os_dep.c (GC_get_stack_base): Add GC_API.
5339 * win32_threads.c: (GC_register_my_thread, GC_unregister_my_thread):
5340 Add GC_API.
5341 * include/gc.h: Add GC_API annotations.
5342 * include/private/gc_locks.h: Define UNCOND_LOCK etc. also for
5343 PCR.
5344 * include/private/gc_pmark.h: Fix comments.
5346 * include/private/gc_priv.h, mark_rts.c, typd_mlc.c:
5347 Add GC_push_typed_structures() to push GC_ext_descriptors.
5349 * tests/test.c: Call GC_INIT for DARWIN; test system type using
5350 gcconfig.h-defined macros.
5352 * allchblk.c (GC_merge_unmapped, GC_freehblk): Refuse to create
5353 blocks large enough that their size, when interpreted as a signed
5354 value, would be negative.
5355 * include/private/gc_priv.h: Comment hb_sz range limit.
5357 * mark.c (GC_push_next_marked): correct comment.
5358 * Makefile.direct: document NO_PROC_STAT.
5359 * include/private/gcconfig.h: Accomodate NO_PROC_STAT.
5362 == [7.1alpha2] 2008-01-10 ==
5364 * Makefile.am: Mention atomic_ops.c and atomic_ops_sysdeps.S
5365 again.  Refer to build directory as ".".
5367 * configure.ac: Ignore --enable-parallel-mark on Darwin for now.
5368 * darwin_stop_world.c: Add FIXME comment for parallel marker.
5370 * include/private/gc_priv.h: Update MAX_ROOT_SETS
5371 and LOG_PHT_ENTRIES to handle larger heaps.
5373 * include/gc.h (GC_INIT,GC_init): Update comments.
5375 * allchblk.c, alloc.c, include/private/gc_priv.h:
5376 Track GC_bytes_dropped and use in GC triggering decisions.
5377 * alloc.c (min_bytes_allocd): Weight atomic blocks less.
5379 * alloc.c (GC_add_to_heap): Call GC_install_header(p) AFTER
5380 adjusting p.
5382 * Makefile.am: Add NT_X64_THREADS_MAKEFILE.
5384 * NT_X64_STATIC_THREADS_MAKEFILE: Clean up obsolete comment.
5385 * alloc.c: Add declaration for GC_add_current_malloc_heap.
5386 * win32_threads.c (GC_beginthreadex): Clean up error
5387 return code.
5388 * doc/README.win64, NT_X64_THREADS_MAKEFILE, Makefile.direct:
5389 Add NT_X64_THREADS_MAKEFILE.
5391 * alloc.c: Define GC_version instead of in version.h.
5392 * version.h: Remove.
5393 * include/gc_version.h: Move most of version.h here.
5394 * include/gc.h: Include gc_version.h.
5395 * gcname.c, add_gc_prefix.c: include gc.h instead of version.h.
5396 * Makefile.direct, Makefile.dj, Makefile.am, include/include.am:
5397 Adjust for version.h rename.
5399 * configure.ac: Put libatomic_ops links in build directory.
5400 * Makefile.am: Don't mention atomic_ops.c and atomic_ops_sysdeps.S
5401 as nodist sources.
5403 * include/gc.h, doc/README.macros: Add GC_NO_THREAD_REDIRECTS,
5404 GC_NO_THREAD_DECLS, don't test explicitly for GC_SOLARIS_THREADS.
5406 * alloc.c: Deal correctly with address wrapping for
5407 GC_greatest_plausible_heap_addr and GC_least_plausible_heap_addr.
5408 * finalize.c, include/gc.h (GC_register_disappearing_link,
5409 GC_register_finalizer_inner): Improve out-of-memory handling.
5410 * include/private/gc_pmark.h: Fix comment spelling.
5412 * include/gc_inline.h, include/gc_tiny_fl.h: cleanups to make usable
5413 in other contexts.
5415 * include/gc.h: Don't define GC_HAVE_BUILTIN_BACKTRACE for uclibc.
5417 * gc_cpp.cc: Don't include gc_cpp.h from local directory.
5419 * allchblk.c, configure.ac (add --enable-munmap)
5421 * dyn_load.c (GC_dyld_image_add): Remove ifdef clause and use the macro
5422 GC_GETSECTBYNAME instead.
5423 * include/private/gc_priv.h: Define GC_GETSECTBYNAME according to the
5424 architecture (Darwin).
5426 * reclaim.c (GC_bytes_found): Expand comment.
5427 * thread_local_alloc.c (GC_malloc_atomic, GC_gcj_malloc): Pass
5428 granules, not bytes, to GC_FAST_MALLOC_GRANS.
5429 * include/gc.h: Never include gc_local_alloc.h.
5430 * tests/test.c: Add size zero allocation tests.
5432 * malloc.c: Update GC_large_allocd_bytes on explicit deallocation.
5433 * allchblk.c: Sanity check GC_max_large_allocd_bytes.
5435 * Makefile.direct: Invoke $(MAKE) instead of make.
5437 * doc/scale.html: Reflect gc7 thread local allocation behavior.
5439 * include/extra/gc.h, include/extra/gc_cpp.h: New.
5440 * include/include.am: Install gc.h and gc_cpp.h in $(prefix)/include
5441 again.
5443 * pthread_support.c (GC_thr_init): Use sysconf(_SC_NPROCESSORS_ONLN)
5444 for HURD.
5446 * include/private/gcconfig.h: Add Linux/mips-64 support.
5448 * dbg_mlc.c: Use random() on all glibc systems.
5449 * mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext() on
5450 HURD.  Add comment.
5451 * pthread_stop_world.c (GC_suspend_handler, GC_stop_init): Accomodate
5452 systems without SA_SIGINFO.
5454 * include/gc.h (GC_PTR_STORE): Fix non-DEBUG parentheses.
5455 * tests/test.c (run_one_test): Add GC_PTR_STORE test.
5456 No longer test for RS6000.
5458 * alloc.c, backgraph.c, headers.c, include/private/gc_priv.h:
5459 Maintain GC_our_memory and GC_n_memory.
5460 * dbg_mlc.c (GC_print_smashed_obj): Improve message.
5461 (GC_print_all_smashed_proc): Pass client object address instead of
5462 base.
5463 * dyn_load.c (sort_heap_sects): New.  (GC_register_map_entries):
5464 Register sections that are contiguous and merged with our heap.
5465 * malloc.c, os_dep.c (GC_text_mapping): Check for just base name
5466 of libraries.
5467 * malloc.c (calloc): Check for special callers even with
5468 USE_PROC_FOR_LIBRARIES. Move assertion.  Add rudimentary
5469 malloc/free tracing.
5470 * misc.c: No longer call GC_init_lib_bounds explicitly.
5471 * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Always
5472 initialize on demand.
5473 * tests/test.c: Call GC_INIT only when required.
5475 * Makefile.direct: Remove comment fragment.
5476 * tests/tests.am: Add smashtest.
5477 * configure.ac: Define GC_USE_DLOPEN_WRAP with redirect-malloc.
5478 * pthread_support.c: Fix comment spelling.
5479 * include/private/gcconfig.h: Define USE_PROC_FOR_LIBRARIES with
5480 GC_LINUX_THREADS and REDIRECT_MALLOC.
5481 * tests/smash_test.c: Initial check-in.
5482 * obj_map.c: Print log entry to correct file.
5483 * include/private/thread_local_alloc.h: Add TlsAlloc error check.
5485 * alloc.c (GC_stopped_mark): Call GC_add_current_malloc_heap()
5486 while world is still running.
5487 * os_dep.c (GC_is_heap_base): Don't call GC_add_current_malloc_heap()
5488 with world stopped.
5489 * include/gc.h (GC_INIT for cygwin): Always call GC_add_roots.
5490 * misc.c (GC_init/GC_init_inner): Perform all work in
5491 GC_init_inner.
5492 * Makefile.direct: Expand -DUSE_MUNMAP comment.
5494 * include/gc.h: Define uintptr_t explicitly for VC++6.
5495 * msvc_dbg.c (GetModuleBase): Revert to strcat if strcat_s doesn't
5496 exist.
5499 == [7.0] 2007-07-02 ==
5501 * include/gc_config_macros.h: Also check for IA64 when setting
5502 GC_HPUX_THREADS.
5503 * mallocx.c: Change my_bytes_allocd to signed_word.
5504 * include/gc_pthread_redirects.h: Remove obsolete Solaris threads
5505 (as opposed to pthreads) support.
5507 * mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext()
5508 on ARM/Linux.  Check getcontext() return value.
5510 * backgraph.c (per_object_func): Make argument types consistent.
5511 (GC_traverse_back_graph): Mark GC_deepest_obj.
5513 * finalize.c (GC_finalize): Change dl_size and fo_size to size_t.
5514 * os_dep.c (GC_win32_get_mem): Add GC_mem_top_down option.
5516 * doc/README.win32, doc/README, README.QUICK: Fix some of the worst
5517 anachronisms.
5518 * dyn_load.c: Partially support cygwin, but don't enable it yet.
5520 * Makefile.am: Use -no-undefined for libgc.
5521 * Makefile.direct: Document USE_PROC_FOR_LIBRARIES.
5522 * dyn_load.c (GC_register_map_entries): Rename prot_buf to prot
5523 consistently.
5524 * misc.c: Fix some WARN calls.  Move GC_is_initialized setting and
5525 GC_thr_init() call.
5526 * os_dep.c: Consistently use WARN where appropriate.
5527 * thread_local_alloc.c: Revert change to GC_WIN32_THREADS test.  Instead
5528 remove inappropriate pthread.h include.
5529 * doc/README.linux: Remove some anachronisms.
5531 * alloc.c: Also use GC_check_tls on non-Linux systems.
5532 * mallocx.c (GC_reclaim_generic): Remove bogus declaration.
5533 * include/private/gc_priv.h (GC_reclaim_generic): Declare correctly
5534 with prototype.
5536 * alloc.c (GC_adj_bytes_allocd): Avoid (long) casts, fix comment.
5537 (GC_print_heap_sects): Use size_t instead of unsigned long.
5538 * thread_local_alloc.c (GC_lookup_thread): Define in the correct
5539 context.
5540 * win32_threads.c, include/gc_config_macros.h: The last of Romano
5541 Paolo Tenca's patch.  Move stdint.h include to gc_config_macros.h.
5542 * include/gc_inline.h: Avoid gc_priv.h dependencies.
5543 * tests/test.c (check_heap_stats): Replace unsigned long with size_t.
5545 * NT_X64_STATIC_THREADS_MAKEFILE: Replace obsolete -debugtype:cv.
5546 * mark_rts.c (GC_push_roots): Fix kind type.
5548 * doc/README.win64: New file.
5549 * doc/doc.am, Makefile.direct: Add README.win64.
5551 * Makefile.am, Makefile.direct: Add NT_X64_STATIC_THREADS_MAKEFILE.
5552 * NT_X64_STATIC_THREADS_MAKEFILE: Fix warning flags.
5553 * allochblk.c, alloc.c, blacklst.c, dbg_mlc.c, dyn_load.c,
5554 finalize.c, headers.c, mach_dep.c, malloc.c, mark.c, misc.c,
5555 obj_map.c, os_dep.c, ptr_chck.c, reclaim.c, typd_mlc.c,
5556 win32_threads.c, cord/de_win.c, include/gc_mark.h,
5557 include/private/gc_hdrs.h, include/private/gc_pmark.h,
5558 include/private/gc_priv.h, tests/test_cpp.cc:
5559 Replace old style function declarations.  Clean up integral types.
5560 Remove register declarations.  The change in malloc.c and the
5561 "int descr" declaration in mark.c are the most likely to have
5562 been real bugs outside of win64.
5563 * msvc_dbg.c: Disable on win64.
5564 * win32_threads.c: Add AMD64 support.
5565 * include/gc.h: no backtrace on AMD64 for now.
5567 * msvc_dbg.c(GetModuleBase): Replace strcat with strcat_s.
5569 * include/gc.h: (GC_word, GC_signed_word): Fix win64 definitions.
5570 Don't include windows.h in an extern "C" context.
5571 * include/private/gcconfig.h: Fix win64/X86_64 configuration.
5572 * tests/test.c: Eliminate more old style function definitions.
5573 Cleanup pointer and integer casts for win64.
5574 * tests/test_cpp.cc: Don't include gc_priv.h.
5575 * NT_STATIC_THREADS_MAKEFILE: Restrict suffixes for VC++ 2005.
5576 * NT_X64_STATIC_THREADS_MAKEFILE: New.
5578 * win32_threads.c: Separate out DEBUG_WIN32_PTHREADS_STACK.  Ignore
5579 FINISHED threads for suspension.  (GC_pthread_join): Add
5580 pthread_self() cast.  (GC_pthread_start_inner): Execute cleanup
5581 handler when popping it.
5582 * include/private/gc_locks.h: Inline THREAD_EQUAL for
5583 GC_WIN32_PTHREADS.  Define USE_PTHREAD_LOCKS only if we have
5584 pthreads.
5586 * gc_dlopen.c, thread_local_alloc.c, threadlibs.c, win32_threads.c,
5587 tests/test.c: Accomodate GC_WIN32_PTHREADS.
5588 * include/gc.h: Don't include windows.h for GC_WIN32_PTHREADS.
5589 * include/gc_config_macros.h: Define both PTHREADS and
5590 GC_WIN32_THREADS.
5591 * include/private/gc_locks.h: Nonstandard definitions of
5592 NUMERIC_THREAD_ID for GC_WIN32_PTHREADS.
5593 * doc/README.win32, Makefile.direct: Include documentation
5594 for GC_WIN32_PTHREADS.
5595 * Makefile.direct: Remove some anachronisms in the documentation.
5597 * Makefile.am: Move includes to bottom.  Add better library
5598 dependencies.  Increment library version.  Remove "SUBDIRS += .".
5599 * cord/cord.am, tests/tests.am: Add better library dependencies.
5600 Remove now unnecessary dependencies.
5601 * include/gc.h (GC_beginthreadex, GC_endthreadex, GC_ExitThread):
5602 Move to define on all Windows platforms.  (_beginthread): define
5603 to generate error if used.
5605 * include/private/gc_locks.h: Format to 80 columns.
5607 * malloc.c(GC_free): Ignore bad frees on MSWIN32 with REDIRECT_MALLOC.
5608 * NT_MAKEFILE: msvc_dbg.h is in include/private.  Don't use cvars
5610 * misc.c (WIN32 GC_write): Define GC_need_to_lock in single-threaded
5611 case.
5612 * win32_threads.c: Test for __MINGW32__ in addition to _MINGW_VER.
5613 (GC_CreateThread, GC_beginthreadex): Deallocate args even if we fail.
5614 * include/gc.h: Add GC_reachable_here().  (GC_WinMain): Add GC_API.
5615 (GC_beginthreadex, GC_endthreadex, GC_ExitThread): Declare.
5616 * tests/test.c: Add GC_reachable_here() call.
5618 * alloc.c (GC_try_to_collect): Call GC_init if necessary.
5619 * tests/thread_leak_test.c: Don't unconditionally define
5620 GC_LINUX_THREADS.
5622 * Makefile.am: Remove extra_ldflags_libgc definition.
5624 * include/private/gc_priv.h: Define AO_REQUIRE_CAS.
5626 * finalize.c (GC_unreachable_finalize_mark_proc): Don't return void
5627 value.
5630 == [7.0alpha9] 2007-05-15 ==
5632 * Some gc6.9 changes.
5633 * Change FindTopOfStack decl in darwin_stop_world.c.
5634 * Move some static tests from misc.c to gcconfig.h.  Use #error.
5635 * Add GC_print_free_list() function.
5636 * Add GC_GNU_THREADS support on HURD.
5637 * __GNUC__ was misspelled as __GNUC in thread_local_alloc.h.
5638 * Integrated various MacOSX patches and tried to reconcile them.
5639 * Added some casts to powerpc.h in libatomic_ops to silence warnings.
5641 * Makefile.am: Include NT_STSTIC_THREADS_MAKEFILE in dist.
5642 * include/private/gc_locks.h: GC_compare_and_exchange, GC_atomic_add:
5643 remove. NUMERIC_THREAD_ID, THREAD_EQUAL: New.  GC_lock_holder: now
5644 unsigned long.  I_DONT_HOLD_LOCK, I_HOLD_LOCK: Update.
5645 * pthread_stop_world.c, pthread_support.c, win32_threads.c: Use
5646 NUMERIC_THREAD_ID, THREAD_EQUAL.
5647 * include/private/gcconfig.h: GENERIC_COMPARE_AND_SWAP: Remove.
5648 * include/private/thread_local_alloc.h: Don't USE_COMPILER_TLS on
5649 ARM.
5651 * dbg_mlc.c, include/gc.h, finalize.c: Merge Alexandre Oliva's
5652 GC_debug_register_finalizer_unreachable() patch from gcc tree.
5653 * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Add assertions
5654 to check GC has been initialized.
5656 * include/gc_cpp.h: Documentation updates.
5657 * include/gc_config_macros.h: Don't check for __ppc__ to set
5658 DARWIN_THREADS.
5659 * Makefile.am: Include configure_atomic_ops.sh in dist.
5661 * Makefile.am: Don't distribute copied atomic_ops files.  Include
5662 libatomic_ops with "make dist".
5663 * configure.ac: Enable THREAD_LOCAL_ALLOC for Cygwin with threads.
5664 * win32_threads.c: Report error for Cygwin + GC_DLL.
5666 * Makefile.direct: Update THREAD_LOCAL_ALLOC documentation.
5667 * cord/de_win.c: Rename and move AboutBox.  Call GC_INIT.  Remove
5668 MakeProcInstance anachronism.
5669 * doc/README.macros: Officially remove elif prohibition.
5670 Remove documentation for defunct SRC_M3 support.
5671 * include/gc.h: Remove more SRC_M3 references.
5672 * include/private/gcconfig.h: Remove still more SRC_M3 references.
5673 GC_SOLARIS_THREADS no longer needs to be checked separately.
5675 * thread_local_alloc.c, include/private/thread_local_alloc.h:
5676 Spell __declspec correctly.
5677 * NT_STATIC_THREADS_MAKEFILE: Enable thread-local allocation.
5679 * doc/README.win32: Adjust GC_win32_dll_threads rules again.
5681 * mark.c (GC_mark_some wrapper): Restructure for readability, handle
5682 GC_started_thread_while_stopped.
5683 * misc.c (Win32 GC_write): Lock GC_write_cs only if needed.
5684 * win32_threads.c: (client_has_run): remove,
5685 GC_started_thread_while_stopped, GC_attached_thread: add.
5686 (GC_push_all_stacks): Add verbose output.
5687 (DllMain): Avoid initializing collector or the like.
5688 Never update both thread tables.
5689 * doc/README.win32: Adjust GC_win32_dll_threads rules.
5691 * pthread_stop_world.c (GC_push_all_stacks): Print thread count with
5692 GC_PRINT_VERBOSE_STATS.
5694 * configure.ac: Comment out redundant
5695 AC_DEFINE(NO_EXECUTE_PERMISSION).
5696 * sparc_mach_dep.S: Remove single quote in comment.
5697 * include/private/gcconfig.h: Fix DATAEND for NONSTOP.
5698 * win32_threads.c: Include stdint.h for Mingw.  Add GC_API for DllMain.
5699 (GC_use_DllMain): Fix assertion.
5701 * configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin.
5702 * Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc.
5703 * include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin
5704 targets. Remove comments.
5705 Prepare ppc64 support for Darwin.
5707 * darwin_stop_world.c (GC_push_all_stacks): Fix compiler warnings.
5708 Make i unsigned.
5709 (GC_stop_world): Likewise. Remove unused GC_thread p.
5710 (GC_start_world): Likewise.
5712 * os_dep.c: Define GC_darwin_register_mach_handler_thread extern.
5713 Remove double SIG_HNDLR_PTR definition.
5714 (GC_forward_exception): Fix compiler warnings, make i unsigned.
5715 Initialize thread_state to NULL.
5716 (catch_exception_raise): Fix compiler warnings, make i unsigned.
5718 * include/private/gc_priv.h (NEED_FIND_LIMIT, FREEBSD variant):
5719 also define for X86_64.
5720 * configure.ac: Move generic gnu (Hurd) case to below kfreebsd case.
5721 * README.changes: Point to ChangeLog.
5723 * darwin_stop_world.c: Move THREAD_FLD defines to ...
5724 * include/private/gc_priv.h: ... here.
5725 Fix THREAD_STATE definitions for ppc64.
5726 * os_dep.c (catch_exception_raise): Use THREAD_FLD for exc_state member
5727 access.
5729 * configure.ac (i586-darwin): Replaced HAS_I386_THREAD_STATE_* with
5730 HAS_X86_THREAD_STATE32_*.
5731 (x86_64-*-darwin*): Extended the above check for x86_64-*-darwin* with
5732 HAS_X86_THREAD_STATE64_*.
5733 Added value 1 in the above AC_DEFINE's. Important for the upcoming
5734 Leopard.
5735 * include/private/gcconfig.h: Modified X86_64 define for Darwin.
5736 Removed __x86_64__ check in POWERPC section. Added base definitions
5737 for the X86_64 Darwin port.
5738 * include/private/gc_priv.h: Added GC_MACH_HEADER and GC_MACH_SECTION
5739 to distinguish between 32 and 64-bit applications. Added definitions
5740 for X86_64 Darwin.
5741 * darwin_stop_world.c: Added HAS_X86_THREAD_STATE64___RAX. And
5742 replaced HAS_I386_THREAD_STATE___EAX with HAS_X86_THREAD_STATE32___EAX.
5743 (GC_push_all_stacks): Added code for X86_64 Darwin. Even for the
5744 !DARWIN_DONT_PARSE_STACK. Maybe obsolete.
5745 * dyn_load.c (GC_dyld_name_for_hdr): Use GC_MACH_HEADER.
5746 (GC_dyld_image_add): Use GC_MACH_HEADER and GC_MACH_SECTION.
5747 Distinguish between getsectbynamefromheader_64 and
5748 getsectbynamefromheader.
5749 * os_dep.c (catch_exception_raise): Introduce exception definition for
5750 X86_64 Darwin. Replaced old i386_EXCEPTION_STATE_* definition with
5751 x86_EXCEPTION_STATE32_*. Add X86_64 for exc_state.faultvaddr.
5754 == [7.0alpha7] 2006-09-19 ==
5756 * More 6.7 changes.
5757 * Declare GC_dump() in gc.h.
5758 * Add --enable-large-config, which just defines the LARGE_CONFIG macro.
5759 * Make GlobalAlloc address alignment a bit more intuitive.
5760 * Use #elif in the definitions of GET_MEM.
5761 * Overhaul porting.html.  Remove corresponding text from README.
5762 * Fix typo in DARWIN section of gcconfig.h.
5763 * Fix Darwin thread memory leak.
5764 * Update x86 AO_test_and_set implementation to use "=q".
5765 * Add $(EXEEXT) to many tests in tests/tests.am.  (Corresponds to a
5766 6.7 fix, which no longer applied.)
5767 * Fix Darwin/PPC port.
5768 * Fix Cygwin/threads port.
5769 * Fix gcj malloc support.
5770 * For GNU-style make, don't build libatomic_ops unless threads are requested.
5771 This should allow single-threaded builds on platforms which do not
5772 currently support libatomic_ops.
5773 * Clean up and hopefully fix the CFLAGS calculation for GNU build.
5774 (Substantially improves things on HP/UX.)
5775 * Integrated Andrei Polushin's Visual C++ patches.  These provide for
5776 stack traces, better C++ debug support, and better log file handling.
5777 Note that these change the location of the log file to a the path of the
5778 executable with a .log extension.  To get the old behavior back, define
5779 OLD_WIN32_LOG_FILE.  For the time being, I'm checking his project
5780 files and the like into a windows-untested subdirectory.  They
5781 are almost certainly already out of date, but better than what we had
5782 before.
5783 * Fixed some win32 threads bugs, and added support for _beginthreadex.
5784 * Fix zero size thread local allocation so that explicit deallocation
5785 works correctly.
5786 * Removed serious bug in GC_malloc_uncollectable(large size).
5787 * Do not try to do thread-local gcj allocation in incremental mode.  There
5788 are races in setting up the descriptor.
5789 * Add GC_INIT() to middle.c, fix some more GC_printfn calls.
5790 * Some assertions erroneously used I_HOLD_LOCK() negatively, even though
5791 it can now spuriously return TRUE.
5792 * Rename SUNOS5 macro and OS name to SOLARIS and SUNOS5DL to SOLARISDL.
5793 * On Linux and some Un*x variants, allocate memory by first trying sbrk,
5794 and then switching to mmap if that fails.
5795 * Fixed /proc/x/maps reading to deal with asynchronous deletions.
5796 * Fix REDIRECT_MALLOC with threads on Linux.  It now usually seems to work
5797 with ugly hacks that include having calloc behave differently when it is
5798 called from ld.so or the pthreads library.  A reasonable amount of
5799 infrastructure was added to support some of this.
5800 * Import various updated build scripts.
5801 * Add GC_register_has_static_roots_callback.
5802 * Fix serious bugs in GC_malloc_atomic_uncollectable().
5803 * Return GC_SUCCESS form GC_get_stack_base().
5804 * Fix several atomic_ops problems on IA64 with HP Compiler.
5805 * Update to atomic_ops-1.2.
5806 * Fix hb_n_marks description and reclaim.c assertion.
5807 * Various additional win32 threads fixes.
5808 * Enable GC_ASSERTIONS for Debug build with NT_THREADS_MAKEFILE.
5811 == [7.0alpha5] ==
5813 * More 6.6, 6.7 changes.
5814 * Some Solaris fixes, including some more general changes in how
5815 the assembly pieces of mach_dep.c are handled.
5816 * Removed a lot of SOLARIS_THREADS-specific code that was only
5817 needed with the old implementation.  This included many (mostly no-op)
5818 versions of GC_is_fresh.
5819 * Don't use atomic_ops in gc_locks.h unless we need threads.
5820 * Fixed USE_MARK_BITS, which is once again the default without PARALLEL_MARK.
5821 * Removed Solaris GC_INIT hack.  It's a workaround for a long dead bug,
5822 and it seemed to be wrong anyway.
5823 * Changed win32_threads.c to require preprocessor-based interception
5824 of thread routines by default.  A client call to GC_use_DllMain is
5825 now required to get the old behavior in which DllMain is used to implicitly
5826 register threads.  This was done for uniformity with other platforms, and
5827 because the DllMain solution seemed to require very tricky code which,
5828 at least in the past, imposed hard bounds on the number of threads.
5829 * Many small changes to make thread support work again on Cygwin.
5830 * Moved definition of allocator lock etc. to pthread_support.c and
5831 win32_threads.c for those two cases.
5832 * Got rid of the FASTLOCK() machinery.  It doesn't seem useful on modern
5833 platforms.
5834 * Cleaned up the uncollectable allocation routines, speeding up the
5835 slower paths.  The code did enough unnecessary work off the critical path
5836 that the underlying logic was getting hard to extract.
5837 * No longer turn off THREAD_LOCAL_ALLOC with DBG_HDRS_ALL.  Indications
5838 are it just works, and I think the reasons for it not working disappeared
5839 a while ago.
5840 * Fixed bugs in hb_n_marks calculation and assertion.
5841 * Don't use __builtin_expect for pre-3.0 gcc.
5842 * Define GWW_VDB only for recent Microsoft tool chains.
5843 * Add overview.html to doc directory.
5844 * Fix NT_STATIC_THREADS_MAKEFILE, various compiler warnings.
5845 * Made thread local allocation sort of work with Cygwin.  The code should
5846 be there to deal with other Windows variants, But non-Cygwin Windows
5847 threads need more bug fixes.
5850 == [7.0alpha4] ==
5852 * Various 6.5, 6.6 changes.
5853 * Removed GC_brief_async_signal_safe_sleep and used atomic_ops instead.
5854 * Integrated build patches from David Angelocola and Petter Urkedal.
5855 * Fix dynamic-linker-based pthread call redirection.
5856 * Renamed RS6000 to POWERPC/AIX.
5857 * Allow recovery from SIGSEGV in marker on Linux.  This works around
5858 a race in thread stack marking if /proc is used to find roots.  We do
5859 that by default with malloc redirection and threads.  This involved
5860 moving some GC_find_limit and SETJMP related declarations to gc_priv.h.
5861 * Added doc/porting.html file.
5862 * Added ADD_HEAP_GUARD_PAGES for sbrk/*nix platforms to debug extreme
5863 memory overwrite errors.
5864 * Added trivial NO_INCREMENTAL flag to facilitate debugging.
5865 * Added GC_getattr_np-based GC_get_stack_base (untested).
5866 * Separated thread local allocation into a separate file and added the
5867 beginning of win32 support for that.
5870 == [7.0alpha3] ==
5872 * Added support for dlopen-based interception of pthread functions.
5873 This is only half done.  The gc.h redefinitions currently interfere.
5874 * Integrated major automake overhaul from Petter Urkedal.
5877 == [7.0alpha2] ==
5879 * GC_bytes_allocd was incremented by a possibly uninitialized variable
5880 in GC_generic_malloc_inner.  (Bug introduced in gc7.0alpha1.)
5881 * Win32 fixes.
5882 * Integrated Ben Hutchings' GetWriteWatch-based virtual dirty bit
5883 implementation for win32.
5884 * Removed pc_gc.tar and floppy targets in Makefile.direct.  Removed
5885 pc_excludes file.
5886 * No longer include GC_bytes_wasted when evaluating allocation progress.
5887 Since we are now counting live memory, it no longer makes sense.
5888 * Applied Davide Angelocola's configure patch.  There are now separate
5889 Makefile.am's in the cord and tests subdirectory, more tests, etc.
5890 * Renamed configure.in to configure.ac.
5891 * Merged a very small number of Nathanael Nerode's configure.ac
5892 cleanups from the gcc tree.  Unfortunately, that file is a bit
5893 different from ours.
5894 * Changed EINTR handling in sem_wait slightly.
5895 * Restructure the root marking code.  Remove all traces of
5896 USE_GENERIC_PUSH_REGS, and effectively make it the default.
5897 Make it easier to pass a context pointer to the mark routine, in
5898 case we ever want to do precise stack marking.
5899 * Replace GC_start_blocking() and GC_end_blocking() with GC_do_blocking().
5900 This remains undocumented, and only implemented for pthreads.  But it
5901 removes an otherwise unavoidable race with stores of callee-save
5902 registers.
5903 * Fix GC_n_mark_bits for the default MARK_BIT_PER_GRANULE case.  This
5904 resulted in bogus complaints in heap dumps.
5905 * Upgrade to libatomic_ops-1.0, and update build structure to match.
5906 * Remove SRC_M3 support. Clean up lock initialization code in misc.c.
5907 * Removed gc_local_alloc.h.  If THREAD_LOCAL_ALLOC is defined, the
5908 thread local allocation routines are now called automatically.
5909 * Renamed gc_inl.h back to gc_inline.h.  Changed the interface appreciably
5910 since locking has turned into a dominant issue, and in-line allocation
5911 only makes sense if it's no worse than thread-local allocation.
5912 Gc_inline.h is now also used to implement thread-local allocation.
5913 * Finished replacing stubborn allocation with manual write barrier.
5914 Untested.
5915 * Use thread-local allocation code by default.
5916 * Added GC_register_my_thread and friends for Posix and win32.
5917 * Patch for GWW_VDB from Ben Hutchings.
5918 * Removed explicit THREAD_LOCAL_ALLOC tests, since that now always
5919 redefines GC_malloc.
5920 * Removed now unused AIX memory allocation code.
5921 * Various minor fixes for bugs introduced in 7.0alpha1.
5924 == [7.0alpha1] ==
5926 * Remove GC_PROTO, VOLATILE, GC_PTR, and GC_CONST.  Assume ANSI C compiler
5927 and use ANSI constructs unconditionally.
5928 * Introduce #elif and #error in some of the appropriate places.
5929 * Remove GC_printf cruft. Use stdargs.
5930 * Remove separate Solaris threads support.  Use the more generic Posix
5931 implementation.
5932 * Use atomic_ops for atomic operations and memory barriers.
5933 * Clean up MPROTECT_VDB implementation.  Use SA_SIGINFO wherever
5934 possible.
5935 * Remove broken SIGNALS stuff.
5936 * Use size_t instead of word, where appropriate.
5937 * Add .S.o rule to Makefile.am.
5938 * Officially discontinue SunOS4, several old flavors of M68K (SunOS4,
5939 A/UX, HP), IBM PC/RTs and RISCOS/Irix4.  (I doubt the old code worked.
5940 If anyone cares, these should be easy to resurrect.)
5941 * Add EXPECT() in some critical places.
5942 * Redefined hb_sz and hb_body to deal with bytes rather than words.
5943 This affected a great deal of code.  I would like to consistently use
5944 byte offsets and sizes where there's not a convincing reason to do
5945 otherwise.
5946 * Redefined several other variables (GC_mem_found, GC_words_allocd)
5947 etc. to use units of bytes.  Most of these were also renamed to
5948 reflect that fact.
5949 * Killed as many "register" declarations as possible.
5950 * Partially replaced stubborn allocation with manual write barrier.
5951 It's currently broken.
5952 * Restructured mark code, to allow mark bits to be kept either on
5953 a per allocation granule or per object basis.  The emphasis is
5954 now on the -DUSE_MARK_BYTES option, since individual bits perform
5955 quite badly on hyper-threaded P4s, and are probably suboptimal on
5956 other architectures.  -DUSE_MARK_BITS is currently broken, and may
5957 be resurrected only for the single-threaded case.  This significantly
5958 reduced the cache footprint required by auxiliary GC data structures.
5959 It also reduces space overhead for small heaps.  It probably slows
5960 things down slightly if interior pointers are very common.
5961 * As part of the above, we now maintain an approximate count of set
5962 mark bits in each heap block.
5963 * As part of the above, the semantics of hb_map changed drastically.
5964 For MARK_BIT_PER_OBJ, it doesn't exist.  For MARK_BIT_PER_GRANULE,
5965 it is purely a way to replace a mod instruction with a table lookup.
5966 (Somewhat to my surprise, this still wins on modern hardware.)
5967 * Removed PRINTSTATS, GATHERSTATS, and SILENT macros.  Everything is
5968 now controlled by GC_print_stats variable and GC_PRINT_STATS
5969 and new GC_PRINT_VERBOSE_STATS environment variables.
5970 * Add GC_log_printf and use it consistently for logging output.
5971 * Unconditionally count the objects we reclaim in the sweep phase.
5972 For thread local allocation, we need that anyway, and we expect
5973 that's increasingly the only case that matters.  And it simplifies
5974 the code.  In general expect minor performance hacks that benefit
5975 only the single-threaded case to disappear.
5976 * Remove GC_quiet from gc.h and elsewhere.
5977 * Changed the heap expansion heuristic, and the definition of
5978 GC_free_space_divisor, to refer to live data size, instead of total
5979 heap size.  I believe this is much more robust.  It wasn't previously
5980 possible, because we didn't have access to live data size.
5981 * Thread local allocation added the extra byte in twice: Once in
5982 thread_local_alloc, and once in malloc_many.
5983 * Removed GC_malloc_words_small and GC_gcj_fast_malloc.  A new
5984 mechanism based on the thread local allocation data structures
5985 is expected to be added instead.  This should allow inlined code
5986 that is both fast and doesn't rely on collector internals.
5987 * Changed both free lists and reclaim lists to be indexed by granules
5988 instead of words, norming halving their size.
5989 * MERGE_SIZE is now the only option, and the macro was removed.
5990 (Without it, we need a memory reference to GC_all_interior_pointers
5991 anyway.  Thus it costs us nothing.)
5992 * Change GC_size_map to map to granules instead of words.  Make sure
5993 that every possible size up to TINY_FREELISTS is present.
5994 * Split of macros need for fast inline allocation into gc_tiny_fl.h
5995 in anticipation of a new inline allocator that doesn't rely on GC
5996 internals.
5997 * Changed thread local allocation to use GRANULE_BYTES and TINY_FREELISTS
5998 in anticipation of a merge with the inline allocation code.
5999 * Removed ALIGN_DOUBLE.  This is mostly handled by GRANULE_BYTES.
6000 * Make locking on most platforms conditional on GC_need_to_lock.
6003 == [6.9] ==
6005 * Fix typo in PREFETCH implementation for X86_64.
6006 * Fix M68K LINUX port.
6007 * __GNUC__ was misspelled as __GNUC in new_gc_alloc.h.
6008 * Integrated Allan Hsu's patch for OS X VM deallocation problems.
6009 * Applied FreeBSD/X86_64 patch.
6012 == [6.8] ==
6014 * Added some support for Dragonfly BSD.
6015 * Improvements to the HP/UX section of configure.in/configure.ac.
6016 * GC_unix_get_mem could neglect to release the malloc lock on Irix, under
6017 extremely unlikely circumstances.
6018 * Added support for kFreeBSD + glibc
6019 * Fix more MacOS threads memory leaks
6020 * Added initial Solaris/X86-64 support
6023 == [6.7] ==
6025 * Add "int" to Solaris "end" and "etext" declaration in gc.h.  Declared
6026 the symbols with underscores and as arrays, since that's what's actually
6027 used.  Perhaps this could all just be removed.
6028 * Fixed ARM GC_test_and_set code.
6029 * Added casts for assignments to hb_last_reclaimed, which truncate the
6030 value.  Added a cast to GC_adj_words_allocd.  Use GetModuleHandleA
6031 when retrieving a handle to kernel32.dll under win32.
6032 * Added Tandem S-Series support.
6033 * Remove spurious gc:: qualifier for operator delete[] in gc_cpp.h.
6034 * Changed a test for LINUX in config_macros.h to one for __linux__.
6035 * Add prototypes for GC_finalizer_notifier and GC_thr_init.
6036 * Use ld instead of nonexistent ldz instruction in Darwin FindTopOfStack.
6037 * Add support for Darwin/X86.
6038 * Merge in some recent gcc fixes.  Add ppc64 asm code.
6039 * Scan MEM_PRIVATE sections under Windows ME and predecessors.
6040 * Interior pointers with some largish offsets into large objects could
6041 be ignored, if GC_all_interior_pointers was set.  (Oddly this worked
6042 correctly for stack references if it was not set.  Otherwise it failed
6043 for both stack and heap references.)
6044 * Integrated Tatsuya Bizenn's NETBSD threads support, with some
6045 untested changes.
6046 * Added GC_strdup and friends to make leak detection work correctly
6047 for strdup clients.  Fixed the existing strdup
6048 with malloc redirection to handle a null malloc return correctly.
6051 == [6.6] ==
6053 * Fix CPU count detection for Irix and FreeBSD.
6054 * Integrate Dan Bonachea's patch for the IBM XLC compiler on Darwin.
6055 * Integrated Andreas Tobler's FreeBSD/PowerPC patch.
6056 * Don't access the GC thread structure from the restart handler.  It's
6057 unsafe, since the handler may run too late.
6058 * Applied Christian Thalinger's patch to change comment syntax in
6059 alpha_mach_dep.S.
6060 * Added test for GC_no_dls in GC_dyld_image_add for DARWIN.
6061 * Use LINUX_STACKBOTTOM for Linux/SH and LINUX/ARM.
6062 * Rewrote GC_parse_map_entry.  This assumed a fixed column layout of
6063 /proc/self/maps on Linux.  This ceased to be true about 2 years ago.
6064 The old code is probably quite problematic with -DREDIRECT_MALLOC.  It
6065 is also used by default for IA64, though I haven't seen actual failures
6066 there.
6067 * More consistently define HBLKSIZE to 4096 on 64 bit architectures with
6068 4K pages.
6069 * With win32 threads, GC_stop_world needs to acquire GC_write_cs.
6070 * Move up struct callinfo declaration to make gcc 4.0.2. happy.
6073 == [6.5] ==
6075 * Integrated Paolo Molaro's patch to deal with EINTR in sem_wait.
6076 * Make GC_approx_sp() write to dummy location to ensure that stack
6077 is grown here, when sp looks reasonable, rather than later, when
6078 it might look like a bad memory reference.  (Problem was never
6079 observed that I know of.  But on rereading the code it seemed
6080 dubious.)
6081 * Separate out GC_with_callee_saves_pushed and sometimes call
6082 it from GC_suspend_handler in pthread_stop_world.c.  Callee-save
6083 register values sometimes failed to get traced under HP/UX on
6084 PA-RISC.  Linux/IA64 had the same problem, though non-stacked
6085 callee-save registers seem to be so rarely used there that nobody
6086 ever noticed.
6087 * Integrated an ancient Darwin powerpc_darwin_machine_dep.s patch
6088 from Andreas Tobler, which I had lost.
6089 * Fix compare_and_exchange implementation for gcc/IA64 to deal with
6090 pickier compiler versions.
6091 * Fixed Itanium 32-bit ABI support (HP/UX).  In particular, the
6092 compare_and_exchange implementation didn't consider that possibility.
6093 * Undefine GC_pthread_detach in win32_threads.c.
6094 * Fixed inclusion of frame.h for NETBSD in os_dep.c.
6095 * Applied Dan Bonachea's patch to use mmap on AIX.
6096 * Several fixes to resurrect the Irix port on recent OS versions.
6097 * Change ALPHA to use LINUX_STACKBOTTOM.
6098 * Change SPARC64/LINUX to also use LINUX_STACKBOTTOM.  Deal with potential
6099 bad values of __libc_stack_end on that platform.
6100 * Relax gctest to allow larger heap if ALIGN_DOUBLE isn't set.
6101 (Unnecessary in 7.0)
6102 * Force a define of __STDC__=0 for the IBM compiler on AIX, so that
6103 we get prototypes.  (Unnecessary in 7.0)
6104 * GC_INIT definition for AIX and CYGWIN referred to DATASTART and DATAEND
6105 which are only defined in private include files.
6106 * Integrated some small gcconfig.h patches from Dan Bonachea.  Also
6107 relaxed assertion about FreeBSD stack size in pthread_support.c.
6108 * Integrated Andrew Begel's darwin_stop_world.c patch for 64-bit
6109 support.  This may need additional work.
6110 * Avoided potentially infinite recursion in GC_save_callers if
6111 the system backtrace calls malloc.  The workaround currently requires
6112 __thread support if this code is used with threads.
6113 * Avoided another similar infinite recursion by conditionally
6114 invoking GC_save_callers in alloc.c.
6115 * Removed all traces of aix_irix_threads.c.  AIX and Irix now use
6116 pthread_support.c and pthread_stop_world.c.  The old code appeared
6117 to be unreliable for AIX, and was not regularly maintained.
6118 * On Irix, ignore segments with MA_FETCHOP or MA_NOTCACHED attributed;
6119 they're not always safe to read.
6120 * Fixed a previously vacuous assertion (diagnosed by the SGI compiler)
6121 in GC_remove_from_fl.
6122 * Fix stack_size assertion in GC_pthread_create.
6123 * Fix assertion in GC_steal_mark_stack.
6126 == [6.4] ==
6128 * Merge gcconfig.h changes from gcc tree.
6129 * Unconditionally include gc_priv.h in solaris_pthreads.c, win32_threads.h,
6130 aix_irix_threads.c, and solaris_threads.c to get thread definitions.
6131 * Start marker threads in GC_thr_init, so that they get started even
6132 if no other threads are ever started.  (Oddly enough, the parallel
6133 collector worked correctly, though not well, with no helper threads.)
6134 * Go ahead and split large blocks in GC_allochblk_nth if GC_dont_gc
6135 is set.
6136 * GC_PRINT_BACK_HEIGHT would deadlock with thread support.
6137 * Let in_progress_space in backgraph.s grow dynamically.
6138 * Fix README.solaris2.  The GC_thr_init() hack doesn't work anymore.
6139 * Convert GC_finalizer_mem_freed to bytes in allchblk.c.
6140 * Add missing declaration for GC_generic_malloc_words_small_inner.
6141 Without it, s390x breaks.
6142 * Applied several MacOSX patches to support older tool chains.
6143 * Bug fix for NetBSD/amd64.  Add NetBSD/sh3 support.
6144 * Fixed an uninitialized variable in cordprnt.c.
6145 * Eliminated some, but not all, gcc -Wall warnings.
6146 * Changed some old style casts to reinterpret_cast in new_gc_alloc.h.
6147 * GC_extend_size_map shouldn't adjust for GC_all_interior_pointers if
6148 GC_DONT_ADD_BYTE_AT_END is set.
6149 * Changed some (long) casts to (word) in preparation for win64.
6150 * Changed "int stack_size" declaration in pthread_support.c to use
6151 size_t.  (Only mattered with GC_ASSERTIONS enabled.)
6152 * Added CRIS (etrax) support.
6153 * Removed GC_IGNORE_FB frame buffer recognition, and replaced
6154 it with a check that the mapping type is MEM_IMAGE.
6155 In theory, this should work much better, but it is a high
6156 risk change for win32.
6157 * GC_allochblk_nth incremented GC_words_wasted by bytes rather than
6158 words.
6159 * Consider GC_words_wasted in GC_adj_words_allocd only if it is within
6160 reason.  (A hack to avoid some extremely unlikely scenarios in which
6161 we manage to allocate only "wasted" space.  7.0 has a better fix.)
6162 * Changed PowerPC GC_clear implementation to use lwsync instead of
6163 eieio, since the documentation recommends against eieio, and
6164 it seems to be incorrect if the preceding memory op is a load.
6165 * Fixed print_block_list to print the correct kind number for
6166 STUBBORN.
6167 * Have configure.in generate an error if it is asked to support
6168 pthreads, but doesn't know how to.
6169 * Added Kazuhiro Inaoka's patch for Renesas M32R support.
6170 * Have the GNU build mechanism link with -ldl.  Rename THREADLIBS
6171 to THREADDLLIBS to reflect this.
6172 * Added Hannes Mehnert's patch for FreeBSD/SPARC support.
6173 * Merged some FreeBSD specific patches to threadlibs.c and dyn_load.c.
6174 * Define MPROTECT_VDB on MACOSX only if threads are being used, since the
6175 dirty page tracking mechanism uses threads.  (This avoids an undefined
6176 reference to _GC_darwin_register_mach_handler_thread.)
6177 * By popular demand, use __libc symbols only if we are built with
6178 USE_LIBC_PRIVATES, which is off by default, and not otherwise documented.
6179 * Ignore GC_enable_incremental() requests when KEEP_BACK_PTRS is set.
6180 The GC itself will dirty lots of pages in this cases, probably making
6181 it counterproductive on all platforms.  And the DARWIN port crashes.
6184 == [6.3] ==
6186 * Compile test_cpp.cc with CXXCOMPILE instead of COMPILE.
6187 * Very large allocations could cause a collector hang.  Correct
6188 calculation of GC_collect_at_heapsize.
6189 * GC_print_hblkfreelist printed some bogus results if USE_MUNMAP
6190 was defined.
6191 * Include gc_config_macros.h in threadlibs.c.
6192 * Correct MacOSX thread stop code.
6193 * SMALL_OBJ definition was off by one.  This could cause crashes
6194 at startup.
6195 * Integrate Paolo Molara's patch to deal with a race in the Darwin
6196 thread stopping code.
6197 * Changed X86_64 implementation to use SA_SIGINFO in the MPROTECT_VDB
6198 implementation.  The old approach appears to have been broken by
6199 recent kernels.
6200 * Added GC_ATTR_UNUSED to eliminate a warning in gc_allocator.h.
6201 * Fix GC_task_self declaration in os_dep.c.
6202 * Increase INITIAL_BUF_SZ in os_dep.c for Solaris /proc reads.
6205 == [6.3alpha6] ==
6207 * Define USE_GENERIC_PUSH_REGS for NetBSD/M68K.
6208 * Fixed the X86_64 PREFETCH macros to correctly handle ia32e (which uses
6209 different prefetch instructions from AMD64).
6210 * GC_config_macros.h did not correctly define GC_WIN32_THREADS from
6211 GC_THREADS.
6212 * Added simple_example.html.
6213 * Merged Andrew Gray's patch to correctly restore signal handlers on
6214 FreeBSD.
6215 * Merged a patch from Andreas Jaeger to deal with prefetch-related warnings
6216 on x86-64.  Added some other casts so that the PREFETCH macros
6217 always get a ptr_t argument.  Removed some casts in the PREFETCH
6218 implementations.
6219 * Added a header guard for gc_allocator.h
6220 and changed GC_debug_free to clobber contents of deallocated object.
6221 * The signal masking code in pthread_stop_world.c contained some errors.
6222 In particular SIGSEGV was masked in the handler, in spite of the fact that
6223 it wrote to the heap.  This could lead to an uncaught SIGSEGV, which
6224 apparently became much more likely in Linux 2.6.  Also fixed some
6225 typos, and reduced code duplication in the same area.
6226 * Remove ltconfig, clean up configure messages for DGUX.
6227 * Integrated NetBSD/OpenBSD patches from Marc Recht and Matthias Drochner.
6230 == [6.3alpha5] ==
6232 * Fix & vs && typo in GC_generic_malloc and
6233 GC_generic_malloc_ignore_off_page.  (Propagated from the gcc tree.)
6234 * Removed SA_NODEFER hack from NetBSD and Solaris write-protect handler.
6235 (According to Christian Limpach, the NetBSD problem is fixed.
6236 Presumably so is the Solaris 2.3 problem.)
6237 * Removed placement delete from gc_cpp.h for the SGI compiler.
6238 * Changed semantics of the GC_IGNORE_FB environment variable.
6239 We still need help in identifying win32
6240 graphics memory mappings.  The current "solution" is a hack.
6241 * Removed "MAKEOVERRIDES =" from Makefile.am and thus Makefile.in.
6242 It probably made more sense in the gcc context.
6243 * Explicitly ensure that NEED_FIND_LIMIT is defined for {Open,Net}BSD/ELF.
6244 * Replaced USE_HPUX_TLS macro by USE_COMPILER_TLS, since gcc often
6245 supports the same extension on various platforms.
6246 * Added some basic (completely untested) defines for win64, in support
6247 of future work.
6248 * Declared GC_jmp_buf in os_dep.s as JMP_BUF instead of jmp_buf, fixing
6249 a memory overwrite bug on Solaris and perhaps other platforms.
6250 * Added 0 != __libc_stack_end test to GC_linux_stack_base.
6251 Otherwise pre-linking could cause the collector to fail.
6252 * Changed default thread local storage implementation to USE_PTHREAD_SPECIFIC
6253 for HP/UX with gcc.  The compiler-based implementation appears to work
6254 only with the vendor compiler.
6255 * Export GC_debug_header_size and GC_USR_PTR_FROM_BASE from gc_mark.h,
6256 making client mark code cleaner and less dependent on GC version.
6257 * Export several new procedures and GC_generic_malloc from gc_mark.h
6258 to support user-defined kinds.  Use the new procedures to replace existing
6259 code in gcj_mlc.c and typd_mlc.c.
6260 * Added support for GC_BACKTRACES.
6261 * Fixed a remaining problem in CORD_str with signed characters.
6262 * Removed supposedly redundant, but very buggy, definitions of finalizer
6263 macros from javaxfc.h.  Fortunately this file probably has no users.
6264 The correct declarations were already in gc.h.
6265 * Also need to set GC_in_thread_creation while waiting for GC during
6266 thread termination, since it is also possible to collect from an
6267 unregistered thread in that case.
6268 * Define NO_GETENV for Windows CE, since getenv doesn't appear to exist.
6269 Plus some other minor WinCE fixes.
6270 * Added GC_register_describe_type_fn.
6271 * Arrange for debugging finalizer registration to ignore non-heap
6272 registrations, since the regular version of the routine also behaves
6273 that way.
6274 * GC_gcj_malloc and friends need to check for finalizers waiting to be run.
6275 One of the more obscure allocation routines with missing a LOCK() call.
6276 * Fixed cvtres invocations in NT_MAKEFILE and NT_STATIC_THREADS_MAKEFILE
6277 to work with VS.NET.
6278 * Cleaned up GC_INIT calls in test.  Updated gc.man to encourage GC_INIT
6279 use in portable code.
6280 * Taught the GC to use libunwind if --enable-full-debug is specified on
6281 IA64 and libunwind is present.
6282 * The USE_MUNMAP code could get confused about the age of a block and
6283 prematurely unmap it.  GC_unmap_old had a bug related to wrapping of
6284 GC_gc_no.  GC_freehblk and GC_merge_unmapped didn't maintain
6285 hb_last_reclaimed reasonably when blocks were merged.  The code was
6286 fixed to reflect original intent, but that may not always be an
6287 improvement.
6290 == [6.3alpha4] ==
6292 * USE_MMAP was broken by confusion in the code dealing with USE_MMAP_ANON.
6293 * Darwin support was broken in alpha3 as a result of my mis-integration of
6294 Andrew Begel's patches.  Fixed with another patch from Andrew Begel.
6295 * A new sanity check in pthread_stop_world.c:GC_push_all_stacks() was
6296 overly aggressive.  We may collect from an unregistered thread during
6297 thread creation.  Fixed by explicitly checking for that case.  (Added
6298 GC_in_thread_creation.)
6301 == [6.3alpha3] ==
6303 * Removed -DSMALL_CONFIG from BCC_MAKEFILE.
6304 * Changed macros to test for an ARM processor (Patch from Richard Earnshaw.)
6305 * Mostly applied a DJGPP patch from Doug Kaufman.  Especially Makefile.dj
6306 had suffered from serious bit rot.
6307 * Rewrote GC_apply_to_maps, eliminating an off-by-one subscript error,
6308 and a call to alloca (for lcc compatibility).
6309 * Changed USE_MUNMAP behavior on POSIX platforms to immediately remap
6310 the memory with PROT_NONE instead of unmapping it.  The latter risks
6311 an intervening mmap grabbing the address space out from underneath us.
6312 Updated this code to reflect a cleaner patch from Ulrich Drepper.
6313 * Replaced _T with _Tp in new_gc_alloc.h to avoid a MACOS X conflict.
6314 (Patch from Andrew Begel.)
6315 * Dynamically choose whether or not lock should spin on win32.
6316 This may be a significant performance improvement for win32.
6317 * Fix Makefile.direct to actually include NT_STATIC_THREADS_MAKEFILE
6318 in the distribution.
6319 * Maybe_install_looping_handler() was accidentally exported, violating
6320 our name space convention.
6321 * Made os_dep.c use sigsetjmp and SA_NODEFER for NetBSD.
6322 * Integrated Andrew Begel's Darwin threads patch, adjusted according to
6323 some of Fergus Hendersons's comments.  (Patch didn't apply cleanly,
6324 errors are possible.)
6325 * Added another test or two for the Intel 8.0 compiler to avoid
6326 confusing it with gcc.  The single-threaded collector should now build
6327 with icc, at least on ia64.
6330 == [6.3alpha2] ==
6332 * Re-enabled I_HOLD_LOCK assertion in aix_irix_threads.h.
6333 * Put back the WINABI qualifier for GC_CreateThread.
6334 * Sometimes explicitly define __private_extern__ before DARWIN dyld.h
6335 include.
6336 * Included signal.h from pthread_support.c.  Removed GC_looping_handler,
6337 which was dead code.
6338 * GC_find_start was misdeclared by gc_pmark.h if PRINT_BLACK_LIST was
6339 defined.
6340 Changed GC_find_start to never just return 0.  According to its
6341 comment it doesn't, and it's unclear that's correct.
6342 * GC_alloc_large had several largely compensating bugs in the
6343 computation of GC_words_wasted.  (It was confused about bytes vs.
6344 words in two places.)
6345 * Integrated Slava Sysoltev's patch to support more recent versions of
6346 the Intel compiler on IA64/Linux.
6347 * Changed win32 spinlock initialization to conditionally set a spin count.
6348 (Emmanual Stumpf pointed out that enabling this makes a large performance
6349 difference on win32 multiprocessors.)  Also cleaned up the win32 spinlock
6350 initialization code a bit.
6351 * Fixed thread support for HP/UX/IA64.  The register backing store base for
6352 the main thread was sometimes not set correctly.
6353 * Added -DEMPTY_GETENV_RESULTS flag to work around Wine problem.
6354 * Declare GC_stack_alloc and GC_stack_free in solaris_threads.h to
6355 avoid 64-bit size mismatches.
6356 * Fixed GC_generic_push_regs to avoid a potential and very unfortunate
6357 tail call optimization.  This could lead to prematurely reclaimed
6358 objects on configurations that used the generic routine and the new
6359 build infrastructure (which potentially optimizes mach_dep.c).
6360 This was a serious bug, but it's unclear whether it has resulted in
6361 any real failures.
6362 * Fixed CORD_str to deal with signed characters.
6363 * Merged a couple of NOSYS/ECOS tests into os_dep.c from gcj.
6364 * Partially merged a win32 patch from Ben Hutchings, and substantially
6365 revised other parts of win32_threads.c.  It had several problems.
6366 Under MinGW with a statically linked library, the main thread was
6367 not registered.  Cygwin detached threads leaked thread descriptors.
6368 There were several race conditions.  For now, unfortunately the
6369 static threads limit remains, though we increased it, and made table
6370 traversal cost depend on the actual thread count.
6371 There is also still some code duplication with pthread_support.c.
6372 (Thread descriptors did become much smaller, since Ben Hutchings
6373 removed the thread context from them.)
6374 * Integrated a Solaris configure.in patch from Rainer Orth.
6375 * Added GC_IGNORE_FB and associated warning to very partially address
6376 the issue of the collector treating a mapped frame buffer as part
6377 of the root set.
6380 == [6.3alpha1] ==
6382 * Integrated some NetBSD patches forwarded to me by Marc Recht.  These
6383 were already in the NetBSD package.
6384 * GC_pthread_create waited for the semaphore even if pthread_create failed.
6385 Applied the analogous fix for aix_irix_threads.c.
6386 * Added Rainer Orth's Tru64 fixes.
6387 * The check for exceeding the thread table size in win32 threadDetach
6388 was incorrect.
6389 * Applied Andrew Begel's patch to correct some reentrancy issues
6390 with dynamic loading on Darwin.
6391 * GC_CreateThread() was neglecting to duplicate the thread handle in
6392 the table.
6393 * Pass +ESdbgasm only on PA-RISC machines with vendor compiler.
6394 * Applied more AIX threads patches from Scott Ananian.
6397 == [6.2] ==
6399 * Integrated a second round of Irix/AIX patches from Dan Bonachea.
6400 Renamed mips_sgi_mach_dep.S back to mips_sgi_mach_dep.s, since it requires
6401 the Irix assembler to do the C preprocessing; gcc -E doesn't work.
6402 * Fixed Makefile.direct for DARWIN.
6403 * There was a race between GC_pthread_detach and thread exit that could
6404 result in a thread structure being deallocated by GC_pthread_detach
6405 even though it was still needed by the thread exit code.
6406 * Fixed version parsing for non-alpha versions in acinclude.m4 and
6407 version checking in version.h.
6410 == [6.2alpha6] ==
6412 * There was an extra underscore in the name of GC_save_registers_in_stack
6413 for NetBSD/SPARC.
6414 * Integrated Brian Alliet's patch for Darwin.  This restructured the
6415 linuxthreads/pthreads support to separate generic pthreads support
6416 from more the system-dependent thread-stopping code.  I believe this
6417 should make it easier to eliminate the code duplication between
6418 pthreads platforms in the future.  The patch included some other
6419 code cleanups.
6420 * Integrated Dan Bonachea's patch to support AIX threads.  This required
6421 substantial manual integration, mostly due to conflicts with other
6422 recent threads changes.  It may take another iteration to
6423 get it to work.
6424 * Removed HPUX/PA-RISC support from aix_irix_threads.c.  It wasn't used
6425 anyway and it cluttered up the code.  And anything we can do to migrate
6426 towards generic pthreads support is a good thing.
6427 * Added a more explicit test for tracing of function arguments to test.c.
6428 * Added Akira Tagoh's PowerPC64 patch.
6429 * Fixed some bit rot in the Cygwin port.
6430 gc.h now includes just windows.h, not winbase.h.
6431 * Declared GC_save_regs_in_stack() in gc_priv.h.  Remove other declarations.
6432 * Changed --enable-cplusplus to use automake consistently.  The old way
6433 confused libtool.  "Make install" didn't work correctly for the old version.
6434 Previously --enable-cplusplus was broken on cygwin.
6435 * Changed the C version of GC_push_regs to fail at compile time if it is
6436 generated with an empty body.  This seems to have been the cause of one
6437 or two subtle failures on unusual platforms.  Those failures should
6438 now occur at build time and be easily fixable.
6441 == [6.2alpha5] ==
6443 * GC_invoke_finalizers could, under rare conditions, set
6444 GC_finalizer_mem_freed to an essentially random value.  This could
6445 possibly cause unbounded heap growth for long-running applications
6446 under some conditions.  (The bug was introduced in 6.1alpha5, and
6447 is not in gcc3.3.)
6448 * Attempted to sanitize the various DLL macros.  GC_USE_DLL disappeared.
6449 GC_DLL is used instead.  All internal tests are now on GC_DLL.
6450 README.macros is now more precise about the intended meaning.
6451 * Include DllMain in the multithreaded win32 version only if the
6452 collector is actually built as a dll.
6453 * Hide the cygwin threadAttach/Detach functions.  They were violating our
6454 namespace rules.
6455 * Fixed an assertion in GC_check_heap_proc.  Added GC_STATIC_ASSERT.
6456 * Removed some obsolete definitions for Linux/PowerPC in gcconfig.h.
6457 * CORD_cat was not rebalancing unbalanced trees in some cases, violating
6458 a CORD invariant.  Also tweaked the re-balancing rule for
6459 CORD_cat_char_star.
6460 * Added hand-coded structured exception handling support to mark.c.
6461 This should enable support of dynamic libraries under win32 with
6462 gcc-compiled code.
6463 Turned on dynamic library scanning for win32/gcc.
6464 * Removed some remnants of read wrapping.
6465 GC_USE_LD_WRAP ws probably broken in recent versions.
6466 * The build could fail on some platforms since gcconfig.h could include
6467 declarations mentioning ptr_t, which was not defined, e.g. when if_mach
6468 was built.  Also
6469 cleaned up tests for GC_PRIVATE_H in gcconfig.h a bit.
6470 * The GC_LOOP_ON_ABORT environment variable interfered with incremental
6471 collection, since the write fault handler was erroneously overridden.
6472 Handlers are now set up in the correct order.
6473 * It used to be possible to call GC_mark_thread_local_free_lists() while
6474 the world was not stopped during an incremental GC.  This was not safe.
6475 Fortunately, it was also unnecessary.  Added GC_world_stopped flag
6476 to avoid it.  (This caused occasional crashes in GC_set_fl_marks
6477 with thread local allocation and incremental GC.  This probably happened
6478 primarily on old, slow multiprocessors.)
6479 * Allowed overriding of MAX_THREADS in win32_threads.c from the build
6480 command line.
6481 * Taught the IA64/linux code to determine the register backing store base from
6482 /proc/self/maps after checking the __libc symbol, but before guessing.
6483 (__libc symbols are on the endangered list, and the guess is likely to not
6484 always be right for 2.6 kernels.)  Restructured the code to read and parse
6485 /proc/self/maps so it only exists in one place (all platforms).
6486 * The -DUSE_PROC_FOR_LIBRARIES code was broken on Linux.  It claimed that it
6487 also registered the main data segment, but didn't actually do so.  (I don't
6488 think anyone actually uses this configuration, but ...)
6489 * Made another attempt to get --enablecplusplus to do the right thing.
6490 Since there are unavoidable problems with C programs linking against a
6491 dynamic library that includes C++ code, I separated out the c++ code into
6492 libgccpp.
6495 == [6.2alpha4] ==
6497 * Use LINUX_STACKBOTTOM for >= glibc2.2 on Linux/MIPS.  (See Debian bug
6498 # 177204)
6499 * Integrated Jeff Sturm and Jesse Rosenstock's MACOSX threads patches.
6500 * Integrated Grzegorz Jakacki's substantial GNU build patch.  "Make dist"
6501 should now work for the GNU build process.  Documentation files
6502 are installed under share/gc.
6503 * Tweaked gc_cpp.h to again support the Borland compiler.
6504 * Updated BCC_MAKEFILE.
6505 * Added GC_ASSERT check for minimum thread stack size.
6506 * Added --enable-gc-assertions.
6507 * Added some web documentation to the distribution.  Updated it in the
6508 process.
6509 * Separate gc_conf_macros.h from gc.h.
6510 * Added generic GC_THREADS client-defined macro to set the appropriate
6511 GC_XXX_THREADS internal macro.  (gc_config_macros.h.)
6512 * Add debugging versions of _ignore_off_page allocation primitves.
6513 * Moved declarations of GC_make_closure and GC_debug_invoke_finalizer
6514 from gc.h to gc_priv.h.
6515 * Reset GC_fail_count even if only a small allocation succeeds.
6516 * Integrated Brian Alliet's patch for dynamic library support on Darwin.
6517 * gc_cpp.h's gc_cleanup destructor called GC_REGISTER_FINALIZER_IGNORE_SELF
6518 when it should have called the lower case version, since it was
6519 explicitly computing a base pointer.
6522 == [6.2alpha3] ==
6524 * Don't include execinfo.h in os_dep.c when it's not needed, and may not
6525 exist.
6528 == [6.2alpha2] ==
6530 * Fixed the completely broken FreeBSD code in 6.2alpha1.
6531 * Changed IRIX reference in dbg_mlc.c to IRIX5.
6532 * Attempted to work around the problems with .S filenames and the SGI
6533 compiler.  (Untested.)
6534 * Worked around an HP/UX make issue with the GNU-style build process.
6535 * Fixed the --enable-cplusplus build machinery to allow builds without
6536 a C++ compiler.  (That was always the intent ...)
6537 * Changed the debugging allocation macros to explicitly pass the return
6538 address for Linux and XXXBSD on hardware for which we can't get stack
6539 traces.  Use __builtin_return_address(0) to generate it when possible.
6540 Some of the configuration work was cleaned up (good) and moved to gc.h
6541 (bad, but necessary).  This should make leak detection more useful
6542 on a number of platforms.
6543 * Fixed compilation problems in dbg_mlc.c with GC_ADD_CALLER.
6544 * Bumped revision number for dynamic library.
6547 == [6.2alpha1] ==
6549 * Guard the test for GC_DUMP_REGULARLY in misc.c with
6550 "#ifndef NO_DEBUGGING".  Otherwise it fails to build with NO_DEBUGGING
6551 defined.
6552 * Message about retrying suspend signals was incorrectly generated even when
6553 flag was not set.
6554 * Cleaned up MACOSX/NEXT root registration code.  There was apparently a
6555 separate ifdef case in GC_register_data_segments() for no reason.
6556 * Removed MPROTECT_VDB for MACOSX port, based on one negative report.
6557 * Arrange for gc.h and friends to be correctly installed with GNU-style
6558 "make install".
6559 * Enable the GNU-style build facility include C++ support in the library
6560 with --enable-cplusplus.
6561 * Mark from GC_thread_key in linux_threads.c, in case that's allocated
6562 from the garbage collected heap, as it is with our own thread-specific
6563 storage implementation.
6564 * Mark all free list header blocks if they are heap allocated.  This avoids
6565 some unnecessary tracing.  And it remains correct if we clear the
6566 root set.
6567 * Improved S390/Linux support.  Add S390/Linux 64-bit support.
6568 * Corrected the spelling of GC_{M,C}ALLOC_EXPLICTLY_TYPED to
6569 GC_{M,C}ALLOC_EXPLICITLY_TYPED in gc_typed.h.  This is technically
6570 an interface change.  Based on the fact that nobody reported this,
6571 I suspect/hope there were no clients.
6572 * Cleaned up gc_typed.h so that (1) it adds an extern "C" declaration
6573 when appropriate, (2) doesn't generate references to undefined internal
6574 macros, and (3) allows easier manual construction of descriptors.
6575 * Close the file descriptor used by GC_print_address_map().
6576 * Set the "close-on-exec" bit for various file descriptors maintained
6577 for the collector's internal use.
6578 * Added a hack to find memory segments owned by the system allocator
6579 under win32.  Based on my tests, this tends to eventually find all
6580 segments, though it may take a while.  There appear to be cleaner,
6581 but slower solutions under NT/XP.  But they rely on an API that's
6582 unsupported under 9X.
6583 * Changed Linux PowerPC stack finding to LINUX_STACKBOTTOM.
6584 * Added GC_set_free_space_divisor to avoid some Windows dll issues.
6585 * Added FIXUP_POINTER, POINTER_SHIFT, POINTER_MASK to allow preprocessing
6586 of candidate pointers for tagging, etc.
6587 * Always lock around GC_notify_full_gc().  Simplified code for
6588 invoking GC_notify_full_gc().
6589 * Changed the way DATASTART is defined on FreeBSD to be robust against
6590 an unmapped page after etext.
6591 * Made GC_enable() and GC_disable() official.  Deprecated direct update
6592 of GC_dont_gc.  Changed GC_gcollect to be a noop when garbage collection
6593 is disabled.
6594 * Call GC_register_dynamic_libraries before stopping the world on Linux,
6595 in order to avoid a potential deadlock due to the dl_iterate_phdr lock.
6596 * Introduced a more general mechanism for platform-dependent code to
6597 decide whether the main data segment should be handled separately
6598 from dynamic libraries, or registered by GC_register_dynamic_libraries.
6599 The latter is more reliable and easier on Linux with dl_iterate_phdr.
6602 == [6.1] ==
6604 * Added GC_MAXIMUM_HEAP_SIZE environment variable.
6605 * Fix configure.in for MIPS/LINUX.
6606 * Double page hash table size for -DLARGE_CONFIG.
6607 * Integrated Bo Thorsen's X86-64 support.
6608 * STACKBOTTOM definition for LINUX/MIPS was partially changed back.
6609 * Replaced all occurrences of LINUX_DATA_START in gcconfig.h with
6610 SEARCH_FOR_DATA_START.  It doesn't hurt to falll back to a search.
6611 And __data_start doesn't seem to get defined correctly of the GC
6612 library is loaded with LD_PRELOAD, e.g. for leak detection.
6613 * If the GC_find_leak environment variable is set, do a
6614 atexit(GC_gcollect) to give us at least one chance to detect leaks.
6615 This may report some very benign leaks, but ...
6616 * Addeded REDIRECT_FREE.  It's necessary if we want leak detection with
6617 LD_PRELOAD.
6618 * Defer printing of leaked objects, as for smashed objects.
6619 * Fixed process and descriptor leak in GC_print_callers.  Try for
6620 line number even if we got function name.)
6621 * Ported parallel GC support and thread local allocation to Alpha.
6622 Not yet well-tested.
6623 * Added GC_DUMP_REGULARLY and added finalization statistics to GC_dump().
6624 * Fixed Makefile.am to mention alpha_mach_dep.S instead of the defunct
6625 alpha_mach_dep.s.
6626 * Incorporated a change to new_gc_alloc.h,
6627 which should make it work with gcc3.1.
6628 * Use alpha_mach_dep.S only on Linux.  (It's not clear that this is
6629 optimal, but it otherwise didn't build on Tru64.)
6630 * Added ifdef to guard free() in os_dep.c.  Otherwise we get a
6631 compilation error on Irix.
6632 * Added an experimental version of GC_memalign to mallocx.c.  This can't
6633 always work, since we don't handle alignment requests in the hblk-level
6634 allocator, and we can't handle arbitrary pointer displacements unless
6635 GC_all_interior_pointers is enabled.  But it should work for alignment
6636 requests up to HBLKSIZE.  This is not yet documented in the standard
6637 places.
6638 * Finally debugged the OSF1/Tru64 thread support.  This needs more testing,
6639 since I needed to add a somewhat unconvincing workaround for signal
6640 delivery issues that I don't yet completely understand.  But it does
6641 pass my tests, even in parallel GC mode.  Incremental GC support is
6642 disabled if thread support is enabled, due to the signal issues.
6643 * Eliminated name-space-incorrect definition of _cdecl from gc_cpp.h.
6644 * Added GC_debug_malloc_replacement and GC_debug_realloc_replacement
6645 declarations to gc.h.  On IA64, this is required for REDIRECT_MALLOC
6646 to work correctly with these.
6647 * Fixed Linux USE_PROC_FOR_LIBRARIES to work with a 64-bit /proc format.
6650 == [6.1alpha5] ==
6652 * Added GC_finalizer_mem_freed, and changed some of the code that
6653 decided on heap expansion to look at it.  Memory explicitly
6654 deallocated by finalizers essentially needs to be counted as reclaimed
6655 by the GC.  Otherwise there are cases in which the heap can grow
6656 infinitely.
6657 * Integrated Adam Megacz patches to not scan dynamic libraries if
6658 we are compiling with gcc on win32.  Otherwise we need structured
6659 exception handling to deal with asynchronously unmapped root
6660 segments, and gcc doesn't directly support that.
6661 * Integrated Anthony Green's patch to support Wine.
6662 * GC_OPERATOR_NEW_ARRAY was misspelled OPERATOR_NEW_ARRAY in several
6663 places, including gc_cpp.cc.
6664 * Integrated Loren James Rittle's Alpha FreeBSD patches.  These also
6665 changed the declarations of symbols like _end on many platforms to
6666 that they wouldn't mistakenly be declared as short data symbols.
6667 * Integrated changes from the Debian distribution.
6668 Fix C++ comments in POWERPC port.  Add ARM32
6669 incremental GC support.  Get rid of USE_GENERIC_PUSH_REGS for alpha/Linux,
6670 this time for real.  Use va_copy to get rid of cord printf problems
6671 (finally).
6672 * Close file descriptor used to count cpus.
6673 * Don't just drop gcj free lists in GC_start_reclaim, since that can
6674 eventually cause the marker to see a bogus mark descriptor in the
6675 dropped objects.  The usual symptom was a very intermittent segmentation
6676 fault in the marker.  This mattered only if one of the GC_gcj_malloc
6677 variants was used.
6678 * Fixed Linux and Solaris/64 SPARC configuration.
6679 * Fixed a typo in strdup definition.
6680 * Changed Makefile.direct to invoke $(CC) to assemble alpha_mach_dep.S.
6681 This is needed on Linux.  I'm not sure whether it's better or worse
6682 on Tru64.
6683 * Changed gc_cpp.h once more to declare operator new and friends only in
6684 a Microsoft environment.  This may need further fine tuning.
6685 * Don't ever override strdup if it's already macro defined.
6686 * Changed gc_cpp.h yet again to also overload placement new.  Due to the
6687 C++ overloading rules, the other overloaded new operations otherwise hide
6688 placement new, which causes many STL uses to break.
6689 * Integrated cygwin pthreads support from Dan Bonachea.
6690 * Turn on DYNAMIC_LOADING for NetBSD.
6691 * Changed printing code to print more complete GC times.
6692 * Applied Mark Mitchell's Irix patch to correct some bitrot.
6693 * Clarified which object-printing routines in dbg_mlc.c should hold
6694 the allocation lock.  Restructured the code to allow reasonable object
6695 printing with -DREDIRECT_MALLOC.
6696 * Fix the Linux mmap code to always start with 0x1000 as the initial hint.
6697 Minor patches for 64-bit AIX, particularly to STACKBOTTOM.
6698 * Renamed "SUSPENDED" flag for Solaris threads support to avoid a conflict
6699 with a system header.
6700 * Cause win32_threads.c to handle an out of range stack pointer correctly,
6701 though currently with a warning.
6704 == [6.1alpha4] ==
6706 * Fixed typo in sparc_mach_dep.S, preventing the 64-bit version from
6707 building.  Increased 64-bit heap size limit in test.c slightly, since
6708 a functional SPARC collector seems to slightly exceed the old limits.
6709 * Use NPRGREG in solaris_threads.c, thus printing all registers if things
6710 go wrong.
6711 * Added GC_MARKERS environment variable to allow use of a single marker
6712 thread on an MP without confusing the lock implementation.
6713 * Collect much less aggressively in incremental mode with GC_TIME_UNLIMITED.
6714 This is really a purely generational mode, and we can afford to
6715 postpone the collection until the heap is (nearly) full.
6716 * Remove read() wrapper for MPROTECT_VDB.  It was causing more harm than
6717 good.  It is often no longer needed if system calls avoid writing to
6718 pointerfull heap objects.
6719 * Fix MACOSX test in gcconfig.h.
6720 * Change GC_test_and_set so that it consistently has one argument.
6721 Add spaces to ::: in powerpc assembly code in gc_locks.h.
6722 * Fixed a formatting error in dbg_mlc.c.  Added prototype to GC_abort()
6723 declaration.
6724 * Removed "source" argument to GC_find_start().  Eliminate GC_FIND_START().
6725 * Added win32 recognition code in configure.in.  Changed some of the
6726 dllimport/export defines in gc.h.
6727 * GC_malloc_many didn't set hb_last_reclaimed when it called
6728 GC_reclaim_generic.  (I'm not sure this matters much, but ...)
6729 * Allocating uncollectable objects with debug information sometimes
6730 allocated objects that were one byte too small, since uncollectable
6731 objects don't have the extra byte added at the end.
6732 * Added a bit more assertion checking to make sure that gcj objects
6733 on free lists never have a nonzero second word.
6734 * Replaced BCC_MAKEFILE with an up-to-date one.
6735 * Upgraded libtool, cinfigure.in and some related files to hopefully
6736 support NetBSD/SPARC.  Unfortunately,
6737 libtool 1.4.2 seemed to be buggy due to missing quotes in several
6738 "test" invocations.  Fixed those in the ltmain.sh script.
6739 * Some win32-specific patches, including the introduction of
6740 GC_CreateThread.
6741 * Merged in gcj changes from Anthony Green to support embedded systems.
6742 * Tried to consistently rename preprocessed assembly files with a capital
6743 .S extension.
6744 * Use alpha_mach_dep.S on ALPHA again.  It doesn't really matter, but this
6745 makes our distribution consistent with the gcc one, avoiding future merge
6746 problems.
6747 * Move GET_MEM definition into gcconfig.h.  Include gcconfig.h slightly
6748 later in gc_priv.h to avoid forward references to ptr_t.
6749 * Add some testing of local allocation to test.c.
6750 * Change definition of INVALID_QTID in specific.h.  The -1 value was used
6751 inconsistently, and too likely to collide with a valid stack address.
6752 Some general clean-up of specific.[ch].  Added assertions.
6753 * On Pthread systems it was not safe to call GC_malloc() between fork()
6754 and exec().  According to the applicable standards, it doesn't appear
6755 to be safe to call malloc() or many other libc functions either, thus
6756 it's not clear this is fixable.  Added experimental support for
6757 -DHANDLE_FORK in linux_threads.c which tries to support it.  It may
6758 succeed if libc does the right thing.  I'm not sure whether it does.
6759 * Documented thread local allocation primitives to require an
6760 explicit GC_init call.  GC_init_parallel is no longer declared to
6761 be a constructor function, since that isn't portable and often
6762 seems to lead to initialization order problems.
6763 * Changed gc_cpp.cc and gc_cpp.h in one more attempt to make them
6764 compatible with Visual C++ 6.
6765 * Some more patches for Linux on HP PA-RISC.
6766 * Added include/gc_allocator.h.  It implements (hopefully) standard
6767 conforming (as opposed to SGI-style) allocators that allocate
6768 collectable (gc_allocator) or GC-traceable, but not collectable
6769 (traceable_allocator) objects.  This borrows heavily from libstc++,
6770 which borrows heavily from the SGI implementation, this part of
6771 which was written by Matt Austern.  Changed test_cpp.cc to very
6772 minimally test this.
6773 * On Linux/X86, retry mmap with a different start argument.  That should
6774 allow the collector to use more (closer to 3GB) of the address space.
6775 * Force 64 bit alignment with GCJ support.
6776 * Refined the choice of sa_handler vs. sa_sigaction in GC_dirty_init
6777 to accommodate some glibc5 systems.
6778 * Compensated for the fact that current versions of glibc set
6779 __libc_stack_end incorrectly on Linux/IA64 while initialization code
6780 is running.  This could cause the collector to miss 16 bytes of
6781 the memory stack if GC_malloc or friends where called before main().
6782 * Mostly integrated Takis Psarogiannakopoulos' port to DG/UX Inix 86.
6783 This will probably take another iteration to work, since his
6784 patch conflicted with the libtool upgrade.
6785 * Added README.arm.cross containing some information about cross-
6786 compiling to an ARM processor from Margaret Fleck.
6789 == [6.1alpha3] ==
6791 * Minor cleanup on the gcconfig.h section for SPARC.
6792 * Minor fix to support Intel compiler for I386/Linux.
6793 * Added SPARC V9 (64-bit) support.
6794 * Restructured the way in which we determine whether or not to keep
6795 call stacks for debug allocation.  By default SAVE_CALL_COUNT is
6796 now zero on all platforms.  Added SAVE_CALL_NARGS parameters.
6797 If possible, use execinfo.h to capture call stack.  (This should
6798 add support for a number of new platforms, though often at
6799 considerable runtime expense.)
6800 * Try to print symbolic information for call stacks.  On Linux, we
6801 do this with a combination of execinfo.h and running addr2line in
6802 a separate process.  This is both much more expensive and much more
6803 useful.  Amazingly, it seems to be fast enough for most purposes.
6804 * Redefined strdup if -DREDIRECT_MALLOC is given.
6805 * Changed incremental collector and MPROTECT_VDB implementation so that,
6806 under favorable conditions, pointer-free objects are not protected.
6807 Added GC_incremental_protection_needs() to determine ahead of time whether
6808 pointer-free objects may be protected.  Replaced GC_write_hint() with
6809 GC_remove_protection().
6810 * Added test for GC_ENABLE_INCREMENTAL environment variable.
6811 * Made GC_time_limit runtime configurable.  Added GC_PAUSE_TIME_TARGET
6812 environment variable.
6813 * Eliminated GC_page_sz, a duplicate of GC_page_size.
6814 * Caused the Solaris and Irix thread creation primitives to call
6815 GC_init_inner().
6818 == [6.1alpha2] ==
6820 * No longer wrap read by default in multi-threaded applications.  It was
6821 pointed out on the libgcj list that this holds the allocation lock for
6822 way too long if the read blocks.  For now, reads into the heap are
6823 broken with incremental collection.  It's possible to turn this back on
6824 if you make sure that read calls don't block (e.g. by calling select
6825 first).
6826 * Fix ifdef in Solaris_threads.h to refer to GC_SOLARIS_THREADS.
6827 * Added check for environment variable GC_IGNORE_GCJ_INFO.
6828 * Added printing of stop-the-world GC times if GC_PRINT_STATS environment
6829 variable is set.
6830 * The calloc definition in leak_detector.h was missing parentheses, and
6831 realloc was missing a second argument to GC_REALLOC.
6832 * Added GC_PRINT_BACK_HEIGHT environment variable and associated
6833 code, mostly in the new file backgraph.c.  See doc/README.environment.
6834 * Added -DUSE_GLOBAL_ALLOC to work around a Windows NT issue.
6835 * Integrated port to NEC EWS4800 (MIPS-based workstation, with somewhat
6836 different address-space layout). This may help for other machines with
6837 holes in the data segment.
6838 * Changed the order in which GC_push_roots and friends push things onto
6839 the mark stack.  GC_push_all calls need to come first, since we can't
6840 necessarily recover if those overflow the mark stack.
6841 * Some minor cleanups to mostly support the Intel compiler on Linux/IA64.
6844 == [6.1alpha1] ==
6846 * Non-debug, atomic allocations could result in bogus smashed object
6847 reports with debugging on.
6848 * Fixed GC_get_register_stack_base (Itanium only) to work around a glibc
6849 2.2.4 bug.
6850 * Initial port to HP/UX on Itanium.  Thread support and both 32 and 64
6851 bit ABIs appear to work.  Parallel mark support doesn't yet, due to
6852 some inline assembly code issues.  Thread local allocation does appear
6853 to work.
6854 * ifdef'ed out glibc2.1/Itanium workaround.  I suspect nobody is using
6855 that combination anymore.
6856 * Added a patch to make new_gc_alloc.h usable with gcc3.0.
6857 * Debugged 64-bit support on HP/UX PA-RISC.
6858 * Turned on dynamic loading support for FreeBSD/ELF.
6859 * Unregistering of finalizers with debugging allocation was broken.
6860 * Old finalizers were not returned correctly from GC_debug_register_finalizer.
6861 * Disabled MPROTECT_VDB for Linux/M68K based on a report that it doesn't work.
6862 * Cleaned up some statistics gathering code in reclaim.c.
6863 * Added some support for OpenBSD/ELF/Linux.
6864 * Added Jakub Jelinek's patch to use dl_iterate_phdr for dynamic library
6865 traversal to dyn_load.c.  Changed it to weakly reference dl_iterate_phdr,
6866 so that the old code is stilll used with old versions of glibc.
6867 * Cleaned up feature test macros for various threads packages and
6868 integrated (partially functional) FreeBSD threads code from Loren Rittle.
6869 It's likely that the cleanup broke something, since it touched lots of
6870 code.  It's also likelly that it fixed some unreported bugs in the
6871 less common thread implementations, since some of the original code
6872 didn't stand up to close scrutiny.  Support for the next pthreads
6873 implementation should be easier to add.
6876 == [6.0] ==
6878 * Two more bug fixes for KEEP_BACK_PTRS and DBG_HDRS_ALL.
6879 * Fixed a stack clearing problem that resulted in SIGILL with a
6880 misaligned stack pointer for multi-threaded SPARC builds.
6881 * Integrated another HURD patch.
6884 == [6.0alpha9] ==
6886 * added README.macros.
6887 * Made gc.mak a symbolic link to work around winzip's tendency to ignore
6888 hard links.
6889 * Simplified the setting of NEED_FIND_LIMIT in os_dep.c, possibly breaking
6890 it on untested platforms.
6891 * Integrated initial GNU HURD port.
6892 * A few more fixes for Digital Mars compiler (Walter Bright).
6893 * Fixed gcc version recognition.  Renamed OPERATOR_NEW_ARRAY to
6894 GC_OPERATOR_NEW_ARRAY.  Changed GC_OPERATOR_NEW_ARRAY to be the default.
6895 It can be overridden with -DGC_NO_OPERATOR_NEW_ARRAY.
6896 * Changed the byte size to free-list mapping in thread local allocation
6897 so that size 0 allocations are handled correctly.
6898 * Fixed Linux/MIPS stackbottom for new toolchain.
6899 * Changed finalization registration to invoke GC_oom_fn when it runs out
6900 of memory.
6901 * Removed lvalue cast in finalize.c.  This caused some debug configurations
6902 not to build with some non-gcc compilers.
6905 == [6.0alpha8] ==
6907 * Changed GC_debug_malloc_replacement and GC_debug_realloc_replacement
6908 so that they compile under Irix.
6909 * Updated powerpc_macosx_mach_dep.s so that it works if the collector
6910 is in a dynamic library.
6911 * Transformed README.debugging into debugging.html, updating and
6912 expanding it in the process.  Added gcdescr.html and tree.html
6913 from the web site to the GC distribution.
6914 * Fixed several problems related to PRINT_BLACK_LIST. This involved
6915 restructuring some of the marker macros.
6916 * Fixed some problems with the sizing of objects with debug information.
6917 Finalization was broken KEEP_BACK_PTRS or PRINT_BLACK_LIST.  Reduced the
6918 object size with SHORT_DEBUG_HDRS by another word.
6919 * The "Needed to allocate blacklisted ..." warning had inadvertently
6920 been turned off by default, due to a buggy test in allchblk.c.  Turned
6921 it back on.
6922 * Removed the marker macros to deal with 2 pointers in interleaved fashion.
6923 They were messy and the performance improvement seemed minimal.  We'll
6924 leave such scheduling issues to the compiler.
6925 * Changed Linux/PowerPC test to also check for __powerpc__ in response
6926 to a discussion on the gcc mailing list.
6927 * Removed the "static" from the jmp_buf
6928 declaration in GC_generic_push_regs.  This was causing problems in
6929 systems that register all of their own roots.  It looks far more correct
6930 to me without the "static" anyway.
6931 * Fixed several problems with thread local allocation of pointer-free or
6932 typed objects.  The collector was reclaiming thread-local free lists, since
6933 it wasn't following the link fields.
6934 * There was apparently a long-standing race condition related to
6935 multi-threaded incremental collection.  A collection could be started and
6936 a thread stopped between the memory unprotect system call and the setting of
6937 the corresponding dirt bit.  I believe this did not affect Solaris or PCR,
6938 which use a different dirty-bit implementation.  Fixed this by installing
6939 signal handlers with sigaction instead of signal, and disabling the thread
6940 suspend signal while in the write-protect handler.  (It is unclear
6941 whether this scenario ever actually occurred.  I found it while tracking
6942 down the following:)
6943 * Incremental collection did not cooperate correctly with the PARALLEL_MARK
6944 implementation of GC_malloc_many or the local_malloc primitives.  It still
6945 doesn't work well, but it shouldn't lose memory anymore.
6946 * Integrated some changes from the gcc source tree that I had previously
6947 missed.
6948 * Added Makefile.direct as a copy of the default Makefile, which would
6949 normally be overwritten if configure is run.
6950 * Changed the gc.tar target in Makefile.direct to embed the version number
6951 in the gc directory name.  This will affect future tar file distributions.
6952 * Changed the Irix dynamic library finding code to no longer try to
6953 eliminate writable text segments under Irix6.x, since that is probably no
6954 longer necessary, and can apparently be unsafe on occasion.
6955 * GC_cleanup with GC_DEBUG enabled passed a real object base address to
6956 GC_debug_register_finalizer_ignore_self, which expected a pointer past the
6957 debug header.  Call GC_register_finalizer_ignore_self instead, even with
6958 debugging enabled.
6959 * The collector didn't build with call chain saving enabled but NARGS=0.
6960 * Fixed up the GNU-style build files enough so that they work in some
6961 obvious cases.
6962 * Added initial port to Digital Mars compiler for win32.
6965 == [6.0alpha7] ==
6967 * Added GC_finalizer_notifier.  Fixed GC_finalize_on_demand.  (The variable
6968 actually wasn't being tested at the right points.  The build-time flag
6969 was.)
6970 * Added Tom Tromey's S390 Linux patch.
6971 * Added code to push GC_finalize_now in GC_push_finalizer_structures.
6972 * Added GC_push_gc_structures() to push all GC internal roots.
6973 * Integrated some FreeBSD changes from Matthew Flatt.
6974 * It looks like USRSTACK is not always correctly defined under Solaris.
6975 Hacked gcconfig.h to attempt to work around the problem.  The result
6976 is not well tested.
6977 * Added Ji-Yong Chung's win32 threads and C++ fixes.
6978 * Arranged for hpux_test_and_clear.s to no longer be needed or built.
6979 It was causing build problems with gas, and it's not clear this is
6980 better than the pthreads alternative on this platform.
6981 * Some MINGW32 fixes from Hubert Garavel.
6982 * Added Initial Hitachi SH4 port from Kaz Kojima.
6983 * Ported thread-local allocation and parallel mark code to HP/UX on PA_RISC.
6984 * Made include/gc_mark.h more public and separated out the really private
6985 pieces.  This is probably still not quite sufficient for clients that
6986 want to supply their own kind of type information.  But it's a start.
6987 This involved lots of identifier renaming to make it namespace clean.
6988 * Added GC_dont_precollect for clients that need complete control over
6989 the root set.
6990 * GC_is_visible didn't do the right thing with gcj objects.  (Not that
6991 many people are likely to care, but ...)
6992 * Don't redefine read with GC_USE_LD_WRAP.
6993 * Initial port to LINUX/HP_PA.  Incremental collection and threads are not
6994 yet supported.  (Incremental collection should work if you have the
6995 right kernel.  Threads may work with a sufficiently patched pthread
6996 library.)
6997 * Changed gcconfig.h to recognize __i386__ as an alternative to i386 in
6998 many places.
6999 * Made win32_threads.c more tolerant of detaching a thread that it didn't
7000 know about.
7001 * Added Makefile.am and configure.in from gcc to the distribution, with
7002 minimal changes.  For the moment, those are just placeholders.  In the
7003 future, we're planning to switch to a GNU-style build environment for
7004 Un*x-like systems, though the old Makefile will remain as a backup.
7005 * Turned off STUBBORN_ALLOC by default, and added it back as a Makefile
7006 option.
7007 * Redistributed some functions between malloc.c and mallocx.c, so that
7008 simple statically linked apps no longer pull in mallocx.o.
7009 * Changed large object allocation to clear the first and last few words
7010 of each block before releasing the lock.  Otherwise the marker could see
7011 objects with nonsensical type descriptors.
7012 * Fixed a couple of subtle problems that could result in not recognizing
7013 interior pointers from the stack.  (I believe these were introduced
7014 in 6.0alpha6.)
7015 * GC_debug_free_inner called GC_free, which tried to reacquire the
7016 allocator lock, and hence deadlocked.  (DBG_HDRS_ALL probably never worked
7017 with threads.)
7018 * Fixed several problems with back traces.  Accidental references to a free
7019 list could cause the free list pointer to be overwritten by a back pointer.
7020 There seemed to be some problems with the encoding of root and finalizer
7021 references.
7024 == [6.0alpha6] ==
7026 * Changed the definition of DATASTART on ALPHA and IA64, where data_start
7027 and __data_start are not defined by earlier versions of glibc.  This might
7028 need to be fixed on other platforms as well.
7029 * Changed the way the stack base and backing store base are found on IA64.
7030 This should now remain reliable on future kernels.  But since it relies
7031 on /proc, it will no longer work in the simulated NUE environment.
7032 * Made the call to random() in dbg_mlc.c with -DKEEP_BACK_PTRS dependent
7033 on the OS.  On non-Unix systems, rand() should be used instead.  Handled
7034 small RAND_MAX.
7035 * Fixed the cord make rules to create the cord subdirectory, if necessary.
7036 * Changed fo_object_size calculation in finalize.c.  Turned finalization
7037 of non-heap object into a no-op.  Removed anachronism from GC_size()
7038 implementation.
7039 * Changed GC_push_dirty call in solaris_threads.c to GC_push_selected.
7040 It was missed in a previous renaming.
7041 * Arranged to not not mask SIGABRT in linux_threads.c.
7042 * Added GC_no_dls hook for applications that want to register their own
7043 roots.
7044 * Integrated Kjetil Matheussen's Amiga changes.
7045 * Added FREEBSD_STACKBOTTOM.  Changed the X86/FreeBSD port to use it.
7046 * Added pthread_detach interception for platforms supported by linux_threads.c
7047 and irix_threads.c.
7048 * Changed the USE_MMAP code to check for the case in which we got the
7049 high end of the address space, i.e. mem_ptr + mem_sz == 0.  It appears
7050 that this can happen under Solaris 7.  It seems to be allowed by what
7051 I would claim is an oversight in the mmap specification.
7052 * Cleanup of linux_threads.c.  Some code was originally cloned from
7053 irix_threads.c and now unnecessary.  Some comments were obviously wrong.
7054 * (Mostly) fixed a longstanding problem with setting of dirty bits from
7055 a signal handler.  In the presence of threads, dirty bits could get lost,
7056 since the etting of a bit in the bit vector was not atomic with respect
7057 to other updates.  The fix is 100% correct only for platforms for which
7058 GC_test_and_set is defined.  The goal is to make that all platforms with
7059 thread support.  Matters only if incremental GC and threads are both
7060 enabled.
7061 * made GC_all_interior_pointers (a.k.a. ALL_INTERIOR_POINTERS) an
7062 initialization time, instead of build-time option.  This is a
7063 nontrivial, high risk change.  It should slow down the code measurably
7064 only if MERGE_SIZES is not defined, which is a very nonstandard
7065 configuration.
7066 * Added doc/README.environment, and implemented what it describes.  This
7067 allows a number of additional configuration options to be set through
7068 the environment.  It documents a few previously undocumented options.
7069 * Integrated Eric Benson's leak testing improvements.
7070 * Removed the option to throw away the beginning of each page (DISCARD_WORDS).
7071 This became less and less useful as processors enforce stricter alignment.
7072 And it hadn't been tested in ages, and was thus probably broken anyway.
7075 == [6.0alpha5] ==
7077 * Changed the definition of GC_pause in linux_threads.c to use a volatile
7078 asm.  Some versions of gcc apparently optimize away writes to local volatile
7079 variables.  This caused poor locking behavior starting at about
7080 4 processors.
7081 * Added GC_start_blocking(), GC_end_blocking() calls and wrapper for sleep
7082 to linux_threads.c.
7083 The first two calls could be used to generally avoid sending GC signals to
7084 blocked threads, avoiding both premature wakeups and unnecessary overhead.
7085 * Fixed a serious bug in thread-local allocation.  At thread termination,
7086 GC_free could get called on small integers.  Changed the code for thread
7087 termination to more efficiently return left-over free-lists.
7088 * Integrated Kjetil Matheussen's BeOS support.
7089 * Rearranged the directory structure to create the doc and tests
7090 subdirectories.
7091 * Sort of integrated Eric Benson's patch for OSF1.  This provided basic
7092 OSF1 thread support by suitably extending hpux_irix_threads.c.  Based
7093 on earlier email conversations with David Butenhof, I suspect that it
7094 will be more reliable in the long run to base this on linux_threads.c
7095 instead.  Thus I attempted to patch up linux_threads.c based on Eric's code.
7096 The result is almost certainly broken, but hopefully close enough that
7097 someone with access to a machine can pick it up.
7098 * Integrated lots of minor changes from the NetBSD distribution.  (These
7099 were supplied by David Brownlee.  I'm not sure about the original
7100 authors.)
7101 * Hacked a bit more on the HP/UX thread-support in linux_threads.c.  It
7102 now appears to work in the absence of incremental collection.  Renamed
7103 hpux_irix_threads.c back to irix_threads.c, and removed the attempt to
7104 support HPUX there.
7105 * Changed gc.h to define _REENTRANT in cases in which it should already
7106 have been defined. It is still safer to also define it on the command
7107 line.
7110 == [6.0alpha4] ==
7112 * Moved up the detection of mostly full blocks to the initiation of the
7113 sweep phase.  This eliminates some lock contention in the PARALLEL_MARK case,
7114 as multiple threads try to look at mostly full blocks concurrently.
7115 * Restored the code in GC_malloc_many that grabs a prefix of the global
7116 free list.  This avoids the case in which every GC_malloc_many call
7117 tries and fails to allocate a new heap block, and the returns a single
7118 object from the global free list.
7119 * Some minor fixes in new_hblk.c.  (Attempted to build free lists in order
7120 of increasing addresses instead of decreasing addresses for cache performance
7121 reasons.  But this seems to be only a very minor gain with -DEAGER_SWEEP,
7122 and a loss in other cases.  So the change was backed out.)
7123 * Fixed some of the documentation.
7124 * Fixed the Linux USE_PROC_FOR_LIBRARIES code to deal with apps that perform
7125 large numbers of mmaps.  Also fixed that code to
7126 deal with short reads.
7127 * Added GC_get_total_bytes().
7128 * Fixed leak detection mode to avoid spurious messages under linuxthreads.
7129 (This should also now be easy for the other supported threads packages.
7130 But the code is tricky enough that I'm hesitant to do it without being able
7131 to test.  Everything allocated in the GC thread support itself should be
7132 explicitly deallocated.)
7133 * Made it possible (with luck) to redirect malloc to GC_local_malloc.
7136 == [6.0alpha3] ==
7138 * Fixed the /proc/self/maps code to not seek, since that apparently is not
7139 reliable across all interesting kernels.
7140 * Fixed some compilation problems in the absence of PARALLEL_MARK
7141 (introduced in alpha2).
7142 * Fixed an algorithmic problem with PARALLEL_MARK.  If work needs to
7143 be given back to the main mark "stack", the BOTTOM entries of the local
7144 stack should be given away, not the top ones.  This has substantial
7145 performance impact, especially for > 2 processors, from what I can tell.
7146 * Extracted gc_lock.h from gc_priv.h.  This should eventually make it a
7147 bit easier to avoid including gc_priv.h in clients.
7148 * Moved all include files to include/ and removed duplicate links to the
7149 same file.  The old scheme was a bad idea because it was too easy to get the
7150 copies out of sync, and many systems don't support hard links.
7151 Unfortunately, it's likely that I broke some of the non-Unix Makefiles in
7152 the process, although I tried to update them appropriately.
7153 * Removed the partial support for a copied nursery.  It's not clear that
7154 this would be a tremendous win, since we don't consistently lose to
7155 generational copying collectors.  And it would significantly complicate
7156 many things.  May be reintroduced if/when it really turns out to win.
7157 * Removed references to IRIX_JDK_THREADS, since I believe there never
7158 were and never will be any clients.
7159 * Added some code to linux_threads.c to possibly support HPUX threads
7160 using the Linux code.  Unfortunately, it doesn't work yet, and is
7161 currently disabled.
7162 * Added support under Linux/X86 for saving the call chain, both in (debug)
7163 objects for client debugging, and in GC_arrays._last_stack for GC
7164 debugging.  This was previously supported only under Solaris.  It is
7165 not enabled by default under X86, since it requires that code be compiled
7166 to explicitly gave frame pointers on the call stack.  (With gcc this
7167 currently happens by default, but is often turned off explicitly.)
7168 To turn it on, define SAVE_CALL_CHAIN.
7171 == [6.0alpha2] ==
7173 * Added USE_MARK_BYTES to reduce the need for compare-and-swap on platforms
7174 for which that's expensive.
7175 * Fixed a locking bug ib GC_gcj_malloc and some locking assertion problems.
7176 * Added a missing volatile to OR_WORD and renamed the parameter to
7177 GC_compare_and_swap so it's not a C++ reserved word.
7178 * Changed Linux dynamic library registration code to look at /proc/self/maps
7179 instead of the rld data structures when REDIRECT_MALLOC is defined.
7180 Otherwise some of the rld data data structures may be prematurely garbage
7181 collected.
7182 * Fixed USE_LD_WRAP a bit more, so it should now work without threads.
7183 * Renamed XXX_THREADS macros to GC_XXX_THREADS for namespace correctness.
7184 Temporarily added some backward compatibility definitions.  Renamed
7185 USE_LD_WRAP to GC_USE_LD_WRAP.
7186 * Many MACOSX POWERPC changes, some additions to the gctest output, and
7187 a few minor generic bug fixes.
7190 == [6.0alpha1] ==
7192 * Added HP/PA prefetch support.
7193 * Added -DDBG_HDRS_ALL and -DSHORT_DBG_HDRS to reduce the cost and improve
7194 the reliability of generating pointer backtrace information, e.g. in
7195 the Bigloo environment.
7196 * Added parallel marking support (-DPARALLEL_MARK).  This currently
7197 works only under IA32 and IA64 Linux, but it shouldn't be hard to adapt
7198 to other platforms.  This is intended to be a lighter-weight (less
7199 new code, probably not as scalable) solution than the work by Toshio Endo
7200 et al, at the University of Tokyo.  A number of their ideas were
7201 reused, though the code wasn't, and the underlying data structure
7202 is significantly different.  In particular, we keep the global mark
7203 stack as a single shared data structure, but most of the work is done
7204 on smaller thread-local mark stacks.
7205 * Changed GC_malloc_many to be cheaper, and to require less mutual exclusion
7206 with -DPARALLEL_MARK.
7207 * Added full support for thread local allocation under Linux
7208 (-DTHREAD_LOCAL_ALLOC).  This is a thin veneer on GC_malloc_many, and
7209 should be easily portable to other platforms, especially those that
7210 support pthreads.
7211 * CLEAR_DOUBLE was not always getting invoked when it should have been.
7212 * GC_gcj_malloc and friends used different out of memory handling than
7213 everything else, probably because I forgot about one when I implemented
7214 the other.  They now both call GC_oom_fn(), not GC_oom_action().
7215 * Integrated Jakub Jelinek's fixes for Linux/SPARC.
7216 * Moved GC_objfreelist, GC_aobjfreelist, and GC_words_allocd out of
7217 GC_arrays, and separately registered the first two as excluded roots.
7218 This makes code compiled with gc_inl.h less dependent on the
7219 collector version.  (It would be nice to remove the inclusion of
7220 gc_priv.h by gc_inl.h completely, but we're not there yet.  The
7221 locking definitions in gc_priv.h are still referenced.)
7222 This change was later conditioned on SEPARATE_GLOBALS, which
7223 is not defined by default, since it involves a performance hit.
7224 * Register GC_obj_kinds separately as an excluded root region.  The
7225 attempt to register it with GC_arrays was usually failing.  (This wasn't
7226 serious, but seemed to generate some confusion.)
7227 * Moved backptr.h to gc_backptr.h.
7230 == [5.4] ==
7232 * Fixed a typo that prevented compilation with -DUSE_3DNOW_PREFETCH.
7233 * Fixed GC_is_thread_stack in solaris_threads.c.  It forgot to return a value
7234 in the common case.
7235 * Fixed another silly syntax problem in GC_double_descr.
7236 * Fixed a GC_gcj_malloc bug: It tended to release the allocator lock twice.
7239 == [5.3] ==
7241 * Fixed _end declaration for OSF1.
7242 * There were lots of spurious leak reports in leak detection mode, caused
7243 by the fact that some pages were not being swept, and hence unmarked
7244 objects weren't making it onto free lists.  (This bug dated back to 5.0.)
7245 * Fixed a typo in the liblinuxgc.so Makefile rule.
7246 * Added the GetExitCodeThread to Win32 GC_stop_world to (mostly) work
7247 around a Windows 95 GetOpenFileName problem.
7250 == [5.2] ==
7252 * dyn_load.c declared GC_scratch_last_end_ptr as an extern even if it
7253 was defined as a macro.  This prevented the collector from building on
7254 Irix.
7255 * We quietly assumed that indirect mark descriptors were never 0.
7256 Our own typed allocation interface violated that.  This could result
7257 in segmentation faults in the marker with typed allocation.
7258 * Fixed a _DUSE_MUNMAP bug in the heap block allocation code.
7259 * Taught the collector about VC++ handling array operator new.
7260 * The two copies of gc_hdrs.h had diverged.  Made one a link to the other
7261 again.
7264 == [5.1] ==
7266 * Fixed a gc.h header bug which showed up under Irix.
7267 * Fixed a typo in GC_double_descr in typd_mlc.c.
7268 This probably could result in objects described by array descriptors not
7269 getting traced correctly.
7270 * The block nearly full tests in reclaim.c were not correct for 64 bit
7271 environments.  This could result in unnecessary heap growth under unlikely
7272 conditions.
7275 == [5.0] ==
7277 * Fixed threadlibs.c for linux threads.  -DUSE_LD_WRAP was broken and
7278 -ldl was omitted.  Fixed Linux stack finding code to handle
7279 -DUSE_LD_WRAP correctly.
7280 * Added MSWIN32 exception handler around marker, so that the collector
7281 can recover from root segments that are unmapped during the collection.
7282 This caused occasional failures under Windows 98, and may also be
7283 an issue under Windows NT/2000.
7286 == [5.0alpha7] ==
7288 * -DREDIRECT_MALLOC was broken in alpha6. Fixed.
7289 * Cleaned up gc_ccp.h slightly, thus also causing the HP C++ compiler to
7290 accept it.
7291 * Removed accidental reference to dbg_mlc.c, which caused dbg_mlc.o to be
7292 linked into every executable.
7293 * Added PREFETCH to bitmap marker.  Changed it to use the header cache.
7294 * GC_push_marked sometimes pushed one object too many, resulting in a
7295 segmentation fault in GC_mark_from_mark_stack.  This was probably an old
7296 bug.  It finally showed up in gctest on win32.
7297 * Gc_priv.h erroneously #defined GC_incremental to be TRUE instead of FALSE
7298 when SMALL_CONFIG was defined.  This was no doubt a major performance bug for
7299 the default win32 configuration.
7300 * Removed -DSMALL_CONFIG from NT_MAKEFILE.  It seemed like an anachronism now
7301 that the average PC has 64MB or so.
7302 * Integrated Bryce McKinley's patches for linux threads and dynamic loading
7303 from the libgcj tree.  Turned on dynamic loading support for Linux/PPC.
7304 * Changed the stack finding code to use environ on HP/UX.  This should
7305 probably be done on other platforms, too.  Since I can't test those, that'll
7306 wait until after 5.0.
7309 == [5.0alpha6] ==
7311 * GC_malloc_explicitly_typed and friends sometimes failed to
7312 initialize first word.
7313 * Added allocation routines and support in the marker for mark descriptors
7314 in a type structure referenced by the first word of an object.  This was
7315 introduced to support gcj, but hopefully in a way that makes it
7316 generically useful.
7317 * Added GC_requested_heapsize, and inhibited collections in non-incremental
7318 mode if the actual used heap size is less than what was explicitly
7319 requested.
7320 * The Solaris pthreads version of GC_pthread_create didn't handle a NULL
7321 attribute pointer.  Solaris thread support used the wrong default thread
7322 stack size.
7323 * Changed PUSH_CONTENTS macro to no longer modify first parameter.
7324 This usually doesn't matter, but it was certainly an accident waiting
7325 to happen ...
7326 * Added GC_register_finalizer_no_order and friends to gc.h.  They're
7327 needed by Java implementations.
7328 * Integrated a fix for a win32 deadlock resulting from clock() calling
7329 malloc.
7330 * Integrated Hiroshi Kawashima's port to Linux/MIPS.  This was designed
7331 for a handheld platform, and may or may not be sufficient for other
7332 machines.
7333 * Fixed a va_arg problem with the %c specifier in cordprnt.c.  It appears
7334 that this was always broken, but recent versions of gcc are the first to
7335 report the (statically detectable) bug.
7336 * Added an attempt at a more general solution to dlopen races/deadlocks.
7337 GC_dlopen now temporarily disables collection.  Still not ideal, but ...
7338 * Added -DUSE_I686_PREFETCH, -DUSE_3DNOW_PREFETCH, and support for IA64
7339 prefetch instructions.  May improve performance measurably, but I'm not
7340 sure the code will run correctly on processors that don't support the
7341 instruction.  Won't build except with very recent gcc.
7342 * Added caching for header lookups in the marker.  This seems to result
7343 in a barely measurable performance gain.  Added support for interleaved
7344 lookups of two pointers, but unconfigured that since the performance
7345 gain is currently near zero, and it adds to code size.
7346 * Changed Linux DATA_START definition to check both data_start and
7347 __data_start, since nothing else seems to be portable.
7348 * Added -DUSE_LD_WRAP to optionally take advantage of the GNU ld function
7349 wrapping mechanism.  Probably currently useful only on Linux.
7350 * Moved some variables for the scratch allocator into GC_arrays.
7351 * Fixed a win32 threads bug that caused the collector to not look for
7352 interior pointers from one of the thread stacks without
7353 ALL_INTERIOR_POINTERS.
7354 * Added Mingw32 support.
7355 * Changed the alpha port to use the generic register scanning code instead
7356 of alpha_mach_dep.s.  Alpha_mach_dep.s doesn't look for pointers in fp
7357 registers, but gcc sometimes spills pointers there.  Changed the IA64 code to
7358 do something similar for similar reasons.
7361 == [5.0alpha4] ==
7363 * Added protection fault handling patch for Linux/M68K from Fergus
7364 Henderson and Roman Hodek.
7365 * Removed the tests for SGI_SOURCE in new_gc_alloc.h.  This was causing that
7366 interface to fail on nonSGI platforms.
7367 * Changed the Linux stack finding code to use /proc, after changing it
7368 to use HEURISTIC1.
7369 * Added HP/UX incremental GC support and HP/UX 11 thread support.
7370 Thread support is currently still flakey.
7371 * Added basic Linux/IA64 support.
7372 * Integrated Anthony Green's PicoJava support.
7373 * Integrated Scott Ananian's StrongARM/NetBSD support.
7374 * Fixed some fairly serious performance bugs in the incremental
7375 collector.  These have probably been there essentially forever.
7376 (Mark bits were sometimes set before scanning dirty pages.
7377 The reclaim phase unnecessarily dirtied full small object pages.)
7378 * Changed the reclaim phase to ignore nearly full pages to avoid
7379 touching them.
7380 * Limited GC_black_list_spacing to roughly the heap growth increment.
7381 * Changed full collection triggering heuristic to decrease full GC
7382 frequency by default, but to explicitly trigger full GCs during
7383 heap growth.  This doesn't always improve things, but on average it's
7384 probably a win.
7385 * GC_debug_free(0, ...) failed.
7388 == [5.0alpha3] ==
7390 * Added some highly incomplete code to support a copied young generation.
7391 Comments on nursery.h are appreciated.
7392 * Changed -DFIND_LEAK, -DJAVA_FINALIZATION, and -DFINALIZE_ON_DEMAND,
7393 so the same effect could be obtained with a runtime switch.   This is
7394 a step towards standardizing on a single dynamic GC library.
7395 * Significantly changed the way leak detection is handled, as a consequence
7396 of the above.
7399 == [5.0alpha2] ==
7401 * Fixed bugs introduced in alpha1 (OpenBSD & large block initialization).
7402 * Added -DKEEP_BACK_PTRS and backptr.h interface.  (The implementation
7403 idea came from Al Demers.)
7406 == [5.0alpha1] ==
7408 * Reworked large block allocator.  Now uses multiple doubly linked free
7409 lists to approximate best fit.
7410 * Changed heap expansion heuristic.  Entirely free blocks are no longer
7411 counted towards the heap size.  This seems to have a major impact on
7412 heap size stability; the old version could expand the heap way too
7413 much in the presence of large block fragmentation.
7414 * added -DGC_ASSERTIONS and some simple assertions inside the collector.
7415 This is mainlyt for collector debugging.
7416 * added -DUSE_MUNMAP to allow the heap to shrink.  Supported on only
7417 a few UNIX-like platforms for now.
7418 * added GC_dump_regions() for debugging of fragmentation issues.
7419 * Changed PowerPC pointer alignment under Linux to 4.
7420 * Changed the Linux/Alpha port to walk the data segment backwards until
7421 it encounters a SIGSEGV.  The old way to find the start of the data
7422 segment broke with a recent release.
7423 * cordxtra.c needed to call GC_REGISTER_FINALIZER instead of
7424 GC_register_finalizer, so that it would continue to work with GC_DEBUG.
7425 * allochblk sometimes cleared the wrong block for debugging purposes
7426 when it dropped blacklisted blocks.  This could result in spurious
7427 error reports with GC_DEBUG.
7428 * added MACOS X Server support.
7429 * Changed the Solaris threads code to ignore stack limits > 8 MB with
7430 a warning.  Empirically, it is not safe to access arbitrary pages
7431 in such large stacks.  And the dirty bit implementation does not
7432 guarantee that none of them will be accessed.
7433 * Integrated Martin Tauchmann's Amiga changes.
7434 * Integrated James Dominy's OpenBSD/SPARC port.
7437 == [4.14] ==
7439 * changed STACKBOTTOM for DJGPP.
7442 == [4.14alpha2] ==
7444 * -DSMALL_CONFIG did not work reliably with large (> 4K) pages.
7445 Recycling the mark stack during expansion could result in a size
7446 zero heap segment, which confused things.  (This was probably also an
7447 issue with the normal config and huge pages.)
7448 * Did more work to make sure that callee-save registers were scanned
7449 completely, even with the setjmp-based code.  Added USE_GENERIC_PUSH_REGS
7450 macro to facilitate testing on machines I have access to.
7451 * Added code to explicitly push register contents for win32 threads.
7452 This seems to be necessary.
7455 == [4.14alpha1] ==
7457 * Fixed GC_print_source_ptr to not use a prototype.
7458 * generalized CYGWIN test.
7459 * gc::new did the wrong thing with PointerFreeGC placement.
7460 * In the ALL_INTERIOR_POINTERS (default) case, some callee-save register
7461 values could fail to be scanned if the register was saved and
7462 reused in a GC frame.  This showed up in verbose mode with gctest
7463 compiled with an unreleased SGI compiler.  I vaguely recall an old
7464 bug report that may have been related.  The bug was probably quite old.
7465 (The problem was that the stack scanning could be deferred until
7466 after the relevant frame was overwritten, and the new save location
7467 might be outside the scanned area.  Fixed by more eager stack scanning.)
7468 * PRINT_BLACK_LIST had some problems.  A few source addresses were garbage.
7469 * Replaced Makefile.dj and added -I flags to cord make targets.
7470 * GC_try_to_collect was broken with the non-incremental collector.
7471 * gc_cleanup destructors could pass the wrong address to
7472 GC_register_finalizer_ignore_self in the presence of multiple
7473 inheritance.
7474 * Changed PowerPC Linux stack finding code.
7477 == [4.13] ==
7479 * Fixed a crucial bug in the Watcom port.  There was a redundant declaration
7480 of GC_push_one in gc_priv.h.
7481 * Added FINALIZE_ON_DEMAND.
7482 * Fixed some pre-ANSI cc problems in test.c.
7483 * Removed getpagesize() use for Solaris.  It seems to be missing in one
7484 or two versions.
7485 * Fixed bool handling for SPARCCompiler version 4.2.
7486 * Fixed some files in include that had gotten unlinked from the main
7487 copy.
7488 * Some RS/6000 fixes (missing casts).
7489 * Fixed several problems in GC_debug_realloc, affecting mostly the
7490 FIND_LEAK case.
7491 * GC_exclude_static_roots contained a buggy unsigned comparison to
7492 terminate a loop.
7493 * CORD_str failed if the substring occurred at the last possible position.
7494 (Only affects cord users.)
7495 * Fixed Linux code to deal with RedHat 5.0 and integrated Peter Bigot's
7496 os_dep.c code for dealing with various Linux versions.
7497 * Added workaround for Irix pthreads sigaction bug and possible signal
7498 misdirection problems.
7499 Since alpha1:
7500 * Changed RS6000 STACKBOTTOM.
7501 * Integrated Patrick Beard's Mac changes.
7502 * Alpha1 didn't compile on Irix m.n, m < 6.
7503 * Replaced Makefile.dj with a new one from Gary Leavens.
7504 * Added Andrew Stitcher's changes to support SCO OpenServer.
7505 * Added PRINT_BLACK_LIST, to allow debugging of high densities of false
7506 pointers.
7507 * Added code to debug allocator to keep track of return address
7508 in GC_malloc caller, thus giving a bit more context.
7509 * Changed default behavior of large block allocator to more
7510 aggressively avoid fragmentation.  This is likely to slow down the
7511 collector when it succeeds at reducing space cost.
7512 * Integrated Fergus Henderson's CYGWIN32 changes.  They are untested,
7513 but needed for newer versions.
7514 * USE_MMAP had some serious bugs.  This caused the collector to fail
7515 consistently on Solaris with -DSMALL_CONFIG.
7516 * Added Linux threads support.
7517 * Fixed more Linux threads problems.
7518 * Changed default GC_free_space_divisor to 3 with new large block allocation.
7519 * More CYGWIN32 fixes.
7520 * Integrated Tyson-Dowd's Linux-M68K port.
7521 * Minor HP PA and DEC UNIX fixes from Fergus Henderson.
7522 * Integrated Christoffe Raffali's Linux-SPARC changes.
7523 * Allowed for one more GC fixup iteration after a full GC in incremental
7524 mode.  Some quick measurements suggested that this significantly
7525 reduces pause times even with smaller GC_RATE values.
7526 * Moved some more GC data structures into GC_arrays.  This decreases
7527 pause times and GC overhead, but makes debugging slightly less convenient.
7528 * Fixed namespace pollution problem ("excl_table").
7529 * Made GC_incremental a constant for -DSMALL_CONFIG, hopefully shrinking
7530 that slightly.
7531 * Added some win32 threads fixes.
7532 * Integrated Ivan Demakov and David Stes' Watcom fixes.
7533 * Various other minor fixes contributed by many people.
7534 * Renamed config.h to gcconfig.h, since config.h tends to be used for
7535 many other things.
7536 * Integrated Matthew Flatt's support for 68K MacOS "far globals".
7537 * Fixed up some of the dynamic library Makefile targets for consistency
7538 across platforms.
7539 * Fixed a USE_MMAP typo that caused out-of-memory handling to fail
7540 on Solaris.
7541 * Added code to test.c to test thread creation a bit more.
7542 * Integrated GC_win32_free_heap.
7543 * Fixed Solaris 2.7 stack base finding problem.  (This may actually
7544 have been done in an earlier alpha release.)
7545 Since alpha3:
7546 * Fixed MSWIN32 recognition test, which interfered with cygwin.
7547 * Removed unnecessary gc_watcom.asm from distribution.  Removed
7548 some obsolete README.win32 text.
7549 * Added Alpha Linux incremental GC support.
7550 Changed Linux signal handler context argument to be a pointer.
7551 * Took care of some new warnings generated by the 7.3 SGI compiler.
7552 * Integrated Phillip Musumeci's FreeBSD/ELF fixes.
7553 * -DIRIX_THREADS was broken with the -o32 ABI (typo in gc_priv.h>
7556 == [4.12] ==
7558 * Fixed ElfW definition in dyn_load.c.
7559 This prevented the dynamic library support from compiling on some
7560 older ELF Linux systems.
7561 * Fixed UTS4 port (which I apparently mangled during the integration)
7562 * "Make C++" failed on Suns with SC4.0, due to a problem with "bool".
7563 Fixed in gc_priv.h.
7564 * Added more pieces for GNU win32.
7565 The current state of things should suffice for at least some
7566 applications.
7567 * Changed the out of memory retry count handling.  (This matters only
7568 if GC_max_retries > 0, which is no longer the default.)
7569 * If a /proc read failed repeatedly, GC_written_pages was not updated
7570 correctly.
7571 * Under unlikely circumstances, the allocator could infinite loop in
7572 an out of memory situation.
7573 * Fixed a syntactic error in the DJGPP code.  Also fixed a test program
7574 problem with DJGPP.
7575 * Atomic uncollectable objects were not treated correctly by the
7576 incremental collector.  This resulted in weird log statistics and
7577 occasional performance problems.
7578 * Fixed some problems resulting from compilers that don't define
7579 __STDC__.  In this case void * and char * were used inconsistently
7580 in some cases.  (Void * should not have been used at all.  If
7581 you have an ANSI superset compiler that does not define __STDC__,
7582 please compile with -D__STDC__=0.)
7583 * Fixed a compilation problem on Irix with -n32 and -DIRIX_THREADS.
7584 Also fixed some other IRIX_THREADS problems which may or may not have
7585 had observable symptoms.
7586 * Fixed an HP PA compilation problem in dyn_load.c.
7587 * SEGV fault handlers sometimes did not get reset correctly.
7588 * Added a fix for SOLARIS_THREADS on Intel.
7589 This probably needs more work to become functional.
7590 * Fixed struct sigcontext_struct in os_dep.c for compilation under
7591 Linux 2.1.X.
7592 * Changed the DJGPP STACKBOTTOM and DATASTART values to those ones suggested.
7593 These may still not be right, but it is
7594 it is likely to work more often than what was there before.  They may
7595 even be exactly right.
7596 * Added a #include <string.h> to test_cpp.cc.  This appears to help
7597 with HP/UX and gcc.
7598 * Version 4.11 failed to run in incremental mode on recent 64-bit Irix
7599 kernels.  This was a problem related to page unaligned heap segments.
7600 Changed the code to page align heap sections on all platforms.
7601 (I had mistakenly identified this as a kernel problem earlier.
7602 It was not.)
7603 * Version 4.11 did not make allocated storage executable, except on
7604 one or two platforms, due to a bug in a #if test.
7605 * Added sparc_sunos4_mach_dep.s to support Sun's compilers under SunOS4.
7606 * Added GC_exclude_static_roots.
7607 * Fixed the object size mapping algorithm.  This shouldn't matter,
7608 but the old code was ugly.
7609 * Heap checking code could die if one of the allocated objects was
7610 larger than its base address.  (Unsigned underflow problem.)
7611 * Added RS6000 (AIX) dynamic library support and fixed STACK_BOTTOM.
7612 * Added Fergus Henderson's patches for improved robustness with large
7613 heaps and lots of blacklisting.
7614 * Added Peter Chubb's changes to support Solaris Pthreads, to support
7615 MMAP allocation in Solaris, to allow Solaris to find dynamic libraries
7616 through /proc, to add malloc_typed_ignore_off_page, and a few other
7617 minor features and bug fixes.
7618 * The Solaris 2 port should not use sbrk.  I received confirmation from
7619 Sun that the use of sbrk and malloc in the same program is not
7620 supported.  The collector now defines USE_MMAP by default on Solaris.
7621 * Replaced the djgpp makefile with Gary Leavens' version.
7622 * Fixed MSWIN32 detection test.
7623 * Added Fergus Henderson's patches to allow putting the collector into
7624 a DLL under GNU win32.
7625 * Added Ivan V. Demakov's port to Watcom C on X86.
7626 * Added Ian Piumarta's Linux/PowerPC port.
7627 * Added PointerFreeGC to the placement
7628 options in gc_cpp.h.  This is of course unsafe, and may be controversial.
7629 On the other hand, it seems to be needed often enough that it's worth
7630 adding as a standard facility.
7633 == [4.11] ==
7635 * Rationalized (hopefully) GC_try_to_collect in an incremental collection
7636 environment.  It appeared to not handle a call while a collection was in
7637 progress, and was otherwise too conservative.
7638 * Merged GC_reclaim_or_delete_all into GC_reclaim_all to get rid of some
7639 code.
7640 * Added Patrick Beard's Mac fixes, with substantial completely untested
7641 modifications.
7642 * Fixed the MPROTECT_VDB code to deal with large pages and imprecise
7643 fault addresses (as on an UltraSPARC running Solaris 2.5).  Note that this
7644 was not a problem in the default configuration, which uses PROC_VDB.
7645 * The DEC Alpha assembly code needed to restore $gp between calls.
7646 * The write command for "de" was completely broken for large files.
7647 I used the easiest portable fix, which involved changing the semantics
7648 so that f.new is written instead of overwriting f.  That's safer anyway.
7649 * Added README.solaris2 with a discussion of the possible problems of
7650 mixing the collector's sbrk allocation with malloc/realloc.
7651 * Changed the data segment starting address for SGI machines.  The
7652 old code failed under IRIX6.
7653 * Required double word alignment for MIPS.
7654 * Various minor fixes to remove warnings.
7655 * Attempted to fix some Solaris threads problems.
7656 In particular, the collector could try to fork a thread with the
7657 world stopped as part of GC_thr_init.  It also failed to deal with
7658 the case in which the original thread terminated before the whole
7659 process did.
7660 * Added -DNO_EXECUTE_PERMISSION.  This has a major performance impact
7661 on the incremental collector under Irix, and perhaps under other
7662 operating systems.
7663 * Added some code to support allocating the heap with mmap.  This may
7664 be preferable under some circumstances.
7665 * Integrated dynamic library support for HP.
7666 * Integrated James Clark's win32 threads support, and made a number
7667 of changes to it. This is still not 100% solid.
7668 * Integrated Alistair Crooks' support for UTS4 running on an Amdahl
7669 370-class machine.
7670 * Fixed a serious bug in explicitly typed allocation.  Objects requiring
7671 large descriptors where handled in a way that usually resulted in
7672 a segmentation fault in the marker.
7673 * Added partial support for GNU win32 development.
7674 * Added optional support for Java-style finalization semantics.
7675 This is recommended only for Java implementations.
7676 * GC_malloc_uncollectable faulted instead of returning 0 when out of
7677 memory.
7678 * Calls to GC_base before the collector was initialized failed on a
7679 DEC Alpha.
7680 * Added base pointer checking to GC_REGISTER_FINALIZER in debugging mode.
7681 * GC_debug_realloc failed for uncollectable objects.
7682 * Explicitly typed allocation could crash if it ran out of memory.
7683 * Added minimal support for a DEC Alpha running Linux.
7684 * Fixed a problem with allocation of objects whose size overflowed
7685 ptrdiff_t.  (This now fails unconditionally, as it should.)
7686 * Added the beginning of Irix pthread support.
7687 * Integrated Xiaokun Zhu's fixes for djgpp 2.01.
7688 * Added SGI-style STL allocator support (gc_alloc.h).
7689 * Fixed a serious bug in README.solaris2.
7690 Multi-threaded programs must include
7691 gc.h with SOLARIS_THREADS defined.
7692 * Changed GC_free so it actually deallocates uncollectable objects.
7693 * Added Linux ELF support for dynamic libraries.
7694 * Changed the Borland cc configuration so that the assembler is not
7695 required.
7696 * Fixed a bug in the C++ test that caused it to fail in 64-bit
7697 environments.
7700 == [4.10] ==
7702 * Fixed a typo around a call to GC_collect_or_expand in alloc.c.  It broke
7703 handling of out of memory.
7706 == [4.9] ==
7708 * More README.debugging fixes.
7709 * Objects ready for finalization, but not finalized in the same GC
7710 cycle, could be prematurely collected.  This occasionally happened
7711 in test_cpp.
7712 * Too little memory was obtained from the system for very large
7713 objects.  That could cause a heap explosion if these objects were
7714 not contiguous (e.g. under PCR), and too much of them was blacklisted.
7715 * Due to an improper initialization, the collector was too hesitant to
7716 allocate blacklisted objects immediately after system startup.
7717 * Moved GC_arrays from the data into the bss segment by not explicitly
7718 initializing it to zero.  This significantly
7719 reduces the size of executables, and probably avoids some disk accesses
7720 on program startup.  It's conceivable that it might break a port that I
7721 didn't test.
7722 * Fixed EMX_MAKEFILE to reflect the gc_c++.h to gc_cpp.h renaming which
7723 occurred a while ago.
7726 == [4.8] ==
7728 * Changed a "comment" in a MacOS specific part of mach_dep.c that caused
7729 gcc to fail on other platforms.
7732 == [4.7] ==
7734 * Fixed some compilation problems with -DCHECKSUMS.
7735 * Updated some Mac specific files.
7736 * Fixed a serious bug for machines with non-word-aligned pointers.
7739 == [4.6] ==
7741 * Added Linux ELF support.
7742 * GC_base crashed if it was called before any other GC_ routines.
7743 This could happen if a gc_cleanup object was allocated outside the heap
7744 before any heap allocation.
7745 * The heap expansion heuristic was not stable if all objects had finalization
7746 enabled.  Fixed finalize.c to count memory in finalization queue and
7747 avoid explicit deallocation.  Changed alloc.c to also consider this count.
7748 (This is still not recommended.  It's expensive if nothing else.)
7749 * GC_malloc_uncollectable(0) was broken.
7750 * The collector didn't compile under Linux 1.3.X.
7751 The current workaround is ugly, but expected to be temporary.
7752 * Fixed a formatting problem for SPARC stack traces.
7753 * Fixed some '=='s in os_dep.c that should have been assignments.
7754 Fortunately these were in code that should never be executed anyway.
7755 * Fixed the heap block allocator to only drop blacklisted blocks in small
7756 chunks.  Made BL_LIMIT self adjusting.  (Both of these were in response
7757 to heap growth observed by Paul Graham.)
7758 * Fixed the Metrowerks/68K Mac code to also mark from a6.
7759 * Significantly updated README.debugging.
7760 * Fixed some problems with longjmps out of signal handlers, especially under
7761 Solaris.  Added a workaround for the fact that siglongjmp doesn't appear to
7762 do the right thing with -lthread under Solaris.
7763 * Added MSDOS/djgpp port.
7764 * Added "make reserved_namespace" and "make user_namespace".  The
7765 first renames ALL "GC_xxx" identifiers as "_GC_xxx".  The second is the
7766 inverse transformation.  Note that doing this is guaranteed to break all
7767 clients written for the other names.
7768 * descriptor field for kind NORMAL in GC_obj_kinds with ADD_BYTE_AT_END
7769 defined should be -ALIGNMENT not WORDS_TO_BYTES(-1).  This is
7770 a serious bug on machines with pointer alignment of less than a word.
7771 * GC_ignore_self_finalize_mark_proc didn't handle pointers to very near the
7772 end of the object correctly.  Caused failures of the C++ test on a DEC Alpha
7773 with g++.
7774 * gc_inl.h still had problems.  Partially fixed.  Added warnings at the
7775 beginning to hopefully specify the remaining dangers.
7776 * Added DATAEND definition to config.h.
7777 * Fixed some of the .h file organization.  Fixed "make floppy".
7780 == [4.5] ==
7782 * Fixed many minor and one major README bugs.
7783 * Fixed ALPHA/OSF/1 dynamic library support.
7784 * Added incremental GC support (MPROTECT_VDB) for Linux (with some
7785 help from Bruno Haible).
7786 * Altered SPARC recognition tests in gc.h and config.h.
7787 * Added basic incremental GC support for win32, as implemented by
7788 Windows NT and Windows 95.  GC_enable_incremental is a no-op
7789 under win32s, which doesn't implement enough of the VM interface.
7790 * Added -DLARGE_CONFIG.
7791 * Fixed GC_..._ignore_off_page to also function without
7792 -DALL_INTERIOR_POINTERS.
7793 * (Hopefully) fixed RS/6000 port.  (Only the test was broken.)
7794 * Fixed a performance bug in the non-incremental collector running
7795 on machines supporting incremental collection with MPROTECT_VDB
7796 (e.g. SunOS 4, DEC AXP).  This turned into a correctness bug under
7797 win32s with win32 incremental collection.  (Not all memory protection
7798 was disabled.)
7799 * Fixed some ppcr related bit rot.
7800 * Caused dynamic libraries to be unregistered before re-registering.
7801 The old way turned out to be a performance bug on some machines.
7802 * GC_root_size was not properly maintained under MSWIN32.
7803 * Added -DNO_DEBUGGING and GC_dump.
7804 * Fixed a couple of bugs arising with SOLARIS_THREADS +
7805 REDIRECT_MALLOC.
7806 * Added NetBSD/M68K port.
7807 * Fixed a serious realloc bug.  For certain object sizes, the collector
7808 wouldn't scan the expanded part of the object.
7811 == [4.4] ==
7813 * ASM_CLEAR_CODE was erroneously defined for HP
7814 PA machines, resulting in a compile error.
7815 * Fixed OS/2 Makefile to create a library.
7816 * Gc_cleanup objects didn't work if they were created on
7817 the stack.  Fixed.
7818 * One copy of Gc_cpp.h in the distribution was out of
7819 synch, and failed to document some known compiler
7820 problems with explicit destructor invocation.  Partially
7821 fixed.  There are probably other compilers on which
7822 gc_cleanup is miscompiled.
7823 * Fixed Makefile to pass C compiler flags to C++ compiler.
7824 * Added Mac fixes.
7825 * Fixed os_dep.c to work around what appears to be
7826 a new and different VirtualQuery bug under newer
7827 versions of win32S.
7828 * GC_non_gc_bytes was not correctly maintained by
7829 GC_free.  Fixed.
7830 * Added GC_set_max_heap_size.
7831 * Changed allocation code to ignore blacklisting if it is preventing
7832 use of a very large block of memory.  This has the advantage
7833 that naive code allocating very large objects is much more
7834 likely to work.  The downside is you might no
7835 longer find out that such code should really use
7836 GC_malloc_ignore_off_page.
7837 * Changed GC_printf under win32 to close and reopen the file
7838 between calls.  FAT file systems otherwise make the log file
7839 useless for debugging.
7840 * Added GC_try_to_collect and GC_get_bytes_since_gc.  These
7841 allow starting an abortable collection during idle times.
7842 This facility does not require special OS support.
7843 * Added some support for the Borland development environment.
7844 * Removed a misfeature from checksums.c that caused unexpected
7845 heap growth.
7846 * Changed finalize.c to call WARN if it encounters a finalization cycle.
7847 WARN is defined in gc_priv.h to write a message, usually to stdout.
7848 In many environments, this may be inappropriate.
7849 * Renamed NO_PARAMS in gc.h to GC_NO_PARAMS, thus adhering to my own
7850 naming convention.
7851 * Added GC_set_warn_proc to intercept warnings.
7852 * Fixed Amiga port.
7853 * Fixed a bug in mark.c that could result in an access to unmapped
7854 memory from GC_mark_from_mark_stack on machines with unaligned
7855 pointers.
7856 * Fixed a win32 specific performance bug that could result in scanning of
7857 objects allocated with the system malloc.
7858 * Added REDIRECT_MALLOC.
7861 == [4.3] ==
7863 * Fixed SPARC alignment problem with GC_DEBUG.
7864 * Fixed Solaris threads /proc workaround.  The real
7865 problem was an interaction with mprotect.
7866 * Incorporated fix from Patrick Beard for gc_c++.h (now gc_cpp.h).
7867 * Slightly improved allocator space utilization by
7868 fixing the GC_size_map mechanism.
7869 * Integrated some Sony News and MIPS RISCos 4.51
7870 patches.
7871 * Fixed HP_PA alignment problem.
7872 * Added GC_same_obj and friends.  Changed GC_base
7873 to return 0 for pointers past the end of large objects.
7874 Improved GC_base performance with ALL_INTERIOR_POINTERS
7875 on machines with a slow integer mod operation.
7876 Added GC_PTR_ADD, GC_PTR_STORE, etc. to prepare
7877 for preprocessor.
7878 * changed the default on most UNIX machines to be that
7879 signals are not disabled during critical GC operations.
7880 This is still ANSI-conforming, though somewhat dangerous
7881 in the presence of signal handlers. But the performance
7882 cost of the alternative is sometimes problematic.
7883 Can be changed back with a minor Makefile edit.
7884 * renamed IS_STRING in gc.h, to CORD_IS_STRING, thus
7885 following my own naming convention.  Added the function
7886 CORD_to_const_char_star.
7887 * Fixed a gross bug in GC_finalize.  Symptom: occasional
7888 address faults in that function.
7889 * Added port to ICL DRS6000 running DRS/NX.  Restructured
7890 things a bit to factor out common code, and remove obsolete
7891 code.  Collector should now run under SUNOS5 with either
7892 mprotect or /proc dirty bits.
7893 * More bug fixes and workarounds for Solaris 2.X.  (These were
7894 mostly related to putting the collector in a dynamic library,
7895 which didn't really work before.  Also SOLARIS_THREADS
7896 didn't interact well with dl_open.)
7897 * Fixed a serious performance bug on the DEC Alpha.  The text
7898 segment was getting registered as part of the root set.
7899 (Amazingly, the result was still fast enough that the bug
7900 was not conspicuous.) The fix works on OSF/1, version 1.3.
7901 Hopefully it also works on other versions of OSF/1 ...
7902 * Fixed a bug in GC_clear_roots.
7903 * Fixed a bug in GC_generic_malloc_words_small that broke
7904 gc_inl.h.
7905 * Fixed some problems with cord/de under Linux.
7906 * Fixed some cord problems, notably with CORD_riter4.
7907 * Added DG/UX port.
7908 * Added finalization registration routines with weaker ordering
7909 constraints.  (This is necessary for C++ finalization with
7910 multiple inheritance, since the compiler often adds self-cycles.)
7911 * Filled the holes in the SCO port.
7912 * John Ellis' additions to the C++ support:  From John:
7913 * I completely rewrote the documentation in the interface gc_c++.h
7914 (later renamed gc_cpp.h).  I've tried to make it both clearer and more
7915 precise.
7916 * The definition of accessibility now ignores pointers from an
7917 finalizable object (an object with a clean-up function) to itself.
7918 This allows objects with virtual base classes to be finalizable by the
7919 collector.  Compilers typically implement virtual base classes using
7920 pointers from an object to itself, which under the old definition of
7921 accessibility prevented objects with virtual base classes from ever
7922 being collected or finalized.
7923 * gc_cleanup now includes gc as a virtual base.  This was enabled by
7924 the change in the definition of accessibility.
7925 * I added support for operator new[].  Since most compilers
7926 don't yet support operator new[], it is conditionalized on
7927 -DOPERATOR_NEW_ARRAY.  The code is untested, but its trivial and looks
7928 correct.
7929 * The test program test_gc_c++ (later renamed test_cpp.cc)
7930 tries to test for the C++-specific functionality not tested by the
7931 other programs.
7932 * Added unistd.h include to misc.c.  (Needed for ppcr.)
7933 * Added PowerMac port.
7934 * Fixed "srcdir"-related Makefile problems.  Changed things so
7935 that all externally visible include files always appear in the
7936 include subdirectory of the source.  Made gc.h directly
7937 includable from C++ code.
7938 * Changed Intel code to also mark from ebp
7939 * Renamed C++ related files so they could live in a FAT
7940 file system.
7941 * Changed Windows NT Makefile to include C++ support in
7942 gc.lib.  Added C++ test as Makefile target.
7945 == [4.2] ==
7947 * Multiple bug fixes/workarounds in the Solaris threads version.
7948 (It occasionally failed to locate some register contents for
7949 marking.  It also turns out that thr_suspend and friends are
7950 unreliable in Solaris 2.3.  Dirty bit reads appear
7951 to be unreliable under some weird
7952 circumstances.  My stack marking code
7953 contained a serious performance bug.  The new code is
7954 extremely defensive, and has not failed in several CPU
7955 hours of testing.  But no guarantees ...)
7956 * Added MacOS support.
7957 * Fixed several syntactic bugs in gc_c++.h and friends.  (These
7958 didn't bother g++, but did bother most other compilers.)
7959 Fixed gc_c++.h finalization interface.
7960 * 64 bit alignment for allocated objects was not guaranteed in a
7961 few cases in which it should have been.
7962 * Added GC_malloc_atomic_ignore_off_page.
7963 * Added GC_collect_a_little.
7964 * Added some prototypes to gc.h.
7965 * Some other minor bug fixes (notably in Makefile).
7966 * Fixed OS/2 / EMX port.
7967 * Fixed AmigaDOS port.
7968 * Fixed the DATASTART definition under Solaris.  There
7969 was a 1 in 16K chance of the collector missing the first
7970 64K of static data (and thus crashing).
7971 * Fixed some blatant anachronisms in the README file.
7972 * Fixed PCR-Makefile for upcoming PPCR release.
7975 == [4.1] ==
7977 * Changed finalization implementation to guarantee that
7978 finalization procedures are called outside of the allocation
7979 lock, making direct use of the interface a little less dangerous.
7980 MAY BREAK EXISTING CLIENTS that assume finalizers
7981 are protected by a lock.  Since there seem to be few multi-threaded
7982 clients that use finalization, this is hopefully not much of
7983 a problem.
7984 * Fixed a gross bug in CORD_prev.
7985 * Fixed a bug in blacklst.c that could result in unbounded
7986 heap growth during startup on machines that do not clear
7987 memory obtained from the OS (e.g. win32S).
7988 * Ported de editor to win32/win32S.  (This is now the only
7989 version with a mouse-sensitive UI.)
7990 * Added GC_malloc_ignore_off_page to allocate large arrays
7991 in the presence of ALL_INTERIOR_POINTERS.
7992 * Changed GC_call_with_alloc_lock to not disable signals in
7993 the single-threaded case.
7994 * Reduced retry count in GC_collect_or_expand for garbage
7995 collecting when out of memory.
7996 * Made uncollectable allocations bypass black-listing, as they
7997 should.
7998 * Fixed a bug in typed_test in test.c that could cause (legitimate)
7999 GC crashes.
8000 * Fixed some potential synchronization problems in finalize.c
8001 * Fixed a real locking problem in typd_mlc.c.
8002 * Worked around an AIX 3.2 compiler feature that results in
8003 out of bounds memory references.
8004 * Partially worked around an IRIX5.2 beta problem (which may
8005 or may not persist to the final release).
8006 * Fixed a bug in the heap integrity checking code that could
8007 result in explicitly deallocated objects being identified as
8008 smashed.  Fixed a bug in the dbg_mlc stack saving code
8009 that caused old argument pointers to be considered live.
8010 * Fixed a bug in CORD_ncmp (and hence CORD_str).
8011 * Repaired the OS2 port, which had suffered from bit rot
8012 in 4.0.  Worked around what appears to be CSet/2 V1.0
8013 optimizer bug.
8014 * Fixed a Makefile bug for target "c++".
8017 == [4.0] ==
8019 * Added support for Solaris threads (which was possible
8020 only by reimplementing some fraction of Solaris threads,
8021 since Sun doesn't currently make the thread debugging
8022 interface available).
8023 * Added non-threads win32 and win32S support.
8024 * (Grudgingly, with suitable muttering of obscenities) renamed
8025 files so that the collector distribution could live on a FAT
8026 file system.  Files that are guaranteed to be useless on
8027 a PC still have long names.  Gc_inline.h and gc_private.h
8028 still exist, but now just include  gc_inl.h and gc_priv.h.
8029 * Fixed a really obscure bug in finalization that could cause
8030 undetected mark stack overflows.  (I would be surprised if
8031 any real code ever tickled this one.)
8032 * Changed finalization code to dynamically resize the hash
8033 tables it maintains.  (This probably does not matter for well-
8034 -written code.  It no doubt does for C++ code that overuses
8035 destructors.)
8036 * Added typed allocation primitives.  Rewrote the marker to
8037 accommodate them with more reasonable efficiency.  This
8038 change should also speed up marking for GC_malloc allocated
8039 objects a little.  See gc_typed.h for new primitives.
8040 * Improved debugging facilities slightly.  Allocation time
8041 stack traces are now kept by default on SPARC/SUNOS4.
8042 * Added better support for small heap applications.
8043 * Significantly extended cord package.  Fixed a bug in the
8044 implementation of lazily read files.  Printf and friends now
8045 have cord variants.  Cord traversals are a bit faster.
8046 * Made ALL_INTERIOR_POINTERS recognition the default.
8047 * Fixed de so that it can run in constant space, independent
8048 of file size.  Added simple string searching to cords and de.
8049 * Added the Hull-Ellis C++ interface.
8050 * Added dynamic library support for OSF/1.
8051 * Changed argument to GC_expand_hp to be expressed
8052 in units of bytes instead of heap blocks.  (Necessary
8053 since the heap block size now varies depending on
8054 configuration.  The old version was never very clean.)
8055 * Added GC_get_heap_size().  The previous "equivalent"
8056 was broken.
8057 * Restructured the Makefile a bit.
8060 == [3.7] ==
8062 * Added a workaround for an HP/UX compiler bug.
8063 * Fixed another stack clearing performance bug.  Reworked
8064 that code once more.
8067 == [3.6] ==
8069 * fixed a bug in the mark stack growth code that was introduced
8070 in 3.4.
8071 * fixed Makefile to work around DEC AXP compiler tail recursion
8072 bug.
8075 == [3.5] ==
8077 * Minor collections now mark from roots only once, if that
8078 doesn't cause an excessive pause.
8079 * The stack clearing heuristic was refined to prevent anomalies
8080 with very heavily recursive programs and sparse stacks.
8081 * Fixed a bug that prevented mark stack growth in some cases.
8082 GC_objects_are_marked should be set to TRUE after a call
8083 to GC_push_roots and as part of GC_push_marked, since
8084 both can now set mark bits.  I think this is only a performance
8085 bug, but I wouldn't bet on it.  It's certainly very hard to argue
8086 that the old version was correct.
8087 * Fixed an incremental collection bug that prevented it from
8088 working at all when HBLKSIZE != getpagesize()
8089 * Changed dynamic_loading.c to include gc_priv.h before testing
8090 DYNAMIC_LOADING.  SunOS dynamic library scanning
8091 must have been broken in 3.4.
8092 * Object size rounding now adapts to program behavior.
8093 * Added a workaround (provided by Manuel Serrano and
8094 colleagues) to a long-standing SunOS 4.X (and 3.X) ld bug
8095 that I had incorrectly assumed to have been squished.
8096 The collector was broken if the text segment size was within
8097 32 bytes of a multiple of 8K bytes, and if the beginning of
8098 the data segment contained interesting roots.  The workaround
8099 assumes a demand-loadable executable.  The original may have
8100 have "worked" in some other cases.
8101 * Added dynamic library support under IRIX5.
8102 * Added support for EMX under OS/2.
8105 == [3.4] ==
8107 * Fixed a performance bug in GC_realloc.
8108 * Updated the amiga port.
8109 * Added NetBSD and 386BSD ports.
8110 * Added cord library.
8111 * Added trivial performance enhancement for
8112 ALL_INTERIOR_POINTERS.  (Don't scan last word.)
8115 == [3.3] ==
8117 * PCR-specific bugs.
8118 * Missing locking in GC_free, redundant FASTUNLOCK
8119 in GC_malloc_stubborn, and 2 bugs in
8120 GC_unregister_disappearing_link.
8121 * Common symbols allocated by the SunOS4.X dynamic loader
8122 were not included in the root set.
8123 * Bug in GC_finalize
8124 * Merged Amiga port from Jesper Peterson (untested)
8125 * Merged NeXT port from Thomas Funke (significantly
8126 modified and untested)
8129 == [3.2] ==
8131 Fixed a serious and not entirely repeatable bug in
8132 the incremental collector.  It appeared only when dirty bit info
8133 on the roots was available, which is normally only under Solaris.
8134 It also added GC_general_register_disappearing_link, and some
8135 testing code.  Interface.c disappeared.
8138 == [3.1] ==
8140 * A workaround for a SunOS 4.X SPARC C compiler
8141 misfeature that caused problems when the collector was turned into
8142 a dynamic library.
8143 * A fix for a bug in GC_base that could result in a memory fault.
8144 * A fix for a performance bug (and several other misfeatures) pointed
8145 out by Dave Detlefs and Al Dosser.
8146 * Use of dirty bit information for static data under Solaris 2.X.
8147 * DEC Alpha/OSF1 support.
8148 * Incremental collection on more platforms.
8149 * A more refined heap expansion policy.  Less space usage by default.
8150 * Various minor enhancements to reduce space usage, and to reduce
8151 the amount of memory scanned by the collector.
8152 * Uncollectable allocation without per object overhead.
8153 * More conscientious handling of out-of-memory conditions.
8154 * Fixed a bug in debugging stubborn allocation.
8155 * Fixed a bug that resulted in occasional erroneous reporting of smashed
8156 objects with debugging allocation.
8157 * Fixed bogus leak reports of size 4096 blocks with FIND_LEAK.
8160 == [3.0] ==
8162 Added generational/incremental collection and stubborn objects.
8165 == [2.5] ==
8167 * Removed an explicit call to exit(1)
8168 * Fixed calls to GC_printf and GC_err_printf, so the correct number of
8169 arguments are always supplied.  The OS/2 C compiler gets confused if
8170 the number of actuals and the number of formals differ.  (ANSI C
8171 doesn't require this to work.  The ANSI sanctioned way of doing things
8172 causes too many compatibility problems.)
8175 == [2.4] ==
8177 Added GC_free_space_divisor as a tuning knob, added
8178 support for OS/2 and linux, and fixed the following bugs:
8179 * On machines with unaligned pointers (e.g. Sun 3), every 128th word could
8180 fail to be considered for marking.
8181 * Dynamic_load.c erroneously added 4 bytes to the length of the data and
8182 bss sections of the dynamic library.  This could result in a bad memory
8183 reference if the actual length was a multiple of a page.  (Observed on
8184 Sun 3.  Can probably also happen on a Sun 4.)
8185 (Dynamic library handling is still broken on Sun 3s
8186 under 4.1.1U1, but apparently not 4.1.1.  If you have such a machine,
8187 use -Bstatic.)
8190 == [2.3] ==
8192 * Added ALL_INTERIOR_POINTERS.
8193 * Missing declaration of etext in the A/UX version.
8194 * Some PCR root-finding problems.
8195 * Blacklisting was not 100% effective, because the plausible future
8196 heap bounds were being miscalculated.
8197 * GC_realloc didn't handle out-of-memory correctly.
8198 * GC_base could return a nonzero value for addresses inside free blocks.
8199 * test.c wasn't really thread safe, and could erroneously report failure
8200 in a multi-threaded environment.  (The locking primitives need to be
8201 replaced for other threads packages.)
8202 * GC_CONS was thoroughly broken.
8203 * On a SPARC with dynamic linking, signals stayed disabled while the
8204 client code was running.
8207 == [2.2] ==
8209 * GC_realloc could fail to extend the size of the object for certain large
8210 object sizes.
8211 * A blatant subscript range error in GC_printf, which unfortunately
8212 wasn't exercised on machines with sufficient stack alignment constraints.
8213 * GC_register_displacement did the wrong thing if it was called after
8214 any allocation had taken place.
8215 * The leak finding code would eventually break after 2048 byte
8216 byte objects leaked.
8217 * interface.c didn't compile.
8218 * The heap size remained much too small for large stacks.
8219 * The stack clearing code behaved badly for large stacks, and perhaps
8220 on HP/PA machines.
8223 == [2.1] ==
8225 * The first stable version since 1.9.
8226 * Added support for PPCR.
8229 == [2.0] ==
8231 * Introduced a consistent naming convention for collector
8232 routines and added support for registering dynamic library data segments
8233 in the standard mark_roots.c.  Most of the data structures were revamped.
8234 The treatment of interior pointers was completely changed.  Finalization
8235 was added.  Support for locking was added.  Object kinds were added.
8236 We added a black listing facility to avoid allocating at addresses known
8237 to occur as integers somewhere in the address space.  Much of this
8238 was accomplished by adapting ideas and code from the PCR collector.
8239 The test program was changed and expanded.
8242 == [1.9] ==
8244 * fixed a major bug in gc_realloc.
8247 == [1.8] ==
8249 * added ULTRIX support in gc_private.h.
8252 == [1.5] ==
8254 * ensure 8 byte alignment for objects allocated on a sparc based machine.
8257 == [1.4] ==
8259 * Does not use compile time determined values
8260 for the stack base.  This no longer works on Sun 3s, since Sun 3/80s use
8261 a different stack base.  We now use a straightforward heuristic on all
8262 machines on which it is known to work (incl. Sun 3s) and compile-time
8263 determined values for the rest.  There should really be library calls
8264 to determine such values.
8267 == [1.3] ==
8269 * Fixed spurious
8270 assembly language assignments to TMP_SP.  Only the assignment in the PC/RT
8271 code is necessary.  On other machines, with certain compiler options,
8272 the assignments can lead to an unsaved register being overwritten.
8273 Known to cause problems under SunOS 3.5 WITHOUT the -O option.  (With
8274 -O the compiler recognizes it as dead code.  It probably shouldn't,
8275 but t2hat's another story.)