implemented Setup.hs to build boehm cpp libs and install them;
[hs-boehmgc.git] / gc-7.2 / ChangeLog
1 [7.2d]
2
3 2012-08-09  Ivan Maidanski <ivmai@mail.ru>
4
5         * doc/README: Change version to 7.2d (rev. D).
6
7 2012-08-05  Ivan Maidanski <ivmai@mail.ru>
8
9         * config.guess: Regenerate (by autoreconf -vif using autoconf-2.68,
10         automake-1.11.1 and libtool-2.4).
11         * config.sub: Likewise.
12         * m4/libtool.m4: Likewise.
13
14 2012-08-02  Ivan Maidanski <ivmai@mail.ru>
15
16         * misc.c (GC_clear_stack_inner): Use GC_approx_sp() instead of
17         "dummy[0]" set to "&dummy" value (that worked as expected only for
18         STACK_GROWS_DOWN case).
19
20 2012-08-02  Ivan Maidanski <ivmai@mail.ru>
21
22         * alloc.c (min_bytes_allocd, GC_stopped_mark): Use GC_approx_sp()
23         instead of "&dummy"; remove 'dummy' local variable.
24         * dyn_load.c (GC_cond_add_roots): Likewise.
25         * misc.c (GC_init): Likewise.
26         * os_dep.c (GC_get_stack_base, GC_get_main_stack_base): Likewise.
27         * pthread_stop_world.c (GC_suspend_handler_inner,
28         nacl_pre_syscall_hook, __nacl_suspend_thread_if_needed): Likewise.
29         * pthread_support.c (GC_thr_init): Likewise.
30         * ptr_chck.c (GC_on_stack): Likewise.
31         * win32_threads.c (GC_push_stack_for): Likewise.
32         * extra/setjmp_t.c (main): Define volatile 'sp' local variable, store
33         its address to it and use it instead of "&dummy"; remove 'dummy' local
34         variable.
35         * mach_dep.c (GC_with_callee_saves_pushed): Use volatile for 'dummy'
36         local variable.
37         * misc.c (GC_clear_stack_inner): Store address of volatile 'dummy'
38         local array (i.e. 'sp' value) to its first element (and use it in the
39         comparison of addresses) to prevent any harmful optimizations as C
40         officially disallows comparisons of pointers to different objects
41         (e.g., some Mac OS X clang releases might turn a conditional
42         expression that uses 'dummy' address into a constant); update comment.
43         * misc.c (GC_call_with_stack_base): Use "&base" instead of "&dummy"
44         (it is safe to use address of base here); remove dummy variable.
45
46 2012-08-01  Ivan Maidanski <ivmai@mail.ru>
47
48         * misc.c (GC_call_with_stack_base): Call GC_noop1 after fn()
49         invocation to prevent a tail-call optimization.
50
51 2012-07-21  Ivan Maidanski <ivmai@mail.ru>
52
53         * os_dep.c (GC_get_stack_base): Abort if pthread_stackseg_np fails
54         (if GC_OPENBSD_THREADS).
55         * pthread_stop_world.c (GC_suspend_all): Get correct stack_ptr by
56         calling pthread_stackseg_np (subtracting ss_size from ss_sp) instead
57         of retrieving it from OpenBSD pthread implementation-dependent context
58         (if GC_OPENBSD_THREADS); remove comment.
59
60 2012-06-17  Ivan Maidanski <ivmai@mail.ru>
61
62         * tests/initsecondarythread.c: Include "private/config.h" if
63         HAVE_CONFIG_H (mostly to have GC_WIN32_PTHREADS defined for
64         pthreads-w32 target).
65         * tests/thread_leak_test.c: Likewise.
66         * tests/threadkey_test.c: Likewise.
67
68 2012-06-16  Ivan Maidanski <ivmai@mail.ru>
69
70         * tests/test_cpp.cc (WinMain): Prevent SEGV in strtok() by checking
71         "cmd" WinMain argument for NULL (in that case "argc" local variable is
72         set to 0).
73
74 2012-06-16  Ivan Maidanski <ivmai@mail.ru>
75
76         * tests/test_cpp.cc (main): Call GC_set_all_interior_pointers(1)
77         before GC_INIT to ensure that the collector considers pointers to
78         object interiors as valid ones (such a pointer could emerge as
79         a result of a type cast to subclass in case of multiple inheritance);
80         add comment.
81
82 [7.2c]
83
84 2012-06-11  Ivan Maidanski <ivmai@mail.ru>
85
86         * doc/README: Change version to 7.2c (rev. C).
87
88 2012-06-08  Ivan Maidanski <ivmai@mail.ru>
89
90         * cordbscs.c (CORD_cat_char_star): Check GC_MALLOC_ATOMIC result for
91         NULL (do OUT_OF_MEMORY in such case) to prevent SEGV.
92
93 2012-06-07  Ivan Maidanski <ivmai@mail.ru>
94
95         * dyn_load.c (GC_register_dynamic_libraries): If GC_scratch_alloc
96         fails (returns null) then abort (with the appropriate message) instead
97         of causing SEGV.
98         * os_dep.c (GC_dirty_init): Likewise.
99         * headers.c (GC_init_headers): Report error and exit if
100         GC_scratch_alloc fails.
101         * include/private/gc_priv.h (GC_scratch_alloc): Improve comment.
102         * os_dep.c (GC_print_address_map): If GC_get_maps return null then
103         print the appropriate message (instead of passing null to GC_err_puts
104         thus causing SEGV).
105
106 2012-06-02  Ivan Maidanski <ivmai@mail.ru>
107
108         * include/private/gc_priv.h (GC_push_all, GC_push_other_roots):
109         Declare as GC_API_PRIV (instead of GC_INNER) to make the symbol
110         externally visible to some well-known 3rd-party software (e.g., ECL).
111         * include/private/gc_priv.h (GC_push_conditional): Declare as
112         GC_API_PRIV (only if GC_DISABLE_INCREMENTAL is undefined).
113         * mark.c (GC_push_all, GC_push_conditional): Remove GC_INNER (to match
114         the declaration).
115         * os_dep.c (GC_push_other_roots): Likewise.
116
117 2012-06-02  Ivan Maidanski <ivmai@mail.ru>
118
119         * include/private/gc_priv.h (GC_clear_mark_bit, GC_set_mark_bit):
120         Declare as GC_API_PRIV (instead of GC_INNER) to make the symbol
121         externally visible to 3rd-party software (e.g., ECL).
122         * mark.c (GC_set_mark_bit, GC_clear_mark_bit): Remove GC_INNER (to
123         match the declaration).
124
125 2012-06-01  Tsugutomo Enami <tsugutomo.enami@jp.sony.com>
126
127         * dyn_load.c: Include sys/param.h and dlfcn.h on NetBSD.
128         * dyn_load.c (GC_FirstDLOpenedLinkMap): Obtain link map using dlinfo()
129         on NetBSD if RTLD_DI_LINKMAP feature present (defined).
130
131 [7.2b]
132
133 2012-05-23  Ivan Maidanski <ivmai@mail.ru>
134
135         * doc/README: Change version to 7.2b (rev. B).
136
137 2012-05-16  Ivan Maidanski <ivmai@mail.ru>
138
139         * malloc.c (GC_malloc_uncollectable): Do not check assertion on
140         hb_n_marks to be zero if multi-threaded; add comment.
141         * mallocx.c (GC_malloc_atomic_uncollectable): Likewise.
142
143 [7.2]
144
145 2012-05-11  Ivan Maidanski  <ivmai@mail.ru>
146
147         * configure.ac, doc/README, include/gc_version.h:
148         Bump version to 7.2 (final).
149         * configure: Regenerate.
150         * Makefile.in: Ditto.
151
152 2012-04-16  H.J. Lu <hjl.tools@gmail.com>
153
154         * include/gc_tiny_fl.h (GC_GRANULE_BYTES): Set to 8 for x32.
155         (GC_GRANULE_WORDS): Set to 2 for x32.
156
157 2012-04-16  H.J. Lu <hjl.tools@gmail.com>
158
159         * include/private/gcconfig.h: (ALIGNMENT): Set to 4 for x32.
160         (CPP_WORDSZ): Set to 32 for x32.
161
162 2012-04-29  Ivan Maidanski <ivmai@mail.ru>
163
164         * alloc.c (GC_check_fl_marks): Cast pointer passed to GC_is_marked to
165         prevent compiler warning.
166
167 2012-04-21  Petter Urkedal <paurkedal@gmail.com>
168
169         * alloc.c (GC_check_fl_marks): Re-read each pointer atomically before
170         following the pointed-to link and bail out if the result is different
171         (this can happen if the thread has popped the object off the
172         free-list); the function is a no-op if AO_load is unavailable.
173
174 2012-04-21  Ivan Maidanski <ivmai@mail.ru>
175
176         * pthread_support.c (GC_remove_all_threads_but_me): Call
177         GC_remove_specific after destroying thread-local list.
178
179 2012-04-20  Ivan Maidanski <ivmai@mail.ru>
180
181         * alloc.c (GC_check_fl_marks): Change prototype (pass pointer to
182         "freelist" element instead of value); do not define the function if
183         THREAD_LOCAL_ALLOC undefined.
184         * include/private/gc_priv.h (GC_check_fl_marks): Likewise.
185         * alloc.c (GC_check_fl_marks): Skip check if the argument points to
186         a special (non-pointer) value; update comment; rename "q" local
187         variable to "list".
188         * thread_local_alloc.c (GC_check_tls_for): Update code according to
189         GC_check_fl_marks functionality change (remove checks for special
190         value).
191
192 2012-04-17  Niklas Therning <niklas@therning.org>
193
194         * include/private/gcconfig.h (HAVE_BUILTIN_UNWIND_INIT): Do not define
195         for clang (as __builtin_unwind_init seems to be a no-op in the latest
196         clang release).
197
198 2012-04-12  Ivan Maidanski <ivmai@mail.ru>
199
200         * include/private/pthread_support.h (DETACHED): Fix a typo in comment.
201
202 2012-04-02  Ivan Maidanski <ivmai@mail.ru>
203
204         * configure: Regenerate.
205         * include/private/config.h.in : Likewise.
206
207 2012-04-02  Ivan Maidanski <ivmai@mail.ru>
208
209         * doc/README.macros (NO_HANDLE_FORK): Replace back with HANDLE_FORK
210         and update.
211         * include/private/gcconfig.h (CAN_HANDLE_FORK): Define also for Darwin
212         in case of MPROTECT_VDB.
213         * misc.c (GC_set_handle_fork): Handle Darwin properly; add comment.
214         * os_dep.c (GC_dirty_init): Do not turn on GC_dirty_maintained for
215         Darwin if GC_handle_fork is on; add comment; remove FIXME.
216         * pthread_support.c (GC_fork_prepare_proc): Remove WARN for Darwin
217         (since GC_dirty_maintained is off in that case).
218         * pthread_support.c (GC_fork_child_proc): Remove comment (for Darwin).
219
220 2012-04-02  Ivan Maidanski <ivmai@mail.ru>
221
222         * include/gc.h (GC_set_handle_fork): New API function.
223         * misc.c (GC_set_handle_fork): Likewise.
224         * include/private/gc_priv.h (GC_handle_fork): New internal variable
225         declaration (only if CAN_HANDLE_FORK).
226         * misc.c (GC_handle_fork): New internal variable (defined only if
227         CAN_HANDLE_FORK); initialize to TRUE if HANDLE_FORK.
228         * include/private/gcconfig.h (HANDLE_FORK): Replace with
229         CAN_HANDLE_FORK.
230         * pthread_support.c (HANDLE_FORK): Likewise.
231         * win32_threads.c (HANDLE_FORK): Likewise.
232         * include/private/gcconfig.h (CAN_HANDLE_FORK): Always define macro if
233         HANDLE_FORK.
234         * pthread_support.c (GC_thr_init): Replace HANDLE_FORK with
235         CAN_HANDLE_FORK; call pthread_atfork only if GC_handle_fork; update
236         the comment.
237         * win32_threads.c (GC_thr_init): Likewise.
238         * tests/test.c (NO_TEST_HANDLE_FORK): Define new macro if fork
239         handling is not supported (or is a no-op) on the target.
240         * tests/test.c (INIT_FORK_SUPPORT): New macro (invoke
241         GC_set_handle_fork unless NO_TEST_HANDLE_FORK).
242         * tests/test.c (GC_OPT_INIT): New macro (defined to GC_INIT or empty).
243         * tests/test.c (GC_COND_INIT): Use INIT_FORK_SUPPORT and GC_OPT_INIT.
244         * tests/test.c (run_one_test): Test NO_TEST_HANDLE_FORK (instead of
245         target-specific macros).
246         * win32_threads.c (GC_remove_all_threads_but_me, GC_fork_prepare_proc,
247         GC_fork_parent_proc, GC_fork_child_proc): Do not test GC_PTHREADS.
248         * configure.ac (HANDLE_FORK, NO_HANDLE_FORK): Update message.
249
250 2012-02-20  Ivan Maidanski <ivmai@mail.ru>
251
252         * pthread_support.c (GC_thr_init): Abort on pthread_atfork failure
253         (only if HANDLE_FORK).
254
255 2012-03-30  Ivan Maidanski <ivmai@mail.ru>
256
257         * include/gc.h (GC_HAVE_GET_HEAP_USAGE_SAFE): Remove public HAVE_
258         macro (since function availability could be determined by autotools);
259         update the comment.
260
261 2012-03-27  Andy Wingo <wingo@pobox.com>
262
263         * configure.ac: Add --enable-handle-fork option; if explicitly passed,
264         enables or disables the pthread_atfork support; if not passed, the
265         default, as determined by gcconfig.h, is to enable HANDLE_FORK if it
266         is supported on the target platform.
267
268 2012-03-28  Ivan Maidanski <ivmai@mail.ru>
269
270         * doc/README.solaris2 (SOLARIS THREADS): Update.
271         * doc/overview.html: Remove information about Solaris old-style
272         threads support.
273
274 2012-03-26  Ivan Maidanski <ivmai@mail.ru>
275
276         * dyn_load.c: Fix a typo and improve comment (for Android).
277
278 2012-03-25  Ivan Maidanski <ivmai@mail.ru>
279
280         * include/gc_mark.h (GC_clear_stack): New API function.
281         * include/private/gc_priv.h (GC_clear_stack): Remove declaration.
282         * misc.c (GC_clear_stack): Replace GC_INNER with GC_API; add GC_CALL
283         calling conventions modifier.
284
285 2012-03-25  Ivan Maidanski <ivmai@mail.ru>
286
287         * allchblk.c (GC_hblkfreelist, GC_free_bytes): Do not define array as
288         STATIC again but only if GC_GCJ_SUPPORT (for GNU GCJ client).
289         * blacklst.c (GC_is_black_listed): Do not define as GC_INNER again
290         (for GNU GCJ client).
291         * include/private/gc_priv.h (GC_is_black_listed): Likewise.
292         * include/private/gc_priv.h (GC_hblkfreelist): Restore removed
293         declaration (but only if GC_GCJ_SUPPORT).
294         * reclaim.c (GC_n_set_marks): Do not define as STATIC again (for GCJ);
295         update the comment.
296
297 2012-03-24  Ivan Maidanski <ivmai@mail.ru>
298
299         * include/gc.h (HIDE_POINTER): Test GC_I_HIDE_POINTERS macro (as
300         a synonym to I_HIDE_POINTERS) again (remains for backward
301         compatibility only).
302
303 2012-03-24  Ivan Maidanski <ivmai@mail.ru>
304
305         * include/gc.h (GC_PTR): Add typedef again (for source-level backward
306         compatibility useful for clients currently using gcc_boehmgc or
307         mono_libgc).
308
309 2012-03-16  Ivan Maidanski <ivmai@mail.ru>
310
311         * tests/test.c (GC_ALPHA_VERSION): Define to GC_TMP_ALPHA_VERSION if
312         not defined by gc_version.h.
313         * extra/add_gc_prefix.c (GC_ALPHA_VERSION): Likewise.
314         * extra/gcname.c (GC_ALPHA_VERSION): Likewise.
315
316 2012-03-15  Ivan Maidanski <ivmai@mail.ru> (really Hans Boehm)
317
318         * malloc.c (GC_SQRT_SIZE_MAX): New macro.
319         * malloc.c (calloc): Add fast initial size overflow check to avoid
320         integer division for reasonably small values passed.
321
322 2012-03-15  Ivan Maidanski <ivmai@mail.ru>
323
324         * malloc.c: Include limits.h for SIZE_MAX.
325         * malloc.c (SIZE_MAX, calloc): Define GC_SIZE_MAX instead of SIZE_MAX.
326
327 2012-03-15  Xi Wang <xi.wang@gmail.com>
328
329         * malloc.c (GC_generic_malloc): Check if the allocation size is
330         rounded to a smaller value.
331         * mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.
332
333 2012-03-15  Xi Wang <xi.wang@gmail.com>
334
335         * malloc.c (calloc): Check multiplication overflow in calloc(),
336         assuming REDIRECT_MALLOC.
337
338 2012-03-06  Ivan Maidanski <ivmai@mail.ru>
339
340         * include/private/gc_priv.h (GC_print_stats): Update the comment.
341         * tests/test.c (GC_print_stats, run_one_test, check_heap_stats):
342         Rename GC_print_stats to print_stats (since the former is used
343         internally by GC and not exported).
344         * tests/test.c (print_stats): Always define (either as a macro or
345         a static int variable) regardless of GC_DLL and SMALL_CONFIG.
346         * tests/test.c (INIT_PRINT_STATS): New macro (used to initialize
347         print_stats if needed); GETENV is used if needed and available.
348         * tests/test.c (GC_COND_INIT): Invoke INIT_PRINT_STATS.
349
350 2012-03-06  Ivan Maidanski <ivmai@mail.ru>
351
352         * misc.c: Include windows.h for Cygwin if GC_READ_ENV_FILE (required
353         for GC_envfile_init).
354         * misc.c (_MAX_PATH): Move definition to the place before the first
355         use (only Win32).
356
357 2012-03-04  Ivan Maidanski <ivmai@mail.ru>
358
359         * misc.c (GC_init): Add a workaround for clang/x64 (coming with
360         Xcode 4.3) which cannot process the static assertion on
361         ((ptr_t)-1 > 0) correctly.
362
363 2012-02-27  Ivan Maidanski <ivmai@mail.ru>
364
365         * win32_threads.c (GC_register_my_thread): Fix SEGV by setting "me"
366         to the newly-created thread GC descriptor (if lookup failed) before
367         altering flags of "me" (only if GC_PTHREADS); add comment (same as
368         in pthread_support.c).
369
370 2012-02-27  Ivan Maidanski <ivmai@mail.ru>
371
372         * os_dep.c (GC_SysVGetDataStart): Place "volatile" keyword for
373         "result" local variable properly.
374
375 2012-02-26  Ivan Maidanski <ivmai@mail.ru>
376
377         * win32_threads.c (GC_remove_all_threads_but_me): Update comment;
378         re-hash GC_threads map as thread Win32 Id in the child differs from
379         that in the parent; rename "id" local variable to "pthread_id".
380         * win32_threads.c (GC_remove_all_threads_but_me): Call
381         GC_setspecific (if THREAD_LOCAL_ALLOC) to re-assign Win32-based
382         thread-local pointer to 'tlfs' (identified by GC_thread_key) of the
383         current thread.
384
385 2012-02-26  Ivan Maidanski <ivmai@mail.ru>
386
387         * pthread_support.c (GC_remove_all_threads_but_me): Refine comment for
388         stop_info.mach_thread update.
389         * pthread_support.c (GC_remove_all_threads_but_me): Call
390         GC_setspecific (if THREAD_LOCAL_ALLOC) to re-assign thread-local
391         pointer to 'tlfs' (identified by GC_thread_key) of the current thread
392         (except for USE_CUSTOM_SPECIFIC).
393
394 2012-02-25  Ivan Maidanski <ivmai@mail.ru>
395
396         * configure: Regenerate.
397
398 2012-02-25  Ivan Maidanski <ivmai@mail.ru>
399
400         * configure.ac (win32_threads): Set variable for "mingw" target
401         (causing definition of "WIN32_THREADS" AM conditional which, in turn,
402         causes win32_threads.c to be compiled and put to libgc.a).
403
404 2012-02-25  Ivan Maidanski <ivmai@mail.ru>
405
406         * include/private/gc_priv.h (SIG_SUSPEND): Do not define for Cygwin
407         and pthreads-w32 (since signals are not used for threads
408         suspend/resume).
409
410 2012-02-24  Ivan Maidanski <ivmai@mail.ru>
411
412         * include/private/gcconfig.h (HANDLE_FORK): Define also for Cygwin
413         (but not for win32-pthreads).
414         * win32_threads.c: Include unistd.h if HANDLE_FORK (for
415         pthread_atfork).
416         * win32_threads.c (GC_wait_for_gc_completion): Add wait_for_all
417         argument.
418         * win32_threads.c (GC_unregister_my_thread, GC_thread_exit_proc): Pass
419         FALSE ("wait_for_all" argument) to GC_wait_for_gc_completion.
420         * win32_threads.c (GC_remove_all_threads_but_me, GC_fork_prepare_proc,
421         GC_fork_parent_proc, GC_fork_child_proc): New functions (similar to
422         that in pthread_support.c) if HANDLE_FORK.
423         * win32_threads.c (GC_thr_init): Invoke pthread_atfork if HANDLE_FORK.
424
425 2012-02-24  Ivan Maidanski <ivmai@mail.ru>
426
427         * os_dep.c (GC_dirty_init): Add FIXME regarding fork (Darwin).
428         * pthread_support.c (GC_remove_all_threads_but_me): Update mach_thread
429         for "me" (Darwin).
430         * pthread_support.c (GC_fork_prepare_proc): Output warning if
431         GC_dirty_maintained (if DARWIN and MPROTECT_VDB).
432         * pthread_support.c (GC_fork_prepare_proc, GC_fork_child_proc): Add
433         FIXME (for Darwin).
434         * tests/test.c (run_one_test): Do not test fork() for Darwin with
435         incremental mode on (if HANDLE_FORK); add FIXME.
436
437 2012-02-21  Ivan Maidanski <ivmai@mail.ru>
438
439         * win32_threads.c (GC_wait_for_gc_completion): Add function (similar
440         implementation as in pthread_support.c).
441         * win32_threads.c (GC_unregister_my_thread, GC_thread_exit_proc):
442         Call GC_wait_for_gc_completion to prevent collecting from unregistered
443         thread; remove FIXME.
444
445 2012-02-21  Ivan Maidanski <ivmai@mail.ru>
446
447         * tests/test.c: Include unistd.h for fork() declaration if HANDLE_FORK
448         (and THREADS).
449
450 2012-02-20  Ivan Maidanski <ivmai@mail.ru> (mostly really Andy Wingo)
451
452         * doc/README.macros (HANDLE_FORK): Replace with NO_HANDLE_FORK; update
453         the documentation.
454         * include/private/gcconfig.h (HANDLE_FORK): Explicitly define if
455         GC_PTHREADS unless already defined or NO_HANDLE_FORK is defined, or
456         unsupported on the target.
457
458 2012-02-16  Ivan Maidanski <ivmai@mail.ru>
459
460         * mark.c (GC_push_all, GC_push_selected): Properly check for empty
461         region after boundaries alignment (for the case when boundaries
462         unaligned and the region is short than one word); simplify the checked
463         condition.
464
465 2012-02-16  Ivan Maidanski <ivmai@mail.ru>
466
467         * finalize.c (GC_finalizer_nested): Change type from char to int to
468         force GC symbols proper alignment for some compilers (e.g., Watcom);
469         add comment.
470         * finalize.c (GC_check_finalizer_nested): Cast GC_finalizer_nested
471         properly (since it holds an unsigned char value).
472         * os_dep.c (GC_get_maps): Remove static "init_buf" variable (of char
473         size) and initialize "maps_buf" to NULL since it is allocated anyway
474         (since maps_size is non-zero).
475         * os_dep.c (GC_register_data_segments): Remove static "dummy" variable
476         (of char size) and use GC_pages_executable instead.
477
478 2012-02-14  Ivan Maidanski <ivmai@mail.ru>
479
480         * include/private/gcconfig.h (NO_DYLD_BIND_FULLY_IMAGE): Do not define
481         if already defined (e.g., by compiler -D option).
482
483 2012-02-10  Ivan Maidanski <ivmai@mail.ru>
484
485         * mark_rts.c (GC_add_roots_inner): Fix update of GC_root_size value
486         for Win32 (adjust GC_root_size before altering r_start/r_end).
487
488 2012-02-01  Ivan Maidanski <ivmai@mail.ru>
489
490         * include/gc.h (GC_dont_gc): Improve comment (add note for new client
491         code).
492         * include/gc.h (GC_is_disabled): New API function.
493         * misc.c (GC_is_disabled): Likewise.
494
495 2012-02-01  Ivan Maidanski <ivmai@mail.ru>
496
497         * include/gc.h (GC_stackbottom): Improve comment (add note for
498         new client code).
499
500 2012-02-01  Ivan Maidanski <ivmai@mail.ru>
501
502         * include/gc.h (GC_base): Fix a typo in the comment.
503
504 2012-02-01  Ivan Maidanski <ivmai@mail.ru>
505
506         * cord/cordtest.c (main): Print "SUCCEEDED" message to stdout
507         instead of stderr.
508
509 2012-01-31  Ivan Maidanski <ivmai@mail.ru>
510
511         * allchblk.c (GC_add_to_fl): Append ';' after FREE_ASSERT().
512         * allchblk.c (GC_remove_from_fl): Fix a typo in a comment.
513
514 2012-01-26  Ivan Maidanski <ivmai@mail.ru>
515
516         * include/private/gcconfig.h (USE_GET_STACKBASE_FOR_MAIN): Define if
517         PLATFORM_ANDROID.
518
519 2012-01-26  Ivan Maidanski <ivmai@mail.ru>  (really Daniel R. Grayson)
520
521         * mark_rts.c (GC_add_roots_inner): Round "b" pointer up to word
522         boundary.
523         * include/gc.h (GC_add_roots): Update the comment.
524
525 2012-01-24  Ivan Maidanski <ivmai@mail.ru>
526
527         * pthread_support.c (STAT_READ, STAT_BUF_SIZE): Move the definition
528         out of PLATFORM_ANDROID condition.
529         * pthread_support.c (GC_get_nprocs_present): New static function
530         obtaining number of avalable CPUs from
531         "/sys/devices/system/cpu/present" (only Linux/arm excluding NaCl).
532         * pthread_support.c (GC_thr_init): Invoke GC_get_nprocs_present
533         (unless set from the environment variable) to workaround a bug in
534         some Linux/arm kernels (including Android).
535
536 2012-01-24  Ivan Maidanski <ivmai@mail.ru>
537
538         * pthread_support.c (GC_get_nprocs): Change "result" local variable
539         type to int from word (to match returned value type); remove redundant
540         cast; initialize "result" variable just before its use.
541
542 2012-01-23  Ivan Maidanski <ivmai@mail.ru>
543
544         * os_dep.c (GC_sigbus_count): Fix a typo in a comment.
545
546 2012-01-20  Ivan Maidanski <ivmai@mail.ru>
547
548         * configure.ac (AC_INIT): Update bug reports email.
549         * doc/gcdescr.html: Likewise.
550         * doc/README.cords: Likewise.
551         * doc/overview.html: Fix email address.
552
553 2012-01-18  Ivan Maidanski <ivmai@mail.ru>
554
555         * tests/realloc_test.c (main): Prevent NULL pointer dereference
556         (exit with an error message in case of NULL returned by GC_malloc).
557
558 2012-01-17  Ivan Maidanski <ivmai@mail.ru>
559
560         * cord/cordtest.c (FNAME1, FNAME2): Do not specify folder
561         (platform-dependent) for temporary file; use same short file name
562         (DOS-compatible) for all targets.
563
564 2012-01-13  Ivan Maidanski <ivmai@mail.ru>
565
566         * extra/gc.c: Include gc_pthread_redirects.h (unless
567         GC_NO_THREAD_REDIRECTS) to restore thread calls macro-based
568         redirection after the corresponding undef's in pthread_support.c.
569         * win32_threads.c: Restore thread calls macro-based redirection
570         (unless GC_NO_THREAD_REDIRECTS) at the file end.
571         * extra/gc.c: Remove "file not well tested" comment.
572
573 2012-01-10  Ivan Maidanski <ivmai@mail.ru>
574
575         * pthread_stop_world.c (GC_restart_handler): Preserve errno value in
576         case of sem_post or GC_log_printf invocation inside.
577
578 2011-12-30  Ivan Maidanski <ivmai@mail.ru>
579
580         * Makefile.in: Regenerate.
581
582 2011-12-30  Ivan Maidanski <ivmai@mail.ru>
583
584         * Makefile.am (pkginclude_HEADERS): Remove gc_allocator.h
585         entry.
586         * Makefile.am (include_HEADERS): Add include/extra/gc_cpp.h entry
587         (only if CPLUSPLUS).
588         * include/include.am (pkginclude_HEADERS): Remove include/gc_cpp.h
589         entry.
590         * include/include.am (include_HEADERS): Remove include/extra/gc_cpp.h
591         entry.
592
593 2011-12-30  Ivan Maidanski <ivmai@mail.ru>
594
595         * misc.c (GC_init): Append ';' after GC_ASSERT().
596         * os_dep.c (GC_protect_heap): Likewise.
597
598 2011-12-30  Ivan Maidanski <ivmai@mail.ru>
599
600         * tests/test_cpp.cc (GC_API_PRIV): New macro (same definition as in
601         gc_priv.h).
602         * tests/test_cpp.cc (GC_printf): Use GC_API_PRIV instead of GC_API.
603
604 2011-12-30  Ivan Maidanski <ivmai@mail.ru>
605
606         * dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove): Declare i, j
607         local variables as unsigned (to prevent compiler warning in
608         a comparison involving sizeof)
609
610 2011-12-27  Ivan Maidanski <ivmai@mail.ru>  (really Richard Sandiford)
611
612         * include/private/gcconfig.h (HBLKSIZE): Define for MIPS.
613
614 2011-12-27  Ivan Maidanski <ivmai@mail.ru>  (really David Daney)
615
616         * include/private/gcconfig.h (CPP_WORDSZ, ALIGNMENT): Handle
617         mips64-linux n64 ABI.
618
619 2011-12-15  Ivan Maidanski <ivmai@mail.ru>
620
621         * configure: Regenerate.
622
623 2011-12-15  Ivan Maidanski <ivmai@mail.ru>
624
625         * configure.ac (ac_cv_fno_strict_aliasing): New variable (set to
626         "skipped" if the client passed "-fstrict-aliasing" option to CFLAGS
627         else set to "yes" if GCC supports "-fno-strict-aliasing" option,
628         otherwise set to "no").
629         * configure.ac (CFLAGS): Append "-fno-strict-aliasing" if
630         ac_cv_fno_strict_aliasing is "yes" (only if GCC).
631
632 2011-12-13  Ivan Maidanski <ivmai@mail.ru>
633
634         * configure: Regenerate.
635
636 2011-12-13  Ivan Maidanski <ivmai@mail.ru>
637
638         * configure.ac (ac_is_dgux): Move down to below gc-debug processing
639         (DG/UX) since it uses "enable_gc_debug" variable; remove FIXME.
640
641 2011-12-13  Ivan Maidanski <ivmai@mail.ru>
642
643         * configure.ac (CFLAGS, CXXFLAGS): Preserve C/C++ flags passed by
644         client (DG/UX only); remove code duplication (put common flags to
645         "dgux_spec_opts" variable).
646
647 2011-11-23  Ivan Maidanski <ivmai@mail.ru>  (really Bruce Mitchener)
648
649         * README: Fix typos.
650         * doc/README.cmake: Likewise.
651         * doc/README.darwin: Likewise.
652         * autogen.sh: Set file 'executable' bit.
653
654 2011-11-15  Ivan Maidanski <ivmai@mail.ru>
655
656         * pthread_support.c (GC_is_thread_tsd_valid): Check tsd more correctly
657         using GC_thread and thread_local_freelists declarations; remove FIXME.
658         * win32_threads.c (GC_is_thread_tsd_valid): Likewise.
659
660 2011-11-15  Ivan Maidanski <ivmai@mail.ru>
661
662         * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Test result of
663         GC_getspecific() for NULL in all cases except for USE_COMPILER_TLS and
664         USE_WIN32_COMPILER_TLS (i.e., no-op implementation of GC_getspecific).
665
666 2011-10-10  Ivan Maidanski <ivmai@mail.ru>  (really Linas Vepstas)
667
668         * include/private/gcconfig.h: Add machine description for Hexagon.
669
670 2011-09-30  Ivan Maidanski <ivmai@mail.ru>
671
672         * tests/test.c (mktree): Insert CHECK_OUT_OF_MEMORY to report mktree()
673         out-of-memory failures.
674         * tests/trace_test.c (mktree): Test whether GC_MALLOC_ATOMIC returns
675         NULL (exit with an error code and the appropriate message printed in
676         this case).
677
678 2011-09-23  Ivan Maidanski <ivmai@mail.ru>
679
680         * configure: Regenerate.
681
682 2011-09-23  Ivan Maidanski <ivmai@mail.ru>
683
684         * configure.ac (NO_DEBUGGING): Define based on testing enable_gc_debug
685         value (instead of based on with_cross_host value).
686
687 2011-09-23  Ivan Maidanski <ivmai@mail.ru>
688
689         * configure.ac (THREAD_LOCAL_ALLOC): Test enable_shared and
690         enable_static values properly when setting THREAD_LOCAL_ALLOC
691         in case PARALLEL_MARK is off (Win32 only).
692
693 2011-09-22  Ivan Maidanski <ivmai@mail.ru>
694
695         * configure: Regenerate.
696         * include/private/config.h.in: Ditto.
697
698 2011-09-22  Ivan Maidanski <ivmai@mail.ru>
699
700         * configure.ac (GC_DLL): New AC template; define if only the dynamic
701         libraries are being built.
702         * configure.ac (THREAD_LOCAL_ALLOC): Define for Win32 implicitly
703         if static libraries are being built (i.e. GC_DLL is not defined).
704         * doc/README.win32: Update "GNU Tools" section.
705
706 2011-09-22  Ivan Maidanski <ivmai@mail.ru>
707
708         * configure.ac (THREADS): Change "posix" to "win32" in case of
709         cross-compiling to MinGW.
710
711 2011-09-22  Ivan Maidanski <ivmai@mail.ru>
712
713         * configure.ac (PARALLEL_MARK): Check --enable-parallel-mark also for
714         Solaris.
715
716 2011-09-20  Ivan Maidanski <ivmai@mail.ru>
717
718         * pthread_start.c (GC_inner_start_routine): Add volatile to "me" local
719         variable to prevent its clobbering.
720
721 2011-09-20  Ivan Maidanski <ivmai@mail.ru>
722
723         * tests/threadkey_test.c (main): Print a message if the test is
724         skipped.
725
726 2011-09-14  Ivan Maidanski <ivmai@mail.ru>
727
728         * backgraph.c (per_object_helper): Cast "i" local variable to word
729         (instead of "sz") in a comparison.
730
731 2011-09-14  Ivan Maidanski <ivmai@mail.ru>
732
733         * Makefile.direct (Makefile): Add rule to create (or overwrite)
734         Makefile from Makefile.direct file.
735         * Makefile.direct (clean): Remove "base_lib", "c++" files as well.
736
737 2011-09-13  Ivan Maidanski <ivmai@mail.ru>
738
739         * CMakeLists.txt (CMAKE_LEGACY_CYGWIN_WIN32): Set to 0 (required for
740         Cygwin).
741
742 2011-09-13  Ivan Maidanski <ivmai@mail.ru>
743
744         * tests/test.c (check_heap_stats): Increase max_heap_sz value (for
745         32-bit targets) from 15M by 1M (as the former is hit sometimes on
746         Cygwin).
747
748 2011-09-13  Ivan Maidanski <ivmai@mail.ru>
749
750         * CMakeLists.txt (cygwin): Remove "-D_REENTRANT" definition.
751         * CMakeLists.txt (cord): Add gdi32 link library.
752
753 2011-09-13  Ivan Maidanski <ivmai@mail.ru>
754
755         * cord/de.c (WIN32): Define also for Cygwin.
756
757 2011-09-13  Ivan Maidanski <ivmai@mail.ru>
758
759         * gc_cpp.cc (operator delete): Do not define for Cygwin since already
760         defined in include/gc_cpp.h file.
761
762 2011-09-08  Ivan Maidanski <ivmai@mail.ru>
763
764         * cord/cordprnt.c (CORD_vsprintf): Cast "prec" and "width" local
765         variables to size_t.
766         * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Change
767         type of "i" local variable to int.
768         * pthread_support.c (start_mark_threads): Likewise.
769         * os_dep.c (GC_repeat_read): Change type of "num_read" to size_t.
770         * os_dep.c (GC_get_maps): Change type of "result" local variable from
771         int to ssize_t; cast "result" to size_t in comparison.
772         * pthread_support.c (GC_remove_all_threads_but_me): Cast "result" to
773         int.
774         * pthread_support.c (GC_wait_for_gc_completion): Change type of
775         "old_gc_no" local variable to word.
776         * pthread_support.c (GC_lock): Change type of "i" local variable to
777         unsigned.
778         * tests/staticrootstest.c (main): Cast sizeof() value to int in
779         comparisons.
780
781 2011-09-07  Ivan Maidanski <ivmai@mail.ru>
782
783         * os_dep.c (GC_find_limit_with_bound): Inside loop, set result local
784         volatile variable and do break instead of return (this also suppresses
785         compiler warning about the potential clobbering of "bound" variable
786         by setjmp).
787
788 2011-09-07  Ivan Maidanski <ivmai@mail.ru>
789
790         * include/gc.h (GC_get_heap_size, GC_get_free_bytes,
791         GC_get_unmapped_bytes, GC_get_bytes_since_gc, GC_get_total_bytes):
792         Refine comment.
793         * include/gc.h (GC_HAVE_GET_HEAP_USAGE_SAFE): New macro.
794         * include/gc.h (GC_get_heap_usage_safe): New API function.
795         * misc.c (GC_get_heap_usage_safe): Likewise.
796         * include/gc_mark.h (GC_get_heap_size_inner, GC_get_free_bytes_inner):
797         Remove API function.
798         * misc.c (GC_get_heap_size_inner, GC_get_free_bytes_inner): Likewise.
799         * misc.c (GC_get_heap_size): Add comment.
800         * misc.c (GC_get_heap_size, GC_get_free_bytes, GC_get_unmapped_bytes,
801         GC_get_bytes_since_gc, GC_get_total_bytes): Remove locking.
802         * misc.c (GC_get_unmapped_bytes): Do not test USE_MUNMAP (not needed
803         after locking removal).
804         * misc.c (GC_get_bytes_since_gc, GC_get_total_bytes): Cast result to
805         size_t.
806
807 2011-09-06  Ivan Maidanski <ivmai@mail.ru>
808
809         * include/gc_mark.h (GC_set_start_callback): Refine comment (the
810         function acquires the GC lock).
811         * include/gc.h (GC_set_all_interior_pointers, GC_set_stop_func,
812         GC_get_stack_base): Likewise.
813         * include/gc.h (GC_get_version, GC_get_gc_no, GC_get_parallel,
814         GC_set_find_leak, GC_get_all_interior_pointers,
815         GC_get_dont_precollect, GC_get_pages_executable, GC_set_max_heap_size,
816         GC_set_force_unmap_on_gcollect): Refine comment (the function is
817         lock-free).
818
819 2011-08-31  Ivan Maidanski <ivmai@mail.ru>
820
821         * tests/initsecondarythread.c: Include windows.h instead of pthread.h
822         unless GC_PTHREADS.
823         * tests/thread_leak_test.c: Likewise.
824         * tests/initsecondarythread.c (thread): Use WINAPI and set return
825         type to DWORD unless GC_PTHREADS.
826         * tests/thread_leak_test.c (test): Likewise.
827         * tests/initsecondarythread.c (main): Use HANDLE, CreateThread and
828         WaitForSingleObject instead of pthread_t, pthread_create and
829         pthread_join, respectively, unless GC_PTHREADS.
830         * tests/thread_leak_test.c (main): Likewise.
831
832 2011-08-31  Ivan Maidanski <ivmai@mail.ru>
833
834         * tests/initsecondarythread.c (GC_NO_THREAD_REDIRECTS): Add comment.
835         * tests/initsecondarythread.c: Include stdio.h.
836         * tests/initsecondarythread.c (thread): Cast result of malloc to void;
837         return arg parameter instead of NULL (to suppress compiler warnings).
838         * tests/initsecondarythread.c (main): Define "code" local variable;
839         store result of pthread_create and pthread_join to "code" variable;
840         exit application with an error code (with the corresponding error
841         message) if pthread_create or pthread_join fails.
842
843 2011-08-31  Ivan Maidanski <ivmai@mail.ru>  (really Jean-Claude Beaudoin)
844
845         * include/private/gcconfig.h (GETCONTEXT_FPU_EXCMASK_BUG): Add FIXME
846         that this is no longer needed with the recent GLibC.
847
848 2011-08-24  Ivan Maidanski <ivmai@mail.ru>
849
850         * hpux_test_and_clear.s: Remove.
851         * Makefile.am (EXTRA_DIST): Remove hpux_test_and_clear.s.
852         * Makefile.direct (SRCS): Ditto.
853         * Makefile.dj (SRCS): Ditto.
854         * Makefile.dj (SRCS): Remove missing gcc_support.c,
855         include/gc_alloc.h, include/gc_local_alloc.h.
856         * doc/gcdescr.html: Remove information about gc_local_alloc.h.
857         * doc/gcinterface.html: Ditto.
858         * doc/scale.html: Ditto.
859         * doc/gcinterface.html: Remove information about gc_alloc.h.
860         * tests/test_cpp.cc: Don't include missing old gc_alloc.h (include
861         new_gc_alloc.h instead); don't test __GNUC__.
862         * tests/test_cpp.cc (main): Use gc_alloc class instead of alloc (don't
863         test __GNUC__).
864         * windows-untested/vc60/gc.dsp (SOURCE): Don't include missing
865         gc_alloc.h, gc_local_alloc.h.
866         * windows-untested/vc60/libgc.dsp (SOURCE): Ditto.
867         * windows-untested/vc70/gc.vcproj (Header Files): Ditto.
868         * windows-untested/vc70/libgc.vcproj (Header Files): Ditto.
869         * windows-untested/vc71/gc.vcproj (Header Files): Ditto.
870         * windows-untested/vc71/libgc.vcproj (Header Files): Ditto.
871         * Makefile.in: Regenerate.
872
873 2011-08-21  Ivan Maidanski <ivmai@mail.ru>
874
875         * allchblk.c (GC_allochblk_nth): Cast MAX_BLACK_LIST_ALLOC and
876         HBLKSIZE to signed_word.
877         * mallocx.c (GC_generic_malloc_many): Cast my_bytes_allocd to word.
878         * mark.c (GC_do_local_mark): Cast the result of local_top minus
879         local_mark_stack to word (since is non-negative).
880         * misc.c (GC_base): Declare sz as unsigned word.
881         * misc.c (GC_enable_incremental): Cast bytes_written to size_t in
882         comparison to len.
883         * obj_map.c (GC_initialize_offsets): Declare 'i' as unsigned.
884         * os_dep.c (GC_or_pages): Ditto.
885         * typd_mlc.c (GC_init_explicit_typing): Ditto.
886         * ptr_chck.c (GC_is_visible): Cast the result of p minus base to word.
887         * typd_mlc.c (GC_make_descriptor): Cast last_set_bit to word (since
888         non-negative) when compared to BITMAP_BITS.
889
890 2011-08-14  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
891
892         * configure.ac: Remove checks for ar and ranlib.
893         * configure.ac: Replace AC_CHECK_HEADER with PKG_CHECK_MODULES when
894         checking for libatomic_ops.  The macro sets the appropriate flags, so
895         simplify accordingly.
896         * Makefile.am, configure.ac: Set ATOMIC_OPS_CFLAGS in configure.ac
897         instead of conditionally doing it in Makefile.am, to be more
898         consistent with the pkg-config case.
899         * configure.ac: Fix a typo and some phrases.
900         * Makefile.in: Regenerate.
901         * aclocal.m4: Ditto.
902         * configure: Ditto.
903
904 2011-08-11  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
905
906         * configure.ac: Since we no longer bundle libatomic_ops, we must
907         check for the sub-directory before using it, in case we didn't
908         find an installed version.
909         * Makefile.am: Don't include libatomic_ops in the distribution.
910         * Makefile.in: Regenerate.
911         * configure: Ditto.
912
913 2011-08-09  Ivan Maidanski <ivmai@mail.ru> (really Jie Liu)
914
915         * configure.ac: Add GC_RTEMS_PTHREADS AH_TEMPLATE and configure
916         for rtems.
917         * os_dep.c: Add GC_get_stack_base if GC_RTEMS_PTHREADS for rtems.
918         * pthread_stop_world.c (GC_stop_init): Add ifdef SA_RESTART.
919         * pthread_stop_world.c (GC_stop_init): Use sigprocmask for rtems
920         when defined GC_RTEMS_PTHREADS.
921         * pthread_support.c: Exclude sys/mman.h for rtems.
922         * pthread_support.c (GC_thr_init): Set default GC_nprocs (1) for
923         rtems.
924         * include/gc_config_macros.h: Define GC_RTEMS_PTHREADS for rtems
925         pthread and define GC_NO_DLOPEN for rtems.
926         * include/private/gc_locks.h: Define USE_PTHREAD_LOCKS for rtems.
927         * include/private/gcconfig.h: Use rtems_get_stack_bottom()
928         for InitStackBottom; and use SIGUSR1 for SIG_SUSPEND, SIGUSR2
929         for SIG_THR_RESTART on rtems.
930         * include/private/thread_local_alloc.h: Use USE_PTHREAD_SPECIFIC
931         for rtems.
932         * tests/test.c (Init): Use exit(0) for rtems instead of return.
933         * configure: Regenerate.
934         * include/private/config.h.in: Ditto.
935
936 2011-07-26  Ivan Maidanski <ivmai@mail.ru>
937
938         * tests/realloc_test.c: New file.
939         * tests/tests.am (TESTS, check_PROGRAMS): Add realloc_test.
940         * .cvsignore: Add realloc_test.
941         * configure: Regenerate.
942         * Makefile.in: Ditto.
943
944 2011-07-14  Ivan Maidanski <ivmai@mail.ru>
945
946         * .cvsignore: Add more auto-generated files.
947
948 2011-07-14  Ivan Maidanski <ivmai@mail.ru>
949
950         * new_hblk.c (GC_build_fl): Adjust "h" local variable cast type
951         when setting obj_link (to prevent compiler warning); reformat the
952         comment.
953         * tests/test.c (reverse_test_inner): Use proper type when touching
954         "b" and "c" local variables (to prevent compiler warning).
955
956 2011-07-05  Ivan Maidanski <ivmai@mail.ru>
957
958         * misc.c (GC_init): Use HOTTER_THAN (instead of STACK_GROWS_DOWN)
959         for GC_stackbottom assertion.
960         * os_dep.c (GC_enclosing_mapping): Define only if IA64 or
961         INCLUDE_LINUX_THREAD_DESCR; make GC_INNER.
962         * pthread_support.c (GC_enclosing_mapping): Declare (only if
963         INCLUDE_LINUX_THREAD_DESCR).
964         * os_dep.c (GC_get_main_stack_base): Don't call pthread_getattr_np
965         if REDIRECT_MALLOC as the former is observed to call redirected
966         malloc (while GC is not initialized yet) on some Linux platforms.
967         * include/private/gc_priv.h (MAX_HEAP_SECTS): Don't use a smaller
968         value for SMALL_CONFIG if USE_PROC_FOR_LIBRARIES defined.
969
970 2011-07-05  Ivan Maidanski <ivmai@mail.ru>
971
972         * malloc.c (GC_init_lib_bounds): Call GC_init (to ensure GC is
973         initialized before doing GC_text_mapping).
974         * misc.c (GC_init): Add a check for GC_init recursion in case of
975         malloc is redirected (abort with the corresponding message).
976         * pthread.c (GC_thr_init): Place GC_add_roots_inner call into
977         "else" branch to prevent "local variable might be uninitialized"
978         compiler warning; add comment.
979
980 2011-07-05  Ivan Maidanski <ivmai@mail.ru>
981
982         * dyn_load.c (GC_register_dynamic_libraries): Remove duplicate
983         call of GC_FirstDLOpenedLinkMap (twice).
984         * dyn_load.c (GC_register_main_static_data): Add comment.
985         * cord/cordbscs.c (CORD_riter): Check for empty string passed (do
986         not call CORD_riter4 if CORD_len() returned zero).
987         * cord/cordbscs.c (CORD_init_min_len): Replace the K&R-style
988         function definition with the ANSI C one.
989         * cord/cordbscs.c: Expand all tabs to spaces; remove
990         trailing spaces at EOLn.
991         * tests/threadkey_test.c (on_thread_exit_inner): Check
992         GC_pthread_create() result.
993
994 2011-07-04  Ivan Maidanski <ivmai@mail.ru>
995
996         * include/private/gcconfig.h (etext): Don't define if unused
997         (NetBSD).
998         * include/private/gcconfig.h (GC_data_start, DATASTART): Define
999         for NetBSD/amd64 if ELF.
1000         * include/private/gcconfig.h (SEARCH_FOR_DATA_START): Don't define
1001         for NetBSD/amd64 if ELF.
1002
1003 2011-07-04  Ivan Maidanski <ivmai@mail.ru> (mostly really Andy Wingo)
1004
1005         * configure.ac (GC_THREADS): Refine the comment.
1006         * configure.ac (GC_WIN32_PTHREADS): Add template.
1007         * configure.ac (cygwin, win32): Define GC_WIN32_THREADS instead of
1008         GC_THREADS.
1009         * configure.ac (pthreads): Add mingw target (GC_WIN32_PTHREADS).
1010         * configure: Regenerate.
1011         * include/private/config.h.in: Ditto.
1012         * include/private/gc_locks.h (GC_WIN32_PTHREADS): Remove nested
1013         test for the macro; add comment.
1014
1015 2011-07-01  Ivan Maidanski <ivmai@mail.ru>
1016
1017         * win32_threads.c (CHECK_LOOKUP_MY_THREAD): New macro definition.
1018         * win32_threads.c (GC_reset_finalizer_nested,
1019         GC_check_finalizer_nested, GC_unregister_my_thread,
1020         GC_do_blocking_inner, GC_call_with_gc_active, GC_init_parallel):
1021         Insert CHECK_LOOKUP_MY_THREAD before dereferencing thread
1022         descriptor pointer (to instruct a LINT-like tool that it is ok to
1023         dereference the pointer).
1024         * win32_threads.c (GC_get_next_stack): Assert plast_stack_min is
1025         non-NULL if current_min is not ADDR_LIMIT (for a LINT-like tool).
1026         * win32_threads.c (GC_init_parallel): Define and use "me" local
1027         variable.
1028         * cord/cordtest.c (test_basics): Test CORD_substr() result is
1029         non-NULL.
1030         * cord/cordtest.c (test_extras): Test fopen() result is non-NULL.
1031         * cord/cordtest.c (test_basics, test_extras, test_printf, main):
1032         Replace the K&R-style function definition with the ANSI C one.
1033         * cord/cordtest.c: Expand all tabs to spaces; remove
1034         trailing spaces at EOLn.
1035         * include/private/gc_priv.h (ABORT): Define as abort() when
1036         checking the code with a LINT-like tool (Win32 only).
1037         * tests/test.c (FAIL): Ditto.
1038         * tests/test.c (CHECH_GCLIB_VERSION): New macro (to check that the
1039         version of libgc.so used at runtime matches that at compile time).
1040         * tests/test.c (GC_COND_INIT): Use CHECH_GCLIB_VERSION.
1041         * tests/test.c (CHECK_OUT_OF_MEMORY): New macro (to test malloc
1042         result for out of memory).
1043         * tests/test.c (cons, small_cons, small_cons_uncollectable,
1044         gcj_cons, reverse_test_inner, mktree, alloc8bytes, typed_test,
1045         run_one_test): Use CHECK_OUT_OF_MEMORY.
1046
1047 2011-06-30  Ivan Maidanski <ivmai@mail.ru>
1048
1049         * dyn_load.c (GC_register_map_entries): Remove "count" local
1050         variable as unused.
1051         * gc_dlopen.c (disable_gc_for_dlopen): Define only if not
1052         USE_PROC_FOR_LIBRARIES.
1053         * malloc.c (calloc): Add parentheses around '&&' operator.
1054         * mark.c (GC_noop_sink): New global variable (instead of a static
1055         local variable inside GC_noop1).
1056         * mark.c (GC_noop1): Use GC_noop_sink variable (to prevent
1057         "variable set but not used" compiler warning).
1058         * include/private/gcconfig.h (USE_PROC_FOR_LIBRARIES): Define only
1059         if undefined yet.
1060         * tests/smash_test.c (main): Don't dereference "p" local variable
1061         if it is NULL.
1062         * tests/staticrootslib.c (main): Ditto.
1063
1064 2011-06-30  Ivan Maidanski <ivmai@mail.ru>
1065
1066         * pthread_support.c (GC_segment_is_thread_stack): Replace '&'
1067         operator with '&&' one in conditional expressions.
1068         * specific.c (remove_specific): Dereference "entry" local variable
1069         only if it is non-NULL.
1070         * include/gc.h (GC_NEW): Refine the comment (about the returned
1071         value).
1072
1073 2011-06-15  Ivan Maidanski <ivmai@mail.ru>
1074
1075         * include/gc_version.h, configure.ac, doc/README: Change to
1076         version 7.2alpha7.
1077         * configure: Regenerate.
1078
1079 [7.2alpha6]
1080
1081 2011-06-14  Ivan Maidanski  <ivmai@mail.ru>
1082
1083         * configure_atomic_ops.sh: Remove.
1084         * Makefile.direct (dist gc.tar): Remove configure_atomic_ops.sh.
1085         * Makefile.am (EXTRA_DIST): Add autogen.sh.
1086         * Makefile.in: Regenerate.
1087         * configure: Ditto.
1088
1089 2011-06-14  Ivan Maidanski  <ivmai@mail.ru>
1090
1091         * include/gc_version.h, configure.ac, doc/README: Change to
1092         version 7.2alpha6.
1093         * configure: Regenerate.
1094
1095 2011-05-31  Ivan Maidanski  <ivmai@mail.ru>
1096
1097         * NT_STATIC_THREADS_MAKEFILE (.cpp.obj): Remove duplicate .cpp
1098         filename passed.
1099         * NT_X64_THREADS_MAKEFILE (.cpp.obj): Use lowercase file
1100         extension.
1101         * NT_X64_STATIC_THREADS_MAKEFILE (.cpp.obj): Ditto.
1102         * NT_MAKEFILE (.cpp.obj): Ditto.
1103
1104 2011-05-31  Ivan Maidanski  <ivmai@mail.ru>
1105
1106         * alloc.c (GC_add_current_malloc_heap, GC_build_back_graph,
1107         GC_traverse_back_graph): Move prototype to gc_priv.h.
1108         * checksums.c (GC_page_was_ever_dirty): Ditto.
1109         * dbg_mlc.c (GC_default_print_heap_obj_proc): Ditto.
1110         * dyn_load.c (GC_parse_map_entry, GC_get_maps,
1111         GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base,
1112         GC_get_next_stack): Ditto.
1113         * finalize.c (GC_reset_finalizer_nested,
1114         GC_check_finalizer_nested): Ditto.
1115         * gcj_mlc.c (GC_start_debugging, GC_store_debug_info): Ditto.
1116         * malloc.c (GC_extend_size_map, GC_text_mapping): Ditto.
1117         * mark_rts.c (GC_mark_thread_local_free_lists): Ditto.
1118         * misc.c (GC_register_main_static_data, GC_init_win32,
1119         GC_setpagesize, GC_init_linux_data_start,
1120         GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf,
1121         GC_initialize_offsets, GC_bl_init, GC_do_blocking_inner,
1122         GC_bl_init_no_interiors): Ditto.
1123         * os_dep.c (GC_greatest_stack_base_below, GC_push_all_stacks):
1124         Ditto.
1125         * reclaim.c (GC_check_leaked): Ditto.
1126         * win32_threads.c (GC_gww_dirty_init): Ditto.
1127         * darwin_stop_world.c (GC_is_mach_marker, GC_mprotect_stop,
1128         GC_mprotect_resume): Move prototype to darwin_stop_world.h.
1129         * pthread_support.c (GC_FindTopOfStack): Ditto.
1130         * dyn_load.c (GC_cond_add_roots): Merge adjacent definitions.
1131         * mark.c (GC_page_was_ever_dirty): Remove (as already declared).
1132         * mark_rts.c (GC_roots_present): Change return type to void
1133         pointer (to match the prototype); return NULL instead of FALSE.
1134         * mark_rts.c (GC_add_roots_inner): Cast GC_roots_present() result.
1135         * os_dep.c (NEED_PROC_MAPS): Move definition to gcconfig.h.
1136         * os_dep.c (GC_write_fault_handler): Make STATIC.
1137         * os_dep.c (GC_set_write_fault_handler): New function (only if
1138         GC_WIN32_THREADS).
1139         * pthread_start.c (GC_start_rtn_prepare_thread,
1140         GC_thread_exit_proc): Move prototype to pthread_support.h.
1141         * pthread_support.c (GC_nacl_initialize_gc_thread,
1142         GC_nacl_shutdown_gc_thread, GC_unblock_gc_signals):
1143         Ditto.
1144         * pthread_support.c (GC_stop_init): Move prototype to
1145         pthread_stop_world.h.
1146         * thread_local_alloc.c (GC_check_tls_for): Reformat comment.
1147         * win32_threads.c (GC_write_fault_handler): Remove prototype.
1148         * win32_threads.c (GC_register_my_thread_inner): Call
1149         GC_set_write_fault_handler instead of SetUnhandledExceptionFilter
1150         (only if MPROTECT_VDB).
1151         * doc/README.win32: Add information about DMC.
1152         * include/private/gc_priv.h (GC_set_write_fault_handler): New
1153         prototype (only if GC_WIN32_THREADS and MPROTECT_VDB).
1154
1155 2011-05-31  Ivan Maidanski  <ivmai@mail.ru>
1156
1157         * misc.c (vsnprintf): Redirect to vsprintf() if NO_VSNPRINTF.
1158
1159 2011-05-31  Ivan Maidanski  <ivmai@mail.ru>
1160
1161         * win32_threads.c (GC_unregister_my_thread): Use KNOWN_FINISHED()
1162         instead of FINISHED macro.
1163         * tests/test.c (check_heap_stats): Round up max_heap_sz value for
1164         Win32 (same as for USE_MMAP).
1165
1166 2011-05-31  Ivan Maidanski  <ivmai@mail.ru>
1167
1168         * tests/test.c (check_heap_stats): Adjust printf format specifier
1169         for max_heap_sz; cast max_heap_sz accordingly.
1170
1171 2011-05-30  Ivan Maidanski  <ivmai@mail.ru>
1172
1173         * doc/README.solaris2: Add note.
1174
1175 2011-05-30  Ivan Maidanski  <ivmai@mail.ru>
1176
1177         * configure.ac (SOLARIS25_PROC_VDB_BUG_FIXED): Don't define for
1178         Solaris/x86 2.10+.
1179         * configure: Regenerate.
1180
1181 2011-05-23  Ivan Maidanski  <ivmai@mail.ru>
1182
1183         * tests/threadkey_test.c (SKIP_THREADKEY_TEST): Skip the test if
1184         defined; explicitly define for some targets.
1185
1186 2011-05-23  Ivan Maidanski  <ivmai@mail.ru>
1187
1188         * mark.c (GC_dirty): Add prototype (only if MANUAL_VDB).
1189         * stubborn.c (GC_dirty): Ditto.
1190         * include/private/gcconfig.h (GWW_VDB, MPROTECT_VDB, PCR_VDB,
1191         PROC_VDB): Undefine if MANUAL_VDB.
1192         * include/private/gcconfig.h (DEFAULT_VDB): Don't define if
1193         MANUAL_VDB.
1194         * os_dep.c (async_set_pht_entry_from_index): Define for
1195         MANUAL_VDB.
1196         * os_dep.c (GC_read_dirty): Set GC_dirty_maintained only if
1197         success; if ioctl() failed then just print warning instead of
1198         aborting.
1199
1200 2011-05-23  Ivan Maidanski  <ivmai@mail.ru>
1201
1202         * include/private/gc_priv.h (GC_ASSERT): Use "%d" (instead of %ld)
1203         for line number printing.
1204
1205 2011-05-23  Ivan Maidanski  <ivmai@mail.ru>
1206
1207         * os_dep.c (GC_read_dirty): Add debug logging if DEBUG_DIRTY_BITS
1208         (for PROC_VDB only); print errors via GC_err_printf; rename "ps"
1209         and "np" local variables to npages and pagesize, respectively;
1210         remove "current_addr" local variable.
1211         * os_dep.c: Reformat comments.
1212
1213 2011-05-22  Ivan Maidanski  <ivmai@mail.ru>
1214
1215         * os_dep.c (GC_get_main_stack_base): Convert to GC_get_stack_base
1216         for BeOS and OS/2; define HAVE_GET_STACK_BASE.
1217         * os_dep.c (GET_MAIN_STACKBASE_SPECIAL): Define when a specific
1218         GC_get_main_stack_base implementation is defined.
1219         * os_dep.c (GC_get_main_stack_base): Define that based on
1220         GC_get_stack_base() in a single place (only if
1221         GET_MAIN_STACKBASE_SPECIAL is unset); check GC_get_stack_base()
1222         result.
1223
1224 2011-05-20  Ivan Maidanski  <ivmai@mail.ru>
1225
1226         * mark.c (GC_push_selected): Remove "push_fn" argument (use
1227         GC_push_all directly); update the documentation; reformat the
1228         comment.
1229         * mark.c (GC_push_conditional): Simplify the code (for better
1230         readability).
1231
1232 2011-05-20  Ivan Maidanski  <ivmai@mail.ru>
1233
1234         * mark.c (alloc_mark_stack): Use FALSE/TRUE (instead of 0/1) for
1235         boolean local variables.
1236         * doc/README.macros (GC_PREFER_MPROTECT_VDB): Update.
1237         * os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty,
1238         GC_remove_protection): Define for GWW_VDB and PROC_VDB in a single
1239         place.
1240         * os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty): Compute
1241         PHT_HASH(h) only once (store result to a local variable).
1242
1243 2011-05-20  Ivan Maidanski  <ivmai@mail.ru>
1244
1245         * doc/README.solaris2: Update.
1246
1247 2011-05-19  Ivan Maidanski  <ivmai@mail.ru> (really Jie Liu)
1248
1249         * include/private/gcconfig.h (end, InitStackBottom): Declare
1250         extern variable for RTEMS.
1251         * include/private/gcconfig.h (DATASTART, DATAEND, STACKBOTTOM):
1252         Update (for RTEMS).
1253         * include/private/gcconfig.h (DATAEND): Fix a typo in the macro
1254         name (for RTEMS).
1255         * tests/test.c (CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER):
1256         Replace with CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER (for RTEMS).
1257
1258 2011-05-18  Ivan Maidanski  <ivmai@mail.ru>
1259
1260         * include/private/gcconfig.h (MPROTECT_VDB): Enable for Solaris in
1261         single-threaded environment.
1262
1263 2011-05-18  Ivan Maidanski  <ivmai@mail.ru>
1264
1265         * include/private/gcconfig.h (MPROTECT_VDB): Undefine if PROC_VDB.
1266         * tests/test.c (NUMBER_ROUND_UP): New macro.
1267         * tests/test.c (check_heap_stats): Round up total expected heap
1268         size to the nearest 4 MiB bound.
1269         * tests/test.c (check_heap_stats): Print the current and expected
1270         heap sizes in case of failure.
1271
1272 2011-05-18  Ivan Maidanski  <ivmai@mail.ru>
1273
1274         * checksums.c (GC_check_blocks, GC_check_dirty): Do log printing
1275         only if GC_print_stats; print errors using GC_err_printf.
1276         * checksums.c (GC_check_blocks): Join adjacent printf() calls into
1277         a single one.
1278
1279 2011-05-17  Ivan Maidanski  <ivmai@mail.ru>
1280
1281         * pthread_support.c (pthread_join): Add assertion (check thread is
1282         finished).
1283         * pthread_support.c (GC_register_my_thread): Don't detach the
1284         thread if invoked from the thread destructor.
1285         * win32_threads.c (GC_register_my_thread): Ditto.
1286         * win32_threads.c (GC_unregister_my_thread): Don't delete the
1287         thread (just set FINISHED) if the thread is not detached (only if
1288         GC_PTHREADS); add assertion (check the thread is not finished).
1289         * tests/threadkey_test.c (main): Join some created threads.
1290
1291 2011-05-17  Ivan Maidanski  <ivmai@mail.ru>
1292
1293         * pthread_support.c (GC_delete_gc_thread): Rename "gc_id" local
1294         variable to "t".
1295         * win32_threads.c (GC_delete_gc_thread): Ditto.
1296         * pthread_support.c (pthread_join, pthread_detach,
1297         pthread_cancel): Rename "thread_gc_id" local variable to "t".
1298         * win32_threads.c (GC_pthread_detach): Ditto.
1299         * win32_threads.c (GC_delete_gc_thread): Remove "gc_nvid" local
1300         variable.
1301         * win32_threads.c (GC_pthread_join): Rename "joinee" local
1302         variable to "t".
1303
1304 2011-05-16  Ivan Maidanski  <ivmai@mail.ru>
1305
1306         * pthread_stop_world.c (pthread_sigmask): Undefine even if not
1307         DEBUG_THREADS.
1308         * pthread_stop_world.c (GC_unblock_gc_signals): New function (only
1309         if GC_EXPLICIT_SIGNALS_UNBLOCK).
1310         * pthread_support.c (GC_unblock_gc_signals): New prototype.
1311         * pthread_support.c (GC_register_my_thread_inner,
1312         GC_register_my_thread): Call GC_unblock_gc_signals (only if
1313         GC_EXPLICIT_SIGNALS_UNBLOCK); add comment.
1314         * include/private/gcconfig.h (GC_EXPLICIT_SIGNALS_UNBLOCK): New
1315         macro.
1316
1317 2011-05-16  Ivan Maidanski  <ivmai@mail.ru>
1318
1319         * pthread_stop_world.c (GC_suspend_handler_inner): Remove "dummy",
1320         "sig" local variables; rename my_thread local variable to "self".
1321
1322 2011-05-13  Ivan Maidanski  <ivmai@mail.ru>
1323
1324         * tests/threadkey_test.c (LIMIT): Use smaller value (don't create
1325         more than 30 in parallel by default).
1326
1327 2011-05-13  Ivan Maidanski  <ivmai@mail.ru>
1328
1329         * tests/threadkey_test.c (key_once, main): Work around for Solaris
1330         PTHREAD_ONCE_INIT.
1331         * tests/threadkey_test.c (LIMIT): Use smaller value for Solaris.
1332
1333 2011-05-13  Ivan Maidanski  <ivmai@mail.ru>
1334
1335         * dyn_load.c (GC_FirstDLOpenedLinkMap): Remove unused "r" local
1336         variable.
1337         * pthread_support.c (GC_unregister_my_thread_inner): Revert back
1338         GC_remove_specific invocation; add a comment.
1339         * include/private/thread_local_alloc.h (GC_remove_specific):
1340         Revert back.
1341         * specific.c: Expand all tabs to spaces.
1342         * specific.c (slow_getspecific): Cast qtid to AO_t.
1343         * include/private/specific.h (quick_thread_id): Reformat comment.
1344         * include/private/specific.h (key_create, setspecific,
1345         remove_specific): Remove "extern" keyword.
1346         * include/private/specific.h (getspecific): Change type of "qtid"
1347         local variable to unsigned long.
1348
1349 2011-05-11  Ivan Maidanski  <ivmai@mail.ru>
1350
1351         * pthread_support.c (GC_check_tls): Fix "#endif" comment.
1352         * include/gc.h (GC_REDIRECT_TO_LOCAL): Remove deprecated comment.
1353         * include/private/thread_local_alloc.h (THREAD_LOCAL_ALLOC):
1354         Remove redundant test of the macro.
1355         * include/private/thread_local_alloc.h: Reformat the code.
1356
1357 2011-05-11  Ivan Maidanski  <ivmai@mail.ru>
1358
1359         * backgraph.c (add_edge): Recognize DEBUG_PRINT_BIG_N_EDGES macro.
1360         * os_dep.c (GC_set_and_save_fault_handler): Recognize
1361         SIGACTION_FLAGS_NODEFER_HACK macro.
1362         * pthread_support.c (mark_mutex): Recognize GLIBC_2_1_MUTEX_HACK
1363         macro.
1364         * pthread_support.c (GC_acquire_mark_lock): Remove commented out
1365         code.
1366         * include/gc_inline.h (GC_MALLOC_WORDS, GC_MALLOC_ATOMIC_WORDS,
1367         GC_CONS): Remove trailing space (before back-slash).
1368         * include/private/gc_hdrs.h (GET_BI, GET_HDR_ADDR): Ditto.
1369         * include/private/gc_pmark.h (PUSH_OBJ, PUSH_CONTENTS,
1370         SET_MARK_BIT_EXIT_IF_SET, LONG_MULT, PUSH_CONTENTS_HDR,
1371         GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP): Ditto.
1372         * include/private/thread_local_alloc.h (GC_key_create): Ditto.
1373         * include/private/gc_priv.h (SUNOS5SIGS): Don't include
1374         sys/siginfo.h on Linux.
1375         * include/private/gcconfig.h: Reformat comments (and some code).
1376         * include/private/gcconfig.h (FORCE_WRITE_PREFETCH): New macro
1377         recognized, force PREFETCH_FOR_WRITE to be defined on x86.
1378         * include/private/gcconfig.h (USE_HPUX_FIXED_STACKBOTTOM): New
1379         macro recognized (for HP/UX).
1380
1381 2011-05-11  Ivan Maidanski  <ivmai@mail.ru>
1382
1383         * os_dep.c (GC_gww_page_was_ever_dirty): Fix comment (for
1384         GWW_VDB).
1385         * os_dep.c (GC_dirty_init): Use memset() for GC_written_pages
1386         resetting (for PROC_VDB).
1387
1388 2011-05-11  Ivan Maidanski  <ivmai@mail.ru> (mostly really Ludovic Courtes)
1389
1390         * tests/threadkey_test.c: New file.
1391         * .cvsignore (threadkey_test): Add.
1392         * tests/tests.am (TESTS, check_PROGRAMS): Add 'threadkey_test'.
1393         * tests/tests.am (threadkey_test_SOURCES, threadkey_test_LDADD):
1394         New variable.
1395         * Makefile.in: Regenerate.
1396
1397 2011-05-11  Ivan Maidanski  <ivmai@mail.ru>
1398
1399         * pthread_support.c (GC_unregister_my_thread_inner): Don't call
1400         GC_remove_specific.
1401         * include/private/thread_local_alloc.h (GC_remove_specific):
1402         Remove (since it is empty for all targets).
1403         * pthread_support.c (GC_record_stack_base): New inline function.
1404         * win32_threads.c (GC_record_stack_base): Ditto.
1405         * pthread_support.c (GC_register_my_thread_inner): Invoke
1406         GC_record_stack_base.
1407         * win32_threads.c (GC_register_my_thread_inner): Ditto.
1408         * pthread_support.c (GC_register_my_thread): If thread is FINISHED
1409         then call GC_record_stack_base, clear FINISHED, initialize
1410         thread-local list and return success.
1411         * win32_threads.c (GC_register_my_thread): Ditto.
1412         * include/gc.h (GC_register_my_thread): Update documentation.
1413         * include/private/thread_local_alloc.h (GC_thread_key): Ditto.
1414
1415 2011-05-10  Ivan Maidanski  <ivmai@mail.ru>
1416
1417         * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Join
1418         adjacent "#ifdef".
1419         * thread_local_alloc.c (GC_malloc_atomic): Call
1420         GC_core_malloc_atomic (instead of GC_core_malloc).
1421
1422 2011-05-10  Ivan Maidanski  <ivmai@mail.ru>
1423
1424         * pthread_start.c (GC_start_rtn_prepare_thread): Change return
1425         type to GC_thread.
1426         * pthread_start.c (GC_inner_start_routine): Pass the current
1427         thread descriptor to pthread_cleanup_push (same as in
1428         win32_threads.c).
1429         * pthread_stop_world.c (GC_push_all_stacks): Rename "me" local
1430         variable to "self".
1431         * win32_threads.c (GC_push_all_stacks): Ditto.
1432         * pthread_stop_world.c (GC_suspend_all, GC_start_world): Rename
1433         "my_thread" local variable to "self".
1434         * pthread_support.c (GC_unregister_my_thread_inner): New static
1435         function.
1436         * pthread_support.c (GC_unregister_my_thread,
1437         GC_thread_exit_proc): Use GC_unregister_my_thread_inner.
1438         * win32_threads.c (GC_register_my_thread, GC_unregister_my_thread,
1439         GC_do_blocking_inner): Rename "t" local variable to "thread_id".
1440         * win32_threads.c (GC_wait_marker, GC_notify_all_marker): Rename
1441         "id" local variable to "thread_id".
1442
1443 2011-05-10  Ivan Maidanski  <ivmai@mail.ru>
1444
1445         * pthread_support.c (GC_unregister_my_thread): Call pthread_self
1446         only once.
1447         * win32_threads.c (GC_pthread_start_inner): Ditto.
1448         * pthread_support.c (GC_unregister_my_thread): Add debug output.
1449         * win32_threads.c (GC_unregister_my_thread): Ditto.
1450         * pthread_support.c (GC_register_my_thread,
1451         GC_start_rtn_prepare_thread): Rename "my_pthread" local variable
1452         to "self".
1453
1454 2011-05-10  Ivan Maidanski  <ivmai@mail.ru>
1455
1456         * include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): Define
1457         unconditionally (do not test GC_I_HIDE_POINTERS); update the
1458         comment.
1459         * include/gc.h (HIDE_POINTER, REVEAL_POINTER): Define as alias to
1460         GC_HIDE/REVEAL_POINTER, respectively.
1461         * include/private/gc_pmark.h (GC_I_HIDE_POINTERS): Do not define.
1462         * include/private/gc_priv.h (GC_I_HIDE_POINTERS): Ditto.
1463
1464 2011-05-10  Ivan Maidanski  <ivmai@mail.ru>
1465
1466         * include/gc.h (GC_register_my_thread): Refine the comment.
1467
1468 2011-05-08  Ivan Maidanski  <ivmai@mail.ru>
1469
1470         * include/gc_inline.h (GC_MALLOC_WORDS, GC_CONS): Add missing
1471         parentheses.
1472         * include/gc_typed.h (GC_get_bit, GC_set_bit,
1473         GC_CALLOC_EXPLICITLY_TYPED): Ditto.
1474
1475 2011-05-07  Ivan Maidanski  <ivmai@mail.ru>
1476
1477         * include/private/gcconfig.h (NO_GETCONTEXT): Add missing ')'.
1478
1479 2011-05-07  Ivan Maidanski  <ivmai@mail.ru> (really Thorsten Glaser)
1480
1481         * include/private/gcconfig.h (NO_GETCONTEXT): Do not use
1482         getcontext(2) on m68k because it is not implemented there.
1483
1484 2011-05-07  Ivan Maidanski  <ivmai@mail.ru>
1485
1486         * alloc.c (GC_clear_a_few_frames): Use BZERO().
1487         * mark_rts.c (GC_clear_roots, GC_rebuild_root_index): Ditto.
1488         * reclaim.c (GC_start_reclaim): Ditto.
1489         * blacklst.c (total_stack_black_listed): Remove "len" local
1490         variable.
1491         * dbg_mlc.c (GC_generate_random_valid_address): Replace "for"
1492         statement with "do-while" one.
1493         * dyn_load.c (GC_register_dynamic_libraries,
1494         GC_register_dynlib_callback): Remove redundant parentheses.
1495
1496 2011-05-06  Ivan Maidanski  <ivmai@mail.ru>
1497
1498         * cord/cordxtra.c (CORD_from_file_lazy_inner): Suppress
1499         "unused result" compiler warning for fread().
1500         * cord/cordxtra.c: Expand all tabs to spaces.
1501
1502 2011-05-06  Ivan Maidanski  <ivmai@mail.ru>
1503
1504         * os_dep.c (GC_write_fault_handler): Break when in_allocd_block
1505         is set to true.
1506
1507 2011-05-06  Ivan Maidanski  <ivmai@mail.ru>
1508
1509         * dbg_mlc.c (GC_has_other_debug_info): Change return type to int;
1510         return -1 if the object has (or had) debugging info but was
1511         marked deallocated.
1512         * include/private/dbg_mlc.h (GC_has_other_debug_info): Ditto.
1513         * dbg_mlc.c (GC_has_other_debug_info): Update documentation;
1514         remove "ohdr" local variable.
1515         * dbg_mlc.c (GC_debug_free): Don't call GC_free if the object has
1516         probably been deallocated.
1517         * dbg_mlc.c (GC_debug_free): Don't actually free the object even
1518         in the leak-finding mode if GC_findleak_delay_free.
1519         * dbg_mlc.c (GC_print_all_smashed_proc): Print a trailing blank
1520         line.
1521         * dbg_mlc.c (GC_check_leaked): New function (only unless
1522         SHORT_DBG_HDRS).
1523         * doc/README.environment (GC_FINDLEAK_DELAY_FREE): Document.
1524         * doc/README.macros (GC_FINDLEAK_DELAY_FREE): Ditto.
1525         * include/private/dbg_mlc.h (START_FLAG, END_FLAG): Use GC_WORD_C
1526         on 64-bit architectures.
1527         * include/private/dbg_mlc.h (NOT_MARKED): Remove redundant
1528         parentheses.
1529         * include/private/dbg_mlc.h (GC_HAS_DEBUG_INFO): Update (due to
1530         GC_has_other_debug_info change).
1531         * include/private/gc_priv.h (GC_findleak_delay_free): New global
1532         variable declaration (unless SHORT_DBG_HDRS).
1533         * misc.c (GC_findleak_delay_free): New global variable; recognize
1534         GC_FINDLEAK_DELAY_FREE.
1535         * misc.c (GC_init): Recognize GC_FINDLEAK_DELAY_FREE environment
1536         variable (unless SHORT_DBG_HDRS).
1537         * reclaim.c (GC_check_leaked): Declare (unless SHORT_DBG_HDRS).
1538         * reclaim.c (GC_add_leaked): Don't add the object to leaked list
1539         if marked as deallocated.
1540
1541 2011-05-05  Ivan Maidanski  <ivmai@mail.ru>
1542
1543         * dbg_mlc.c (GC_has_other_debug_info): Fix punctuation in the
1544         comment.
1545         * dbg_mlc.c (GC_FREED_MEM_MARKER): New macro.
1546         * dbg_mlc.c (GC_debug_free): Use GC_FREED_MEM_MARKER.
1547         * dbg_mlc.c (GC_smashed): Refine documentation.
1548         * mark.c (GC_push_selected): Change dirty_fn return type to
1549         GC_bool.
1550         * os_dep.c (GC_page_was_ever_dirty): Make GC_INNER.
1551         * reclaim.c (GC_reclaim_small_nonempty_block): Remove "kind"
1552         local  variable.
1553         * reclaim.c (GC_reclaim_block): Pass true constant to
1554         GC_reclaim_small_nonempty_block (instead of report_if_found).
1555         * doc/README.autoconf: Update; fix a typo.
1556         * include/private/gcconfig.h (GC_WORD_C): New macro.
1557
1558 2011-05-03  Ivan Maidanski  <ivmai@mail.ru>
1559
1560         * dbg_mlc.c (GC_store_debug_info_inner): Cast "linenum".
1561         * dbg_mlc.c (GC_check_annotated_obj): Fix punctuation in the
1562         comment.
1563         * dbg_mlc.c (GC_print_smashed_obj): Add (and print) "msg"
1564         argument.
1565         * dbg_mlc.c (GC_debug_free, GC_print_all_smashed_proc): Pass
1566         message to GC_print_smashed_obj.
1567         * dbg_mlc.c (GC_debug_free): Call GC_size once.
1568         * dbg_mlc.c (GC_debug_realloc): Calculate old_sz only if
1569         allocation succeeded; remove unnecessary check for object is
1570         smashed (since this is done in GC_debug_free); remove "clobbered"
1571         local variable.
1572
1573 2011-05-03  Ivan Maidanski  <ivmai@mail.ru>
1574
1575         * dbg_mlc.c (GC_store_debug_info_inner, GC_store_debug_info):
1576         Rename "integer" argument to "linenum"; change the type of the
1577         argument to int.
1578         * gcj_mlc.c (GC_store_debug_info): Ditto.
1579         * dbg_mlc.c (GET_OH_LINENUM): New macro.
1580         * dbg_mlc.c (GC_print_obj, GC_print_smashed_obj): Use
1581         GET_OH_LINENUM; adjust print format specifier.
1582         * dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
1583         GC_debug_malloc_atomic_ignore_off_page,
1584         GC_debug_generic_malloc_inner,
1585         GC_debug_generic_malloc_inner_ignore_off_page,
1586         GC_debug_malloc_stubborn, GC_debug_malloc_atomic,
1587         GC_debug_malloc_uncollectable,
1588         GC_debug_malloc_atomic_uncollectable): Remove unnecessary cast of
1589         "i".
1590         * gcj_mlc.c (GC_debug_gcj_malloc): Ditto.
1591
1592 2011-04-26  Ivan Maidanski  <ivmai@mail.ru>
1593
1594         * .cvsignore (initsecondarythread, test_cpp): Add.
1595         * os_dep.c (GC_linux_stack_base): Rename to
1596         GC_linux_main_stack_base.
1597         * os_dep.c (GC_freebsd_stack_base): Rename to
1598         GC_freebsd_main_stack_base; adjust error message.
1599         * pthread_stop_world.c (GC_stop_init): Use GC_SEM_INIT_PSHARED
1600         as an argument for sem_init().
1601         * pthread_support.c (pthread_create): Ditto.
1602         * pthread_support.c (pthread_create): Abort in case sem_init()
1603         fails.
1604         * include/private/gc_priv.h (GC_SEM_INIT_PSHARED): Define.
1605         * tests/initsecondarythread.c: Include gcconfig.h; call GC_INIT
1606         from main() if it should be done from the primordial thread only.
1607
1608 2011-04-26  Ivan Maidanski  <ivmai@mail.ru>
1609
1610         * alloc.c: Don't include sys/types.h for ArmCC.
1611         * dyn_load.c: Ditto.
1612         * os_dep.c: Ditto.
1613         * mach_dep.c (_setjmp, _longjmp): Redirect to setjmp/longjmp for
1614         ArmCC.
1615         * mark.c (GC_noop): Define specially for ArmCC.
1616         * include/private/gc_priv.h (GC_noop): Ditto.
1617         * misc.c (GC_init): Don't test pointers comparison for ArmCC.
1618         * misc.c: Don't include unistd.h for ArmCC.
1619         * os_dep.c (pages_executable): Rename to GC_pages_executable;
1620         make STATIC.
1621         * os_dep.c (GC_unix_mmap_get_mem): Don't define for ArmCC.
1622         * ptr_chck.c (GC_is_visible): Explicitly cast
1623         (GC_DS_PER_OBJECT-GC_INDIR_PER_OBJ_BIAS) to word (to suppress
1624         a compiler warning).
1625         * include/private/gcconfig.h: Recognize __arm.
1626         * include/private/gcconfig.h (HBLKPTR): Define for ArmCC.
1627         * include/private/gcconfig.h (HBLKPTR): Add parentheses for
1628         "bytes" argument.
1629
1630 2011-04-24  Ivan Maidanski  <ivmai@mail.ru>
1631
1632         * pthread_support.c (GC_get_nprocs): Don't define for Android.
1633         * pthread_support.c (GC_dummy_thread_local): Don't test
1634         GC_LINUX_THREADS.
1635         * include/gc_config_macros.h (GC_ADD_CALLER, GC_RETURN_ADDR):
1636         Define for Android.
1637
1638 2011-04-24  Ivan Maidanski  <ivmai@mail.ru>
1639
1640         * mach_dep.c (NO_GETCONTEXT): Move to gcconfig.h.
1641         * os_dep.c (GC_write_fault_handler): Don't include ucontext.h if
1642         NO_GETCONTEXT.
1643         * include/private/gcconfig.h (GETPAGESIZE): Define as a sysconf
1644         call for Android.
1645
1646 2011-04-23  Ivan Maidanski  <ivmai@mail.ru>
1647
1648         * include/private/gc_locks.h (WIN32_LEAN_AND_MEAN, NOSERVICE):
1649         Define before including windows.h.
1650         * include/private/gc_priv.h (WIN32_LEAN_AND_MEAN, NOSERVICE):
1651         Ditto.
1652         * include/private/thread_local_alloc.h (WIN32_LEAN_AND_MEAN,
1653         NOSERVICE): Ditto.
1654         * include/private/gc_priv.h (CLOCKS_PER_SEC): Reformat the
1655         comment.
1656         * include/private/gc_priv.h (MS_TIME_DIFF): Avoid floating-point
1657         arithmetics; add a comment.
1658
1659 2011-04-23  Ivan Maidanski  <ivmai@mail.ru>
1660
1661         * mark.c (GC_clear_hdr_marks): Don't test USE_MARK_BYTES.
1662         * extra/setjmp_t.c (main): Don't test USE_MARK_BITS.
1663         * include/private/gc_pmark.h (SET_MARK_BIT_EXIT_IF_SET): Ditto.
1664         * include/private/gc_pmark.h (SET_MARK_BIT_EXIT_IF_SET): Remove
1665         "mark_byte" local variable.
1666         * include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET): Add a comment
1667         about that AO_or() is not used by GC unless USE_MARK_BITS
1668         explicitly set.
1669         * include/private/gc_priv.h (OR_WORD): Ditto.
1670         * include/private/gc_pmark.h (INCR_MARKS): Remove trailing ';',
1671         add parentheses.
1672         * include/private/gc_priv.h (ONES): Define before use by
1673         MAKE_COOLER.
1674         * include/private/gc_priv.h (MARK_BITS_SZ): Define where used.
1675         * include/private/gc_priv.h (OR_WORD): Don't define if
1676         USE_MARK_BYTES.
1677         * include/private/gcconfig.h (USE_MARK_BYTES); Remove duplicate
1678         definition; simplify expression.
1679
1680 2011-04-22  Ivan Maidanski  <ivmai@mail.ru>
1681
1682         * os_dep.c (GC_get_maps): Always close the file.
1683         * pthread_support.c (GC_get_nprocs): Ditto.
1684         * os_dep.c (READ): Define similarly across the file (without
1685         parameters).
1686         * pthread_support.c (GC_get_nprocs): Use signed int type for "i"
1687         and "len" local variables (since read() may return -1).
1688         * include/private/gc_pmark.h (LONG_MULT): Add prefix/suffix
1689         double underscore; add "volatile" for asm.
1690         * include/private/gc_pmark.h (LONG_MULT): Add missing
1691         parentheses.
1692         * include/private/gc_priv.h (OR_WORD): Ditto.
1693         * include/private/gc_priv.h (OR_WORD): Remove unnecessary brackets
1694         and ';' symbol.
1695
1696 2011-04-22  Ivan Maidanski  <ivmai@mail.ru>
1697
1698         * os_dep.c (GC_get_stack_base): Implement for Android (same as
1699         for Linux).
1700         * pthread_support.c (GC_get_nprocs): Return 1 (instead of -1) if
1701         failed to open "stat" file (not to issue a warning twice); update
1702         the comment.
1703         * pthread_support.c (GC_thr_init): Call sysconf() on Android to
1704         get the number of CPUs.
1705
1706 2011-04-21  Ivan Maidanski  <ivmai@mail.ru>
1707
1708         * include/private/gc_priv.h (_GNU_SOURCE): Revert one of the
1709         recent patches regarding this macro as the macro should be set
1710         (to 1) before including any other system header.
1711
1712 2011-04-21  Ivan Maidanski  <ivmai@mail.ru>
1713
1714         * doc/README.environment (GC_INITIAL_HEAP_SIZE,
1715         GC_MAXIMUM_HEAP_SIZE): Update.
1716
1717 2011-04-20  Ivan Maidanski  <ivmai@mail.ru>
1718
1719         * misc.c (GC_parse_mem_size_arg): Allow 'k', 'M', 'G' suffixes in
1720         heap size specifier; return 0 if not a valid one.
1721         * include/gc_cpp.h: Explicitly define inline one-argument delete
1722         operator for Cygwin (as a workaround).
1723         * include/gc_cpp.h: Reformat the code.
1724         * tests/test_cpp.cc: Ditto.
1725         * tests/test_cpp.cc (main): Suppress compiler warnings about
1726         "assigned value is unused".
1727
1728 2011-04-19  Ivan Maidanski  <ivmai@mail.ru>
1729
1730         * misc.c (GC_parse_mem_size_arg): New function.
1731         * misc.c (GC_init): Use GC_parse_mem_size_arg().
1732         * pthread_stop_world.c (tkill): Declare for Android.
1733
1734 2011-04-19  Ivan Maidanski  <ivmai@mail.ru>
1735
1736         * include/private/gc_priv.h (_GNU_SOURCE): Include features.h
1737         first (except for NaCl) and then define the macro to 1 if not yet.
1738
1739 2011-04-18  Ivan Maidanski  <ivmai@mail.ru> (really Ludovic Courtes)
1740
1741         * tests/tests.am (TESTS, check_PROGRAMS): Add
1742         'initsecondarythread'.
1743         * tests/tests.am (initsecondarythread_SOURCES,
1744         initsecondarythread_LDADD): New variable.
1745         * Makefile.in: Regenerate.
1746         * configure: Ditto.
1747
1748 2011-04-18  Ivan Maidanski  <ivmai@mail.ru>
1749
1750         * dbg_mlc.c (GC_store_debug_info_inner): Always define; add
1751         "const" to its string argument.
1752         * dbg_mlc.c (GC_store_debug_info): Call GC_store_debug_info_inner.
1753         * dbg_mlc.c (GC_debug_free): Set GC_have_errors in case of
1754         smashed or previously deallocated found.
1755         * dbg_mlc.c (GC_check_heap_block): Replace while loop with a for
1756         one.
1757         * reclaim.c (GC_reclaim_check): Ditto.
1758         * dbg_mlc.c (GC_check_heap_proc): Remove redundant cast to word.
1759         * os_dep.c (GC_get_stack_base): Don't initialize
1760         stackbase_main_self/ss_sp on Solaris if thr_main() is zero (thus
1761         calling GC_INIT() from a non-primordial thread is possible now).
1762         * reclaim.c (GC_add_leaked): Turn into an inline one.
1763         * reclaim.c (GC_reclaim_small_nonempty_block):
1764         Change report_if_found type from int/word to boolean.
1765         * include/private/gc_priv.h (GC_start_reclaim): Ditto.
1766         * include/private/gc_priv.h (set_mark_bit_from_hdr,
1767         clear_mark_bit_from_hdr): Place closing parenthesis properly;
1768         reformat the code.
1769
1770 2011-04-16  Ivan Maidanski  <ivmai@mail.ru>
1771
1772         * os_dep.c (GC_get_main_stack_base): Try to use
1773         pthread_attr_getstack first for Linux if THREADS.
1774         * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Adjust text
1775         alignment.
1776
1777 2011-04-13  Ivan Maidanski  <ivmai@mail.ru>
1778
1779         * dbg_mlc.c (GC_generate_random_backtrace_no_gc): Fix a message
1780         typo.
1781         * dbg_mlc.c (GC_debug_malloc): Add a comment (about zero size).
1782         * dbg_mlc.c (GC_debug_generic_malloc_inner): Reformat the comment.
1783         * dbg_mlc.c (GC_strdup): Call GC_err_printf instead of WARN (in
1784         case of NULL argument).
1785         * dbg_mlc.c (GC_free): In case of NULL argument, just return
1786         (without any warning printed); eliminate "uncollectable" local
1787         variable.
1788
1789 2011-04-13  Ivan Maidanski  <ivmai@mail.ru> (mostly really Rainer Orth)
1790
1791         * configure.ac (THREADDLLIBS): Use alternate thread library on
1792         Solaris 8.
1793         * configure.ac (need_atomic_ops_asm): Set to true only for Sparc
1794         Solaris.
1795         * configure.ac: Don't use libdl on mips-sgi-irix6.
1796         * configure: Regenerate.
1797
1798 2011-04-11  Ivan Maidanski  <ivmai@mail.ru> (really Jie Liu)
1799
1800         * mach_dep.c (NO_GETCONTEXT); Define for RTEMS.
1801         * mach_dep.c (GC_with_callee_saves_pushed): Don't call
1802         __builtin_unwind_init() for RTEMS; use setjmp() without the
1803         leading underscore (for RTEMS).
1804         * tests/test.c (BIG): Use smaller value for RTEMS.
1805         * tests/test.c (main): Customize for RTEMS.
1806
1807 2011-04-11  Ivan Maidanski  <ivmai@mail.ru> (mostly really Jim Meyering)
1808
1809         * configure.host: Remove doubled words in comments.
1810         * os_dep.c: Ditto.
1811         * doc/README: Ditto.
1812         * extra/setjmp_t.c: Ditto.
1813         * tests/huge_test.c: Ditto.
1814         * extra/setjmp_t.c (getpagesize, nested_sp, main, g): Replace the
1815         K&R-style function definition with the ANSI C one.
1816         * extra/setjmp_t.c: Expand all tabs to spaces.
1817         * extra/setjmp_t.c (nested_sp): Implement in the same way as
1818         GC_approx_sp.
1819
1820 2011-04-10  Ivan Maidanski  <ivmai@mail.ru> (really Iain Sandoe, Mike Stump)
1821
1822         * dyn_load.c (GC_dyld_sections): Add more sctions.
1823         * dyn_load.c (GC_dyld_add_sect_fmts): New static varaible.
1824         * dyn_load.c (L2_MAX_OFILE_ALIGNMENT): New macro.
1825         * dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove): Improve
1826         logging; add support for on-demand sections.
1827         * dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove): Reformat
1828         the code.
1829
1830 2011-04-10  Ivan Maidanski  <ivmai@mail.ru>
1831
1832         * gcj_mlc.c (GC_gcj_malloc_initialized): Use STATIC unless
1833         GC_ASSERTIONS.
1834         * include/private/gc_priv.h (GC_gcj_malloc_initialized): Don't
1835         declare (as external) unless GC_ASSERTIONS.
1836         * os_dep.c (GC_win32_free_heap): Clear GC_heap_bases[] also for
1837         Cygwin; add FIXME.
1838         * include/private/gcconfig.h: Include <sys/unistd.h> for RTEMS.
1839         * include/private/gcconfig.h: Add "#error" for every "-->" mark.
1840         * include/private/gcconfig.h (CLEAR_DOUBLE): Turn the code into
1841         an expression.
1842         * include/private/pthread_support.h (SUSPENDED_EXT): Add new flag
1843         (which existed previously as SUSPENDED and still exists in GCJ).
1844         * include/private/pthread_support.h (DISABLED_GC): Change the
1845         value (as it is already used by SUSPENDED_EXT).
1846
1847 2011-04-10  Ivan Maidanski  <ivmai@mail.ru> (mostly really Iain Sandoe)
1848
1849         * tests/test.c (reverse_test):  Modify count (BIG) for
1850         ppc64-darwin.
1851
1852 2011-04-09  Ivan Maidanski  <ivmai@mail.ru>
1853
1854         * reclaim.c (GC_print_all_errors): Recognize new GC_ABORT_ON_LEAK
1855         macro and environment variable; abort if any error has been
1856         printed provided the environment variable (or macro) is set.
1857         * doc/README.environment (GC_ABORT_ON_LEAK): Document.
1858         * doc/README.macros (GC_ABORT_ON_LEAK): Ditto.
1859         * doc/README.macros (FIND_LEAK, SUNOS5SIGS, PCR,
1860         USE_COMPILER_TLS): Reformat the text.
1861
1862 2011-04-09  Ivan Maidanski  <ivmai@mail.ru> (really Jie Liu)
1863
1864         * os_dep.c (GC_unix_sbrk_get_mem, GC_unix_get_mem): Don't define
1865         for RTEMS.
1866         * include/private/gcconfig.h (RTEMS): Add support for.
1867         * include/private/gcconfig.h (GET_MEM): Use calloc() for RTEMS.
1868
1869 2011-04-09  Ivan Maidanski  <ivmai@mail.ru>
1870
1871         * mallocx.c (GC_malloc_uncollectable): Move to malloc.c (since
1872         it is used internally in some places).
1873
1874 2011-04-09  Ivan Maidanski  <ivmai@mail.ru>
1875
1876         * dbg_mlc.c (GC_register_finalizer_no_order): Remove redundant
1877         declaration.
1878         * dbg_mlc.c (GC_debug_malloc_replacement,
1879         GC_debug_realloc_replacement): Rename RA to GC_DBG_RA.
1880         * malloc.c (GC_debug_malloc_replacement): Ditto.
1881         * mallocx.c (GC_debug_realloc_replacement): Ditto.
1882         * dbg_mlc.c (GC_store_debug_info): Move proto from dbg_mlc.h.
1883         * malloc.c (GC_strdup, GC_strndup, GC_wcsdup): Move to mallocx.c.
1884         * malloc.c: Include errno.h only REDIRECT_MALLOC; remove redundant
1885         includes of string.h.
1886         * mallocx.c: Include string.h (for GC_strdup).
1887         * include/private/dbg_mlc.h (GC_store_debug_info): Move declaration
1888         to dbg_mlc.c.
1889         * include/private/gc_locks.h (UNCOND_LOCK, UNCOND_UNLOCK): Remove
1890         redundant trailing ';'.
1891         * include/private/gc_priv.h (START_WORLD, COND_DUMP): Ditto.
1892         * include/private/gc_locks.h (LOCK, UNLOCK): Place opening '{'
1893         properly.
1894         * include/private/gc_priv.h (GC_DBG_RA): Move from dbg_mlc.c,
1895         malloc.c, mallocx.c.
1896
1897 2011-04-07  Ivan Maidanski  <ivmai@mail.ru>
1898
1899         * alloc.c (GC_check_heap, GC_print_all_smashed): Move the
1900         definition from misc.c.
1901         * dbg_mlc.c (GC_debug_malloc_atomic_uncollectable): Define as
1902         public.
1903         * include/gc.h (GC_debug_malloc_atomic_uncollectable): Declare.
1904         * include/gc.h (GC_MALLOC_ATOMIC_UNCOLLECTABLE): Define new public
1905         macro.
1906         * dbg_mlc.c (MAX_SMASHED): Don't define if already set.
1907         * reclaim.c (MAX_LEAKED): Ditto.
1908         * dbg_mlc.c (GC_add_smashed): Add FIXME about the concurrent
1909         access to the global array.
1910         * reclaim.c (GC_add_leaked): Ditto.
1911         * misc.c (GC_print_back_height): Set on if GC_PRINT_BACK_HEIGHT
1912         (new macro) is defined.
1913         * doc/README.macros (GC_PRINT_BACK_HEIGHT): Document.
1914         * misc.c (GC_dump_regularly, GC_init): Replace 0/1 for
1915         GC_dump_regularly and GC_print_back_height variables with
1916         FALSE/TRUE.
1917         * reclaim.c (GC_print_all_errors): Refine the comment.
1918
1919 2011-04-04  Ivan Maidanski  <ivmai@mail.ru>
1920
1921         * tests/test.c (reverse_test_inner): Undo one of the previous
1922         patches which shifts "c" and "d" pointers only if
1923         ALL_INTERIOR_POINTERS (since interior pointers are always
1924         recognized in stacks).
1925
1926 2011-04-03  Ivan Maidanski  <ivmai@mail.ru>
1927
1928         * misc.c (GC_stdout, GC_stderr): Move the definition to the place
1929         where GC_log is defined (Unix only).
1930         * misc.c (GC_init): Recognize "GC_ONLY_LOG_TO_FILE" environment
1931         variable and the similar macro; redirect GC_stdout and GC_stderr
1932         to GC_log if "GC_LOG_FILE" environment variable is set unless
1933         prohibited by GC_ONLY_LOG_TO_FILE (Unix only).
1934         * doc/README.environment (GC_ONLY_LOG_TO_FILE): Document.
1935         * doc/README.macros (GC_ONLY_LOG_TO_FILE): Ditto.
1936
1937 2011-04-03  Ivan Maidanski  <ivmai@mail.ru>
1938
1939         * misc.c (GC_stdout, GC_write): Rename GC_stdout to GC_log (Win32
1940         only).
1941         * misc.c (GC_write): Add for MacOS (and OS/2); change WRITE()
1942         accordingly.
1943         * misc.c (GC_write): Reformat code (Unix only).
1944         * misc.c (GC_printf): Check GC_quiet before va_start().
1945
1946 2011-04-03  Ivan Maidanski  <ivmai@mail.ru>
1947
1948         * allchblk.c (GC_freehblk): Use GC_log_printf instead of GC_printf
1949         inside "if (GC_print_stats)" branch.
1950         * alloc.c (GC_collect_or_expand): Ditto.
1951         * dyn_load.c (GC_register_dynamic_libraries): Ditto.
1952         * headers.c (GC_scratch_alloc): Ditto.
1953         * os_dep.c (GC_get_maps, GC_remap, PROTECT,
1954         GC_write_fault_handler, GC_dirty_init, GC_mprotect_thread): Ditto.
1955         * alloc.c (min_bytes_allocd): Use GC_log_printf instead of
1956         GC_printf for DEBUG_THREADS output.
1957         * darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list,
1958         GC_stop_world, GC_thread_resume, GC_start_world): Ditto.
1959         * pthread_start.c (GC_inner_start_routine): Ditto.
1960         * pthread_stop_world.c (GC_suspend_handler, GC_restart_handler,
1961         GC_push_all_stacks, GC_suspend_all, GC_stop_world,
1962         GC_start_world): Ditto.
1963         * pthread_support.c (GC_mark_thread, GC_get_nprocs,
1964         GC_start_rtn_prepare_thread, pthread_create): Ditto.
1965         * alloc.c (GC_adj_bytes_allocd, GC_maybe_gc, GC_stopped_mark,
1966         GC_finish_collection): Reformat code.
1967         * pthread_stop_world.c (GC_print_sig_mask): Ditto.
1968         * pthread_support.c (GC_thr_init): Ditto.
1969         * checksums.c (GC_update_check_page): Use GC_printf() instead of
1970         GC_err_printf() for error printing.
1971         * checksums.c (GC_check_blocks, GC_check_dirty): Use GC_log_printf
1972         instead of GC_printf for logging purposes.
1973         * dyn_load.c (sys_errlist, sys_nerr, errno): Move declaration of
1974         external variable outside from GC_register_dynamic_libraries.
1975         * dyn_load.c (GC_register_dynamic_libraries): Don't use
1976         sys_errlist value if errno equals to sys_nerr.
1977         * dyn_load.c (GC_register_dynamic_libraries): Use GC_log_printf
1978         instead of GC_printf for DL_VERBOSE output.
1979         * dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove,
1980         GC_init_dyld): Use GC_log_printf instead of GC_printf for
1981         DARWIN_DEBUG output.
1982         * os_dep.c (catch_exception_raise): Use GC_log_printf
1983         instead of GC_printf for DEBUG_EXCEPTION_HANDLING output.
1984         * reclaim.c (GC_print_free_list): Move "n" increment out of
1985         GC_printf() call.
1986
1987 2011-04-03  Ivan Maidanski  <ivmai@mail.ru>
1988
1989         * win32_threads.c (DEBUG_CYGWIN_THREADS, DEBUG_WIN32_PTHREADS,
1990         DEBUG_WIN32_THREADS): Remove.
1991         * win32_threads.c (GC_register_my_thread_inner,
1992         GC_win32_start_inner): Use GC_log_printf instead of GC_printf
1993         inside "if (GC_print_stats)" branch.
1994         * win32_threads.c (GC_PTHREAD_PTRVAL): New macro (defined only if
1995         GC_PTHREADS).
1996         * win32_threads.c (GC_delete_gc_thread, NUMERIC_THREAD_ID,
1997         GC_pthread_join, GC_pthread_create): Use GC_PTHREAD_PTRVAL
1998         macro.
1999         * win32_threads.c (GC_push_stack_for, GC_mark_thread,
2000         GC_CreateThread, GC_beginthreadex, GC_pthread_join,
2001         GC_pthread_create, GC_pthread_start_inner, GC_thread_exit_proc,
2002         GC_mark_thread_local_free_lists): Use GC_log_printf instead of
2003         GC_printf for DEBUG_THREADS output.
2004         * win32_threads.c (GC_win32_start_inner, GC_CreateThread,
2005         GC_beginthreadex, GC_pthread_join, GC_pthread_create,
2006         GC_pthread_start_inner, GC_thread_exit_proc): Cast
2007         GetCurrentThreadId result to long; don't cast value of pthread_t
2008         type to int; adjust printf format specifiers.
2009         * doc/README.win32 (DEBUG_WIN32_PTHREADS): Remove obsolete
2010         information.
2011
2012 2011-04-03  Ivan Maidanski  <ivmai@mail.ru>
2013
2014         * tests/test.c (cons, small_cons, gcj_cons, check_ints,
2015         check_uncollectable_ints, print_int_list, check_marks_int_list,
2016         fork_a_thread, finalizer, mktree, chktree, alloc8bytes,
2017         alloc_small, tree_test, typed_test, check_heap_stats, WinMain,
2018         test, main): Remove unnecessary casts of GC_printf calls to void.
2019
2020 2011-04-02  Ivan Maidanski  <ivmai@mail.ru>
2021
2022         * allchblk.c (GC_print_hblkfreelist): Adjust (make uniform across
2023         BDWGC) printed message (adjust letters case, terminating dot and
2024         new line symbols).
2025         * alloc.c (GC_check_fl_marks): Ditto.
2026         * backgraph.c (new_back_edges): Ditto.
2027         * checksums.c (GC_check_dirty): Ditto.
2028         * darwin_stop_world.c (GC_push_all_stacks,
2029         GC_suspend_thread_list): Ditto.
2030         * dbg_mlc.c (GC_print_type, GC_debug_free, GC_debug_realloc,
2031         store_old): Ditto.
2032         * dyn_load.c (GC_register_dynamic_libraries): Ditto.
2033         * mark.c (GC_initiate_gc, GC_mark_some, GC_mark_from, GC_push_all,
2034         GC_push_selected, GC_push_next_marked_dirty): Ditto.
2035         * mark_rts.c (GC_exclude_static_roots_inner): Ditto.
2036         * os_dep.c (GC_remap, GC_default_push_other_roots,
2037         GC_push_thread_structures, GC_dirty_init, GC_read_dirty,
2038         catch_exception_raise_state, catch_exception_raise_state_identity,
2039         GC_mprotect_thread_notify, GC_mprotect_thread,
2040         catch_exception_raise): Ditto.
2041         * pthread_stop_world.c (GC_print_sig_mask, GC_push_all_stacks,
2042         GC_stop_world, GC_stop_init): Ditto.
2043         * pthread_support.c (GC_thr_init, GC_register_my_thread_inner,
2044         GC_start_routine): Ditto.
2045         * win32_threads.c (GC_register_my_thread_inner,
2046         GC_push_all_stacks, GC_win32_start_inner, GC_pthread_join,
2047         GC_pthread_start_inner): Ditto.
2048         * alloc.c (GC_expand_hp_inner): Realign the code.
2049         * mark.c (GC_mark_from, GC_mark_local, GC_do_parallel_mark):
2050         Ditto.
2051         * misc.c (GC_init): Ditto.
2052         * os_dep.c (GC_dirty_init, GC_read_dirty): Ditto.
2053         * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Ditto.
2054         * tests/test.c (run_one_test): Ditto.
2055         * misc.c (GC_err_puts): Document.
2056         * misc.c (GC_err_write): Remove.
2057         * os_dep.c (dump_maps): Ditto.
2058         * include/private/gc_priv.h (GC_err_write): Ditto.
2059         * os_dep.c (GC_print_address_map): Call GC_err_puts() instead of
2060         dump_maps() and GC_err_write().
2061         * os_dep.c (GC_read_dirty): Remove redundant brackets.
2062
2063 2011-04-02  Ivan Maidanski  <ivmai@mail.ru>
2064
2065         * tests/test.c (reverse_test_inner): Test interior pointer
2066         recognition only if ALL_INTERIOR_POINTERS.
2067         * tests/test.c (run_one_test): Replace GC_all_interior_pointers
2068         with GC_get_all_interior_pointers(); simplify the expression.
2069         * tests/test.c (check_heap_stats): Replace GC_bytes_allocd and
2070         GC_bytes_allocd_before_gc with GC_get_total_bytes().
2071         * tests/test.c (main): Replace GC_gc_no with GC_get_gc_no().
2072
2073 2011-03-27  Ivan Maidanski  <ivmai@mail.ru>
2074
2075         * dbg_mlc.c (GC_debug_strdup, GC_debug_free): Output a portability
2076         warning if the argument is NULL and GC is in leaks detection mode.
2077         * dbg_mlc.c (GC_debug_strndup, GC_debug_wcsdup): New public
2078         function definition.
2079         * malloc.c (GC_strndup, GC_wcsdup, strndup): Ditto.
2080         * mallocx.c (GC_posix_memalign): Ditto.
2081         * malloc.c (strdup): Fix string size value; rename "len" to "lb".
2082         * mallocx.c: Include errno.h unless WinCE (otherwise include
2083         windows.h for Win32 error constants).
2084         * win32_threads.c: Define WIN32_LEAN_AND_MEAN and NOSERVICE before
2085         windows.h inclusion.
2086         * misc.c (GC_init): Register at-exit callback if GC_find_leak
2087         (even if GC_FIND_LEAK macro is unset).
2088         * pthread_stop_world.c (NACL_STORE_REGS,
2089         __nacl_suspend_thread_if_needed, GC_nacl_initialize_gc_thread):
2090         Use BCOPY() instead of memcpy().
2091         * pthread_support.c (GC_init_real_syms): Ditto.
2092         * doc/README: Update year in copyright.
2093         * include/gc.h: Ditto.
2094         * doc/README.macros (GC_DEBUG_REPLACEMENT, GC_REQUIRE_WCSDUP):
2095         Document new macro.
2096         * doc/README.macros (REDIRECT_MALLOC): Update documentation.
2097         * include/gc.h (GC_strndup, GC_posix_memalign, GC_debug_strndup):
2098         New API function prototype.
2099         * include/gc.h (GC_MALLOC, GC_REALLOC): Redirect to
2100         GC_debug_malloc/realloc_replacement() if GC_DEBUG_REPLACEMENT.
2101         * include/gc.h (GC_STRDUP): Remove redundant parentheses.
2102         * include/leak_detector.h (realloc, strdup): Ditto.
2103         * include/gc.h (GC_STRNDUP): New API macro.
2104         * include/gc.h (GC_NEW, GC_NEW_ATOMIC, GC_NEW_STUBBORN,
2105         GC_NEW_UNCOLLECTABLE): Add missing parentheses.
2106         * include/gc.h (GC_wcsdup, GC_debug_wcsdup): New API function
2107         prototype (only if GC_REQUIRE_WCSDUP).
2108         * include/gc.h (GC_WCSDUP): New API macro (only if
2109         GC_REQUIRE_WCSDUP).
2110         * include/leak_detector.h: Add copyright header; add usage
2111         comment; include stdlib.h and string.h after gc.h (unless
2112         GC_DONT_INCLUDE_STDLIB).
2113         * include/leak_detector.h (malloc, calloc, free, realloc):
2114         Undefine symbol before its redefinition.
2115         * include/leak_detector.h (strndup, memalign, posix_memalign):
2116         Redefine to the corresponding GC function.
2117         * include/leak_detector.h (wcsdup): Redefine to GC_WCSDUP (only
2118         if GC_REQUIRE_WCSDUP).
2119         * include/leak_detector.h (CHECK_LEAKS): Add comment; don't define
2120         the macro if already defined.
2121
2122 2011-03-22  Ivan Maidanski  <ivmai@mail.ru>
2123
2124         * misc.c (GC_abort): Use _exit() (instead of DebugBreak) on Win32
2125         when doing code static analysis (to inform the tool that the
2126         function is a no-return one).
2127         * os_dep.c (GC_linux_stack_base): Remove a duplicate validation
2128         of the length of "stat" file; use signed int type for "i",
2129         "buf_offset" and "len" local variables (since read() may
2130         return -1).
2131
2132 2011-03-20  Ivan Maidanski  <ivmai@mail.ru>
2133
2134         * blacklst.c (GC_bl_init_no_interiors): New function (the code
2135         moved from GC_bl_init).
2136         * blacklst.c (GC_bl_init): Invoke GC_bl_init_no_interiors unless
2137         GC_all_interior_pointers mode; remove unnecessarily parameter cast
2138         for GC_scratch_alloc call.
2139         * include/private/gc_priv.h (GC_bl_init): Move the function
2140         declaration to misc.c file.
2141         * misc.c (GC_bl_init_no_interiors): Add a prototype.
2142         * misc.c (GC_set_all_interior_pointers): Allow values other than 0
2143         and 1; allow altering GC_set_all_interior_pointers value even
2144         after GC initialization.
2145         * obj_map.c (GC_initialize_offsets): Clear GC_valid_offsets and
2146         GC_modws_valid_offsets if GC_all_interior_pointers is off.
2147         * misc.c (GC_init): Don't call GC_initialize_offsets() unless
2148         GC_all_interior_pointers mode.
2149
2150 2011-03-20  Ivan Maidanski  <ivmai@mail.ru>
2151
2152         * alloc.c (GC_finish_collection): Remove redundant brackets;
2153         adjust code indentation.
2154         * blacklst.c (GC_add_to_black_list_normal): Simplify expression
2155         (to improve code readability).
2156         * blacklst.c (GC_is_black_listed): Join nested "if" (into a single
2157         conditional expression); initialize "nblocks" just before the loop
2158         beginning.
2159         * misc.c (GC_init): Don't compute initial_heap_sz if GC is already
2160         initialized.
2161         * include/private/gc_priv.h (GC_initialize_offsets): Move the
2162         function declaration to misc.c file.
2163         * obj_map.c (GC_initialize_offsets): Remove offsets_initialized
2164         static variable since the function is called only once.
2165         * tests/middle.c: Include "gc.h" instead of <gc.h>; expand all
2166         tabs to spaces; adjust code indentation; replace the K&R-style
2167         function definition with the ANSI C one.
2168         * tests/smash_test.c: Ditto.
2169         * tests/middle.c (main): Use setter for GC_all_interior_pointers;
2170         adjust printf format specifier (and cast the value passed to).
2171
2172 2011-03-15  Ivan Maidanski  <ivmai@mail.ru>
2173
2174         * doc/README.macros (SMALL_CONFIG, LARGE_CONFIG): Refine the
2175         documentation.
2176         * include/private/gc_hdrs.h (LOG_BOTTOM_SZ): Ignore SMALL_CONFIG
2177         if LARGE_CONFIG is defined.
2178         * include/private/gc_priv.h (CPP_LOG_HBLKSIZE): Ditto.
2179
2180 2011-03-15  Ivan Maidanski  <ivmai@mail.ru>
2181
2182         * alloc.c (GC_finish_collection): Replace "#else #ifdef" with
2183         "#elif".
2184         * include/private/gc_priv.h (CPP_LOG_HBLKSIZE, LOG_PHT_ENTRIES,
2185         MAX_ROOT_SETS, MAX_HEAP_SECTS): Ditto.
2186         * alloc.c (GC_expand_hp_inner): Check for GC_collect_at_heapsize
2187         overflow even if not LARGE_CONFIG.
2188         * dbg_mlc.c (GC_check_heap_proc): Check "oh" size even if
2189         SMALL_CONFIG.
2190         * finalize.c (GC_print_finalization_stats): Fix "#endif" comment.
2191         * new_hblk.c (GC_build_fl_clear2, GC_build_fl_clear4, GC_build_fl2,
2192         GC_build_fl4): Reformat the comment; adjust code indentation.
2193         * new_hblk.c (GC_build_fl): Fix indentation.
2194         * include/private/gc_hdrs.h: Ditto.
2195         * doc/README.environment (GC_LOG_FILE, GC_PRINT_VERBOSE_STATS,
2196         GC_FULL_FREQUENCY): Refine the documentation.
2197
2198 2011-03-13  Ivan Maidanski  <ivmai@mail.ru>
2199
2200         * extra/msvc_dbg.c: Test _MSC_VER macro; include "gc.h" (for
2201         GC_word); reformat the code; expand all tabs to spaces.
2202         * extra/msvc_dbg.c (ULONG_PTR): Replace with GC_ULONG_PTR; define
2203         as word.
2204
2205 2011-03-13  Ivan Maidanski  <ivmai@mail.ru>
2206
2207         * dbg_mlc.c (GC_get_back_ptr_info, GC_print_obj,
2208         GC_print_smashed_obj, GC_debug_free_inner): Add a code for a
2209         LINT-like tool to instruct it that the function is invoked only
2210         with valid parameters (otherwise a SEGV is ok); recognize LINT2
2211         new macro.
2212         * misc.c (GC_abort): Instruct a LINT-like tool that the function
2213         never returns in fact.
2214         * os_dep.c (GC_linux_stack_base): Check for read buffer overflow;
2215         close the file immediately after read; use STRTOULL() instead of
2216         decoding the address number manually.
2217         * include/private/gc_priv.h (EXPECT): Don't specify outcome for a
2218         LINT-like tool.
2219         * include/private/gc_priv.h (GC_all_interior_pointers): Instruct a
2220         LINT-like tool that the value is restricted to zero and one only
2221         (required since the variable is global and its value is used as a
2222         part of array index expression is some places).
2223
2224 2011-03-13  Ivan Maidanski  <ivmai@mail.ru>
2225
2226         * dbg_mlc.c (GC_make_closure): Fix SEGV in case GC_malloc returns
2227         NULL.
2228         * dbg_mlc.c (GC_debug_register_finalizer,
2229         GC_debug_register_finalizer_no_order,
2230         GC_debug_register_finalizer_unreachable,
2231         GC_debug_register_finalizer_ignore_self): Handle out of memory
2232         case properly (similar to GC_register_finalizer_inner).
2233         * headers.c (GC_install_header): Handle the case when alloc_hdr()
2234         returns NULL.
2235         * os_dep.c (GC_get_maps_len): Defend against missing "maps" file.
2236         * pthread_support.c (GC_mark_thread): Place a dummy return
2237         statement (which uses "id" argument) before the actual use of "id"
2238         as an array index (to suppress a warning produced by some static
2239         code analysis tools).
2240         * win32_threads.c (GC_mark_thread): Ditto.
2241         * pthread_support.c (GC_thr_init): Abort (with the appropriate
2242         message) if out of memory.
2243
2244 2011-03-13  Ivan Maidanski  <ivmai@mail.ru>
2245
2246         * finalize.c (GC_register_finalizer_inner): Fix a typo in a
2247         comment.
2248         *include/private/gcconfig.h (STACKBOTTOM): Ditto.
2249         * gcj_mlc.c (GC_core_gcj_malloc): Replace 0/1 with TRUE/FALSE in
2250         EXPECT (the 2nd argument).
2251         * malloc.c (GC_core_malloc_atomic, GC_core_malloc, GC_free):
2252         Ditto.
2253         * mark.c (GC_mark_and_push, GC_mark_and_push_stack): Ditto.
2254         * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Ditto.
2255         * include/private/gc_hdrs.h (HC_GET_HDR): Ditto.
2256         * include/private/gc_priv.h (SMALL_OBJ): Ditto.
2257         * include/private/specific.h (getspecific): Ditto.
2258         * pthread_support.c (LOCK_STATS): Add a comment.
2259
2260 2011-03-08  Ivan Maidanski  <ivmai@mail.ru>
2261
2262         * include/gc_pthread_redirects.h (GC_NO_DLOPEN,
2263         GC_NO_PTHREAD_SIGMASK, GC_PTHREAD_CREATE_CONST,
2264         GC_PTHREAD_EXIT_ATTRIBUTE, GC_NO_PTHREAD_CANCEL): Move the
2265         definition to gc_config_macros.
2266
2267 2011-03-08  Ivan Maidanski  <ivmai@mail.ru>
2268
2269         * pthread_support.c (pthread_cancel, GC_pthread_cancel_t,
2270         GC_pthread_cancel): Test GC_NO_PTHREAD_CANCEL (instead of NACL and
2271         GC_PTHREAD_EXIT_ATTRIBUTE).
2272         * include/gc_pthread_redirects.h (GC_pthread_cancel,
2273         pthread_cancel): Ditto.
2274         * pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
2275         GC_pthread_join, GC_pthread_detach, GC_pthread_cancel): Realign
2276         code.
2277         * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE):
2278         Define as empty for NaCl.
2279         * include/gc_pthread_redirects.h (GC_NO_PTHREAD_CANCEL): New macro
2280         defined.
2281
2282 2011-03-07  Ivan Maidanski  <ivmai@mail.ru>
2283
2284         * dyn_load.c (GC_init_dyld): Do not invoke
2285         _dyld_bind_fully_image_containing_address() if GC_no_dls (as it is
2286         not required to register the main data segment in that case).
2287         * include/gc.h (GC_no_dls): Adjust the comment.
2288
2289 2011-03-07  Ivan Maidanski  <ivmai@mail.ru>
2290
2291         * dyn_load.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Test
2292         GC_NO_DLOPEN.
2293         * gc_dlopen.c: Ditto.
2294         * include/gc_pthread_redirects.h (GC_dlopen, dlopen): Ditto.
2295         * gc_dlopen.c: Don't include dlfcn.h (as it is included in
2296         gc_pthread_redirects.h).
2297         * pthread_support.c (pthread_sigmask, GC_pthread_sigmask_t,
2298         GC_pthread_sigmask): Test GC_NO_PTHREAD_SIGMASK (instead of
2299         GC_DARWIN_THREADS, GC_OPENBSD_THREADS and NACL).
2300         * include/gc_pthread_redirects.h (GC_pthread_sigmask,
2301         pthread_sigmask): Ditto.
2302         * win32_threads.c (pthread_sigmask, GC_pthread_sigmask): Test
2303         GC_NO_PTHREAD_SIGMASK (instead of GC_WIN32_PTHREADS); reformat the
2304         comment.
2305         * pthread_support.c (pthread_create, GC_pthread_create_t,
2306         GC_pthread_create): Rename GC_PTHREAD_CONST to
2307         GC_PTHREAD_CREATE_CONST.
2308         * win32_threads.c (GC_pthread_create): Ditto.
2309         * include/gc_pthread_redirects.h: Ditto.
2310         * include/gc_pthread_redirects.h (GC_NO_DLOPEN,
2311         GC_NO_PTHREAD_SIGMASK): New macro defined.
2312         * include/gc_pthread_redirects.h (GC_PTHREAD_CREATE_CONST): Set to
2313         empty for NaCl.
2314         * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): Do
2315         not define for Android (as CANCEL_SAFE is not defined).
2316
2317 2011-03-07  Ivan Maidanski  <ivmai@mail.ru>
2318
2319         * include/gc.h (GC_ADD_CALLER, GC_RETURN_ADDR,
2320         GC_HAVE_BUILTIN_BACKTRACE, GC_CAN_SAVE_CALL_STACKS): Move
2321         definition to gc_config_macros.h file.
2322         * include/gc_config_macros.h: Check the file is included from gc.h
2323         file.
2324         * include/gc_version.h: Ditto.
2325         * include/gc_config_macros.h: Reformat comments.
2326         * include/gc_version.h: Reformat code.
2327
2328 2011-02-20  Ivan Maidanski  <ivmai@mail.ru> (mostly really Elijah Taylor)
2329
2330         * gc_dlopen.c: Empty unit for NaCl.
2331         * os_dep.c: Include fcntl.h for NaCl.
2332         * os_dep.c (GC_get_main_stack_base): Ignore
2333         USE_GET_STACKBASE_FOR_MAIN macro for NaCl.
2334         * os_dep.c (GC_get_stack_base): Return GC_UNIMPLEMENTED for NaCl.
2335         * os_dep.c (GC_remap): Use mmap (instead of mprotect) for NaCl.
2336         * pthread_start.c (GC_inner_start_routine): Don't invoke
2337         pthread_cleanup_push/pop for NaCl.
2338         * pthread_stop_world.c (GC_nacl_num_gc_threads,
2339         GC_nacl_thread_idx, GC_nacl_park_threads_now,
2340         GC_nacl_thread_parker, GC_nacl_gc_thread_self,
2341         GC_nacl_thread_parked, GC_nacl_thread_used,
2342         GC_nacl_thread_parking_inited, GC_nacl_thread_alloc_lock): New
2343         variable (fo NaCl only).
2344         * pthread_stop_world.c (GC_suspend_handler): Reformat the code.
2345         * pthread_stop_world.c (GC_remove_allowed_signals,
2346         suspend_handler_mask, GC_stop_count, GC_world_is_stopped,
2347         GC_retry_signals, SIG_THR_RESTART, GC_suspend_ack_sem,
2348         GC_restart_ack_sem, GC_suspend_handler_inner, GC_suspend_handler,
2349         GC_restart_handler): Don't define for NaCl.
2350         * pthread_support.c (GC_get_nprocs): Ditto.
2351         * include/private/gc_priv.h (SIG_SUSPEND): Ditto.
2352         * include/private/gcconfig.h (LINUX): Ditto.
2353         * pthread_stop_world.c (GC_push_all_stacks): Push register storage
2354         for NaCl.
2355         * pthread_stop_world.c (GC_suspend_all, GC_stop_world,
2356         GC_start_world): Implement for NaCl.
2357         * pthread_stop_world.c (GC_stop_world): Don't define unused "i"
2358         local variable for OpenBSD (and NaCl).
2359         * pthread_stop_world.c (NACL_STORE_REGS): New macro definition for
2360         NaCl.
2361         * pthread_stop_world.c (nacl_pre_syscall_hook,
2362         __nacl_suspend_thread_if_needed, nacl_post_syscall_hook,
2363         GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread): New
2364         function (for NaCl only).
2365         * pthread_stop_world.c (GC_stop_init): Empty for NaCl.
2366         * pthread_support.c (pthread_cancel, pthread_sigmask): Don't
2367         redirect for NaCl.
2368         * include/gc_pthread_redirects.h (pthread_cancel,
2369         pthread_sigmask): Ditto.
2370         * pthread_support.c (GC_nacl_initialize_gc_thread,
2371         GC_nacl_shutdown_gc_thread): New internal prototype (NaCl only).
2372         * pthread_support.c (GC_new_thread, GC_delete_thread): Initialize
2373         and shutdown thread for NaCl.
2374         * pthread_support.c (GC_thr_init): Call sysconf for NaCl.
2375         * pthread_support.c (GC_pthread_exit): Call GC_thread_exit_proc
2376         for NaCl.
2377         * include/gc.h: Don't include features.h for NaCl.
2378         * include/gc_pthread_redirects.h (GC_PTHREAD_CONST): New macro.
2379         * include/gc_pthread_redirects.h (GC_pthread_create): Use
2380         GC_PTHREAD_CONST instead of const.
2381         * win32_threads.c (GC_pthread_create): Ditto.
2382         * pthread_support.c (GC_pthread_create_t, GC_pthread_create,
2383         pthread_create): Ditto.
2384         * include/private/gcconfig.h (NACL): Recognize NaCl.
2385         * include/private/gcconfig.h (GC_LINUX_THREADS): Valid for NaCl.
2386         * include/private/pthread_stop_world.h (thread_stop_info): Add
2387         reg_storage member; define NACL_GC_REG_STORAGE_SIZE macro (for
2388         NaCl only).
2389         * include/private/pthread_support.h (GC_nacl_gc_thread_self):
2390         Declare internal variable (for NaCl only).
2391
2392 2011-02-19  Ivan Maidanski  <ivmai@mail.ru>
2393
2394         * aclocal.m4: Regenerate (by autoreconf -vif using autoconf-2.68,
2395         automake-1.11.1 and libtool-2.4).
2396         * configure: Ditto.
2397         * ltmain.sh: Ditto.
2398         * makefile.in: Ditto.
2399         * m4/libtool.m4: Ditto.
2400         * m4/ltversion.m4: Ditto.
2401         * mach_dep.c (GC_with_callee_saves_pushed): Fix FE_ALL_EXCEPT
2402         macro.
2403
2404 2011-02-13  Ivan Maidanski  <ivmai@mail.ru>
2405
2406         * mark.c (GC_mark_some): Prefix and suffix "asm" and "volatile"
2407         keywords with double underscore.
2408         * os_dep.c (GC_unix_get_mem): Reformat the code.
2409         * os_dep.c (catch_exception_raise, catch_exception_raise_state,
2410         catch_exception_raise_state_identity): Add GC_API_OSCALL to
2411         function definition.
2412         * os_dep.c (catch_exception_raise_state,
2413         catch_exception_raise_state_identity): Move definition to be
2414         before GC_ports.
2415         * os_dep.c (catch_exception_raise): Declare to have the symbol
2416         defined before GC_ports.
2417         * os_dep.c (GC_ports): Store references to catch_exception_raise,
2418         catch_exception_raise_state, catch_exception_raise_state_identity
2419         (to prevent stripping these symbols as dead).
2420         * os_dep.c (catch_exception_raise, catch_exception_raise_state,
2421         catch_exception_raise_state_identity): Mark these symbols as
2422         "referenced dynamically" via an assembler directive (unless
2423         NO_DESC_CATCH_EXCEPTION_RAISE).
2424         * include/private/gc_priv.h (GC_API_OSCALL): New macro (defined
2425         similar to GC_API but as if GC_DLL is always defined).
2426
2427 2011-02-10  Ivan Maidanski  <ivmai@mail.ru> (with input from Dimitry Andric)
2428
2429         * os_dep.c: Don't include signal.h for GC_write_fault_handler on
2430         Win32.
2431         * os_dep.c (SIG_OK): Don't return true unless SIGSEGV or SIGBUS on
2432         FreeBSD.
2433         * os_dep.c (CODE_OK): Use SEGV_ACCERR on FreeBSD (define
2434         SEGV_ACCERR for older FreeBSD releases).
2435         * os_dep.c (SIG_OK, CODE_OK, GC_write_fault_handler): Reformat the
2436         code.
2437
2438 2011-02-10  Ivan Maidanski  <ivmai@mail.ru>
2439
2440         * dyn_load.c (GC_register_map_entries,
2441         GC_register_dynamic_libraries_dl_iterate_phdr): Calculate
2442         DATASTART only once if DATASTART_IS_FUNC.
2443         * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr):
2444         Calculate DATAEND only once if DATAEND_IS_FUNC.
2445         * dyn_load.c: Add comment to some endif; realign some code.
2446         * dyn_load.c (GC_init_dyld): Don't use
2447         _dyld_bind_fully_image_containing_address if
2448         NO_DYLD_BIND_FULLY_IMAGE defined; add FIXME.
2449         * include/private/gcconfig.h (GC_data_start, GC_find_limit):
2450         Declare if used by DATASTART/DATAEND, respectively.
2451         * include/private/gcconfig.h (DATASTART_IS_FUNC, DATAEND_IS_FUNC):
2452         Define if DATASTART/DATAEND is a function, respectively.
2453         * include/private/gcconfig.h (GETPAGESIZE, NO_PTHREAD_TRYLOCK,
2454         NO_DYLD_BIND_FULLY_IMAGE): Define for Darwin/arm as well; include
2455         unistd.h.
2456
2457 2011-02-10  Ivan Maidanski  <ivmai@mail.ru>
2458
2459         * os_dep.c (GC_setpagesize, GC_task_self, PROTECT, UNPROTECT):
2460         Reorder to remove redundant ifdef for Win32.
2461         * os_dep.c: Add comment to some endif.
2462         * os_dep.c: Include pthread.h (for Linux even if single-threaded)
2463         if USE_GET_STACKBASE_FOR_MAIN; also include it for Darwin.
2464         * os_dep.c (STACKBOTTOM): Redefine for Darwin (unless prohibited
2465         for some reason).
2466         * os_dep.c (GC_get_main_stack_base): Allow
2467         USE_GET_STACKBASE_FOR_MAIN for Linux even if single-threaded; add
2468         assertion for the returned result.
2469         * os_dep.c (GC_get_stack_base): Define for Darwin if
2470         multi-threaded.
2471         * os_dep.c (GC_page_was_dirty): Reformat the code.
2472         * os_dep.c: Reformat some comments.
2473         * os_dep.c (SIG_OK, CODE_OK): Add comment (for FreeBSD).
2474         * os_dep.c (ID_STOP, ID_RESUME): Define only if threads.
2475         * os_dep.c (catch_exception_raise): Remove redundant parentheses;
2476         refine the documentation.
2477
2478 2011-02-10  Ivan Maidanski  <ivmai@mail.ru>
2479
2480         * NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE for C++ files as
2481         well.
2482         * NT_STATIC_THREADS_MAKEFILE: Ditto.
2483         * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Refine.
2484         * include/gc.h (GC_INIT): Document.
2485         * include/private/gc_priv.h (GC_MACH_HEADER, GC_MACH_SECTION,
2486         GC_GETSECTBYNAME): Define depending only on the word size (i.e.,
2487         define these macros also for ARM).
2488         * tests/test.c (check_heap_stats): Print main thread stack bottom
2489         as well (only if verbose mode is on).
2490
2491 2011-02-09  Ivan Maidanski  <ivmai@mail.ru> (mostly Jean-Claude Beaudoin)
2492
2493         * mach_dep.c (GC_with_callee_saves_pushed): Fix and improve code
2494         introduced by the previous patch (if GETCONTEXT_FPU_EXCMASK_BUG
2495         and X86_64).
2496
2497 2011-01-22  Ivan Maidanski  <ivmai@mail.ru> (mostly Jean-Claude Beaudoin)
2498
2499         * darwin_stop_world.c (GC_FindTopOfStack): Prefix and suffix
2500         "volatile" keyword with double underscore.
2501         * mach_dep.c (GETCONTEXT_FPU_EXCMASK_BUG): Recognize new macro and
2502         include fenv.h if defined (unless NO_GETCONTEXT or HAVE_PUSH_REGS).
2503         * mach_dep.c (GC_with_callee_saves_pushed): Restore FPU exception
2504         mask corrupted by getcontext if GETCONTEXT_FPU_EXCMASK_BUG.
2505         * include/private/gcconfig.h (GETCONTEXT_FPU_EXCMASK_BUG): Define
2506         for Linux/amd64 (since its GLibc getcontext currently has the bug).
2507
2508 2011-01-17  Ivan Maidanski  <ivmai@mail.ru>
2509
2510         * allchblk.c (GC_use_entire_heap): Change type to int (as declared
2511         in gc.h); set the default value depending on new GC_USE_ENTIRE_HEAP
2512         macro.
2513         * misc.c (GC_init): Test GC_USE_ENTIRE_HEAP environment variable to
2514         alter the default value of GC_use_entire_heap.
2515         * doc/README.environment (GC_USE_ENTIRE_HEAP): Document.
2516         * doc/README.macros (GC_USE_ENTIRE_HEAP): Ditto.
2517
2518 2011-01-12  Ivan Maidanski  <ivmai@mail.ru>
2519
2520         * include/private/gcconfig.h (PARALLEL_MARK): Do not make it cause
2521         MPROTECT_VDB undefining.
2522
2523 2011-01-07  Ivan Maidanski  <ivmai@mail.ru>
2524
2525         * gc_dlopen.c: Reformat the comments and adjust code indentation.
2526         * include/private/gcconfig.h (DYNAMIC_LOADING): Fix filename in
2527         the comment.
2528
2529 2011-01-07  Ivan Maidanski  <ivmai@mail.ru>
2530
2531         * include/private/gc_priv.h (THREAD_FLD, MAX_HEAP_SECTS,
2532         _GC_arrays, GC_push_all_stack_sections, PRINT_BLACK_LIST,
2533         GC_add_to_black_list_stack, GC_ASSERT, SIG_SUSPEND,
2534         NEED_FIND_LIMIT): Reformat the code and comments for.
2535         * include/private/gc_priv.h (_GC_arrays): Move the conditional
2536         macro definitions (shortcuts for GC_arrays members) into the
2537         structure body.
2538
2539 2011-01-07  Ivan Maidanski  <ivmai@mail.ru>
2540
2541         * .cvsignore: Add more auto-generated files.
2542         * include/private/.cvsignore: Ditto.
2543         * darwin_stop_world.c (GC_mach_handler_thread,
2544         GC_use_mach_handler_thread,
2545         GC_darwin_register_mach_handler_thread): Define only if
2546         MPROTECT_VDB.
2547         * darwin_stop_world.c (GC_suspend_thread_list): Use
2548         GC_mach_handler_thread and GC_use_mach_handler_thread only if
2549         MPROTECT_VDB.
2550         * darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count
2551         only if defined (i.e. unless GC_NO_THREADS_DISCOVERY).
2552         * misc.c (GC_init): Fix comment for GWW_VDB.
2553         * os_dep.c (GC_mprotect_state_t): Reformat the code.
2554         * os_dep.c (DARWIN_EXC_STATE, DARWIN_EXC_STATE_COUNT,
2555         DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR): New macros.
2556         * os_dep.c (catch_exception_raise): Use DARWIN_EXC_STATE,
2557         DARWIN_EXC_STATE_COUNT, DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR;
2558         reformat the comment.
2559         * pthread_support.c (GC_thr_init): Define "dummy" local variable
2560         only unless GC_DARWIN_THREADS; reformat the code.
2561         * include/private/gcconfig.h (MPROTECT_VDB): Define for Darwin
2562         even in the single-threaded mode; define for iPhone/iPad.
2563         * include/private/gcconfig.h (IA64): Remove unnecessary "ifdef"
2564         around "undef".
2565         * include/private/gcconfig.h (HEURISTIC1): Remove unused for
2566         Cygwin.
2567         * include/private/gcconfig.h (STACKBOTTOM): Use fixed address for
2568         Darwin/arm (instead of HEURISTIC1).
2569         * include/private/gcconfig.h (GET_MEM): Reformat the code.
2570
2571 2011-01-05  Ivan Maidanski  <ivmai@mail.ru>
2572
2573         * misc.c (GC_write): Replace multiple "ifdef/endif" with "elif"
2574         (for ECOS and NOSYS).
2575         * os_dep.c (GC_get_main_stack_base): Ditto.
2576         * os_dep.c (GC_get_main_stack_base): Check
2577         USE_GET_STACKBASE_FOR_MAIN macro before checking STACKBOTTOM one;
2578         remove "dummy" variable (use result one instead); reformat the
2579         code.
2580         * doc/README.macros (SN_TARGET_PS3): Document.
2581         * extra/threadlibs.c (main): Don't output "-lpthread" (and "-ldl")
2582         for Android.
2583         * include/private/pthread_support.h: Fix comment for "endif".
2584
2585 2010-12-26  Ivan Maidanski  <ivmai@mail.ru> (mostly really Miguel de Icaza)
2586
2587         * misc.c (GC_allocate_ml): Define global variable if SN_TARGET_PS3.
2588         * misc.c (GC_init): Initialize GC_allocate_ml if SN_TARGET_PS3.
2589         * os_dep.c (SIGSEGV): Define to dummy zero if SN_TARGET_PS3.
2590         * os_dep.c (GC_unix_mmap_get_mem): Don't define if SN_TARGET_PS3.
2591         * os_dep.c (GC_default_push_other_roots,
2592         GC_push_thread_structures): Define for SN_TARGET_PS3.
2593         * include/private/gc_locks.h (GC_allocate_ml, LOCK, UNLOCK): Define
2594         for SN_TARGET_PS3.
2595         * include/private/gcconfig.h (SN_TARGET_PS3): Recognize new macro
2596         (Sony PS/3 target).
2597         * include/private/gcconfig.h (THREADS): Define unconditionally if
2598         SN_TARGET_PS3.
2599         * include/private/gcconfig.h (GET_MEM): Define for SN_TARGET_PS3.
2600
2601 2010-12-26  Ivan Maidanski  <ivmai@mail.ru>
2602
2603         * alloc.c (GC_collect_or_expand): Replace NIL with NULL in message.
2604         * dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
2605         GC_debug_malloc_atomic_ignore_off_page,
2606         GC_debug_generic_malloc_inner,
2607         GC_generic_malloc_inner_ignore_off_page, GC_debug_malloc_stubborn,
2608         GC_debug_malloc_atomic, GC_debug_malloc_uncollectable,
2609         GC_debug_malloc_atomic_uncollectable): Ditto.
2610         * gcj_mlc.c (GC_debug_gcj_malloc): Ditto.
2611         * dbg_mlc.c (GC_check_annotated_obj): Replace NIL with NULL in a
2612         comment.
2613         * dyn_load.c (GC_FirstDLOpenedLinkMap): Ditto.
2614         * mark_rts.c (GC_roots_present): Ditto.
2615         * doc/README: Ditto.
2616         * include/private/gc_hdrs.h (IS_FORWARDING_ADDR_OR_NIL): Ditto.
2617         * include/private/gc_priv.h (_GC_arrays): Ditto.
2618
2619 2010-12-26  Ivan Maidanski  <ivmai@mail.ru> (mostly really Geoff Norton
2620                                              and Jonathan Pryor)
2621
2622         * configure.ac: Use AC_CHECK_LIB() to check for pthread instead of
2623         just blindly linking to -lpthread, as Android includes pthread
2624         support within libc and does not provide a separate libpthread.
2625         * dyn_load.c (GC_register_dynamic_libraries): Skip current link map
2626         entry if l_addr is NULL (Android/bionic only).
2627         * pthread_stop_world.c (android_thread_kill): New internal function
2628         (Android only).
2629         * pthread_stop_world.c (GC_suspend_all, GC_start_world): Call
2630         android_thread_kill (based on tkill) instead of pthread_kill on
2631         Android (since pthread_kill cannot be used safely on the platform).
2632         * pthread_support.c (GC_new_thread): Store thread Id (obtained from
2633         gettid) for use by android_thread_kill (Android only).
2634         * include/private/pthread_support.h (GC_Thread_Rep): Add kernel_id
2635         structure member (Android only).
2636         * include/private/gcconfig.h: Recognize __x86_64 macro as a synonym
2637         of __x86_64__ (Darwin); define __environ macro (Android on M68K).
2638         * configure: Regenerate.
2639
2640 2010-12-02  Ivan Maidanski  <ivmai@mail.ru>
2641
2642         * allchblk.c (GC_freehblk): Print extended error message (done via
2643         GC_printf() before aborting with a short message) only if
2644         GC_print_stats.
2645         * dyn_load.c (GC_register_dynamic_libraries): Ditto.
2646         * os_dep.c (GC_get_maps, GC_register_data_segments, GC_remap,
2647         PROTECT, GC_write_fault_handler, GC_mprotect_thread): Ditto.
2648         * pthread_stop_world.c (GC_start_world): Ditto.
2649         * win32_threads.c (GC_register_my_thread_inner): Ditto.
2650         * os_dep.c (GC_get_main_stack_base, GC_register_data_segments,
2651         GC_dirty_init): Remove redundant print of an error message before
2652         aborting with the same message.
2653         * os_dep.c (GC_register_data_segments): Remove format specifier
2654         from the string passed to GC_err_puts(); use ABORT instead of EXIT
2655         (if invalid executable type).
2656         * os_dep.c (GC_remap): Adjust printf format specifier (for long
2657         type).
2658         * os_dep.c (GC_dirty_init): Print a message about SIG_IGN detected
2659         (for SIGSEGV/BUS) only if GC_print_stats.
2660         * os_dep.c (catch_exception_raise): Join 2 adjacent GC_err_printf
2661         calls.
2662
2663 2010-11-25  Ivan Maidanski  <ivmai@mail.ru>
2664
2665         * tests/test.c (main): Print the relevant message if GWW_VDB.
2666         * include/private/gcconfig.h: Don't define MPROTECT_VDB for Win32
2667         on x64 if compiled by GCC.
2668
2669 2010-11-04  Ivan Maidanski  <ivmai@mail.ru>
2670
2671         * tests/staticrootstest.c: Include string.h for memset() prototype.
2672         * tests/thread_leak_test.c (main): Fix printf() format specifiers.
2673
2674 2010-10-22  Ivan Maidanski <ivmai@mail.ru>
2675
2676         * CMakeLists.txt: Check enable_parallel_mark on Darwin.
2677         * configure.ac: Ditto.
2678         * darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS,
2679         DARWIN_QUERY_TASK_THREADS): Rename to GC_NO_THREADS_DISCOVERY and
2680         GC_DISCOVER_TASK_THREADS, respectively.
2681         * os_dep.c (DARWIN_SUSPEND_GC_THREADS): Ditto.
2682         * pthread_support.c (DARWIN_SUSPEND_GC_THREADS): Ditto.
2683         * darwin_stop_world.c (DARWIN_QUERY_TASK_THREADS): Don't define
2684         (and remove FIXME).
2685         * darwin_stop_world.c (GC_use_threads_discovery): Add GC_API;
2686         comment; remove FIXME.
2687         * win32_threads.c (GC_NO_DLLMAIN): Rename to
2688         GC_NO_THREADS_DISCOVERY.
2689         * tests/test.c (GC_NO_DLLMAIN): Ditto.
2690         * doc/README.macros (GC_NO_DLLMAIN): Ditto.
2691         * doc/README.win32 (GC_NO_DLLMAIN): Ditto.
2692         * doc/README.macros (GC_NO_THREADS_DISCOVERY): Update the comment.
2693         * win32_threads.c (GC_win32_dll_threads): Define as macro to true
2694         if GC_DISCOVER_TASK_THREADS (and not GC_NO_THREADS_DISCOVERY);
2695         update the comment.
2696         * win32_threads.c (GC_use_DllMain): Rename to
2697         GC_use_threads_discovery; do not set GC_win32_dll_threads if
2698         GC_DISCOVER_TASK_THREADS.
2699         * win32_threads.c (GC_started_thread_while_stopped,
2700         GC_lookup_thread_inner, UNPROTECT_THREAD, GC_lookup_pthread,
2701         GC_thr_init, GC_pthread_create, DllMain): Rewrite some expressions
2702         which use GC_win32_dll_threads to minimize the possibility of
2703         an "unreachable code" compiler warning when GC_win32_dll_threads
2704         is defined as a macro.
2705         * win32_threads.c (GC_unregister_my_thread): Don't call
2706         GC_delete_thread() if GC_win32_dll_threads and THREAD_LOCAL_ALLOC
2707         (since can't happen); use "t" local variable only if not
2708         GC_win32_dll_threads.
2709         * win32_threads.c (GC_register_my_thread_inner): Reformat the
2710         comment.
2711         * doc/README.macros (GC_DISCOVER_TASK_THREADS): Document.
2712         * include/gc.h (GC_use_DllMain): Rename to
2713         GC_use_threads_discovery but keep old name as a macro definition.
2714         * include/gc.h (GC_use_threads_discovery): Declare also for
2715         Darwin; update the comment.
2716         * tests/test.c (main): Call GC_use_threads_discovery for Darwin
2717         (to test the mode if possible).
2718         * configure: Regenerate.
2719
2720 2010-10-16  Ivan Maidanski <ivmai@mail.ru>
2721
2722         * darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS,
2723         DARWIN_QUERY_TASK_THREADS): New macro recognized.
2724         * darwin_stop_world.c (GC_query_task_threads): add STATIC;
2725         initialize to false; define as macro if DARWIN_SUSPEND_GC_THREADS
2726         or DARWIN_QUERY_TASK_THREADS; remove FIXME.
2727         * darwin_stop_world.c (GC_use_threads_discovery): New function
2728         (for setting GC_query_task_threads value).
2729         * darwin_stop_world.c (GC_mach_handler_thread,
2730         GC_use_mach_handler_thread, GC_mach_thread, GC_MAX_MACH_THREADS,
2731         GC_mach_threads, GC_mach_threads_count, GC_suspend_thread_list,
2732         GC_darwin_register_mach_handler_thread): Define only if not
2733         DARWIN_SUSPEND_GC_THREADS.
2734         * darwin_stop_world.c (GC_stop_world, GC_start_world): Exclude
2735         the code for GC_query_task_threads case from compilation unless
2736         DARWIN_SUSPEND_GC_THREADS.
2737         * os_dep.c (GC_darwin_register_mach_handler_thread): Declared only
2738         if Darwin threads and not DARWIN_SUSPEND_GC_THREADS.
2739         * os_dep.c (GC_mprotect_thread): Call
2740         GC_darwin_register_mach_handler_thread only if THREADS and not
2741         DARWIN_SUSPEND_GC_THREADS.
2742         * pthread_support.c (marker_mach_threads): Don't define if
2743         DARWIN_SUSPEND_GC_THREADS.
2744         * pthread_support.c (GC_mark_thread): Don't fill in
2745         marker_mach_threads if DARWIN_SUSPEND_GC_THREADS.
2746         * include/private/gc_locks.h (GC_need_to_lock): Always declare for
2747         THREADS case.
2748
2749 2010-10-15  Ivan Maidanski <ivmai@mail.ru>
2750
2751         * darwin_stop_world.c (GC_query_task_threads): Don't define to
2752         false for DARWIN_DONT_PARSE_STACK case; unconditionally initialize
2753         the variable to false (for now).
2754         * darwin_stop_world.c (GC_push_all_stacks): Call task_threads()
2755         only if not DARWIN_DONT_PARSE_STACK.
2756         * darwin_stop_world.c (GC_stop_world, GC_start_world): Use the
2757         approach based on task_threads() only if GC_query_task_threads
2758         else use GC_threads table.
2759
2760 2010-10-15  Ivan Maidanski <ivmai@mail.ru>
2761
2762         * darwin_stop_world.c (GC_mach_threads): Remove static qualifier.
2763         * darwin_stop_world.c (GC_stop_init): Remove (as we do not need to
2764         really clear GC_mach_threads[]).
2765         * darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count
2766         (instead of calling GC_stop_init).
2767         * include/private/pthread_support.h (GC_stop_init): Remove proto.
2768         * pthread_support.c (GC_stop_init): Add proto (unless Darwin).
2769         * pthread_support.c (GC_thr_init): Don't call GC_stop_init() if
2770         GC_DARWIN_THREADS.
2771
2772 2010-10-14  Ivan Maidanski <ivmai@mail.ru>
2773
2774         * darwin_stop_world.c (GC_stack_range_for): New static function
2775         (move the code from GC_push_all_stacks).
2776         * darwin_stop_world.c (GC_push_all_stacks): Call
2777         GC_stack_range_for(); rename kern_return local variable to
2778         kern_result.
2779         * darwin_stop_world.c (GC_is_mach_marker): Change argument type
2780         from mach_port_t to thread_act_t.
2781         * pthread_support.c (GC_is_mach_marker): Ditto.
2782
2783 2010-10-12  Ivan Maidanski <ivmai@mail.ru>
2784
2785         * darwin_stop_world.c (GC_push_all_stacks): Fix "my_task" local
2786         variable initialization (always call current_task()).
2787         * pthread_support.c (GC_thr_init, GC_register_my_thread_inner):
2788         Don't set thread's stop_info.stack_ptr value for Darwin.
2789         * include/private/darwin_stop_world.h (thread_stop_info): Update
2790         the comment for stack_ptr.
2791
2792 2010-10-10  Ivan Maidanski <ivmai@mail.ru>
2793
2794         * darwin_stop_world.c (GC_push_all_stacks): Rename "r", "me" local
2795         variables to "kern_return" and "my_thread" ones, respectively;
2796         call mach_port_deallocate() unconditionally.
2797         * darwin_stop_world.c (GC_stop_world): Don't call mach_thread_self
2798         if DEBUG_THREADS.
2799
2800 2010-10-09  Ivan Maidanski <ivmai@mail.ru>
2801
2802         * darwin_stop_world.c (GC_mach_thread): Move from
2803         darwin_stop_world.h.
2804         * include/private/darwin_stop_world.h (GC_mach_thread): Remove.
2805         * win32_threads.c (GC_start_world): Define "thread_id" local
2806         variable only if GC_ASSERTIONS; decide whether to resume a thread
2807         based on its "suspended" field value; assert that suspended thread
2808         stack_base is non-zero and the thread is not our one.
2809
2810 2010-10-08  Ivan Maidanski <ivmai@mail.ru>
2811
2812         * darwin_stop_world.c (GC_thread_resume): New inline function
2813         (move code from GC_thread_resume).
2814         * darwin_stop_world.c (GC_start_world): Check result of
2815         task_threads(); call GC_thread_resume().
2816         * os_dep.c (GC_malloc_heap_l, GC_is_malloc_heap_base): Define
2817         only if not CYGWIN32.
2818         * os_dep.c (GC_is_heap_base): Call GC_is_malloc_heap_base() only
2819         if not CYGWIN32.
2820
2821 2010-10-06  Ivan Maidanski <ivmai@mail.ru>
2822
2823         * darwin_stop_world.c (FindTopOfStack): Change return type to
2824         ptr_t (from long); make GC_INNER; add GC_ prefix.
2825         * darwin_stop_world.c (GC_push_all_stacks): Add thread_blocked
2826         local variable (initialized from the corresponding GC_thread
2827         field unless GC_query_task_threads); add assertion that our
2828         thread is not blocked; prefix FindTopOfStack with GC_ and remove
2829         no longer needed cast to ptr_t of the result; handle thread
2830         blocked case (and remove FIXME); use GC_push_all_stack_sections
2831         unless GC_query_task_threads (and remove FIXME).
2832         * pthread_support.c (GC_FindTopOfStack): Declare (if needed).
2833         * pthread_support.c (GC_do_blocking_inner): Call
2834         GC_save_regs_in_stack (if needed) before acquiring the lock.
2835         * win32_threads.c (GC_do_blocking_inner): Ditto.
2836         * pthread_support.c (GC_do_blocking_inner): Set/clear topOfStack
2837         field of GC_thread (Darwin only).
2838         * include/private/pthread_support.h (GC_thread): Add topOfStack
2839         field for Darwin (unless DARWIN_DONT_PARSE_STACK).
2840
2841 2010-10-05  Ivan Maidanski <ivmai@mail.ru>
2842
2843         * finalize.c (GC_check_finalizer_nested): Change return type to
2844         char pointer (instead of int pointer); use explicit cast for
2845         GC_finalizer_nested assignment.
2846         * pthread_support.c (GC_check_finalizer_nested): Ditto.
2847         * win32_threads.c (GC_check_finalizer_nested): Ditto.
2848         * finalize.c (GC_finalizer_nested): Change type to unsigned char.
2849         * finalize.c (GC_notify_or_invoke_finalizers): Change type of
2850         "pnested" local variable to char pointer.
2851         * pthread_support.c (GC_do_blocking_inner,
2852         GC_call_with_gc_active): Use explicit cast for "thread_blocked"
2853         field assignment.
2854         * win32_threads.c (GC_lookup_pthread): Use explicit cast for
2855         "suspended" field assignment.
2856         * win32_threads.c (GC_Thread_Rep): Use short type for
2857         finalizer_skipped; use char type for finalizer_nested and flags
2858         fields and reorder some fields (to minimize GC_Thread_Rep
2859         structure size).
2860         * include/private/pthread_support.h (GC_Thread_Rep): Ditto.
2861         * win32_threads.c (GC_Thread_Rep): Use char type for suspended
2862         field (instead of GC_bool).
2863         * include/private/pthread_support.h (GC_Thread_Rep): Use char type
2864         for thread_blocked field (instead of short).
2865
2866 2010-09-30  Ivan Maidanski <ivmai@mail.ru>
2867
2868         * darwin_stop_world.c (GC_query_task_threads): New variable (or
2869         macro).
2870         * darwin_stop_world.c (GC_push_all_stacks): Use
2871         GC_query_task_threads (to choose between algorithms based on
2872         kernel task_threads and based on GC_threads table); update FIXME;
2873         remove commented out GC_push_one statements.
2874         * pthread_support.c (GC_thr_init, GC_do_blocking_inner,
2875         GC_call_with_gc_active, GC_register_my_thread_inner): Initialize
2876         stack_ptr field for all platforms.
2877         * pthread_support.c (GC_call_with_gc_active): Initialize
2878         saved_stack_ptr field for all platforms.
2879         * include/private/darwin_stop_world.h (thread_stop_info): Add
2880         stack_ptr field; change type of already_suspended from int to
2881         GC_bool.
2882
2883 2010-09-29  Ivan Maidanski <ivmai@mail.ru>
2884
2885         * darwin_stop_world.c (GC_MAX_MACH_THREADS): New macro.
2886         * darwin_stop_world.c (GC_mach_threads, GC_stop_init): Use
2887         GC_MAX_MACH_THREADS instead of THREAD_TABLE_SZ.
2888         * darwin_stop_world.c (GC_mach_threads): Add FIXME.
2889         * darwin_stop_world.c (GC_stop_init, GC_suspend_thread_list,
2890         GC_stop_world): Use FALSE and TRUE for already_suspended field and
2891         "changed", "found" variables.
2892         * darwin_stop_world.c (GC_is_mach_marker): New prototype (only if
2893         PARALLEL_MARK).
2894         * darwin_stop_world.c (GC_suspend_thread_list): Change return type
2895         to GC_bool; change type of "changed", "found" to GC_bool; make
2896         "my_thread" as an argument (instead of acquiring/deallocating it
2897         locally); do not add my_thread, GC_mach_handler_thread and marker
2898         threads to GC_mach_threads table; check for overflow of
2899         GC_mach_threads table; increase GC_mach_threads_count if "found"
2900         is true and info.suspend_count is non-zero.
2901         * darwin_stop_world.c (GC_suspend_thread_list, GC_start_world):
2902         Adjust "thread" format specifiers for GC_printf(); search thread
2903         in "old_list" starting from the previous found one.
2904         * darwin_stop_world.c (GC_stop_world): Rename "changes" to
2905         "changed" local variable; remove "result" variable; adjust
2906         GC_printf debugging message.
2907         * darwin_stop_world.c (GC_start_world): Do not check for
2908         my_thread and GC_use_mach_handler_thread (since they are not added
2909         to GC_mach_threads table); call thread_info() only if
2910         DEBUG_THREADS or GC_ASSERTIONS.
2911         * pthread_support.c (marker_mach_threads): New static variable (if
2912         Darwin).
2913         * pthread_support.c (GC_is_mach_marker): New function (if Darwin).
2914         * pthread_support.c (GC_mark_thread): Fill in marker_mach_threads
2915         table (if Darwin).
2916
2917 2010-09-26  Ivan Maidanski <ivmai@mail.ru>
2918
2919         * alloc.c (GC_parallel): Define only if THREADS.
2920         * misc.c (GC_get_parallel): Ditto.
2921         * include/gc.h (GC_parallel, GC_get_parallel,
2922         GC_get_suspend_signal, GC_allow_register_threads,
2923         GC_register_my_thread, GC_unregister_my_thread): Define only if
2924         GC_THREADS.
2925         * include/gc.h (GC_get_heap_size): Fix a typo in a comment.
2926
2927 2010-09-11  Ivan Maidanski <ivmai@mail.ru> (really Ludovic Courtes)
2928
2929         * configure.ac: Use `AC_C_INLINE'.
2930         * include/private/gc_priv.h (GC_INLINE): Use "inline" keyword
2931         (determined by configure AC_C_INLINE) if HAVE_CONFIG_H is defined.
2932         * configure.ac: Expand all tabs to spaces.
2933         * configure: Regenerate.
2934         * include/private/config.h.in: Ditto.
2935
2936 2010-09-11  Ivan Maidanski <ivmai@mail.ru>
2937
2938         * dyn_load.c (DL_ITERATE_PHDR_STRONG): New macro (define for
2939         FreeBSD).
2940         * dyn_load.c (GC_register_main_static_data): Move the definition
2941         above GC_register_dynamic_libraries_dl_iterate_phdr one (FreeBSD
2942         case); unconditionally return FALSE if DL_ITERATE_PHDR_STRONG.
2943         * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Test
2944         GC_register_main_static_data() result (instead of direct testing
2945         of dl_iterate_phdr (to prevent a compiler warning).
2946         * os_dep.c (CODE_OK): Test si_code also for the value of 2
2947         (FreeBSD case; required for FreeBSD v7+).
2948         * os_dep.c (CODE_OK): Properly use parentheses (HPUX case).
2949         * include/private/gcconfig.h (DATASTART): Cast etext argument in
2950         GC_FreeBSDGetDataStart() call; remove unnecessary "&" (FreeBSD
2951         case).
2952
2953 2010-09-09  Ivan Maidanski <ivmai@mail.ru> (with input from Ludovic Courtes)
2954
2955         * include/private/specific.h (quick_thread_id): Define thru
2956         GC_approx_sp(); define as a macro.
2957         * include/private/specific.h (getspecific): Use GC_INLINE instead
2958         of __inline__ (to work around Sun CC which does not recognize
2959         inline keyword surrounded with underscores).
2960         * include/private/specific.h: Expand all tabs to spaces; remove
2961         trailing spaces at EOLn.
2962
2963 2010-09-04  Ivan Maidanski <ivmai@mail.ru>
2964
2965         * darwin_stop_world.c (FindTopOfStack): Simplify condition
2966         expressions.
2967         * darwin_stop_world.c (GC_push_all_stacks): Merge two variants
2968         of this function (DARWIN_DONT_PARSE_STACK).
2969         * darwin_stop_world.c (GC_push_all_stacks): Add a check for our
2970         thread is found (same as in pthread_stop_world.c).
2971         * darwin_stop_world.c (GC_push_all_stacks): Print the number of
2972         scanned threads if verbose (same as in pthread_stop_world.c).
2973
2974 2010-09-04  Ivan Maidanski <ivmai@mail.ru>
2975
2976         * darwin_stop_world.c (GC_push_all_stacks): Reset
2977         thread_state_count value before every thread_get_state call;
2978         refine the comment for thread_state_count.
2979         * darwin_stop_world.c (GC_push_all_stacks): Ignore rsp, rip/eip,
2980         rflags, cs, fs, gs, ss, ds, es, __pc registers; uncomment ebp
2981         register pushing.
2982         * darwin_stop_world.c (GC_push_all_stacks): Set outCount to
2983         GC_MACH_THREAD_STATE_COUNT (instead of THREAD_STATE_MAX).
2984         * darwin_stop_world.c (GC_push_all_stacks): Remove FIXME and WARN
2985         for i386.
2986
2987 2010-09-03  Ivan Maidanski <ivmai@mail.ru>
2988
2989         * doc/README.macros (DARWIN_DONT_PARSE_STACK): Fix a typo.
2990         * darwin_stop_world.c (GC_use_mach_handler_thread): Change type
2991         to GC_bool.
2992         * darwin_stop_world.c (GC_suspend_thread_list, GC_start_world):
2993         Simplify the expressions involving GC_use_mach_handler_thread.
2994         * darwin_stop_world.c (GC_darwin_register_mach_handler_thread):
2995         Initialize GC_use_mach_handler_thread to TRUE (instead of 1).
2996
2997 2010-09-02  Ivan Maidanski <ivmai@mail.ru>
2998
2999         * include/gc_pthread_redirects.h (GC_pthread_sigmask, GC_dlopen,
3000         pthread_sigmask, dlopen): Don't define for Win32 pthreads (and
3001         don't include signal.h and dlfcn.h).
3002
3003 2010-08-25  Ivan Maidanski <ivmai@mail.ru> (with help from Hans Boehm)
3004
3005         * dyn_load.c (GC_register_dynlib_callback): Add FIXME.
3006
3007 2010-08-18  Ivan Maidanski <ivmai@mail.ru> (really Andreas Tobler)
3008
3009         * include/private/gcconfig.h: Add support for FreeBSD on ppc64.
3010
3011 2010-08-18  Ivan Maidanski <ivmai@mail.ru> (with help from Andreas Tobler)
3012
3013         * os_dep.c (PROTECT, UNPROTECT): Correct VM_PROT_EXEC to
3014         VM_PROT_EXECUTE.
3015
3016 2010-08-14  Ivan Maidanski <ivmai@mail.ru>
3017
3018         * aclocal.m4: Regenerate (by autoreconf -vif using autoconf-2.67,
3019         automake-1.11.1 and libtool-2.2.8).
3020         * configure: Ditto.
3021         * ltmain.sh: Ditto.
3022         * Makefile.in: Ditto.
3023         * include/private/config.h.in: Ditto.
3024         * m4/libtool.m4: Ditto.
3025         * m4/ltoptions.m4: Ditto.
3026         * m4/ltversion.m4: Ditto.
3027         * m4/lt~obsolete.m4: Ditto.
3028
3029 2010-08-14  Ivan Maidanski <ivmai@mail.ru>
3030
3031         * os_dep.c (os2_alloc): Don't set PAG_EXECUTE unless
3032         pages_executable is on.
3033         * os_dep.c (os2_alloc): Add FIXME (for recursion).
3034         * os_dep.c (UNPROTECT): Abort with a more informative message if
3035         pages_executable is on ("mprotect" case).
3036         * os_dep.c (PROTECT, UNPROTECT): Set VM_PROT_EXEC if
3037         pages_executable is on (Darwin case).
3038         * pthread_support.c (GC_init_real_syms): Abort with an informative
3039         message if libgc is linked after libpthread.
3040
3041 2010-08-14  Ivan Maidanski <ivmai@mail.ru>
3042
3043         * dyn_load.c (GC_register_dynlib_callback): Adjust "start" pointer
3044         for 64-bit targets.
3045         * pthread_support.c (start_mark_threads): Expand PTHREAD_CREATE
3046         macro.
3047         * pthread_support.c (start_mark_threads): Call INIT_REAL_SYMS()
3048         since REAL(pthread_create) is used.
3049         * pthread_support.c (PTHREAD_CREATE): Remove unused.
3050
3051 2010-08-14  Ivan Maidanski <ivmai@mail.ru>
3052
3053         * extra/threadlibs.c (main): Remove --wrap for "read" (since not
3054         wrapped anymore).
3055         * doc/README.linux (GC_USE_LD_WRAP): Ditto.
3056         * os_dep.c (__wrap_read): Ditto (in the comment).
3057
3058 2010-08-14  Ivan Maidanski <ivmai@mail.ru> (with help from Hans Boehm)
3059
3060         * include/gc_pthread_redirects.h: Test GC_PTHREADS and GC_H at the
3061         beginning of the file.
3062         * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): New
3063         macro (defined only for Linux and Solaris).
3064         * include/gc_pthread_redirects.h (GC_pthread_cancel,
3065         GC_pthread_exit): Declare new API function (only if
3066         GC_PTHREAD_EXIT_ATTRIBUTE).
3067         * include/gc_pthread_redirects.h (pthread_cancel, pthread_exit):
3068         Redirect (if GC_PTHREAD_EXIT_ATTRIBUTE).
3069         * include/private/pthread_support.h (DISABLED_GC): New macro.
3070         * pthread_support.c (pthread_cancel, pthread_exit): Restore
3071         original definition or declare "real" function (if needed and
3072         GC_PTHREAD_EXIT_ATTRIBUTE).
3073         * pthread_support.c (GC_pthread_cancel_t, GC_pthread_exit_t):
3074         Declare new types if needed.
3075         * pthread_support.c (GC_pthread_cancel, GC_pthread_exit): New
3076         function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE).
3077         * pthread_support.c (GC_init_real_syms): Initialize pointers to
3078         the "real" pthread_cancel and pthread_exit (only if
3079         GC_PTHREAD_EXIT_ATTRIBUTE).
3080         * pthread_support.c (GC_unregister_my_thread): Enable collections
3081         if DISABLED_GC was set (only if GC_PTHREAD_EXIT_ATTRIBUTE).
3082         * pthread_support.c (pthread_cancel, pthread_exit): New wrapped
3083         function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE defined).
3084         * pthread_support.c (GC_start_routine): Refine the comment.
3085         * extra/threadlibs.c (main): Adjust --wrap (add "read",
3086         "pthread_exit", "pthread_cancel" but remove "sleep").
3087         * doc/README.linux (GC_USE_LD_WRAP): Ditto.
3088         * doc/README.linux: Expand all tabs to spaces; remove trailing
3089         spaces at EOLn.
3090
3091 2010-08-12  Ivan Maidanski <ivmai@mail.ru> (mostly really Mike Gran)
3092
3093         * include/gc.h (GC_MALLOC_STUBBORN): Remove trailing ';' in the
3094         macro definition.
3095         * include/gc.h (GC_reachable_here): Ditto.
3096         * include/gc.h (GC_reachable_here): Prefix and postfix "volatile"
3097         with double '_'.
3098
3099 2010-07-29  Ivan Maidanski <ivmai@mail.ru> (with input from NIIBE Yutaka)
3100
3101         * pthread_start.c: New file.
3102         * CMakeLists.txt (SRC): Add pthread_start.c.
3103         * Makefile.am (libgc_la_SOURCES): Ditto.
3104         * Makefile.direct (CSRCS): Ditto.
3105         * Makefile.direct (OBJS): Add pthread_start.obj.
3106         * extra/gc.c: Add a comment; include pthread_start.c.
3107         * pthread_support.c (start_info): Move the struct definition down
3108         closer to its usage.
3109         * pthread_support.c (GC_thread_exit_proc): Replace STATIC with
3110         GC_INNER.
3111         * pthread_support.c (GC_inner_start_routine): Move to the
3112         definition to pthread_start.c; leave only the prototype; remove
3113         STATIC.
3114         * pthread_support.c (GC_start_rtn_prepare_thread): New function
3115         (contains parts of the original GC_inner_start_routine).
3116         * Makefile.in: Regenerate.
3117         * configure: Ditto.
3118
3119 2010-07-28  Ivan Maidanski <ivmai@mail.ru> (mostly really Noah Lavine)
3120
3121         * configure.ac (NO_EXECUTE_PERMISSION): Add comment.
3122         * doc/README.macros (NO_EXECUTE_PERMISSION): Update the
3123         documentation.
3124         * include/gc.h (GC_set_pages_executable, GC_get_pages_executable):
3125         New API function declaration.
3126         * include/gc.h (GC_ignore_warn_proc): Reformat the comment.
3127         * os_dep.c (OPT_PROT_EXEC): Remove (superseded by
3128         pages_executable).
3129         * os_dep.c (pages_executable): New static variable.
3130         * os_dep.c (IGNORE_PAGES_EXECUTABLE): New macro (used by
3131         GC_get_pages_executable only).
3132         * os_dep.c (GC_unix_mmap_get_mem, GC_remap, PROTECT, UNPROTECT):
3133         Replace OPT_PROT_EXEC with pages_executable.
3134         * os_dep.c (GC_unix_mmap_get_mem, GC_remap, GC_win32_get_mem,
3135         GC_wince_get_mem, UNPROTECT): Undefine IGNORE_PAGES_EXECUTABLE.
3136         * os_dep.c (GC_win32_get_mem, GC_wince_get_mem, GC_remap, PROTECT,
3137         UNPROTECT): Use PAGE_EXECUTE_... only if pages_executable is on.
3138         * os_dep.c (GC_set_pages_executable, GC_get_pages_executable): New
3139         API function definition.
3140
3141 2010-07-28  Ivan Maidanski <ivmai@mail.ru>
3142
3143         * tests/test.c (check_heap_stats): Increase max_heap_sz by 20% for
3144         64-bit CPUs (to prevent "Unexpected heap growth" failure on Win64,
3145         at least).
3146
3147 2010-07-14  Ivan Maidanski <ivmai@mail.ru>
3148
3149         * tests/test.c (check_heap_stats): Increase max_heap_sz by 25% for
3150         32-bit CPUs (to prevent "Unexpected heap growth" failure).
3151
3152 2010-07-13  Ivan Maidanski <ivmai@mail.ru>
3153
3154         * gc_dlopen.c (dlopen): Prototype REAL_DLFUNC if GC_USE_LD_WRAP.
3155         * pthread_support.c (pthread_create, pthread_join, pthread_detach,
3156         pthread_sigmask): Ditto.
3157         * gc_dlopen.c (dlopen): Remove cast (redundant since the prototype
3158         is added).
3159         * gc_dlopen.c (GC_dlopen): Fix return type.
3160         * pthread_support.c (GC_init_real_syms): Don't define
3161         LIBPTHREAD_NAME, LIBPTHREAD_NAME_LEN, len, namebuf and
3162         libpthread_name if RTLD_NEXT.
3163
3164 2010-07-13  Ivan Maidanski <ivmai@mail.ru>
3165
3166         * gc_dlopen.c (disable_gc_for_dlopen): Update the comment.
3167         * gc_dlopen.c (dlopen): Ditto.
3168         * include/gc.h: Update copyright header.
3169         * include/gc.h (GC_enable_incremental): Refine the comment.
3170         * include/gc.h (DECLSPEC_NORETURN): Define macro as empty if
3171         missing (only for Win32).
3172         * include/gc.h (GC_ExitThread): Use DECLSPEC_NORETURN.
3173         * win32_threads.c (GC_ExitThread): Ditto.
3174         * include/gc.h (GC_endthreadex): Add a comment.
3175
3176 2010-05-31  Ivan Maidanski <ivmai@mail.ru> (really Alexander Belchenko)
3177
3178         * include/cord.h: Fix typos.
3179         * include/cord.h: Expand all tabs to spaces; remove trailing
3180         spaces at EOLn.
3181
3182 2010-05-22  Ivan Maidanski <ivmai@mail.ru>
3183
3184         * Makefile.in: Regenerate.
3185         * configure: Ditto.
3186
3187 2010-05-22  Ivan Maidanski <ivmai@mail.ru>
3188
3189         * Makefile.am (EXTRA_DIST): Add "CMakeLists.txt" and
3190         "tests/CMakeLists.txt".
3191         * doc/doc.am (dist_pkgdata_DATA): Add "doc/README.cmake".
3192
3193 2010-05-21  Ivan Maidanski <ivmai@mail.ru> (really Bradley Smith and
3194                                             Stefano Rivera)
3195
3196         * mach_dep.c (NO_GETCONTEXT): Also define if AVR32.
3197         * include/private/gcconfig.h (AVR32): New macro (also define the
3198         supplementary macros for the target).
3199         * include/private/thread_local_alloc (USE_COMPILER_TLS): Don't
3200         define for AVR32.
3201
3202 2010-05-13  Ivan Maidanski <ivmai@mail.ru> (mostly really Uros Bizjak)
3203
3204         * tests/leak_test.c (main): Explicitly define as returning int
3205         (to prevent a spurious test failure on some Linux/alpha targets).
3206         * tests/thread_leak_test.c (main): Ditto.
3207         * tests/thread_leak_test.c: Initialize GC_find_leak in the main
3208         thread (before GC_INIT) only.
3209         * tests/leak_test.c (main): Use GC_set_find_leak() instead of
3210         accessing GC_find_leak directly.
3211         * tests/thread_leak_test.c (main): Ditto.
3212
3213 2010-05-05  Ivan Maidanski <ivmai@mail.ru>
3214
3215         * include/gc.h (GC_find_leak, GC_finalize_on_demand,
3216         GC_java_finalization, GC_dont_expand, GC_no_dls,
3217         GC_dont_precollect): Simplify the comment (remove the information
3218         about data races since the value is boolean).
3219
3220 2010-04-16  Ivan Maidanski <ivmai@mail.ru> (mostly really Louis Zhuang)
3221
3222         * os_dep.c (GC_get_stack_base, GC_get_main_stack_base): New
3223         Solaris-specific implementation (based on thr_stksegment).
3224         * os_dep.c (stackbase_main_self, stackbase_main_ss_sp): New static
3225         variable used by the Solaris-specific GC_get_stack_base().
3226
3227 2010-04-16  Ivan Maidanski <ivmai@mail.ru> (mostly really NIIBE Yutaka)
3228
3229         * pthread_support.c (GC_mark_thread_local_free_lists,
3230         GC_check_tls): Mark (and check) only for live threads (in case of
3231         GC_destroy_thread_local() is called already but GC_delete_thread()
3232         is not yet).
3233         * win32_threads.c (GC_mark_thread_local_free_lists, GC_check_tls):
3234         Ditto (matters only if GC_PTHREADS defined).
3235
3236 2010-04-09  Ivan Maidanski <ivmai@mail.ru>
3237
3238         * NT_MAKEFILE: Remove the comment about DLL and Win32S.
3239         * NT_STATIC_THREADS_MAKEFILE: Ditto.
3240         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
3241         * NT_MAKEFILE: Add ".SUFFIXES" directive (to handle gc_cpp.cc
3242         properly on VS 2005+).
3243         * NT_MAKEFILE: Update GC log file name in comments.
3244         * NT_STATIC_THREADS_MAKEFILE: Ditto.
3245         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
3246         * NT_X64_THREADS_MAKEFILE: Ditto.
3247         * doc/README.win32: Ditto.
3248         * NT_MAKEFILE: Remove ":full" for "-debug" option (since no
3249         longer supported by VS).
3250         * NT_STATIC_THREADS_MAKEFILE: Ditto.
3251         * NT_MAKEFILE: Commented out copying of gc_cpp.cc to gc_cpp.cpp.
3252         * NT_STATIC_THREADS_MAKEFILE: Ditto.
3253         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
3254         * NT_X64_THREADS_MAKEFILE: Ditto.
3255         * NT_STATIC_THREADS_MAKEFILE: Add -D PARALLEL_MARK option.
3256         * NT_STATIC_THREADS_MAKEFILE: Increase stack size for gctest.exe.
3257         * NT_X64_STATIC_THREADS_MAKEFILE: Remove "-stack" option (use the
3258         default stack size limit).
3259         * NT_X64_THREADS_MAKEFILE: Rename "gc64_dll.dll" to "gc64.dll".
3260         * win32_threads.c (GC_get_next_stack): Always define (since it is
3261         also used for Cygwin now).
3262
3263 2010-03-26  Ivan Maidanski <ivmai@mail.ru> (really Hans Boehm)
3264
3265         * alloc.c (GC_maybe_gc): Move GC_notify_full_gc() call upper to
3266         be just before GC_clear_marks() call.
3267         * include/gc_mark.h (GC_start_callback_proc): Refine the comment.
3268
3269 2010-03-23  Ivan Maidanski <ivmai@mail.ru> (really Dave Korn)
3270
3271         * Makefile.am (check_LTLIBRARIES): Initialize to empty.
3272         * tests/tests.am (TESTS, check_PROGRAMS): Add staticrootstest.
3273         * tests/tests.am (staticrootstest_SOURCES, staticrootstest_LDADD,
3274         libstaticrootslib_la_SOURCES, libstaticrootslib_la_LIBADD,
3275         libstaticrootslib_la_LDFLAGS, libstaticrootslib_la_DEPENDENCIES):
3276         Define.
3277         * tests/tests.am (check_LTLIBRARIES): Add libstaticrootslib.la.
3278         * .cvsignore: Ignore libstaticrootslib.la.
3279         * Makefile.in: Regenerate.
3280
3281 2010-03-20  Ivan Maidanski <ivmai@mail.ru>
3282
3283         * m4/libtool.m4: Re-add auto-generated file (for "make dist").
3284         * m4/lt~obsolete.m4: Ditto.
3285         * m4/ltoptions.m4: Ditto.
3286         * m4/ltsugar.m4: Ditto.
3287         * m4/ltversion.m4: Ditto.
3288
3289 2010-03-20  Ivan Maidanski <ivmai@mail.ru> (really Dave Korn)
3290
3291         * tests/staticrootstest.c: New file.
3292         * tests/staticrootslib.c: Ditto.
3293
3294 2010-03-19  Ivan Maidanski <ivmai@mail.ru> (really Dave Korn)
3295
3296         * dyn_load.c (GC_get_next_stack, GC_cond_add_roots): Define for
3297         Cygwin as well as other win32 targets.
3298         * dyn_load.c (GC_wnt): Define to constant true.
3299         * dyn_load.c (GC_register_dynamic_libraries): Define for Cygwin as
3300         well as other win32 targets.
3301         * mark_rts.c (rt_hash, GC_roots_present, add_roots_to_index):
3302         Don't define for Cygwin, as on other win32.
3303         * mark_rts.c (GC_add_roots_inner, GC_clear_roots): Handle on
3304         Cygwin as for other win32 targets.
3305         * mark_rts.c (GC_rebuild_root_index): Don't declare on Cygwin, as
3306         other win32.
3307         * mark_rts.c (GC_remove_tmp_roots): Do declare on Cygwin as on
3308         other win32.
3309         * mark_rts.c (GC_remove_roots, GC_remove_roots_inner): Don't
3310         declare on Cygwin as on other win32.
3311         * mark_rts.c (GC_is_tmp_root): Do declare on Cygwin when
3312         !NO_DEBUGGING, as on other win32 targets.
3313         * mark_rts.c (GC_cond_register_dynamic_libraries): Handle on
3314         Cygwin as for other win32 targets.
3315         * os_dep.c (GC_setpagesize): Handle on Cygwin as on other win32.
3316         * os_dep.c (GC_get_main_stack_base): Don't declare on Cygwin, as
3317         other win32.
3318         * os_dep.c (GC_sysinfo): Declare on Cygwin, as other win32.
3319         * os_dep.c (GC_win32_get_mem): Declare on Cygwin, as on other
3320         Win32, but call GC_unix_get_mem instead of GlobalAlloc.
3321         * os_dep.c (GC_win32_free_heap): Declare on Cygwin (as empty).
3322         * ptr_chck.c (GC_is_visible): Register dynamic libraries on Cygwin
3323         as on other win32 platforms.
3324         * win32_threads.c (GC_get_next_stack): Define on Cygwin as well as
3325         for dynamic loading targets.
3326         * include/private/gc_priv.h (GC_INNER): Don't try to use
3327         visibility on Cygwin which does not support it.
3328         * include/private/gc_priv.h (struct roots): Don't declare r_next
3329         member on Cygwin as on other windows hosts.
3330         * include/private/gc_priv.h (LOG_RT_SIZE, RT_SIZE): Don't define
3331         likewise.
3332         * include/private/gc_priv.h (struct _GC_arrays): Do declare
3333         _heap_bases[] member and don't declare _root_index likewise.
3334         * include/private/gc_priv.h (GC_heap_bases): Do define likewise.
3335         * include/private/gc_priv.h (_SYSTEM_INFO): Do forward-declare
3336         likewise.
3337         * include/private/gc_priv.h (GC_sysinfo): Do declare extern
3338         likewise.
3339         * include/private/gcconfig.h (GC_win32_get_mem, GET_MEM): Do
3340         prototype on Cygwin as other win32 platforms.
3341
3342 2010-03-13  Ivan Maidanski <ivmai@mail.ru>
3343
3344         * os_dep.c (GC_get_main_stack_base): Use pthread_getattr_np() and
3345         pthread_attr_getstack() instead of GC_get_stack_base() (and check
3346         returned stackaddr for NULL); output a warning on failure.
3347
3348 2010-03-12  Ivan Maidanski <ivmai@mail.ru>
3349
3350         * alloc.c (GC_start_call_back): Replace the definition type to
3351         GC_start_callback_proc.
3352         * alloc.c (GC_set_start_callback, GC_get_start_callback): New
3353         setter/getter function.
3354         * alloc.c (GC_try_to_collect_inner): Call GC_notify_full_gc()
3355         unconditionally (because GC_try_to_collect_inner always does full
3356         GC).
3357         * include/gc_mark.h (GC_start_callback_proc): New type.
3358         * include/gc_mark.h (GC_set_start_callback,
3359         GC_get_start_callback): New API function declaration.
3360
3361 2010-03-12  Ivan Maidanski <ivmai@mail.ru>
3362
3363         * doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Document.
3364         * os_dep.c (GC_get_main_stack_base): Recognize
3365         USE_GET_STACKBASE_FOR_MAIN (only if THREADS and LINUX_STACKBOTTOM)
3366         and use GC_get_stack_base() in this case.
3367
3368 2010-03-05  Ivan Maidanski <ivmai@mail.ru> (really Burkhard Linke)
3369
3370         * os_dep.c (GC_get_stack_base): Add LOCK/UNLOCK() (since
3371         GC_find_limit_with_bound() should be called with the lock held).
3372         * backgraph.c (FOR_EACH_PRED): Fix a typo.
3373
3374 2010-03-05  Ivan Maidanski <ivmai@mail.ru>
3375
3376         * alloc.c (GC_set_stop_func, GC_get_stop_func): Add
3377         DCL_LOCK_STATE.
3378         * finalize.c (GC_notify_or_invoke_finalizers): Ditto.
3379         * gc_dlopen.c (disable_gc_for_dlopen): Ditto.
3380         * gcj_mlc.c (maybe_finalize, GC_debug_gcj_malloc): Ditto.
3381         * mark.c (GC_print_trace): Ditto.
3382         * misc.c (GC_set_warn_proc, GC_get_warn_proc, GC_enable,
3383         GC_disable, GC_new_free_list, GC_new_kind, GC_new_proc,
3384         GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier,
3385         GC_get_finalizer_notifier): Ditto.
3386         * os_dep.c (GC_get_stack_base, GC_print_callers): Ditto.
3387         * pthread_support.c (GC_is_thread_tsd_valid,
3388         GC_wait_for_gc_completion, GC_init_parallel, GC_do_blocking_inner,
3389         GC_call_with_gc_active, GC_unregister_my_thread, pthread_join,
3390         pthread_detach, GC_register_my_thread, GC_inner_start_routine,
3391         pthread_create): Ditto.
3392         * reclaim.c (GC_print_all_errors): Ditto.
3393         * win32_threads.c (GC_is_thread_tsd_valid, GC_register_my_thread,
3394         GC_unregister_my_thread, GC_do_blocking_inner,
3395         GC_call_with_gc_active, GC_lookup_pthread, GC_pthread_join,
3396         GC_pthread_start_inner, GC_thread_exit_proc, GC_pthread_detach,
3397         GC_init_parallel): Ditto.
3398
3399 2010-02-25  Ivan Maidanski <ivmai@mail.ru> (really Bruce Mitchener)
3400
3401         * .cvsignore: New file.
3402         * include/private/.cvsignore: Ditto.
3403
3404 2010-02-24  Ivan Maidanski <ivmai@mail.ru>
3405
3406         * CMakeLists.txt: Change copyright header.
3407         * tests/CMakeLists.txt: Ditto.
3408
3409 2010-02-24  Ivan Maidanski <ivmai@mail.ru> (really Bruce Mitchener)
3410
3411         * doc/README.darwin: Update.
3412
3413 2010-02-24  Ivan Maidanski <ivmai@mail.ru> (really Bruce Mitchener)
3414
3415         * CMakeLists.txt: Adjust INCLUDE_DIRECTORIES and SRC (to make it
3416         usable on Mac OS X).
3417         * doc/README.cmake: Update.
3418
3419 2010-02-24  Ivan Maidanski <ivmai@mail.ru> (really Jack Andrews)
3420
3421         * CMakeLists.txt: New file (adding CMake support).
3422         * tests/CMakeLists.txt: Ditto.
3423         * doc/README.cmake: Ditto.
3424
3425 2010-02-19  Ivan Maidanski <ivmai@mail.ru> (really Bruce Mitchener)
3426
3427         * configure.ac (darwin): Don't define HAS_PPC_THREAD_STATE...
3428         macros.
3429         * include/private/gc_priv.h (THREAD_FLD): Recognize
3430         __DARWIN_UNIX03 instead of HAS_PPC_THREAD_STATE... macros.
3431         * configure: Regenerate.
3432         * include/private/config.h.in: Ditto.
3433
3434 2010-02-15  Ivan Maidanski <ivmai@mail.ru> (really Alexandr Shadchin)
3435
3436         * pthread_support.c: Include <sys/param.h> and <sys/sysctl.h> for
3437         OpenBSD.
3438         * pthread_support.c (get_ncpu): Define also for Darwin, NetBSD and
3439         OpenBSD.
3440         * pthread_support.c (GC_thr_init): Use get_ncpu() for Darwin,
3441         NetBSD and OpenBSD.
3442
3443 2010-02-04  Ivan Maidanski <ivmai@mail.ru>
3444
3445         * mallocx.c (GC_generic_malloc_many, GC_malloc_many): Define even
3446         if THREADS is undefined.
3447         * include/gc.h (GC_malloc_many): Update the comment.
3448
3449 2010-02-03  Ivan Maidanski <ivmai@mail.ru>
3450
3451         * ChangeLog: Fix some typos.
3452
3453 2010-01-29  Ivan Maidanski <ivmai@mail.ru>
3454
3455         * Makefile.in: Regenerate (by autoreconf -vif using
3456         libtool-2.2.6b, automake-1.11.1, autoconf-2.65).
3457         * aclocal.m4: Ditto.
3458         * compile: Ditto.
3459         * config.guess: Ditto.
3460         * config.sub: Ditto.
3461         * configure: Ditto.
3462         * depcomp: Ditto.
3463         * install-sh: Ditto.
3464         * ltmain.sh: Ditto.
3465         * missing: Ditto.
3466         * mkinstalldirs: Ditto.
3467
3468 2010-01-15  Ivan Maidanski <ivmai@mail.ru>
3469
3470         * include/gc_cpp.h (GC_PLACEMENT_DELETE): Define for Embarcadero
3471         (formerly known as Borland) C++ compiler v6.21+.
3472         * include/gc_cpp.h (GC_NO_OPERATOR_NEW_ARRAY): Define for ancient
3473         VC++ compilers.
3474
3475 2009-12-18  Ivan Maidanski <ivmai@mail.ru>
3476
3477         * win32_threads.c (GC_register_my_thread_inner,
3478         GC_pthread_start_inner): Undo the previous commit changes for
3479         the thread flags and DETACHED state (since the state is only
3480         tested in GC_thread_exit_proc).
3481
3482 2009-12-18  Ivan Maidanski <ivmai@mail.ru> (with input from
3483                                             Jean-Claude Beaudoin)
3484
3485         * include/gc.h (GC_unregister_my_thread): Fix a typo; update the
3486         comment.
3487         * pthread_support.c (GC_delete_thread): Allow to delete the main
3488         thread (don't call GC_INTERNAL_FREE for it); update the comment.
3489         * win32_threads.c (GC_delete_thread): Ditto.
3490         * pthread_support.c (GC_unregister_my_thread): Add an assertion
3491         for FINISHED flag is unset.
3492         * tests/test.c (check_heap_stats): Test the main thread
3493         unregistering (only if THREADS).
3494         * win32_threads.c (GC_register_my_thread_inner): Set flags to
3495         DETACHED (only if GC_PTHREADS).
3496         * win32_threads.c (GC_unregister_my_thread): Add FIXME (for
3497         GC_wait_for_gc_completion).
3498         * win32_threads.c (GC_pthread_start_inner): Clear flags detached
3499         state if needed; set pthread_id and flags while holding the lock.
3500
3501 2009-12-17  Ivan Maidanski <ivmai@mail.ru> (with input from Andy Wingo)
3502
3503         * include/private/gc_priv.h (SIG_SUSPEND): Don't define for
3504         OpenBSD and Darwin.
3505
3506 2009-12-17  Ivan Maidanski <ivmai@mail.ru>
3507
3508         * include/gc.h: Recognize _M_X64 (as an alias for _AMD64_).
3509
3510 2009-12-10  Hans-J. Boehm <Hans.Boehm@hp.com>
3511
3512         * test.c (main, WinMain): Consistently don't invoke
3513         GC_enable_incremental() if MAKE_BACKGRAPH is defined, but
3514         do invoke it even if parallel marking is enabled.
3515
3516 2009-12-08  Ivan Maidanski <ivmai@mail.ru>
3517
3518         * tests/test.c (reverse_test): Comment out a check for MSWIN32
3519         (when determing BIG value) assuming outdated win32S.
3520         * tests/test.c (reverse_test): Rename to reverse_test_inner;
3521         change the declaration (to be of GC_fn_type); call itself thru
3522         GC_call_with_gc_active() if the argument is zero.
3523         * tests/test.c (reverse_test): New function added calling
3524         reverse_test_inner thru GC_do_blocking (to test GC_do_blocking and
3525         GC_call_with_gc_active).
3526
3527 2009-12-08  Ivan Maidanski <ivmai@mail.ru> (with input from Marcos Dione)
3528
3529         * doc/README.macros (IGNORE_DYNAMIC_LOADING, PLATFORM_ANDROID):
3530         Document.
3531         * dyn_load.c: Don't include <elf.h> if PLATFORM_ANDROID.
3532         * dyn_load.c: Include bionic <linker.h> (instead of <link.h>) if
3533         PLATFORM_ANDROID.
3534         * include/private/gcconfig.h (LINUX): Define also if
3535         PLATFORM_ANDROID (for the windows-based toolkit).
3536         * include/private/gcconfig.h (SEARCH_FOR_DATA_START): Explicitly
3537         define for Android/x86 platform.
3538         * include/private/gcconfig.h (IGNORE_DYNAMIC_LOADING): Recognize
3539         new macro (undefine DYNAMIC_LOADING in this case).
3540         * include/private/gcconfig.h (CANCEL_SAFE): Don't define if
3541         PLATFORM_ANDROID.
3542         * include/private/gcconfig.h (IF_CANCEL): Fix definition for the
3543         explicitly defined CANCEL_SAFE.
3544
3545 2009-12-08  Ivan Maidanski <ivmai@mail.ru>
3546
3547         * allchblk.c (GC_allochblk_nth): Don't call GC_remove_protection()
3548         if GC_DISABLE_INCREMENTAL.
3549         * reclaim.c (GC_reclaim_generic): Ditto.
3550         * checksums.c (GC_page_was_ever_dirty): Add prototype.
3551         * include/private/gc_locks.h (GC_mark_lock_holder): Don't declare
3552         unless PARALLEL_MARK.
3553         * include/private/gc_priv.h (GC_dirty_maintained,
3554         GC_page_was_dirty, GC_remove_protection, GC_dirty_init): Don't
3555         declare if GC_DISABLE_INCREMENTAL.
3556         * include/private/gc_priv.h (GC_print_finalization_stats): Don't
3557         declare if SMALL_CONFIG.
3558         * include/private/gcconfig.h (CHECKSUMS): Explicitly undefine if
3559         GC_DISABLE_INCREMENTAL (since nothing to check).
3560         * include/private/gcconfig.h (DEFAULT_VDB): Don't define if
3561         GC_DISABLE_INCREMENTAL.
3562         * os_dep.c (GC_dirty_maintained): Ditto.
3563         * mark.c (GC_initiate_gc): Don't call GC_read_dirty() if
3564         GC_DISABLE_INCREMENTAL.
3565         * os_dep.c (GC_gww_page_was_ever_dirty, GC_page_was_ever_dirty):
3566         Uncomment; define only if CHECKSUMS.
3567
3568 2009-12-08  Ivan Maidanski <ivmai@mail.ru>
3569
3570         * darwin_stop_world.c (GC_push_all_stacks): Fix a bug (call
3571         GC_push_all_stack() instead of GC_push_all_stack_frames()).
3572         * include/private/gc_priv.h (GC_push_all_stack_frames,
3573         GC_push_all_register_frames): Rename to
3574         GC_push_all_stack_sections and GC_push_all_register_sections,
3575         respectively.
3576         * mark_rts.c (GC_push_all_stack_frames,
3577         GC_push_all_register_frames, GC_push_all_stack_part_eager_frames,
3578         GC_push_current_stack): Ditto.
3579         * pthread_stop_world.c (GC_push_all_stacks): Ditto.
3580         * win32_threads.c (GC_push_stack_for): Ditto.
3581         * misc.c (GC_call_with_gc_active): Rename "frame" local variable
3582         to "stacksect".
3583         * pthread_support.c (GC_call_with_gc_active): Ditto.
3584         * win32_threads.c (GC_call_with_gc_active): Ditto.
3585         * pthread_support.c (GC_call_with_gc_active): Update FIXME for
3586         Darwin.
3587         * win32_threads.c (GC_Thread_Rep): Update the comment for
3588         traced_stack_sect.
3589
3590 2009-12-08  Ivan Maidanski <ivmai@mail.ru> (really mostly Hans Boehm)
3591
3592         * darwin_stop_world.c (GC_push_all_stacks): Rename
3593         activation_frame to traced_stack_sect.
3594         * include/private/gc_priv.h (GC_push_all_stack_frames,
3595         GC_push_all_register_frames): Ditto.
3596         * include/private/pthread_support.h (GC_Thread_Rep): Ditto.
3597         * mark_rts.c (GC_push_all_register_frames,
3598         GC_push_all_stack_frames, GC_push_all_stack_part_eager_frames,
3599         GC_push_current_stack): Ditto.
3600         * pthread_stop_world.c (GC_push_all_stacks): Ditto.
3601         * pthread_support.c (GC_call_with_gc_active): Ditto.
3602         * win32_threads.c (GC_Thread_Rep, GC_call_with_gc_active,
3603         GC_push_stack_for): Ditto.
3604         * include/private/gc_priv.h (GC_activation_frame_s): Rename to
3605         GC_traced_stack_sect_s.
3606         * include/private/gc_priv.h (GC_activation_frame): Rename to
3607         GC_traced_stack_sect.
3608         * misc.c (GC_activation_frame, GC_call_with_gc_active): Ditto.
3609         * doc/README.macros (UNICODE): Document.
3610
3611 2009-12-07  Ivan Maidanski <ivmai@mail.ru>
3612
3613         * doc/README.macros (GC_READ_ENV_FILE): Document (new macro).
3614         * include/private/gc_priv.h (GETENV): Recognize GC_READ_ENV_FILE;
3615         declare and use GC_envfile_getenv().
3616         * misc.c (GC_envfile_content, GC_envfile_length): New static
3617         variable (only if GC_READ_ENV_FILE).
3618         * misc.c (GC_ENVFILE_MAXLEN): New macro (used in GC_envfile_init).
3619         * misc.c (GC_envfile_init, GC_envfile_getenv): New function (only
3620         if GC_READ_ENV_FILE).
3621         * misc.c (GC_init): Call GC_envfile_init() (before using GETENV)
3622         if GC_READ_ENV_FILE.
3623         * misc.c (GC_init): Move GC_setpagesize() and GC_init_win32()
3624         calls to be just before GC_envfile_init() one (since the latter
3625         uses GET_MEM).
3626         * misc.c (GC_abort): use ExitProcess() (instead of DebugBreak) for
3627         WinCE if NO_DEBUGGING; add a comment for DebugBreak() (for WinCE).
3628         * mark_rts.c (GC_add_roots_inner): Remove redundant trailing '\n'
3629         from the ABORT message.
3630         * misc.c (GC_init): Ditto.
3631         * os_dep.c (GC_get_main_stack_base, GC_register_data_segments):
3632         Ditto.
3633         * pthread_stop_world.c (GC_push_all_stacks): Ditto.
3634         * pthread_support.c (GC_init_real_syms, start_mark_threads):
3635         Ditto.
3636
3637 2009-12-06  Ivan Maidanski <ivmai@mail.ru>
3638
3639         * win32_threads.c (GC_get_next_stack): Don't define for Cygwin
3640         (since unused for now).
3641
3642 2009-12-06  Ivan Maidanski <ivmai@mail.ru>
3643
3644         * dyn_load.c (HAVE_REGISTER_MAIN_STATIC_DATA): Don't define unless
3645         GC_register_main_static_data() is defined.
3646         * dyn_load.c (GC_register_dynamic_libraries): Define only if used
3647         (if DYNAMIC_LOADING or PCR or Win32/CE).
3648         * dyn_load.c (GC_register_main_static_data): Define the default
3649         one only if DYNAMIC_LOADING.
3650         * include/private/gc_priv.h (GC_register_dynamic_libraries):
3651         Declare only if used (to prevent compiler warning).
3652
3653 2009-12-04  Ivan Maidanski <ivmai@mail.ru>
3654
3655         * mark_rts.c (GC_approx_sp): Add a comment (for GCC).
3656
3657 2009-12-04  Ivan Maidanski <ivmai@mail.ru>
3658
3659         * include/gc_version.h, configure.ac, doc/README: Change to
3660         version 7.2alpha5.
3661         * configure: Regenerate.
3662
3663 [7.2alpha4]
3664
3665 2009-12-01  Ivan Maidanski <ivmai@mail.ru>
3666
3667         * include/gc_version.h, configure.ac, doc/README: Change to
3668         version 7.2alpha4.
3669         * configure: Regenerate.
3670
3671 2009-11-21  Ivan Maidanski <ivmai@mail.ru>
3672
3673         * configure.ac (AC_CONFIG_COMMANDS): Quote srcdir value.
3674         * configure: Regenerate.
3675
3676 2009-11-18  Ivan Maidanski <ivmai@mail.ru> (really mostly Zoltan Varga)
3677
3678         * include/gc.h (GC_get_suspend_signal): New function declaration.
3679         * misc.c (GC_get_suspend_signal): New API function (only if
3680         THREADS).
3681
3682 2009-11-16  Ivan Maidanski <ivmai@mail.ru>
3683
3684         * alloc.c (min_bytes_allocd): Multiply GC_free_space_divisor by
3685         two if GC_incremental (instead of TRUE_INCREMENTAL).
3686
3687 2009-11-10  Ivan Maidanski <ivmai@mail.ru>
3688
3689         * sparc_mach_dep.S (GC_push_regs): Remove the reference.
3690
3691 2009-11-09  Ivan Maidanski <ivmai@mail.ru>
3692
3693         * os_dep.c (SIZE_T, PULONG_PTR): Remove.
3694         * os_dep.c (ULONG_PTR): Replace with GC_ULONG_PTR (defined as GC
3695         "word"); add the comment.
3696         * os_dep.c (GetWriteWatch_type, detect_GetWriteWatch,
3697         GC_gww_read_dirty): Prefix ULONG_PTR with "GC_".
3698
3699 2009-11-07  Ivan Maidanski <ivmai@mail.ru>
3700
3701         * win32_threads.c (THREAD_TABLE_SZ): Change back to a power-of-two
3702         const value (for speed).
3703         * win32_threads.c (THREAD_TABLE_INDEX): New macro.
3704         * win32_threads.c (GC_new_thread, GC_lookup_thread_inner,
3705         GC_delete_gc_thread, GC_delete_thread, GC_lookup_pthread): Use
3706         THREAD_TABLE_INDEX instead of THREAD_TABLE_SZ.
3707         * win32_threads.c (PTHREAD_MAP_HASH): Rename to PTHREAD_MAP_INDEX.
3708
3709 2009-11-07  Ivan Maidanski <ivmai@mail.ru>
3710
3711         * win32_threads.c (THREAD_TABLE_SZ): Make the const value prime.
3712
3713 2009-11-06  Ivan Maidanski <ivmai@mail.ru>
3714
3715         * backgraph.c: Remove apostrophe char from "#error".
3716
3717 2009-11-06  Ivan Maidanski <ivmai@mail.ru>
3718
3719         * doc/README.macros (GC_DISABLE_INCREMENTAL): Document.
3720         * include/private/gcconfig.h (GC_DISABLE_INCREMENTAL): Recognize
3721         new macro; implicitly define it if SMALL_CONFIG.
3722         * alloc.c (GC_incremental, GC_timeout_stop_func): Check for
3723         GC_DISABLE_INCREMENTAL instead of SMALL_CONFIG.
3724         * include/private/gc_priv.h (GC_incremental, TRUE_INCREMENTAL,
3725         GC_push_conditional): Ditto.
3726         * mark.c (GC_push_next_marked_dirty, GC_push_selected,
3727         GC_push_conditional, GC_block_was_dirty): Ditto.
3728         * misc.c (GC_enable_incremental): Ditto.
3729         * misc.c (GC_init): Ditto (for "GC_PAUSE_TIME_TARGET" and
3730         "GC_ENABLE_INCREMENTAL" environment variables).
3731         * misc.c (GC_enable_incremental): Reformat the code.
3732
3733 2009-11-06  Ivan Maidanski <ivmai@mail.ru>
3734
3735         * dyn_load.c (WIN32_LEAN_AND_MEAN): Guard with ifndef.
3736         * misc.c (WIN32_LEAN_AND_MEAN): Ditto.
3737         * os_dep.c (WIN32_LEAN_AND_MEAN): Ditto.
3738         * allchblk.c (GC_allochblk_nth): Fix a minor typo (don't/doesn't)
3739         in a comment.
3740         * backgraph.c: Ditto.
3741         * dyn_load.c (GC_register_dynamic_libraries): Ditto.
3742         * extra/threadlibs.c (main): Ditto.
3743         * pthread_support.c (pthread_join): Ditto.
3744         * tests/test.c (main): Ditto.
3745
3746 2009-11-06  Ivan Maidanski <ivmai@mail.ru>
3747
3748         * mach_dep.c (GC_push_regs): Remove STATIC (just to catch
3749         a duplicate symbol definition linker error).
3750         * misc.c (GC_clear_stack_inner): Ditto.
3751         * sparc_mach_dep.S (GC_push_regs): Comment out the reference.
3752         * sparc_mach_dep.S: Remove trailing spaces at EOLn; remove
3753         multiple trailing blank lines.
3754
3755 2009-11-06  Ivan Maidanski <ivmai@mail.ru>
3756
3757         * include/private/gc_priv.h (GC_write_disabled): New variable
3758         declaration (only if GC_ASSERTIONS and Win32 threads).
3759         * misc.c (GC_write): Add assertion for GC_write_disabled value is
3760         not on (only if THREADS).
3761         * win32_threads.c (GC_write_disabled): New variable (only if
3762         GC_ASSERTIONS and not Cygwin).
3763         * win32_threads.c (GC_stop_world): Set and clear GC_write_disabled
3764         (while holding GC_write_cs).
3765
3766 2009-11-05  Ivan Maidanski <ivmai@mail.ru>
3767
3768         * win32_threads.c (GC_please_stop): If DllMain-based thread
3769         registration is not compiled in then define GC_please_stop as
3770         a non-volatile variable for assertion only.
3771         * win32_threads.c (GC_stop_world): Set and clear only if defined.
3772         * win32_threads.c (GC_stop_world): Add the comment for GC_printf()
3773         usage (while holding GC_write_cs).
3774         * win32_threads.c (GC_delete_gc_thread): Ditto.
3775         * os_dep.c (GC_remove_protection): Ditto.
3776
3777 2009-11-05  Ivan Maidanski <ivmai@mail.ru>
3778
3779         * pthread_support.c (GC_inner_start_routine): Join 3 sequential
3780         GC_printf() calls into a single one (for DEBUG_THREADS).
3781
3782 2009-11-05  Ivan Maidanski <ivmai@mail.ru>
3783
3784         * include/private/gc_priv.h (GC_total_stacksize): New variable
3785         declaration (only if THREADS).
3786         * alloc.c (GC_total_stacksize): New variable (only if THREADS).
3787         * alloc.c (min_bytes_allocd): Calculate stack_size using
3788         GC_stackbottom only in the single-threaded case; otherwise use
3789         GC_total_stacksize; print GC_total_stacksize value if
3790         DEBUG_THREADS.
3791         * darwin_stop_world.c (GC_push_all_stacks): Use "%p" printf type
3792         specifier for lo/hi values (instead of "%lx").
3793         * darwin_stop_world.c (GC_push_all_stacks): Use
3794         GC_push_all_stack_frames() instead of GC_push_all_stack().
3795         * darwin_stop_world.c (GC_push_all_stacks): Recalculate
3796         GC_total_stacksize value.
3797         * pthread_stop_world.c (GC_push_all_stacks): Ditto.
3798         * win32_threads.c (GC_push_all_stacks): Ditto.
3799         * win32_threads.c (GC_push_stack_for): Pass "me" argument; return
3800         stack size; don't check for non-zero value of thread->stack_base.
3801         * win32_threads.c (GC_push_all_stacks): Don't call
3802         GC_push_stack_for() and don't check for "t->id == me" if
3803         thread->stack_base is zero.
3804
3805 2009-11-05  Ivan Maidanski <ivmai@mail.ru>
3806
3807         * dyn_load.c (GC_dump_meminfo): Prefix "%lx" printf type specifier
3808         with "0x".
3809         * os_dep.c (PROTECT): Ditto.
3810         * win32_threads.c (GC_mark_thread_local_free_lists): Cast p->id to
3811         int (to match printf type specifier).
3812
3813 2009-11-05  Ivan Maidanski <ivmai@mail.ru>
3814
3815         * tests/test.c (check_heap_stats): Take into account the unmapped
3816         memory size when checking for "Unexpected heap growth"; remove
3817         FIXME.
3818
3819 2009-11-03  Hans Boehm <Hans.Boehm@hp.com>
3820
3821         * alloc.c: Revert last change.
3822
3823 2009-11-02  Ivan Maidanski <ivmai@mail.ru>
3824
3825         * include/private/gcconfig.h (STACKBOTTOM): Add a presence check
3826         for eCos/NOSYS.
3827         * misc.c (GC_write): Comment out _Jv_diag_write() call (since no
3828         longer defined in GCJ).
3829
3830 2009-11-02  Ivan Maidanski <ivmai@mail.ru>
3831
3832         * os_dep.c (brk): Rename to ecos_gc_brk.
3833
3834 2009-11-01  Ivan Maidanski <ivmai@mail.ru>
3835
3836         * alloc.c (min_bytes_allocd): Use GC_stackbottom value to compute
3837         stack_size even if THREADS.
3838         * doc/README.macros (DEBUG_THREADS): Document.
3839         * pthread_support.c (DEBUG_THREADS): Remove the commented out
3840         definition.
3841         * win32_threads.c (DEBUG_WIN32_THREADS): Remove duplicate
3842         definition.
3843         * win32_threads.c: Include errno.h (except for WinCE).
3844         * win32_threads.c (GC_win32_start_inner): Copy "start" and "param"
3845         to local variables, and free "arg" parameter before "start"
3846         invocation.
3847         * win32_threads.c (GC_beginthreadex): Set errno to EAGAIN on error
3848         (instead of calling SetLastError(ERROR_NOT_ENOUGH_MEMORY)).
3849         * win32_threads.c (GC_beginthreadex): Return 0 on error (instead
3850         of -1).
3851
3852 2009-10-23  Ivan Maidanski <ivmai@mail.ru>
3853
3854         * darwin_stop_world.c (GC_darwin_register_mach_handler_thread):
3855         Use GC_INNER for the function definition.
3856         * include/private/darwin_stop_world.h
3857         (GC_darwin_register_mach_handler_thread): Remove the prototype.
3858         * include/private/darwin_stop_world.h: Add copyright header.
3859         * os_dep.c (GC_darwin_register_mach_handler_thread): Use GC_INNER
3860         for the function prototype.
3861         * include/private/gc_priv.h (NDEBUG): Explicitly define if
3862         NO_DEBUGGING and not GC_ASSERTIONS (before the standard headers
3863         inclusion).
3864
3865 2009-10-22  Ivan Maidanski <ivmai@mail.ru>
3866
3867         * include/private/gcconfig.h: Move DebugBreak() workaround (for
3868         x86mingw32ce toolchain) to gc_priv.h (after windows.h inclusion).
3869
3870 2009-10-22  Ivan Maidanski <ivmai@mail.ru>
3871
3872         * allchblk.c (GC_unmap_old, GC_merge_unmapped, GC_allochblk,
3873         GC_freehblk): Use GC_INNER for the function definition.
3874         * alloc.c (GC_never_stop_func, GC_should_collect,
3875         GC_try_to_collect_inner, GC_collect_a_little_inner,
3876         GC_set_fl_marks, GC_add_to_our_memory, GC_add_to_heap,
3877         GC_expand_hp_inner, GC_collect_or_expand, GC_allocobj): Ditto.
3878         * backgraph.c (GC_build_back_graph, GC_traverse_back_graph):
3879         Ditto.
3880         * blacklst.c (GC_default_print_heap_obj_proc, GC_bl_init,
3881         GC_promote_black_lists, GC_unpromote_black_lists,
3882         GC_add_to_black_list_normal, GC_add_to_black_list_stack,
3883         GC_is_black_listed): Ditto.
3884         * darwin_stop_world.c (GC_push_all_stacks, GC_push_all_stacks,
3885         GC_stop_init, GC_stop_world, GC_start_world): Ditto.
3886         * dbg_mlc.c (GC_has_other_debug_info, GC_store_back_pointer,
3887         GC_marked_for_finalization, GC_generate_random_backtrace_no_gc,
3888         GC_store_debug_info, GC_start_debugging,
3889         GC_debug_generic_malloc_inner,
3890         GC_debug_generic_malloc_inner_ignore_off_page,
3891         GC_debug_malloc_uncollectable, GC_debug_free_inner): Ditto.
3892         * dyn_load.c (GC_register_dynamic_libraries,
3893         GC_register_main_static_data, GC_init_dyld): Ditto.
3894         * finalize.c (GC_push_finalizer_structures, GC_finalize,
3895         GC_notify_or_invoke_finalizers, GC_print_finalization_stats):
3896         Ditto.
3897         * gcj_mlc.c (GC_core_gcj_malloc): Ditto.
3898         * headers.c (GC_find_header, GC_header_cache_miss,
3899         GC_scratch_alloc, GC_init_headers, GC_install_header,
3900         GC_install_counts, GC_remove_header, GC_remove_counts,
3901         GC_next_used_block, GC_prev_block): Ditto.
3902         * mach_dep.c (GC_with_callee_saves_pushed): Ditto.
3903         * malloc.c (GC_collect_or_expand, GC_alloc_large,
3904         GC_generic_malloc_inner, GC_generic_malloc_inner_ignore_off_page,
3905         GC_core_malloc_atomic, GC_core_malloc, GC_free_inner): Ditto.
3906         * mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.
3907         * mark.c (GC_collection_in_progress, GC_clear_hdr_marks,
3908         GC_set_hdr_marks, GC_set_mark_bit, GC_clear_mark_bit,
3909         GC_clear_marks, GC_initiate_gc, GC_mark_some,
3910         GC_mark_stack_empty, GC_invalidate_mark_state,
3911         GC_signal_mark_stack_overflow, GC_mark_from, GC_help_marker,
3912         GC_mark_init, GC_push_all, GC_push_conditional,
3913         GC_mark_and_push_stack, GC_push_all_eager, GC_push_all_stack):
3914         Ditto.
3915         * mark_rts.c (GC_is_static_root, GC_roots_present, GC_approx_sp,
3916         GC_exclude_static_roots_inner, GC_push_all_register_frames,
3917         GC_push_all_stack_frames, GC_cond_register_dynamic_libraries,
3918         GC_push_roots): Ditto.
3919         * misc.c (GC_extend_size_map, GC_clear_stack, GC_err_write):
3920         Ditto.
3921         * new_hblk.c (GC_build_fl, GC_new_hblk): Ditto.
3922         * obj_map.c (GC_register_displacement_inner, GC_add_map_entry,
3923         GC_initialize_offsets): Ditto.
3924         * os_dep.c (GC_get_maps, GC_parse_map_entry, GC_text_mapping,
3925         GC_init_linux_data_start, GC_init_netbsd_elf, GC_setpagesize,
3926         GC_set_and_save_fault_handler, GC_setup_temporary_fault_handler,
3927         GC_reset_fault_handler, GC_get_register_stack_base, GC_init_win32,
3928         GC_add_current_malloc_heap, GC_is_heap_base, GC_unmap, GC_remap,
3929         GC_unmap_gap, GC_push_all_stacks, GC_gww_dirty_init,
3930         GC_dirty_init, GC_read_dirty, GC_page_was_dirty,
3931         GC_page_was_ever_dirty, GC_remove_protection,
3932         GC_write_fault_handler, GC_mprotect_stop, GC_mprotect_resume,
3933         GC_save_callers, GC_print_callers): Ditto.
3934         * pthread_stop_world.c (GC_push_all_stacks, GC_stop_world,
3935         GC_start_world, GC_stop_init): Ditto.
3936         * pthread_support.c (GC_mark_thread_local_free_lists,
3937         GC_lookup_thread, GC_reset_finalizer_nested,
3938         GC_check_finalizer_nested, GC_segment_is_thread_stack,
3939         GC_greatest_stack_base_below, GC_thr_init, GC_init_parallel,
3940         GC_do_blocking_inner, GC_lock, GC_acquire_mark_lock,
3941         GC_release_mark_lock, GC_wait_for_reclaim, GC_notify_all_builder,
3942         GC_wait_marker, GC_notify_all_marker): Ditto.
3943         * reclaim.c (GC_print_all_errors, GC_block_empty,
3944         GC_reclaim_generic, GC_start_reclaim, GC_continue_reclaim,
3945         GC_reclaim_all): Ditto.
3946         * thread_local_alloc.c (GC_init_thread_local,
3947         GC_destroy_thread_local, GC_mark_thread_local_fls_for): Ditto.
3948         * win32_threads.c (GC_reset_finalizer_nested,
3949         GC_check_finalizer_nested, GC_do_blocking_inner, GC_stop_world,
3950         GC_start_world, GC_push_all_stacks, GC_get_next_stack,
3951         GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_for_reclaim,
3952         GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker,
3953         GC_thr_init, GC_init_parallel, GC_lock,
3954         GC_mark_thread_local_free_lists): Ditto.
3955         * alloc.c (GC_add_current_malloc_heap, GC_build_back_graph,
3956         GC_traverse_back_graph): Use GC_INNER for the function prototype.
3957         * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
3958         Ditto.
3959         * dbg_mlc.c (GC_default_print_heap_obj_proc): Ditto.
3960         * dyn_load.c (GC_parse_map_entry, GC_get_maps,
3961         GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base,
3962         GC_get_next_stack): Ditto.
3963         * finalize.c (GC_reset_finalizer_nested,
3964         GC_check_finalizer_nested): Ditto.
3965         * gcj_mlc.c (GC_start_debugging): Ditto.
3966         * include/private/dbg_mlc.h (GC_save_callers, GC_print_callers,
3967         GC_has_other_debug_info, GC_store_debug_info): Ditto.
3968         * include/private/gc_hdrs.h (GC_header_cache_miss): Ditto.
3969         * include/private/gc_locks.h (GC_lock): Ditto.
3970         * include/private/gc_pmark.h (GC_signal_mark_stack_overflow,
3971         GC_mark_from): Ditto.
3972         * include/private/pthread_support.h (GC_lookup_thread,
3973         GC_stop_init): Ditto.
3974         * include/private/thread_local_alloc.h (GC_init_thread_local,
3975         GC_destroy_thread_local, GC_mark_thread_local_fls_for): Ditto.
3976         * malloc.c (GC_extend_size_map, GC_text_mapping): Ditto.
3977         * mark.c (GC_page_was_ever_dirty): Ditto.
3978         * mark_rts.c (GC_mark_thread_local_free_lists): Ditto.
3979         * misc.c (GC_register_main_static_data, GC_init_win32,
3980         GC_setpagesize, GC_init_linux_data_start,
3981         GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf,
3982         GC_do_blocking_inner): Ditto.
3983         * os_dep.c (GC_greatest_stack_base_below): Ditto.
3984         * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init):
3985         Ditto.
3986         * include/private/gc_priv.h: Ditto (for most prototypes).
3987         * include/private/gc_priv.h (GC_INNER): Update the comment.
3988         * doc/README.macros (GC_DLL): Update.
3989
3990 2009-10-22  Ivan Maidanski <ivmai@mail.ru>
3991
3992         * alloc.c (GC_collection_in_progress): Move the prototype to
3993         gc_priv.h.
3994         * gc_dlopen.c (GC_collection_in_progress): Ditto.
3995         * pthread_support.c (GC_collection_in_progress): Ditto.
3996         * misc.c (GC_init_parallel): Ditto.
3997         * pthread_support.c (GC_init_parallel): Ditto.
3998         * win32_threads.c (GC_init_parallel): Ditto.
3999         * darwin_stop_world.c (GC_thr_init): Ditto.
4000         * misc.c (GC_thr_init): Ditto.
4001         * pthread_stop_world.c (GC_thr_init): Ditto.
4002         * pthread_support.c (GC_thr_init): Ditto.
4003         * blacklst.c (GC_clear_bl, GC_copy_bl,
4004         GC_number_stack_black_listed): Make STATIC.
4005         * dbg_mlc.c (GC_print_obj, GC_make_closure,
4006         GC_debug_invoke_finalizer): Ditto.
4007         * malloc.c (GC_alloc_large_and_clear): Ditto.
4008         * mark.c (GC_push_selected, GC_push_marked1, GC_push_marked2,
4009         GC_push_marked4, GC_push_marked, GC_push_next_marked,
4010         GC_push_next_marked_dirty, GC_push_next_marked_uncollectable):
4011         Ditto.
4012         * misc.c (GC_clear_stack_inner): Ditto.
4013         * os_dep.c (GC_repeat_read, GC_default_push_other_roots): Ditto.
4014         * darwin_stop_world.c (FindTopOfStack): Make static; define only
4015         if not DARWIN_DONT_PARSE_STACK.
4016         * dbg_mlc.c (GC_debug_free_inner): Define only if DBG_HDRS_ALL.
4017         * dyn_load.c (GC_repeat_read): Remove unused prototype.
4018         * include/private/gc_pmark.h (GC_find_start): Ditto.
4019         * misc.c (GC_read, GC_register_finalizer_no_order): Ditto.
4020         * dyn_load.c (GC_segment_is_thread_stack): Add prototype (only if
4021         THREADS).
4022         * dyn_load.c (GC_register_main_static_data): Define only if
4023         DYNAMIC_LOADING.
4024         * finalize.c (GC_enqueue_all_finalizers): Remove unnecessary tail
4025         "return" statement.
4026         * gc_dlopen.c (GC_SOLARIS_THREADS): Don't recognize (since implies
4027         GC_PTHREADS).
4028         * include/gc.h: Fix a typo.
4029         * include/gc_inline.h (GC_ASSERT): Define (if not defined) since
4030         the header is public.
4031         * include/gc_inline.h (GC_generic_malloc_many): New public
4032         function declaration.
4033         * mallocx.c (GC_generic_malloc_many): Make public.
4034         * include/private/gc_priv.h (GC_INNER): Use visibility attribute
4035         (if available).
4036         * include/private/gc_priv.h (GC_EXTERN): Define using GC_INNER.
4037         * include/private/gc_priv.h: Include atomic_ops.h if THREADS and
4038         MPROTECT_VDB.
4039         * os_dep.c: Don't include atomic_ops.h
4040         * win32_threads.c: Ditto.
4041         * include/private/gc_priv.h (GC_push_selected, GC_push_regs,
4042         GC_push_marked, GC_number_stack_black_listed,
4043         GC_alloc_large_and_clear, GC_reclaim_or_delete_all,
4044         GC_generic_malloc_many, GC_make_closure,
4045         GC_debug_invoke_finalizer, GC_print_obj, GC_page_was_ever_dirty):
4046         Remove the prototype.
4047         * mark.c (GC_page_was_ever_dirty): Add prototype (only if
4048         PROC_VDB).
4049         * include/private/gc_priv.h (GC_push_next_marked_dirty,
4050         GC_push_next_marked, GC_push_next_marked_uncollectable): Move
4051         the prototype to mark.c.
4052         * include/private/gc_priv.h (GC_is_static_root): Declare only if
4053         not THREADS.
4054         * include/private/gc_priv.h (GC_free_inner): Declare only if
4055         THREADS.
4056         * include/private/gc_priv.h (GC_debug_free_inner): Declare only if
4057         THREADS and DBG_HDRS_ALL.
4058         * include/private/gc_priv.h (GC_markers): Declare GC_markers only
4059         if PARALLEL_MARK.
4060         * include/private/gc_priv.h (GC_register_main_static_data): Move
4061         the prototype to misc.c.
4062         * mach_dep.c (GC_push_regs): Make STATIC; define only along with
4063         HAVE_PUSH_REGS definition.
4064         * mach_dep.c (GC_clear_stack_inner): Replace K&R-style function
4065         definition with the ANSI C one.
4066         * mark.c (GC_started_thread_while_stopped): Declared only if not
4067         GNU C.
4068         * win32_threads.c (GC_started_thread_while_stopped): Don't define
4069         if GNU C.
4070         * mark.c (GC_mark_from): Avoid unbalanced brackets in
4071         #if-#else-#endif blocks.
4072         * mark_rts.c (GC_is_static_root): Define only if not THREADS.
4073         * os_dep.c (GC_get_stack_base): Make public (for OpenBSD).
4074         * os_dep.c (GC_page_was_ever_dirty): Comment out the function
4075         except for PROC_VDB.
4076         * tests/test.c (main): Don't reference GC_print_obj,
4077         GC_make_closure, GC_debug_invoke_finalizer,
4078         GC_page_was_ever_dirty, GC_is_fresh (in GC_noop).
4079         * thread_local_alloc.c: Don't include "gc_inline.h".
4080         * win32_threads.c (GC_write_fault_handler): Declare only if
4081         MPROTECT_VDB.
4082
4083 2009-10-21  Ivan Maidanski <ivmai@mail.ru>
4084
4085         * allchblk.c (DEBUG): Remove macro (since unused).
4086         * allchblk.c: Include private/gc_priv.h before other includes and
4087         definitions.
4088         * alloc.c: Ditto.
4089         * gc_dlopen.c: Ditto.
4090         * headers.c: Ditto.
4091         * mallocx.c: Ditto.
4092         * mark_rts.c: Ditto.
4093         * new_hblk.c: Ditto.
4094         * reclaim.c: Ditto.
4095         * mark.c: Include private/gc_pmark.h before other includes.
4096         * misc.c: Ditto.
4097         * dyn_load.c (_GNU_SOURCE): Move the definition to gc_priv.h.
4098         * pthread_support.c (_USING_POSIX4A_DRAFT10): Ditto.
4099         * pthread_support.c (_POSIX4A_DRAFT10_SOURCE): Remove (since
4100         already defined in gc_config_macros.h).
4101         * dyn_load.c (GC_init_dyld): Remove parameter cast for
4102         _dyld_register_func_for_add_image() and
4103         _dyld_register_func_for_remove_image(); add the comment about
4104         possible warnings; add FIXME for the deprecated
4105         _dyld_bind_fully_image_containing_address().
4106         * include/private/gc_priv.h: Include gc.h before the standard
4107         headers inclusion.
4108         * tests/test.c: Ditto.
4109         * include/private/gcconfig.h (DebugBreak): Update the comment.
4110         * typd_mlc.c (ED_INITIAL_SIZE): Remove ';'.
4111         * alloc.c: Reformat the code (partly adjust indentation).
4112         * backgraph.c: Ditto.
4113         * blacklst.c: Ditto.
4114         * checksums.c: Ditto.
4115         * finalize.c: Ditto.
4116         * gcj_mlc.c: Ditto.
4117         * mach_dep.c: Ditto.
4118         * mark_rts.c: Ditto.
4119         * obj_map.c: Ditto.
4120         * os_dep.c: Ditto.
4121         * ptr_chck.c: Ditto.
4122         * stubborn.c: Ditto.
4123         * thread_local_alloc.c: Ditto.
4124         * typd_mlc.c: Ditto.
4125
4126 2009-10-20  Ivan Maidanski <ivmai@mail.ru> (really mostly OpenBSD contributors)
4127
4128         * configure.ac (openbsd): Define GC_OPENBSD_THREADS.
4129         * configure.ac: Add AM_CONDITIONAL(OPENBSD_THREADS).
4130         * configure.ac: Add sparc-openbsd case.
4131         * doc/README.macros (GC_NETBSD_THREADS, GC_OPENBSD_THREADS):
4132         Document.
4133         * tests/test.c (main): Handle OpenBSD case.
4134         * extra/threadlibs.c: Add the copyright header; expand all tabs to
4135         spaces; remove trailing spaces at EOLn.
4136         * include/private/pthread_stop_world.h: Ditto.
4137         * extra/threadlibs.c (main): Replace K&R-style function definition
4138         with the ANSI C one.
4139         * extra/threadlibs.c (main): Handle GC_OPENBSD_THREADS case.
4140         * dyn_load.c (OPENBSD): Recognize (similar to NETBSD).
4141         * include/gc_config_macros.h (GC_SOLARIS_THREADS): Recognize;
4142         define it for OpenBSD.
4143         * include/gc_pthread_redirects.h (GC_pthread_sigmask,
4144         pthread_sigmask): Don't declare and redefine for OpenBSD.
4145         * include/private/gcconfig.h: Handle OpenBSD (on arm, sh, i386,
4146         amd64, powerpc).
4147         * mach_dep.c (NO_GETCONTEXT): Ditto.
4148         * include/private/pthread_stop_world.h (thread_stop_info): Don't
4149         define last_stop_count field if OpenBSD.
4150         * misc.c (GC_init_dyld): Add declaration (if NetBSD).
4151         * misc.c (GC_init): Don't call GC_init_netbsd_elf() for OpenBSD.
4152         * os_dep.c (GC_init_netbsd_elf): Don't define for OpenBSD.
4153         * os_dep.c (old_segv_act, GC_jmp_buf_openbsd): New static variable
4154         (only if OpenBSD).
4155         * os_dep.c (GC_fault_handler_openbsd, GC_find_limit_openbsd,
4156         GC_skip_hole_openbsd): New static function (only if OpenBSD).
4157         * os_dep.c (GC_get_stack_base, GC_get_main_stack_base,
4158         GC_register_data_segments): Define specially for OpenBSD case.
4159         * os_dep.c (GC_fault_handler_lock): Initialize to
4160         AO_TS_INITIALIZER (instead of 0).
4161         * pthread_support.c (GC_allocate_lock): Ditto.
4162         * pthread_stop_world.c (NSIG, GC_print_sig_mask,
4163         GC_remove_allowed_signals, suspend_handler_mask, GC_stop_count,
4164         GC_world_is_stopped, GC_retry_signals, SIG_THR_RESTART,
4165         GC_suspend_ack_sem, GC_suspend_handler_inner, GC_suspend_handler,
4166         GC_restart_handler): Don't define and use if OpenBSD.
4167         * pthread_stop_world.c (GC_suspend_all, GC_stop_world,
4168         GC_start_world): Handle OpenBSD case.
4169         * pthread_stop_world.c (GC_stop_init): Define as empty if OpenBSD.
4170         * pthread_support.c (pthread_sigmask): Don't undefine the macro and
4171         don't define the wrapper function if OpenBSD.
4172         * pthread_support.c (GC_thr_init): Handle OpenBSD case.
4173         * configure: Regenerate.
4174         * include/private/config.h.in: Ditto.
4175
4176 2009-10-20  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
4177
4178         * dyn_load.c: Move the inclusion of private/gc_priv.h below
4179         definition of a feature macro (_GNU_SOURCE).
4180
4181 2009-10-20  Ivan Maidanski <ivmai@mail.ru>
4182
4183         * include/gc.h (REVEAL_POINTER): Remove redundant parentheses.
4184         * include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): New macros
4185         (only if GC_I_HIDE_POINTERS).
4186         * backgraph.c (GET_OH_BG_PTR): Prefix REVEAL_POINTER() with "GC_".
4187         * dbg_mlc.c (GC_get_back_ptr_info): Ditto.
4188         * finalize.c (GC_grow_table, GC_dump_finalization, GC_finalize,
4189         GC_enqueue_all_finalizers): Ditto.
4190         * backgraph.c (SET_OH_BG_PTR): Prefix HIDE_POINTER() with "GC_".
4191         * finalize.c (GC_general_register_disappearing_link,
4192         GC_unregister_disappearing_link, GC_register_finalizer_inner,
4193         GC_finalize): Ditto.
4194         * include/private/dbg_mlc.h (HIDE_BACK_PTR): Ditto.
4195         * include/private/dbg_mlc.h (GC_I_HIDE_POINTERS): Define instead
4196         of I_HIDE_POINTERS.
4197         * include/private/gc_priv.h (GC_I_HIDE_POINTERS): Ditto.
4198         * include/gc.h (_GC_H): Strip leading underscore.
4199         * include/gc_backptr.h (_GC_H): Ditto.
4200         * include/gc_gcj.h (_GC_H): Ditto.
4201         * include/gc_mark.h (_GC_H): Ditto.
4202         * include/gc_typed.h (_GC_TYPED_H, _GC_H): Ditto.
4203         * include/javaxfc.h (_GC_H): Ditto.
4204         * include/new_gc_alloc.h (__GC_SPECIALIZE): Ditto.
4205         * include/private/dbg_mlc.h (_GC_H): Ditto.
4206         * include/private/gc_priv.h (_GC_H): Ditto.
4207         * include/gc_backptr.h: Reformat the code (adjust indentation,
4208         comment out function parameter names).
4209         * include/gc_gcj.h: Ditto.
4210         * include/gc_mark.h: Ditto.
4211         * include/gc_typed.h: Ditto.
4212         * include/javaxfc.h: Ditto.
4213         * include/private/dbg_mlc.h: Ditto.
4214         * include/private/gc_priv.h: Ditto.
4215
4216 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
4217
4218         * gc_cpp.cc: Include "gc_cpp.h" instead of <gc_cpp.h>.
4219
4220 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
4221
4222         * include/private/gc_priv.h (GC_INNER): New macro (for GC-scope
4223         variable definitions).
4224         * include/private/gc_priv.h (GC_EXTERN): Update the comment.
4225         * allchblk.c (GC_unmap_threshold): Define as GC_INNER.
4226         * alloc.c (GC_incremental, GC_world_stopped, GC_n_heap_sects,
4227         GC_n_memory, GC_fail_count): Ditto.
4228         * blacklst.c (GC_black_list_spacing, GC_print_heap_obj): Ditto.
4229         * gcj_mlc.c (GC_gcj_malloc_initialized, GC_gcjobjfreelist): Ditto.
4230         * mach_dep.c (GC_save_regs_ret_val): Ditto.
4231         * mark.c (GC_n_mark_procs, GC_obj_kinds, GC_n_kinds,
4232         GC_mark_stack, GC_mark_stack_limit, GC_mark_stack_size,
4233         GC_mark_stack_top, GC_mark_state, GC_mark_stack_too_small,
4234         GC_mark_no, GC_markers): Ditto.
4235         * mark_rts.c (GC_root_size, GC_push_typed_structures): Ditto.
4236         * misc.c (GC_allocate_ml, GC_debugging_started, GC_check_heap,
4237         GC_print_all_smashed, GC_print_back_height, GC_dump_regularly,
4238         GC_backtraces, GC_force_unmap_on_gcollect,
4239         GC_large_alloc_warn_interval, GC_is_initialized, GC_write_cs,
4240         GC_current_warn_proc, GC_blocked_sp, GC_activation_frame): Ditto.
4241         * os_dep.c (GC_page_size, GC_dont_query_stack_min,
4242         GC_no_win32_dlls, GC_wnt, GC_sysinfo, GC_push_other_roots,
4243         GC_dirty_maintained, GC_fault_handler_lock): Ditto.
4244         * pthread_support.c (GC_allocate_ml, GC_lock_holder,
4245         GC_need_to_lock, GC_thr_initialized, GC_threads,
4246         GC_in_thread_creation, GC_collecting, GC_allocate_lock,
4247         GC_mark_lock_holder): Ditto.
4248         * reclaim.c (GC_bytes_found, GC_fl_builder_count, GC_have_errors):
4249         Ditto.
4250         * win32_threads.c (GC_allocate_ml, GC_lock_holder,
4251         GC_need_to_lock, GC_mark_lock_holder, GC_collecting): Ditto.
4252         * extra/gc.c (GC_INNER, GC_EXTERN): Define as STATIC.
4253         * mach_dep.c (GC_with_callee_saves_pushed): Remove redundant {}.
4254         * os_dep.c (GC_init_win32): Reformat the comment.
4255
4256 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
4257
4258         * include/private/gc_priv.h (GC_bytes_allocd, GC_objfreelist,
4259         GC_aobjfreelist): Replace GC_EXTERN to extern for SEPARATE_GLOBALS
4260         case (since they are not defined inside GC at present).
4261         * include/private/gc_priv.h (GC_objects_are_marked): Remove the
4262         declaration (since made static).
4263         * mark.c (GC_objects_are_marked): Define as STATIC.
4264         * win32_threads.c (GC_thr_initialized, GC_in_thread_creation):
4265         Ditto.
4266         * mark.c (GC_N_KINDS_INITIAL_VALUE): New macro (defined and used
4267         to initialize GC_n_kinds).
4268         * win32_threads.c (start_mark_threads): Adjust the comment.
4269
4270 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
4271
4272         * alloc.c (GC_notify_full_gc): Use GC_INLINE for a tiny static
4273         function.
4274         * backgraph.c (pop_in_progress, GC_apply_to_each_object): Ditto.
4275         * mark_rts.c (add_roots_to_index): Ditto.
4276
4277 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
4278
4279         * extra/gc.c: New file.
4280         * Makefile.am (EXTRA_DIST): Add "extra/gc.c".
4281         * configure: Regenerate.
4282         * Makefile.in: Ditto.
4283
4284 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
4285
4286         * misc.c (GC_log): Remove the declaration; move the definition (to
4287         the place where it is used); make STATIC.
4288         * misc.c (GC_init): Use GC_err_printf() instead of GC_log_printf()
4289         to print open log failure.
4290         * misc.c (GC_write): Don't abort on open log failure if the GC is
4291         compiled with GC_PRINT_VERBOSE_STATS (useful for WinCE).
4292
4293 2009-10-19  Ivan Maidanski <ivmai@mail.ru> (really Andreas Tobler)
4294
4295         * include/private/gcconfig.h (USE_MMAP): Guard with ifndef.
4296
4297 2009-10-18  Ivan Maidanski <ivmai@mail.ru>
4298
4299         * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Move
4300         the variable declaration to gc_priv.h.
4301         * alloc.c (GC_bytes_found, GC_unmap_threshold,
4302         GC_force_unmap_on_gcollect): Ditto.
4303         * dyn_load.c (GC_no_win32_dlls, GC_wnt): Ditto.
4304         * finalize.c (GC_fail_count): Ditto.
4305         * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
4306         GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Ditto.
4307         * include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size,
4308         GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack,
4309         GC_mark_stack_too_small, GC_mark_state): Ditto.
4310         * include/private/pthread_support.h (GC_threads,
4311         GC_thr_initialized, GC_in_thread_creation): Ditto.
4312         * mallocx.c (GC_bytes_found): Ditto.
4313         * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Ditto.
4314         * misc.c (GC_unmap_threshold): Ditto.
4315         * os_dep.c (GC_unmap_threshold): Ditto.
4316         * pthread_support.c (GC_markers): Ditto.
4317         * thread_local_alloc.c (GC_gcjobjfreelist,
4318         GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
4319         * win32_threads.c (GC_fault_handler_lock, GC_write_cs,
4320         GC_dont_query_stack_min, GC_markers, GC_wnt): Ditto.
4321         * include/private/gc_priv.h (GC_EXTERN): New macro (used mostly as
4322         a tag for now); defined after "gcconfig.h" inclusion.
4323         * include/private/gc_priv.h: Use GC_EXTERN instead of "extern"
4324         keyword for most global variables.
4325         * alloc.c (GC_copyright): Add the comment about the symbol
4326         visibility.
4327         * finalize.c (GC_fo_entries): Ditto.
4328         * include/private/gc_priv.h (GC_print_stats): Ditto.
4329         * misc.c (GC_quiet): Ditto.
4330         * mallocx.c (GC_bytes_allocd_tmp): Make the volatile variable
4331         STATIC.
4332         * pthread_support.c (GC_threads): Add explicit zero initializer
4333         (to make the variable definition differ from the declaration).
4334
4335 2009-10-18  Ivan Maidanski <ivmai@mail.ru>
4336
4337         * backgraph.c (GC_quiet): Remove the declaration (not needed
4338         anymore since gc_priv.h is always included).
4339         * checksums.c (GC_quiet): Ditto.
4340         * gcj_mlc.c (GC_quiet): Ditto.
4341         * headers.c (GC_hdr_cache_hits, GC_hdr_cache_misses): Add the
4342         comment.
4343         * include/private/gc_hdrs.h (GC_hdr_cache_hits,
4344         GC_hdr_cache_misses): Ditto.
4345         * mark.c (GC_first_nonempty): Make the volatile variable STATIC.
4346         * pthread_stop_world.c (GC_stop_count, GC_world_is_stopped):
4347         Ditto.
4348         * win32_threads.c (GC_please_stop, GC_max_thread_index,
4349         GC_mark_mutex_waitcnt): Ditto.
4350
4351 2009-10-18  Ivan Maidanski <ivmai@mail.ru>
4352
4353         * pthread_support.c (GC_USE_LD_WRAP): Fix a typo (swapped 'L' and
4354         'D') in the name.
4355
4356 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
4357
4358         * gc_dlopen.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Define if dlopen
4359         redirection is turned off; turn it on later when dlopen real
4360         symbol is no longer needed (according to the comment and the same
4361         as in dyn_load.c).
4362         * gc_dlopen.c (WRAP_FUNC, REAL_FUNC): Rename to WRAP_DLFUNC and
4363         REAL_DLFUNC, respectively (to have unique names since the
4364         definitions may differ from that of the similar ones in
4365         pthread_support.c).
4366         * mark.c (source): Undefine the macro when no longer needed.
4367         * os_dep.c (handler): Rename the type to GC_fault_handler_t (to
4368         have the unique name across the project).
4369         * os_dep.c (STAT_BUF_SIZE, STAT_READ); Guard with ifndef; add the
4370         comment.
4371         * pthread_support.c (STAT_BUF_SIZE, STAT_READ): Ditto.
4372         * os_dep.c (sbrk): Undo sbrk() redirection (for ECOS) when no
4373         longer needed.
4374
4375 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
4376
4377         * pthread_stop_world.c (pthread_sigmask): Undefine before using
4378         in GC_print_sig_mask() (only if DEBUG_THREADS); add the comment.
4379         * win32_threads.c (dlopen, _beginthread): Don't undefine (since
4380         neither redirected nor used here).
4381         * win32_threads.c (GC_Thread_Rep): Rename "table_management" to
4382         "tm" for short; remove "tm_" prefix.
4383         * win32_threads.c (in_use, next): Don't define the macros; use
4384         tm.in_use and tm.next fields, respectively (to ease debugging).
4385         * win32_threads.c (HASH): Rename to PTHREAD_MAP_HASH (to have
4386         unique name across the project).
4387
4388 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
4389
4390         * include/private/gc_priv.h (I_HIDE_POINTERS): Define before gc.h
4391         inclusion.
4392         * include/private/gc_pmark.h (I_HIDE_POINTERS): Define if gc.h is
4393         not included yet.
4394         * finalize.c (I_HIDE_POINTERS): Don't define.
4395         * include/private/dbg_mlc.h (I_HIDE_POINTERS): Ditto.
4396         * misc.c (I_HIDE_POINTERS): Ditto.
4397         * include/private/dbg_mlc.h (HIDE_POINTER, REVEAL_POINTER,
4398         GC_hidden_pointer): Don't define if HIDE_POINTER is undefined.
4399         * include/private/gc_pmark.h: Remove the comment about gc_priv.h
4400         inclusion order.
4401
4402 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
4403
4404         * dyn_load.c: Include gc_priv.h before using configuration
4405         information (MACOS).
4406         * dyn_load.c (GC_must_restore_redefined_dlopen): Rename to
4407         GC_MUST_RESTORE_REDEFINED_DLOPEN.
4408
4409 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
4410
4411         * backgraph.c (SET_OH_BG_PTR): Place outermost parenthesis
4412         properly.
4413         * darwin_stop_world.c: Replace "if DEBUG_THREADS" with
4414         "ifdef DEBUG_THREADS".
4415         * pthread_stop_world.c: Ditto.
4416         * pthread_support.c: Ditto.
4417         * include/gc_inline.h: Guard with GC_INLINE_H.
4418
4419 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
4420
4421         * alloc.c (GC_copyright): Define as const.
4422         * alloc.c (GC_collect_at_heapsize): Replace "static" with "STATIC"
4423         (since the name starts with "GC_" prefix).
4424         * dbg_mlc.c (GC_describe_type_fns): Ditto.
4425         * dyn_load.c (GC_FirstDLOpenedLinkMap,
4426         GC_register_dynlib_callback, GC_dyld_sections,
4427         GC_dyld_name_for_hdr, GC_dyld_image_add, GC_dyld_image_remove):
4428         Ditto.
4429         * malloc.c (GC_libpthread_start, GC_libpthread_end,
4430         GC_libld_start, GC_libld_end): Ditto.
4431         * mark_rts.c (GC_remove_root_at_pos, GC_rebuild_root_index):
4432         Ditto.
4433         * os_dep.c (GC_gww_read_dirty, GC_gww_page_was_dirty,
4434         GC_gww_page_was_ever_dirty, GC_mprotect_thread_notify,
4435         GC_mprotect_thread_reply, GC_mprotect_thread, GC_darwin_sigbus,
4436         GC_forward_exception): Ditto.
4437         * pthread_support.c (GC_syms_initialized): Ditto.
4438         * typd_mlc.c (GC_push_typed_structures_proc): Ditto.
4439         * win32_threads.c (GC_win32_dll_threads,
4440         GC_register_my_thread_inner, GC_lookup_pthread, GC_get_stack_min,
4441         GC_waitForSingleObjectInfinite): Ditto.
4442         * darwin_stop_world.c (GC_use_mach_handler_thread,
4443         GC_use_mach_handler_thread, GC_mach_threads_count): Replace
4444         "static" with "STATIC" and add zero initializer.
4445         * os_dep.c (GC_task_self, GC_ports, GC_mprotect_state,
4446         GC_sigbus_count): Ditto.
4447         * headers.c (free_hdr): Replace "static" with GC_INLINE.
4448         * misc.c (GC_tmp): Rename static variable to fwrite_gc_res.
4449         * os_dep.c (memory): Rename static variable to ecos_gc_memory.
4450         * os_dep.c (async_set_pht_entry_from_index): Make static (for
4451         MPROTECT_VDB case).
4452         * pthread_support.c (GC_real_pthread_create,
4453         GC_real_pthread_sigmask, GC_real_pthread_join,
4454         GC_real_pthread_detach, GC_init_real_syms): Use REAL_FUNC() macro
4455         for static GC_real_XXX symbols.
4456         * win32_threads.c (GC_may_be_in_stack): Remove "GC_" prefix.
4457
4458 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
4459
4460         * alloc.c (GC_never_stop_func, GC_check_fl_marks,
4461         GC_finish_collection): Reformat the code (make opening bracket
4462         style uniform across the file).
4463         * allchblk.c (GC_allochblk): Ditto.
4464         * backgraph.c (add_edge): Ditto.
4465         * dbg_mlc.c (GC_marked_for_finalization): Ditto.
4466         * dyn_load.c (GC_register_dynamic_libraries, GC_init_dyld): Ditto.
4467         * finalize.c (GC_null_finalize_mark_proc): Ditto.
4468         * gc_dlopen.c (GC_dlopen): Ditto.
4469         * mark.c (GC_push_marked1, GC_push_marked2, GC_push_marked4):
4470         Ditto.
4471         * misc.c (looping_handler, GC_call_with_gc_active,
4472         GC_do_blocking_inner, GC_do_blocking): Ditto.
4473         * os_dep.c (GC_get_main_stack_base, GC_read_dirty): Ditto.
4474         * pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
4475         GC_pthread_join, GC_pthread_detach, GC_check_tls,
4476         GC_do_blocking_inner, GC_call_with_gc_active): Ditto.
4477         * reclaim.c (GC_reclaim_clear, GC_reclaim_block,
4478         GC_print_free_list): Ditto.
4479         * os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty,
4480         GC_remove_protection): Reformat the code (wrap long lines).
4481
4482 2009-10-16  Ivan Maidanski <ivmai@mail.ru>
4483
4484         * alloc.c (GC_finish_collection): Replace getenv() with GETENV().
4485         * dyn_load.c (GC_init_dyld): Ditto.
4486         * os_dep.c (GC_print_callers): Ditto.
4487         * dyn_load.c (GC_dyld_name_for_hdr): Cast _dyld_get_image_name()
4488         result (since it's always of "struct mach_header" type).
4489         * dyn_load.c (GC_init_dyld): Cast GC_dyld_image_add and
4490         GC_dyld_image_remove (to always have the first argument of
4491         "struct mach_header" pointer type).
4492
4493 2009-10-16  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
4494
4495         * configure.ac: Add threads support for OpenBSD case (threads may
4496         not work correctly for it).
4497         * configure: Regenerate.
4498
4499 2009-10-15  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
4500
4501         * acinclude.m4: Rename to m4/gc_set_version.m4.
4502         * aclocal.m4: Regenerate.
4503         * configure: Ditto.
4504         * Makefile.in: Ditto.
4505         * m4/libtool.m4: Delete the file.
4506         * m4/lt~obsolete.m4: Ditto.
4507         * m4/ltoptions.m4: Ditto.
4508         * m4/ltsugar.m4: Ditto.
4509         * m4/ltversion.m4: Ditto.
4510
4511 2009-10-15  Ivan Maidanski <ivmai@mail.ru>
4512
4513         * include/private/gcconfig.h: Define DebugBreak() as _exit(-1) for
4514         x86mingw32ce toolchain to workaround the incorrect DebugBreak()
4515         declaration in winbase.h (the workaround would turn into a no-op
4516         when DebugBreak() will be defined as a macro in the toolchain).
4517
4518 2009-10-15  Ivan Maidanski <ivmai@mail.ru>
4519
4520         * include/private/gcconfig.h: Recognize __i386__ if WinCE (for
4521         x86mingw32ce toolchain).
4522         * include/private/gcconfig.h (NO_GETENV): Don't define for CeGCC
4523         toolchain (or if already defined).
4524         * include/private/gcconfig.h (NO_GETENV_WIN32): New macro (always
4525         defined for WinCE or if NO_GETENV is defined).
4526         * misc.c (GC_CreateLogFile): Use NO_GETENV_WIN32 macro instead of
4527         NO_GETENV one.
4528
4529 2009-10-15  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
4530
4531         * configure.ac: Add AC_CONFIG_MACRO_DIR([m4]).
4532         * Makefile.am: Add "ACLOCAL_AMFLAGS = -I m4".
4533         * libtool.m4: Remove.
4534         * aclocal.m4: Regenerate.
4535         * configure: Ditto.
4536         * Makefile.in: Ditto.
4537         * m4/libtool.m4: New file (generated).
4538         * m4/lt~obsolete.m4: Ditto.
4539         * m4/ltoptions.m4: Ditto.
4540         * m4/ltsugar.m4: Ditto.
4541         * m4/ltversion.m4: Ditto.
4542
4543 2009-10-10  Ivan Maidanski <ivmai@mail.ru>
4544
4545         * include/gc.h (GC_UNDERSCORE_STDCALL): Recognize new macro;
4546         prefix GC_CreateThread and GC_ExitThread with '_' if defined.
4547         * doc/README.macros (GC_UNDERSCORE_STDCALL): Document.
4548
4549 2009-10-09  Ivan Maidanski <ivmai@mail.ru>
4550
4551         * alloc.c (GC_collect_or_expand): Add "retry" argument; add the
4552         comments; don't use "default" stop_func on a retry if
4553         GC_dont_expand.
4554         * alloc.c (GC_collect_or_expand): Reformat the code (make the
4555         indentation style uniform across the function).
4556         * alloc.c (GC_allocobj): Pass "retry" argument to
4557         GC_collect_or_expand().
4558         * malloc.c (GC_alloc_large): Ditto.
4559         * include/private/gc_priv.h (GC_collect_or_expand): Move the
4560         declaration to malloc.c; add "retry" argument.
4561
4562 2009-10-09  Ivan Maidanski <ivmai@mail.ru>
4563
4564         * alloc.c (GC_start_call_back): Move the variable definition from
4565         misc.c.
4566         * include/private/gc_priv.h (GC_start_call_back): Remove the
4567         declaration.
4568         * alloc.c (GC_notify_full_gc): Remove unnecessary cast of 0.
4569         * alloc.c (GC_try_to_collect_inner): Also call stop_func at the
4570         beginning of the function.
4571         * include/gc.h (GC_try_to_collect): Refine the comment about
4572         stop_func.
4573
4574 2009-10-08  Ivan Maidanski <ivmai@mail.ru>
4575
4576         * alloc.c (GC_default_stop_func, GC_try_to_collect_general,
4577         GC_gcollect): Add the comment.
4578         * alloc.c (GC_try_to_collect_general): Move the assertion on
4579         stop_func != 0 to GC_try_to_collect().
4580         * alloc.c (GC_try_to_collect_general): If stop_func == 0 then use
4581         GC_default_stop_func instead (holding the lock).
4582         * alloc.c (GC_gcollect): Pass 0 as stop_func instead of
4583         GC_default_stop_func (to prevent data races).
4584
4585 2009-10-08  Ivan Maidanski <ivmai@mail.ru>
4586
4587         * Makefile.direct: Move "define arguments" documentation to
4588         doc/README.macros; add reference to doc/README.macros.
4589         * Makefile.dj: Change the documentation reference to
4590         doc/README.macros.
4591         * README.QUICK: Ditto.
4592         * configure.ac: Ditto.
4593         * allchblk.c: Remove unnecessary "-D" from the comment.
4594         * doc/README.macros: Ditto.
4595         * README.environment: Ditto.
4596         * include/gc.h: Ditto.
4597         * include/gc_inline.h: Ditto.
4598         * include/private/gcconfig.h: Ditto.
4599         * README.QUICK: Fix a typo.
4600         * README.QUICK: Expand all tabs to spaces.
4601         * configure: Regenerate.
4602         * include/private/config.h.in: Ditto.
4603
4604 2009-10-07  Ivan Maidanski <ivmai@mail.ru>
4605
4606         * misc.c (GC_CreateLogFile): Use FILE_ATTRIBUTE_NORMAL for
4607         CreateFile(); don't immediately flush every write if very verbose.
4608
4609 2009-10-07  Ivan Maidanski <ivmai@mail.ru>
4610
4611         * doc/README.win32: Replace ".exe.log" to ".gc.log".
4612         * doc/README.win64: Ditto.
4613         * doc/README.win64: Fix a typo.
4614         * misc.c (GC_CreateLogFile): Strip executable file extension for
4615         the log file; use ".gc.log" extension (instead of ".log").
4616
4617 2009-10-07  Ivan Maidanski <ivmai@mail.ru>
4618
4619         * include/gc_config_macros.h: Avoid the redefinition of
4620         GC_xxx_THREADS macros.
4621
4622 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
4623
4624         * alloc.c (GC_try_to_collect_general): Change the type of "result"
4625         local variable to GC_bool.
4626
4627 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
4628
4629         * include/gc_config_macros.h: Use old behavior for FreeBSD and
4630         NetBSD platform detection code (check that other GC_xxx_THREADS
4631         are undefined); add FIXME.
4632
4633 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
4634
4635         * include/gc_config_macros.h: Rearrange the platform detection
4636         code (GC_WIN32_PTHREADS implies GC_WIN32_THREADS; define
4637         GC_THREADS first if GC_XXX_THREADS already set; define proper
4638         GC_XXX_THREADS if GC_THREADS; define GC_PTHREADS in a single
4639         place; define _REENTRANT if posix threads except for Win32).
4640         * include/gc_config_macros.h: Reformat the code (make the
4641         indentation style uniform across the file).
4642
4643 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
4644
4645         * alloc.c (GC_try_to_collect_general): New function (move the code
4646         from GC_try_to_collect, pass force_unmap argument).
4647         * alloc.c (GC_try_to_collect, GC_gcollect): Call
4648         GC_try_to_collect_general().
4649         * alloc.c (GC_gcollect_and_unmap): New public function.
4650         * include/gc.h (GC_gcollect_and_unmap): New function declaration.
4651         * tests/test.c (window_proc): Call GC_gcollect_and_unmap() on
4652         WM_HIBERNATE event (instead of GC_set_force_unmap_on_gcollect()
4653         and GC_gcollect()).
4654
4655 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
4656
4657         * include/gc.h (GC_allow_register_threads, GC_register_my_thread,
4658         GC_unregister_my_thread, GC_malloc_many): Refine the comment.
4659         * include/gc.h (GC_malloc_many, GC_NEXT): Declare unconditionally
4660         (that is, don't depend on GC_THREADS macro).
4661         * include/gc.h: Don't check for __CYGWIN32__ and __CYGWIN__ along
4662         with a check for GC_PTHREADS (since the former implies the
4663         latter).
4664
4665 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
4666
4667         * include/gc.h: Reformat the code (make the indentation style
4668         uniform across the file).
4669         * include/gc.h (GC_SOLARIS_THREADS): Don't check for.
4670         * include/gc.h (GC_MIN, GC_MAX): Don't define.
4671         * mallocx.c (GC_malloc_many): Add comment to #endif.
4672
4673 2009-10-02  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
4674
4675         * configure.ac: Drop the subdir-objects Automake option, since
4676         it's incompatible with picking source files from libatomic_ops.
4677         * Makefile.in: Regenerate.
4678
4679 2009-10-01  Ivan Maidanski <ivmai@mail.ru> (really mostly Andreas Tobler)
4680
4681         * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Add
4682         "extern" keyword to a global variable declaration (some compilers
4683         require it).
4684         * alloc.c (GC_bytes_found, GC_unmap_threshold,
4685         GC_force_unmap_on_gcollect): Ditto.
4686         * dyn_load.c (GC_no_win32_dlls, GC_wnt): Ditto.
4687         * finalize.c (GC_fail_count): Ditto.
4688         * include/private/gc_hdrs.h (GC_hdr_cache_hits,
4689         GC_hdr_cache_misses): Ditto.
4690         * mallocx.c (GC_bytes_found): Ditto.
4691         * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Ditto.
4692         * misc.c (GC_unmap_threshold): Ditto.
4693         * os_dep.c (GC_unmap_threshold, GC_old_allocator): Ditto.
4694         * pthread_support.c (GC_markers): Ditto.
4695         * thread_local_alloc.c (GC_gcjobjfreelist,
4696         GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
4697         * win32_threads.c (GC_fault_handler_lock, GC_write_cs,
4698         GC_dont_query_stack_min, GC_markers, GC_wnt): Ditto.
4699
4700 2009-10-01  Ivan Maidanski <ivmai@mail.ru>
4701
4702         * Makefile.in: Regenerate (by autoreconf -vif, deleting libtool.m4
4703         first and using libtool-2.2, automake-1.10.2, autoconf-2.64).
4704         * aclocal.m4: Ditto.
4705         * config.guess: Ditto.
4706         * config.sub: Ditto.
4707         * configure: Ditto.
4708         * depcomp: Ditto.
4709         * install-sh: Ditto.
4710         * ltmain.sh: Ditto.
4711         * missing: Ditto.
4712         * mkinstalldirs: Ditto.
4713         * include/private/config.h.in: Ditto.
4714
4715 2009-10-01  Ivan Maidanski <ivmai@mail.ru>
4716
4717         * tests/huge_test.c: Define GC_IGNORE_WARN (if not defined) to
4718         suppress misleading GC "Out of Memory!" warning printed on every
4719         GC_MALLOC(LONG_MAX) call.
4720         * tests/huge_test.c: Include "gc.h" instead of <gc.h>.
4721         * tests/huge_test.c (main): Replace K&R-style function definition
4722         with the ANSI C one.
4723         * tests/huge_test.c: Expand all tabs to spaces.
4724
4725 2009-10-01  Ivan Maidanski <ivmai@mail.ru>
4726
4727         * dyn_load.c (GC_register_dynamic_libraries): Always use
4728         lpMaximumApplicationAddress value for WinCE (even for old
4729         versions).
4730         * os_dep.c (VER_PLATFORM_WIN32_CE): Define if not in winbase.h.
4731         * os_dep.c (GC_dont_query_stack_min): New global variable (only if
4732         WinCE and THREADS).
4733         * os_dep.c (GC_setpagesize): Adjust lpMaximumApplicationAddress
4734         for WinCE (prior to version 6) if not _WIN32_WCE_EMULATION; set
4735         GC_dont_query_stack_min for older WinCE (prior to version 5).
4736         * win32_threads.c (GC_dont_query_stack_min): Declare.
4737         * win32_threads.c (GC_get_stack_min): Rename the macro to
4738         GC_wince_evaluate_stack_min for WinCE; update the comment.
4739         * win32_threads.c (GC_push_stack_for, GC_get_next_stack): Use
4740         GC_wince_evaluate_stack_min() instead of GC_get_stack_min() for
4741         WinCE and don't update thread's last_stack_min value (only if
4742         GC_dont_query_stack_min).
4743         * win32_threads.c (GC_push_stack_for): Skip assertion for WinCE if
4744         GC_dont_query_stack_min (since the evaluated stack_min value may
4745         be incorrect if the stack is bigger than 64 KiB).
4746
4747 2009-10-01  Ivan Maidanski <ivmai@mail.ru>
4748
4749         * gc_dlopen.c (GC_dlopen): Add function redirector (only if
4750         GC_USE_LD_WRAP).
4751         * include/gc.h: Include "gc_pthread_redirects.h" even if
4752         GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS.
4753         * include/gc_pthread_redirects.h (GC_PTHREAD_REDIRECTS_H): Don't
4754         define and check for (since included only from gc.h).
4755         * include/gc_pthread_redirects.h: Declare "GC_" symbols even if
4756         GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS.
4757         * include/gc_pthread_redirects.h: Include signal.h only to get
4758         sigset_t definition.
4759
4760 2009-09-30  Ivan Maidanski <ivmai@mail.ru>
4761
4762         * configure: Regenerate (by autoreconf -vif, deleting libtool.m4
4763         first).
4764         * Makefile.in: Ditto.
4765         * aclocal.m4: Ditto.
4766         * include/private/config.h.in: Ditto.
4767
4768 2009-09-30  Ivan Maidanski <ivmai@mail.ru>
4769
4770         * Makefile.direct: Remove trailing spaces at EOLn.
4771         * Makefile.direct: Document GC_REGISTER_MEM_PRIVATE.
4772         * mark_rts.c (GC_is_tmp_root): Define also for WinCE unless
4773         NO_DEBUGGING (that is, replace _WIN32_WCE_EMULATION with MSWINCE).
4774         * os_dep.c (GC_sysinfo): Remove explicit global variable
4775         initialization to "{0}" (revert back the previous change) since it
4776         might produce a warning.
4777
4778 2009-09-30  Ivan Maidanski <ivmai@mail.ru>
4779
4780         * allchblk.c (GC_large_alloc_warn_interval): Move declaration from
4781         gc_priv.h.
4782         * allchblk.c (GC_large_alloc_warn_suppressed): Move definition
4783         from misc.c; define as STATIC.
4784         * include/private/gc_priv.h (GC_large_alloc_warn_interval,
4785         GC_large_alloc_warn_suppressed): Remove declaration.
4786         * alloc.c (GC_bytes_found): Add "defined in" comment.
4787         * mallocx.c (GC_bytes_found): Ditto.
4788         * misc.c (GC_unmap_threshold): Ditto.
4789         * os_dep.c (GC_old_allocator): Ditto.
4790         * pthread_support.c (GC_markers): Ditto.
4791         * thread_local_alloc.c (GC_gcjobjfreelist,
4792         GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
4793         * win32_threads.c (GC_markers): Ditto.
4794         * alloc.c (GC_start_time): Explicitly initialize to 0 or NULL (to
4795         be distinctive from a variable declaration).
4796         * backgraph.c (GC_max_height, GC_deepest_obj): Ditto.
4797         * blacklst.c (GC_old_normal_bl, GC_incomplete_normal_bl,
4798         GC_old_stack_bl, GC_incomplete_stack_bl): Ditto.
4799         * checksums.c (GC_faulted, GC_n_dirty_errors,
4800         GC_n_faulted_dirty_errors, GC_n_changed_errors, GC_n_clean,
4801         GC_n_dirty, GC_bytes_in_used_blocks): Ditto.
4802         * dbg_mlc.c (GC_smashed): Ditto.
4803         * finalize.c (GC_old_dl_entries): Ditto.
4804         * gcj_mlc.c (GC_gcj_kind, GC_gcj_debug_kind, GC_gcjobjfreelist,
4805         GC_gcjdebugobjfreelist): Ditto.
4806         * mach_dep.c (GC_save_regs_ret_val): Ditto.
4807         * mark.c (GC_n_rescuing_pages, GC_mark_stack, GC_mark_stack_limit,
4808         GC_mark_stack_top): Ditto.
4809         * misc.c (GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset):
4810         Ditto.
4811         * os_dep.c (GC_data_start, GC_page_size, GC_sysinfo,
4812         GC_old_segv_handler, GC_old_bus_handler,
4813         GC_old_bus_handler_used_si, GC_old_segv_handler_used_si,
4814         GC_proc_buf, GC_proc_fd, GC_vd_base): Ditto.
4815         * pthread_stop_world.c (GC_stop_count, GC_stopping_pid): Ditto.
4816         * reclaim.c (GC_leaked): Ditto.
4817         * typd_mlc.c (GC_explicit_kind, GC_array_kind, GC_ext_descriptors,
4818         GC_typed_mark_proc_index, GC_array_mark_proc_index,
4819         GC_eobjfreelist, GC_arobjfreelist): Ditto.
4820         * win32_threads.c (GC_pthread_map_cache, GC_marker_cv,
4821         GC_marker_Id): Ditto.
4822         * dbg_mlc.c (GC_smashed, GC_n_smashed): Define as STATIC.
4823         * gcj_mlc.c (GC_gcjdebugobjfreelist): Ditto.
4824         * os_dep.c (GC_vd_base): Ditto.
4825         * pthread_support.c (GC_mark_threads): Ditto.
4826         * reclaim.c (GC_leaked): Ditto.
4827         * typd_mlc.c (GC_bm_table): Ditto.
4828         * mark_rts.c (GC_save_regs_ret_val): Change declaration type to
4829         that of definition; add "defined in" comment.
4830         * mark_rts.c (GC_push_current_stack): Remove unnecessary cast for
4831         GC_save_regs_ret_val.
4832         * misc.c (GC_check_heap, GC_print_all_smashed,
4833         GC_start_call_back): Remove unnecessary cast (of 0).
4834         * misc.c (GC_LARGE_ALLOC_WARN_INTERVAL): New tuning macro.
4835         * misc.c (GC_large_alloc_warn_interval): Initialize to
4836         GC_LARGE_ALLOC_WARN_INTERVAL value.
4837         * misc.c (GC_tmp): Change to "static".
4838         * os_dep.c (GC_setpagesize): Reformat the code (collapse multiple
4839         function definitions).
4840         * os_dep.c (GC_mprotect_state): Define as static.
4841         * pthread_support.c (dummy_thread_local): Prefix with "GC_".
4842         * win32_threads.c (WinMain): Remove FIXME for WinCE.
4843
4844 2009-09-30  Ivan Maidanski <ivmai@mail.ru> (really Hans Boehm)
4845
4846         * os_dep.c (PROTECT, UNPROTECT): Use distinct ABORT messages.
4847
4848 2009-09-30  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
4849
4850         * configure.ac: Rewrite the tests for external or internal
4851         libatomic_ops.
4852         * configure.ac: In particular, drop the symbolic links. Add option
4853         --with-libatomic-ops for forced selection.
4854         * Makefile.am: Adjust the path of source files from libatomic_ops
4855         to not use the links.
4856         * Makefile.am (libgc_la_LIBADD): Add $(ATOMIC_OPS_LIBS). This will
4857         be empty if we use the bundled AO sources.
4858         * configure: Regenerate.
4859         * Makefile.in: Ditto.
4860
4861 2009-09-29  Ivan Maidanski <ivmai@mail.ru>
4862
4863         * Makefile.am: Strip version suffix for libatomic_ops directory.
4864         * build_atomic_ops.sh: Ditto.
4865         * build_atomic_ops.sh.cygwin: Ditto.
4866         * configure_atomic_ops.sh: Ditto.
4867         * Makefile.direct: Remove AO_VERSION definition; strip version
4868         suffix for libatomic_ops directory.
4869         * NT_STATIC_THREADS_MAKEFILE: Ditto.
4870         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
4871         * NT_X64_THREADS_MAKEFILE: Ditto.
4872         * gc.mak: Ditto.
4873         * Makefile.in: Regenerate.
4874
4875 2009-09-29  Ivan Maidanski <ivmai@mail.ru>
4876
4877         * libatomic_ops: Rename from "libatomic_ops-1.2".
4878
4879 2009-09-28  Ivan Maidanski <ivmai@mail.ru>
4880
4881         * alloc.c (GC_version): Add "const" keyword.
4882         * alloc.c (GC_get_version): New public function.
4883         * include/gc.h (GC_get_version): New function declaration; update
4884         the comment for the GC version.
4885
4886 2009-09-27  Ivan Maidanski <ivmai@mail.ru>
4887
4888         * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
4889         GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Use "extern"
4890         (for the global variable declaration) again.
4891         * include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size,
4892         GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack,
4893         GC_mark_stack_too_small, GC_mark_state): Ditto.
4894         * include/private/gcconfig.h (GC_register_stackbottom): Ditto.
4895         * include/private/pthread_support.h (GC_threads,
4896         GC_thr_initialized, GC_in_thread_creation): Ditto.
4897         * include/private/gc_priv.h: Ditto (for all global variables).
4898
4899 2009-09-27  Ivan Maidanski <ivmai@mail.ru>
4900
4901         * real_malloc.c: Include private/config.h if HAVE_CONFIG_H.
4902
4903 2009-09-27  Ivan Maidanski <ivmai@mail.ru>
4904
4905         * allchblk.c (GC_hblkfreelist): Define as STATIC.
4906         * blacklst.c (GC_total_stack_black_listed): Ditto.
4907         * include/private/gc_priv.h (GC_hblkfreelist, GC_stopped_mark,
4908         GC_total_stack_black_listed, GC_push_stubborn_structures): Remove
4909         declaration.
4910         * mark_rts.c (GC_stopped_mark): Add declaration (only if
4911         THREAD_LOCAL_ALLOC).
4912         * allchblk.c (GC_fail_count): Move the declaration out of
4913         GC_allochblk_nth(); remove "extern".
4914         * alloc.c (IF_THREADS): Remove unused macro.
4915         * alloc.c (GC_world_stopped): Define only if THREAD_LOCAL_ALLOC.
4916         * alloc.c (GC_stopped_mark): Set GC_world_stopped value only if
4917         THREAD_LOCAL_ALLOC.
4918         * alloc.c (GC_bytes_found, GC_collection_in_progress,
4919         GC_check_tls, GC_unmap_threshold, GC_force_unmap_on_gcollect):
4920         Remove K&R-style "extern" for the declaration.
4921         * dbg_mlc.c (GC_free_inner): Ditto.
4922         * dyn_load.c (GC_repeat_read, GC_roots_present, GC_is_heap_base,
4923         GC_get_next_stack, GC_no_win32_dlls, GC_wnt): Ditto.
4924         * finalize.c (GC_fail_count): Ditto.
4925         * include/private/gc_hdrs.h (GC_hdr_cache_hits,
4926         GC_hdr_cache_misses): Ditto.
4927         * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
4928         GC_lock, GC_collecting, GC_mark_lock_holder, GC_need_to_lock):
4929         Ditto.
4930         * include/private/gc_pmark.h (GC_mark_procs, GC_n_mark_procs,
4931         GC_mark_stack_size, GC_mark_stack_limit, GC_mark_stack_top,
4932         GC_mark_stack, GC_mark_stack_too_small, GC_mark_state): Ditto.
4933         * include/private/gc_priv.h (GC_current_warn_proc, GC_obj_kinds,
4934         GC_n_kinds, GC_fo_entries, GC_n_heap_sects, GC_n_memory,
4935         GC_page_size, GC_sysinfo, GC_black_list_spacing,
4936         GC_objects_are_marked, GC_incremental, GC_dirty_maintained,
4937         GC_root_size, GC_debugging_started, GC_large_alloc_warn_interval,
4938         GC_large_alloc_warn_suppressed, GC_blocked_sp,
4939         GC_activation_frame, GC_push_other_roots,
4940         GC_push_finalizer_structures, GC_push_thread_structures,
4941         GC_push_typed_structures, GC_start_call_back, GC_is_initialized,
4942         GC_check_heap, GC_print_all_smashed, GC_print_all_errors,
4943         GC_print_heap_obj, GC_have_errors, GC_print_stats,
4944         GC_dump_regularly, GC_backtraces, GC_print_back_height,
4945         GC_debug_generic_malloc_inner,
4946         GC_debug_generic_malloc_inner_ignore_off_page,
4947         GC_fl_builder_count, GC_mark_no, GC_help_marker,
4948         GC_setup_temporary_fault_handler, GC_reset_fault_handler): Ditto.
4949         * include/private/gcconfig.h (GC_SysVGetDataStart,
4950         GC_FreeBSDGetDataStart, GC_register_stackbottom,
4951         GC_MacTemporaryNewPtr, GC_amiga_get_mem): Ditto.
4952         * include/private/pthread_support.h (GC_threads,
4953         GC_thr_initialized, GC_in_thread_creation): Ditto.
4954         * malloc.c (GC_text_mapping): Ditto.
4955         * mallocx.c (GC_bytes_found): Ditto.
4956         * mark.c (GC_check_dirty, GC_started_thread_while_stopped): Ditto.
4957         * mark_rts.c (GC_save_regs_ret_val): Ditto.
4958         * misc.c (GC_clear_stack_inner, GC_init_parallel, GC_init_win32,
4959         GC_setpagesize, GC_init_linux_data_start,
4960         GC_set_and_save_fault_handler, GC_unmap_threshold): Ditto.
4961         * os_dep.c (GC_unmap_threshold, GC_push_all_stacks,
4962         GC_darwin_register_mach_handler_thread): Ditto.
4963         * pthread_support.c (GC_markers, GC_collection_in_progress):
4964         Ditto.
4965         * tests/test.c (GC_amiga_free_all_mem): Ditto.
4966         * thread_local_alloc.c (GC_gcjobjfreelist,
4967         GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
4968         * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init,
4969         GC_fault_handler_lock, GC_write_cs, GC_markers): Ditto.
4970         * misc.c (GC_read, GC_register_finalizer_no_order, GC_init_dyld):
4971         Move the declaration out of GC_init(); remove "extern".
4972         * os_dep.c (GC_abort): Add the comment; add workaround to suppress
4973         compiler "unreachable code" warnings for ABORT callers (where
4974         ABORT is followed by a dummy return statement).
4975         * os_dep.c (GC_old_allocator): Move the declaration out of
4976         GC_default_push_other_roots(); remove "extern".
4977         * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
4978         Move the declaration out of GC_stop_world() and GC_start_world()
4979         (only if MPROTECT_VDB); remove "extern".
4980
4981 2009-09-27  Ivan Maidanski <ivmai@mail.ru>
4982
4983         * win32_threads.c (GC_get_stack_min, GC_push_stack_for,
4984         GC_get_next_stack): Recognize _WIN32_WCE_EMULATION macro (used for
4985         WinCE emulation and for custom WinCE 6 devices); add the comment.
4986         * win32_threads.c (GC_get_stack_min): Cast pointer to word instead
4987         of DWORD.
4988         * win32_threads.c (GC_get_next_stack): Don't use and maintain the
4989         latest known stack_min value for WinCE (if GC_get_stack_min is
4990         defined as a macro); update the comments.
4991         * win32_threads.c (GC_wnt): Don't declare for WinCE.
4992
4993 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
4994
4995         * Makefile.direct: Document EMPTY_GETENV_RESULTS.
4996         * gcj_mlc.c (GC_clear_stack): Remove declaration.
4997         * malloc.c (GC_clear_stack): Ditto.
4998         * mallocx.c (GC_clear_stack): Ditto.
4999         * typd_mlc.c (GC_clear_stack): Ditto.
5000         * gcj_mlc.c (GENERAL_MALLOC, GENERAL_MALLOC_IOP): Rename to
5001         GENERAL_MALLOC_INNER and GENERAL_MALLOC_INNER_IOP, respectively;
5002         remove "lb" unnecessary cast to word.
5003         * include/private/gc_priv.h (GC_clear_stack): Add declaration.
5004         * include/private/gc_priv.h (GENERAL_MALLOC, GENERAL_MALLOC_IOP):
5005         Move common declaration from typd_mlc.c and malloc.c; remove
5006         unnecessary result and "lb" parameter casts.
5007         * include/private/thread_local_alloc.h: Guard against duplicate
5008         header file inclusion.
5009         * os_dep.c (USE_MUNMAP): Replace "-->" with an error directive for
5010         the case when USE_MMAP is not defined.
5011         * pthread_support.c (GC_is_thread_tsd_valid): New internal
5012         function (only if GC_ASSERTIONS and THREAD_LOCAL_ALLOC); move the
5013         code from thread-local GC_malloc(); add FIXME for the condition.
5014         * win32_threads.c (GC_is_thread_tsd_valid): Ditto.
5015         * thread_local_alloc.c (GC_gcjobjfreelist): Change the type (to
5016         match that of its definition).
5017         * thread_local_alloc.c (GC_destroy_thread_local): Add a cast for
5018         GC_gcjobjfreelist.
5019         * thread_local_alloc.c (GC_lookup_thread, GC_lookup_thread_inner):
5020         Remove unused declaration; don't include pthread.h.
5021         * thread_local_alloc.c (GC_is_thread_tsd_valid): New declaration
5022         (only if GC_ASSERTIONS).
5023         * thread_local_alloc.c (GC_malloc): Use GC_is_thread_tsd_valid()
5024         instead of GC_lookup_thread().
5025         * win32_threads.c (GC_lookup_thread_inner): Define as STATIC.
5026         * win32_threads.c (UNPROTECT): Rename to UNPROTECT_THREAD (to have
5027         id different from that in os_dep.c).
5028
5029 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
5030
5031         * allchblk.c (GC_enough_large_bytes_left): Replace "inline static"
5032         with GC_INLINE.
5033         * include/private/gc_priv.h (fixed_getenv): Ditto.
5034         * alloc.c (GC_max, GC_min): Replace "static INLINE" with
5035         GC_INLINE.
5036         * mark_rts.c (rt_hash): Ditto.
5037         * win32_threads.c (GC_get_max_thread_index): Ditto.
5038         * include/private/gc_priv.h (INLINE): Prefix with "GC_"; include
5039         "static"; define for Sun CC; define for VC++ (and other
5040         compilers).
5041         * pthread_support.c: Don't define __inline__ for non-GNU compilers
5042         (not needed anymore).
5043
5044 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
5045
5046         * NT_THREADS_MAKEFILE: Remove file (since it duplicates gc.mak).
5047         * Makefile.in: Remove reference to NT_THREADS_MAKEFILE.
5048         * Makefile.am: Ditto.
5049         * Makefile.dj: Ditto.
5050         * Makefile.direct: Ditto.
5051         * doc/README.win32: Add reference to gc.mak.
5052         * NT_X64_THREADS_MAKEFILE: Ditto.
5053
5054 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
5055
5056         * Makefile.in: Regenerate (by autoreconf -vif).
5057         * aclocal.m4: Ditto.
5058         * compile: Ditto.
5059         * config.guess: Ditto.
5060         * config.sub: Ditto.
5061         * configure: Ditto.
5062         * depcomp: Ditto.
5063         * install-sh: Ditto.
5064         * ltmain.sh: Ditto.
5065         * missing: Ditto.
5066         * mkinstalldirs: Ditto.
5067         * include/private/config.h.in: New file (generated).
5068         * Makefile.direct: Remove references to acinclude.m4, libtool.m4.
5069
5070 2009-09-26  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
5071
5072         * autogen.sh: Update.
5073
5074 2009-09-26  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
5075
5076         * Makefile.am: Don't add libtool.m4 to EXTRA_DIST.
5077         * acinclude.m4: Fix underquoting of GC_SET_VERSION.
5078         * README.QUICK: Update information for Makefile.
5079         * Makefile.am: Do not distribute the substituted bdw-gc.pc.
5080         * configure.ac: Add AM conditional analog to KEEP_BACK_PTRS.
5081         * tests/tests.am: Use it here to conditionally enable tracetest
5082         when possible.
5083
5084 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
5085
5086         * dyn_load.c (GC_wnt): Update the comment.
5087         * dyn_load.c (GC_register_dynamic_libraries): Add the comment for
5088         _WIN32_WCE_EMULATION; recognize GC_REGISTER_MEM_PRIVATE (new
5089         macro); call GC_is_heap_base() only if check for Type succeeded.
5090
5091 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
5092
5093         * mark_rts.c (GC_is_tmp_root): Don't define unless NO_DEBUGGING;
5094         update the comment.
5095         * include/private/gc_priv.h (GC_is_tmp_root): Remove declaration.
5096
5097 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
5098
5099         * alloc.c: Expand all tabs to spaces; remove trailing spaces at
5100         EOLn; remove multiple trailing blank lines.
5101         * misc.c: Ditto.
5102         * os_dep.c: Ditto.
5103         * pthread_support.c: Ditto.
5104         * include/private/gc_priv.h: Ditto.
5105         * include/private/gcconfig.h: Ditto.
5106
5107 2009-09-25  Hans Boehm <Hans.Boehm@hp.com>
5108
5109         * include/private/gcconfig.h (CANCEL_SAFE, IF_CANCEL): new macros.
5110         * include/private/gc_priv.h (DISABLE_CANCEL, RESTORE_CANCEL,
5111         ASSERT_CANCEL_DISABLED): New macros.
5112         * alloc.c (GC_maybe_gc): Assert cancellation disabled.
5113         (GC_collect_a_little_inner,GC_try_to_collect, GC_collect_or_expand):
5114         Disable cancellation.
5115         (GC_add_to_our_memory): Check for overflow.
5116         * misc.c (GC_cancel_disable_count): declare.
5117         (GC_init, GC_write): Disable cancellation.
5118         (GC_init): Remove redundant GC_is_initialized test.
5119         * os_dep.c (GC_repeat_read): Assert cancellation disabled.
5120         (GC_get_stack_base): Disable cancellation.
5121         * pthread_stop_world.c (GC_suspend_handler_inner): Disable
5122         cancellation.
5123         * pthread_support.c (GC_mark_thread): Permanently disable
5124         cancellation.
5125         (GC_wait_for_gc_completion, GC_wait_builder, GC_wait_marker):
5126         Assert cancellation disabled.
5127         (fork handling): Disable cancellation, fix comment.
5128         (GC_pthread_create): Disable cancellation.
5129         (GC_unregister_my_thread): Disable cancellation.
5130         * Makefile.direct: Document NO_CANCEL_SAFE.
5131
5132 2009-09-25  Ivan Maidanski <ivmai@mail.ru>
5133
5134         * Makefile: Remove outdated file (Makefile.direct should be used
5135         instead).
5136
5137 2009-09-25  Ivan Maidanski <ivmai@mail.ru>
5138
5139         * win32_threads.c: Reformat the code (make indentation and
5140         opening bracket style uniform across the file; wrap long code and
5141         comment lines).
5142
5143 2009-09-25  Ivan Maidanski <ivmai@mail.ru>
5144
5145         * include/gc.h (GC_use_DllMain): Refine (and reformat) the
5146         comment.
5147
5148 2009-09-25  Ivan Maidanski <ivmai@mail.ru> (really mostly Petter Urkedal)
5149
5150         * configure.ac: Add documentation to AC_DEFINE for GC_THREADS and
5151         EMPTY_GETENV_RESULTS.
5152         * configure.ac: Fix a typo.
5153         * Makefile.am: Ditto.
5154
5155 2009-09-25  Ivan Maidanski <ivmai@mail.ru>
5156
5157         * checksums.c (GC_checksum, GC_update_check_page): Remove
5158         "register" keyword in local variable declarations (for the code
5159         used only for debugging or which is not time-critical).
5160         * dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info,
5161         GC_store_debug_info_inner, GC_check_annotated_obj, GC_print_obj,
5162         GC_print_smashed_obj, GC_debug_end_stubborn_change,
5163         GC_debug_invoke_finalizer): Ditto.
5164         * dyn_load.c (GC_register_dynamic_libraries): Ditto.
5165         * mallocx.c (GC_realloc): Ditto.
5166         * mark_rts.c (GC_print_static_roots, GC_is_static_root,
5167         GC_clear_roots): Ditto.
5168         * misc.c (GC_write): Ditto.
5169         * os_dep.c (GC_print_callers): Ditto.
5170         * dyn_load.c (GC_register_dynamic_libraries): Rename "i" local
5171         variable to "j" for the nested loop (just not to hide the similar
5172         variable in the outer one).
5173         * mark_rts.c (GC_print_static_roots): Output an error message
5174         using GC_err_printf() (instead of GC_printf()).
5175
5176 2009-09-25  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
5177
5178         * configure.ac: Move include flag from ${INCLUDE} ...
5179         * Makefile.am: ... to AM_CPPFLAGS and also add the build directory.
5180         * configure.ac: Call AM_CONFIG_HEADER([include/private/config.h]).
5181         * configure.ac: Add documentation to all AC_DEFINE either directly
5182         or using AH_TEMPLATE.
5183
5184 2009-09-24  Ivan Maidanski <ivmai@mail.ru>
5185
5186         * win32_threads.c (GC_waitForSingleObjectInfinite): New static
5187         function (only if GC_WINMAIN_REDIRECT).
5188         * win32_threads.c (WinMain): Call GC_waitForSingleObjectInfinite()
5189         thru GC_do_blocking() instead of calling WaitForSingleObject()
5190         directly.
5191
5192 2009-09-24  Ivan Maidanski <ivmai@mail.ru>
5193
5194         * pthread_support.c (start_mark_threads): Refine printed message.
5195         * win32_threads.c (GC_thr_init): Ditto.
5196         * win32_threads.c: Reformat some code pieces (wrap too long code
5197         lines).
5198
5199 2009-09-24  Ivan Maidanski <ivmai@mail.ru>
5200         (ivmai145.diff)
5201
5202         * Makefile.direct (GC_WINMAIN_REDIRECT): Add the comment for.
5203         * Makefile.direct (NO_GETENV): Update the comment.
5204         * include/gc.h (GC_WINMAIN_WINCE_LPTSTR): Remove macro.
5205         * include/gc.h (GC_WinMain): Remove declaration.
5206         * include/gc.h (WinMain): Define (as GC_WinMain) if and only if
5207         GC_WINMAIN_REDIRECT.
5208         * tests/test.c (GC_COND_INIT): Define as GC_INIT() also in case of
5209         WinCE target unless GC_WINMAIN_REDIRECT is defined.
5210         * tests/test.c (WINMAIN_LPTSTR): New macro.
5211         * tests/test.c (WinMain): Use WINMAIN_LPTSTR instead of LP[W]STR
5212         and GC_WINMAIN_WINCE_LPTSTR.
5213         * win32_threads.c (start_mark_threads): Add the comment for
5214         MARK_THREAD_STACK_SIZE.
5215         * win32_threads.c: Recognize new GC_WINMAIN_REDIRECT macro.
5216         * win32_threads.c (WINMAIN_LPTSTR, WINMAIN_THREAD_STACK_SIZE): New
5217         macro (only if GC_WINMAIN_REDIRECT).
5218         * win32_threads.c: Undefine WinMain macro if GC_WINMAIN_REDIRECT.
5219         * win32_threads.c (GC_WinMain): Add prototype (only if
5220         GC_WINMAIN_REDIRECT).
5221         * win32_threads.c (main_thread_args, WinMain): Rename
5222         GC_WINMAIN_WINCE_LPTSTR to WINMAIN_LPTSTR.
5223         * win32_threads.c (WinMain): Call GC_INIT() instead of GC_init();
5224         use WINMAIN_THREAD_STACK_SIZE.
5225         * win32_threads.c (WinMain): Call GC_deinit() and
5226         DeleteCriticalSection() only if WinCE; add FIXME.
5227
5228 2009-09-24  Ivan Maidanski <ivmai@mail.ru>
5229
5230         * os_dep.c (GC_get_main_stack_base): add assertion for mem_base
5231         value returned by GC_get_stack_base().
5232
5233 2009-09-23  Ivan Maidanski <ivmai@mail.ru>
5234         (ivmai150.diff)
5235
5236         * Makefile.direct (MUNMAP_THRESHOLD, GC_FORCE_UNMAP_ON_GCOLLECT):
5237         Add the comment for.
5238         * alloc.c (GC_unmap_threshold, GC_force_unmap_on_gcollect):
5239         Declare external variable (only if USE_MUNMAP).
5240         * alloc.c (GC_try_to_collect): Temporarily set GC_unmap_threshold
5241         value to 1 if GC_force_unmap_on_gcollect and restore it before
5242         unlocking (only if USE_MUNMAP).
5243         * doc/README.environment (GC_FORCE_UNMAP_ON_GCOLLECT): Add
5244         information for.
5245         * include/gc.h (GC_set_force_unmap_on_gcollect,
5246         GC_get_force_unmap_on_gcollect): New public function prototype.
5247         * include/gc.h (GC_FORCE_UNMAP_ON_GCOLLECT): New macro is
5248         recognized.
5249         * misc.c (GC_FORCE_UNMAP_ON_GCOLLECT): Ditto.
5250         * include/gc.h (GC_INIT_CONF_FORCE_UNMAP_ON_GCOLLECT): New
5251         internal macro (used by GC_INIT only).
5252         * misc.c (GC_force_unmap_on_gcollect): New global variable.
5253         * misc.c (GC_init): Recognize new "GC_FORCE_UNMAP_ON_GCOLLECT"
5254         environment variable (and set GC_force_unmap_on_gcollect).
5255         * misc.c (GC_set_force_unmap_on_gcollect,
5256         GC_get_force_unmap_on_gcollect): New public function.
5257         * tests/test.c (window_proc): Call GC_set_force_unmap_on_gcollect
5258         to force the mode on if WM_HIBERNATE; restore the mode after
5259         GC_gcollect().
5260
5261 2009-09-23  Ivan Maidanski <ivmai@mail.ru>
5262
5263         * Makefile.direct (LARGE_CONFIG): Update information.
5264         * include/gc.h (GC_stop_func): Refine the comment.
5265
5266 2009-09-21  Ivan Maidanski <ivmai@mail.ru>
5267
5268         * configure.ac: Use EMPTY_GETENV_RESULTS instead of NO_GETENV for
5269         Win32 (workaround for Wine bug).
5270
5271 2009-09-20  Ivan Maidanski <ivmai@mail.ru>
5272
5273         * allchblk.c (GC_freehblk): Adjust local variables indentation.
5274         * mallocx.c (GC_generic_malloc_many): Ditto.
5275         * typd_mlc.c (GC_malloc_explicitly_typed_ignore_off_page,
5276         GC_calloc_explicitly_typed): Ditto.
5277         * typd_mlc.c (GC_make_array_descriptor): Remove unnecessary
5278         brackets.
5279
5280 2009-09-20  Ivan Maidanski <ivmai@mail.ru>
5281
5282         * configure.ac: Replace GC_WIN32_THREADS with GC_THREADS.
5283         * configure.ac: Process enable_parallel_mark option for Cygwin and
5284         Win32; define THREAD_LOCAL_ALLOC for Win32.
5285
5286 2009-09-20  Ivan Maidanski <ivmai@mail.ru>
5287
5288         * include/private/gc_priv.h: Define AO_ASSUME_WINDOWS98 if
5289         PARALLEL_MARK (required for VC++ x86).
5290
5291 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
5292         (ivmai149.diff)
5293
5294         * dbg_mlc.c (GC_generate_random_backtrace): Call
5295         GC_try_to_collect(GC_never_stop_func) instead of GC_gcollect();
5296         if GC is disabled then print error message and return.
5297         * include/gc.h (GC_try_to_collect): Refine the comment.
5298         * include/private/gc_priv.h (GC_never_stop_func): Fix return type;
5299         refine the comment.
5300
5301 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
5302         (ivmai147.diff)
5303
5304         * add_gc_prefix.c: Move the file to the new "extra" directory.
5305         * AmigaOS.c: Ditto.
5306         * gcname.c: Ditto.
5307         * if_mach.c: Ditto.
5308         * if_not_there.c: Ditto.
5309         * MacOS.c: Ditto.
5310         * msvc_dbg.c: Ditto.
5311         * setjmp_t.c: Ditto.
5312         * threadlibs.c: Ditto.
5313         * EMX_MAKEFILE: Prepend setjmp_t.c with "extra" directory.
5314         * Makefile: Prepend AmigaOS.c, MacOS.c, add_gc_prefix.c, gcname.c,
5315         if_mach.c, if_not_there.c, msvc_dbg.c, setjmp_t.c, threadlibs.c
5316         with "extra" directory.
5317         * Makefile.am: Ditto.
5318         * Makefile.direct: Ditto.
5319         * Makefile.dj: Ditto.
5320         * Makefile.in: Ditto.
5321         * NT_MAKEFILE: Prepend msvc_dbg.obj with "extra" directory.
5322         * NT_STATIC_THREADS_MAKEFILE: Ditto.
5323         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
5324         * NT_X64_THREADS_MAKEFILE: Ditto.
5325         * NT_THREADS_MAKEFILE: Prepend msvc_dbg.c with "extra" directory.
5326         * gc.mak: Ditto.
5327         * PCR-Makefile: Prepend if_mach.c, if_not_there.c with "extra"
5328         directory.
5329         * SMakefile.amiga: Prepend AmigaOS.c, setjmp_t.c with "extra"
5330         directory.
5331         * doc/simple_example.html: Update for threadlibs.c.
5332         * os_dep.c: Prepend included AmigaOS.c with "extra" directory.
5333
5334 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
5335
5336         * allchblk.c: Expand all tabs to spaces; remove trailing spaces at
5337         EOLn; remove multiple trailing blank lines.
5338         * mark.c: Ditto.
5339         * mark_rts.c: Ditto.
5340         * pthread_stop_world.c: Ditto.
5341         * win32_threads.c: Ditto.
5342         * include/gc.h: Ditto.
5343         * include/private/gc_priv.h: Ditto.
5344         * pthread_stop_world.c: Add copyright header.
5345         * include/gc.h: Reformat some comments.
5346
5347 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
5348         (ivmai130a.diff, ivmai130b.diff - superseding diff44, diff69)
5349
5350         * include/gc.h (GC_do_blocking, GC_call_with_gc_active): New
5351         function prototype.
5352         * include/private/gc_priv.h (STOP_WORLD): Replace a no-op (for the
5353         single-threaded case) with an assertion check for the state to be
5354         not a "do-blocking" one.
5355         * include/private/gc_priv.h (blocking_data): Move the structure
5356         definition from pthread_support.c; change "fn" return type to void
5357         pointer.
5358         * include/private/gc_priv.h (GC_activation_frame_s): New structure
5359         type.
5360         * include/private/gc_priv.h (GC_push_all_stack_frames): New
5361         function declaration (only if THREADS).
5362         * include/private/gc_priv.h (GC_world_stopped): Don't declare
5363         unless THREADS.
5364         * include/private/gc_priv.h (GC_blocked_sp,
5365         GC_activation_frame_s): New declaration (only if not THREADS).
5366         * include/private/gc_priv.h (GC_push_all_register_frames): New
5367         function declaration (only for IA-64).
5368         * include/private/gc_priv.h (NURSERY, GC_push_proc): Remove
5369         obsolete (unused) symbols.
5370         * include/private/gc_priv.h (GC_push_all_stack_partially_eager):
5371         Remove declaration (since it is static now).
5372         * mark_rts.c (GC_push_all_stack_partially_eager): Move from mark.c
5373         (for code locality) and make STATIC.
5374         * mark_rts.c (GC_push_all_register_frames): New function (only for
5375         IA-64).
5376         * mark_rts.c (GC_push_all_stack_frames): New function (only if
5377         THREADS).
5378         * mark_rts.c (GC_add_trace_entry): New function prototype (used by
5379         GC_push_all_stack_partially_eager(), only if TRACE_BUF).
5380         * mark_rts.c (GC_push_all_stack_part_eager_frames): New function.
5381         * mar_rts.c (GC_save_regs_ret_val): Move the declaration out of a
5382         function body (only for IA-64).
5383         * mark_rts.c (GC_push_current_stack): Call
5384         GC_push_all_stack_part_eager_frames() instead of
5385         GC_push_all_stack_partially_eager().
5386         * mark_rts.c (GC_push_current_stack): Call
5387         GC_push_all_register_frames() instead of GC_push_all_eager() for
5388         IA-64 backing store.
5389         * misc.c (GC_do_blocking_inner): Declare function (if THREADS
5390         only).
5391         * misc.c (GC_blocked_sp, GC_blocked_register_sp,
5392         GC_activation_frame): New global variables (only if not THREADS).
5393         * misc.c (GC_call_with_gc_active, GC_do_blocking_inner): New API
5394         function (only if not THREADS).
5395         * misc.c (GC_do_blocking): Move the function from
5396         pthread_support.c.
5397         * include/private/pthread_support.h (GC_Thread_Rep): Add
5398         "activation_frame" field.
5399         * pthread_stop_world.c (GC_push_all_stacks): Call
5400         GC_push_all_stack_frames() and GC_push_all_register_frames instead
5401         of GC_push_all_stack() and/or GC_push_all_eager(); don't check for
5402         STACK_GROWS_UP here.
5403         * pthread_support.c (GC_do_blocking_inner): Remove "static"; store
5404         "fn" result back to "client_data" field.
5405         * pthread_support.c (GC_call_with_gc_active): New API function.
5406         * win32_threads.c (GC_call_with_gc_active): Ditto.
5407         * win32_threads.c (GC_Thread_Rep): Add "thread_blocked_sp" and
5408         "activation_frame" fields.
5409         * win32_threads.c (GC_new_thread): Add assertion checking for
5410         thread_blocked_sp is NULL.
5411         * win32_threads.c (GC_do_blocking_inner): New function.
5412         * win32_threads.c (GC_stop_world): Don't suspend a thread if its
5413         thread_blocked_sp is non-NULL.
5414         * win32_threads.c (GC_push_stack_for): Use thread
5415         "activation_frame" (if non-NULL); use "thread_blocked_sp" if
5416         non-NULL (instead of calling GetThreadContext()); "UNPROTECT" the
5417         thread before modifying its last_stack_min; call
5418         GC_push_all_stack_frames() instead of GC_push_all_stack(); update
5419         the comments.
5420
5421 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
5422         (ivmai129.diff - superseding diff47)
5423
5424         * alloc.c (GC_default_stop_func): New static variable (initialized
5425         to GC_never_stop_func).
5426         * alloc.c (GC_set_stop_func, GC_get_stop_func): New function.
5427         * alloc.c (GC_timeout_stop_func): Define as GC_default_stop_func
5428         (instead of GC_never_stop_func) if SMALL_CONFIG (or NO_CLOCK),
5429         else call GC_default_stop_func() before getting "current_time".
5430         * alloc.c (GC_maybe_gc): Expand GC_gcollect_inner() macro (for
5431         FIXME comment).
5432         * alloc.c (GC_maybe_gc, GC_collect_a_little_inner): add FIXME for
5433         replacing GC_never_stop_func with GC_default_stop_func (if
5434         possible).
5435         * alloc.c (GC_gcollect): Use GC_default_stop_func.
5436         * alloc.c (GC_collect_or_expand): Use GC_default_stop_func
5437         (instead of GC_never_stop_func) unless it is trigged due to out of
5438         memory; don't increment GC_fail_count and don't output warning
5439         (before trying to collect again) in case the collection has been
5440         interrupted (by GC_default_stop_func) and the heap expansion has
5441         failed too.
5442         * include/gc.h (GC_set_stop_func, GC_get_stop_func): New function
5443         prototypes.
5444
5445 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
5446
5447         * os_dep.c (GC_get_stack_base): Add FIXME; add assertion for
5448         GC_get_writable_length() result.
5449
5450 2009-09-18  Ivan Maidanski <ivmai@mail.ru> (really Ludovic Courtes)
5451
5452         * configure.ac: Don't use -lpthread -ldl for Cygwin.
5453
5454 2009-09-18  Ivan Maidanski <ivmai@mail.ru>
5455
5456         * NT_THREADS_MAKEFILE: Make it back equal to gc.mak.
5457
5458 2009-09-18  Ivan Maidanski <ivmai@mail.ru>
5459         (ivmai142.diff)
5460
5461         * include/private/gcconfig.h (GWW_VDB): Undefine if
5462         USE_GLOBAL_ALLOC (since incompatible).
5463         * os_dep.c (GetWriteWatch_alloc_flag): Define as 0 unless GWW_VDB
5464         is defined.
5465         * os_dep.c (GC_unmap_threshold): Declare (for use in
5466         GC_init_win32) if USE_MUNMAP.
5467         * os_dep.c (GC_init_win32): Turn off memory unmapping if
5468         GlobalAlloc() is used.
5469         * os_dep.c (GC_win32_get_mem): Define and use new
5470         VIRTUAL_ALLOC_PAD macro; don't waste a extra memory page unless
5471         MPROTECT_VDB is in use.
5472
5473 2009-09-17  Ivan Maidanski <ivmai@mail.ru>
5474
5475         * Makefile: Replace "version.h" with "include/gc_version.h".
5476         * include/gc_version.h: Ditto.
5477
5478 2009-09-17  Ivan Maidanski <ivmai@mail.ru>
5479
5480         * alloc.c (GC_collect_or_expand): Output heap size in WARN()
5481         (before returning FALSE) for convenience.
5482
5483 2009-09-17  Ivan Maidanski <ivmai@mail.ru>
5484         (ivmai139.diff)
5485
5486         * allchblk.c (GC_allochblk_nth): Use GC_PRIdPTR in WARN() format
5487         string.
5488         * pthread_support.c (start_mark_threads, GC_thr_init): Ditto.
5489         * win32_threads.c (GC_delete_thread): Ditto.
5490         * include/private/gc_priv.h (GC_PRIdPTR): New macro.
5491         * pthread_stop_world.c (GC_suspend_handler_inner): Remove
5492         unnecessary cast for WARN argument.
5493         * pthread_support.c (start_mark_threads): if pthread_create()
5494         failed then don't try to create other marker threads and (after
5495         printing a warning) adjust GC_markers and GC_parallel values; log
5496         GC_markers value (possibly adjusted) after that.
5497
5498 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5499         (ivmai140.diff)
5500
5501         * win32_threads.c (start_mark_threads): if pthread_create() is
5502         failed then don't try to create other marker threads and (after
5503         printing a warning) adjust GC_markers and GC_parallel values.
5504         * win32_threads.c (mark_mutex_event, builder_cv, mark_cv): Move
5505         the definition upper (to be visible in start_mark_threads()).
5506         * win32_threads.c (start_mark_threads): if CreateThread() or
5507         _beginthreadex() is failed then don't try to create other marker
5508         threads and (after printing a warning) adjust GC_markers,
5509         GC_parallel values, and destroy the event objects (either only
5510         some for the uncreated threads if DONT_USE_SIGNALANDWAIT or all if
5511         not a single thread is created).
5512         * win32_threads.c (GC_thr_init): Log GC_markers value (possibly
5513         adjusted) after start_mark_threads() call.
5514
5515 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5516
5517         * Makefile.am: Back remove "GC_" prefix for PTHREADS,
5518         DARWIN_THREADS, WIN32_THREADS (for configure.ac).
5519
5520 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5521
5522         * ChangeLog: Remove trailing spaces at EOLn; insert blank lines
5523         where missed.
5524         * doc/README: Expand all tabs to spaces; remove trailing spaces at
5525         EOLn; remove multiple trailing blank lines.
5526         * doc/README.autoconf: Ditto.
5527         * doc/README.DGUX386: Ditto.
5528         * doc/README.environment: Ditto.
5529         * doc/README.macros: Ditto.
5530         * doc/README.win32: Ditto.
5531         * tests/test.c: Ditto.
5532         * tests/test_cpp.cc: Ditto.
5533         * backgraph.c: Ditto.
5534         * blacklst.c: Ditto.
5535         * checksums.c: Ditto.
5536         * darwin_stop_world.c: Ditto.
5537         * dbg_mlc.c: Ditto.
5538         * dyn_load.c: Ditto.
5539         * finalize.c: Ditto.
5540         * gc_dlopen.c: Ditto.
5541         * gcj_mlc.c: Ditto.
5542         * headers.c: Ditto.
5543         * mach_dep.c: Ditto.
5544         * malloc.c: Ditto.
5545         * mallocx.c: Ditto.
5546         * new_hblk.c: Ditto.
5547         * obj_map.c: Ditto.
5548         * ptr_chck.c: Ditto.
5549         * real_malloc.c: Ditto.
5550         * reclaim.c: Ditto.
5551         * stubborn.c: Ditto.
5552         * thread_local_alloc.c: Ditto.
5553         * typd_mlc.c: Ditto.
5554         * gc_cpp.cc: Ditto.
5555         * include/gc_allocator.h: Ditto.
5556         * include/gc_backptr.h: Ditto.
5557         * include/gc_config_macros.h: Ditto.
5558         * include/gc_cpp.h: Ditto.
5559         * include/gc_gcj.h: Ditto.
5560         * include/gc_inline.h: Ditto.
5561         * include/gc_mark.h: Ditto.
5562         * include/gc_pthread_redirects.h: Ditto.
5563         * include/gc_typed.h: Ditto.
5564         * include/gc_version.h: Ditto.
5565         * include/javaxfc.h: Ditto.
5566         * include/new_gc_alloc.h: Ditto.
5567         * include/private/darwin_semaphore.h: Ditto.
5568         * include/private/dbg_mlc.h: Ditto.
5569         * include/private/gc_hdrs.h: Ditto.
5570         * include/private/gc_locks.h: Ditto.
5571         * include/private/gc_pmark.h: Ditto.
5572         * include/private/gcconfig.h: Ditto.
5573         * include/private/pthread_support.h: Ditto.
5574         * include/private/thread_local_alloc.h: Ditto.
5575         * darwin_stop_world.c: Add copyright header.
5576         * include/gc_backptr.h: Ditto.
5577         * include/gc_config_macros.h: Ditto.
5578         * include/gc_pthread_redirects.h: Ditto.
5579         * include/gc_version.h: Ditto.
5580         * include/javaxfc.h: Ditto.
5581         * include/private/darwin_semaphore.h: Ditto.
5582         * include/private/pthread_support.h: Ditto.
5583         * gc_cpp.cc: Make copyright header uniform across the package.
5584         * include/gc_cpp.h: Ditto.
5585
5586 2009-09-16  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
5587         (gc_config_h_6a.patch with a minor correction)
5588
5589         * include/private/gc_priv.h: Change include of config.h to
5590         private/config.h.
5591         * include/private/gc_pmark.h: Ditto.
5592         * gc_cpp.cc: Ditto.
5593         * tests/test.c: Ditto.
5594         * tests/test_cpp.cc: Include private/config.h (if HAVE_CONFIG_H);
5595         undefine GC_BUILD.
5596
5597 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5598         (ivmai128.diff - superseding diff62, diff66 partly)
5599
5600         * finalize.c (GC_general_register_disappearing_link): Return
5601         GC_SUCCESS, GC_DUPLICATE, GC_NO_MEMORY (instead of 0, 1 and 2,
5602         respectively).
5603         * include/gc.h (GC_NO_MEMORY): New macro (defined as 2).
5604         * include/gc.h (GC_register_disappearing_link,
5605         GC_general_register_disappearing_link): Update the comment.
5606         * typd_mlc.c (GC_calloc_explicitly_typed): Use GC_NO_MEMORY macro.
5607         * finalize.c (GC_general_register_disappearing_link,
5608         GC_register_finalizer_inner): Recalculate the hash table index
5609         after GC_oom_fn succeeded (since the table may grow while not
5610         holding the lock) and check again that the entry is still not in
5611         the table (free the unused entry otherwise unless DBG_HDRS_ALL).
5612         * finalize.c (GC_register_finalizer_inner): Initialize "hhdr"
5613         local variable (to prevent a compiler warning).
5614         * finalize.c (GC_register_finalizer_inner): Don't modify the data
5615         pointed by "ocd" and "ofn" in GC_register_finalizer_inner() failed
5616         (due to out of memory).
5617
5618 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5619         (ivmai124.diff - superseding diff67 partly)
5620
5621         * alloc.c (GC_set_fl_marks, GC_clear_fl_marks): Transform loop to
5622         suppress compiler "variable might be uninitialized" warnings.
5623
5624 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5625         (ivmai138.diff)
5626
5627         * Makefile.direct (DONT_USE_SIGNALANDWAIT): Add the comment for.
5628         * win32_threads.c (DONT_USE_SIGNALANDWAIT): Always define for
5629         WinCE.
5630         * win32_threads.c (THREAD_HANDLE): Cast Id (of DWORD type) to
5631         HANDLE thru word type (to avoid a compiler warning) for WinCE.
5632         * win32_threads.c (GC_marker_cv, GC_marker_Id): New static array
5633         (only if DONT_USE_SIGNALANDWAIT).
5634         * win32_threads.c (start_mark_threads): Initialize GC_marker_Id
5635         and GC_marker_cv for each helper thread (only if
5636         DONT_USE_SIGNALANDWAIT).
5637         * win32_threads.c (GC_mark_mutex_state): New static variable (only
5638         if DONT_USE_SIGNALANDWAIT).
5639         * win32_threads.c (GC_mark_mutex_waitcnt,
5640         signalObjectAndWait_func): Don't define if DONT_USE_SIGNALANDWAIT.
5641         * win32_threads.c (GC_acquire_mark_lock, GC_release_mark_lock):
5642         Use InterlockedExchange() over GC_mark_mutex_state (instead of
5643         AO_fetch_and_add()) if DONT_USE_SIGNALANDWAIT.
5644         * win32_threads.c (GC_wait_marker, GC_notify_all_marker):
5645         Implement wait/broadcast primitives using Win32 multiple events
5646         (one for each marker thread) if DONT_USE_SIGNALANDWAIT (instead of
5647         using Win32 SignalObjectAndWait).
5648         * win32_threads.c (GC_thr_init): Don't declare hK32 local
5649         variable, don't check for GC_wnt, and don't initialize
5650         signalObjectAndWait_func if DONT_USE_SIGNALANDWAIT.
5651
5652 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5653         (ivmai127.diff - superseding diff49)
5654
5655         * alloc.c (GC_finish_collection): Call GC_print_finalization_stats
5656         if GC_print_stats (after getting "done_time").
5657         * finalize.c (GC_old_dl_entries): New static variable (only if not
5658         SMALL_CONFIG).
5659         * finalize.c (GC_finalize): Save current GC_dl_entries value (only
5660         if not SMALL_CONFIG).
5661         * finalize.c (GC_print_finalization_stats): Define if and only if
5662         not SMALL_CONFIG; use GC_old_dl_entries value; use GC_log_printf()
5663         instead of GC_printf(); use "%lu" (instead of "%u") print format
5664         specifier; use unsigned long type for "ready" counter (for LP64
5665         targets).
5666         * misc.c (GC_dump): No longer call GC_print_finalization_stats()
5667         here (since it is called from GC_finish_collection()).
5668         * misc.c (STACKBASE): Remove unused macro undef (for NOSYS and
5669         ECOS).
5670
5671 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5672         (ivmai134.diff)
5673
5674         * alloc.c (GC_expand_hp): Replace GC_init_inner() call with
5675         GC_init() one.
5676         * malloc.c (GC_alloc_large, GC_generic_malloc_inner): Ditto.
5677         * mallocx.c (GC_generic_malloc_many): Ditto.
5678         * misc.c (GC_enable_incremental): Ditto.
5679         * alloc.c (GC_expand_hp): Update the comment.
5680         * mark.c (GC_obj_kinds): Ditto.
5681         * win32_threads.c (GC_allow_register_threads): Ditto.
5682         * private/gc_priv.h (GC_init_inner): Remove function declaration.
5683         * misc.c (GC_init_inner): Replace with public GC_init().
5684
5685 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5686         (ivmai126.diff)
5687
5688         * gcj_mlc.c (GC_gcj_fake_mark_proc): New static function.
5689         * gcj_mlc.c (GC_init_gcj_malloc): If mp is 0 then supply
5690         GC_gcj_fake_mark_proc (aborting with the appropriate message)
5691         instead.
5692
5693 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5694         (ivmai125.diff)
5695
5696         * os_dep.c (GC_wince_get_mem): If VirtualAlloc() returns NULL (due
5697         to out of memory) then don't increment GC_n_heap_bases and don't
5698         call VirtualAlloc() again (with MEM_COMMIT).
5699         * os_dep.c (GC_remap): Abort with a more informatory message if
5700         VirtualAlloc() fails due to out of memory; update FIXME.
5701
5702 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5703         (ivmai132.diff - superseding diff41a, diff64, diff84 partly)
5704
5705         * Makefile: Fix typo for msvc_dbg.c.
5706         * Makefile.direct: Ditto.
5707         * Makefile.am: Prefix PTHREADS, DARWIN_THREADS, WIN32_THREADS with
5708         "GC_".
5709         * Makefile.dj: Don't reference remove files (nursery.c,
5710         gc_nursery.h, gc_copy_descr.h).
5711         * NT_MAKEFILE: Don't define __STDC__ macro (no longer used).
5712         * NT_STATIC_THREADS_MAKEFILE: Ditto.
5713         * NT_THREADS_MAKEFILE: Ditto.
5714         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
5715         * NT_X64_THREADS_MAKEFILE: Ditto.
5716         * gc.mak: Ditto.
5717         * NT_MAKEFILE: Remove unnecessary -DGC_BUILD (since it is always
5718         defined in the source files).
5719         * NT_THREADS_MAKEFILE: Ditto.
5720         * NT_X64_THREADS_MAKEFILE: Ditto.
5721         * gc.mak: Ditto.
5722         * NT_X64_THREADS_MAKEFILE: Fix typo for -DGC_NOT_DLL.
5723         * NT_STATIC_THREADS_MAKEFILE: Replace GC_WIN32_THREADS with
5724         GC_THREADS.
5725         * NT_THREADS_MAKEFILE: Ditto.
5726         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
5727         * NT_X64_THREADS_MAKEFILE: Ditto.
5728         * gc.mak: Ditto.
5729         * NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE to suppress the
5730         compiler warnings.
5731         * NT_STATIC_THREADS_MAKEFILE: Ditto.
5732         * NT_X64_STATIC_THREADS_MAKEFILE: Place -D_CRT_SECURE_NO_DEPRECATE
5733         before "$*.C" (and "$*.CPP").
5734         * NT_X64_THREADS_MAKEFILE: Ditto.
5735
5736 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
5737         (ivmai131.diff - superseding diff83, diff84 partly)
5738
5739         * doc/README.solaris2: Replace GC_SOLARIS_THREADS with GC_THREADS.
5740         * doc/README.win32: Replace GC_WIN32_THREADS with GC_THREADS.
5741         * doc/README.win64: Add info about mingw-w64; add note for VC++
5742         warnings suppression.
5743
5744 2009-09-15  Hans Boehm <Hans.Boehm@hp.com> (Mostly Juan Jose Garcia-Ripoll)
5745         (Also similar to, but not the same as, Ivan's diff104_cvs)
5746
5747         * os_dep.c (GC_forward_exception): Fix logic in several places.
5748         (OSX-specific)
5749
5750 2009-09-15  Ivan Maidanski <ivmai@mail.ru>
5751         (ivmai137v2.diff)
5752
5753         * include/private/gc_priv.h (MAX_HEAP_SECTS): Guard with ifndef.
5754
5755 2009-09-14  Ivan Maidanski <ivmai@mail.ru>
5756         (ivmai136v2.diff)
5757
5758         * Makefile.direct: Copy missing information for -DSHORT_DBG_HDRS
5759         from Makefile.
5760         * Makefile: Remove the information about "define arguments" (which
5761         is incomplete and outdated compared to that in Makefile.direct);
5762         add help reference to Makefile.direct.
5763         * Makefile.dj: Ditto.
5764
5765 2009-09-14  Ivan Maidanski <ivmai@mail.ru>
5766         (ivmai135.diff)
5767
5768         * alloc.c (world_stopped_total_time, world_stopped_total_divisor):
5769         Replace "STATIC" with "static" in the definition (since the
5770         symbols aren't prefixed with "GC_").
5771         * win32_threads.c (marker_sp, marker_bsp, marker_last_stack_min,
5772         start_mark_threads, mark_mutex, builder_cv, mark_cv,
5773         mark_mutex_event, signalObjectAndWait_func, main_thread_start):
5774         Ditto.
5775         * pthread_support.c (GC_wait_builder): Define as STATIC.
5776         * win32_threads.c (GC_wait_builder): Ditto.
5777
5778 2009-09-14  Ivan Maidanski <ivmai@mail.ru>
5779         (ivmai133.diff)
5780
5781         * misc.c (GC_get_heap_size_inner, GC_get_free_bytes_inner): New
5782         API function.
5783         * include/gc_pmark.h (GC_get_heap_size_inner,
5784         GC_get_free_bytes_inner): New function declaration.
5785
5786 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
5787         (ivmai121.diff)
5788
5789         * include/gc.h: Recognize __CEGCC__ (as a synonym for _WIN32_WCE).
5790         * include/gc_config_macros.h: Ditto.
5791         * include/gc.h (GC_MAXIMUM_HEAP_SIZE): Recognize new macro.
5792         * include/gc.h (GC_INIT_CONF_MAXIMUM_HEAP_SIZE): New macro (for
5793         internal use).
5794         * include/gc_config_macros.h: Always include stddef.h if GCC.
5795         * include/gc_config_macros.h (GC_API): Define for CeGCC in the
5796         same way as for MinGW.
5797         * include/gc_config_macros.h (GC_API): Group the definition for
5798         all cases together (check for GC_DLL only once).
5799         * include/gc_pthread_redirects.h: Group non-Darwin code together.
5800         * tests/test.c: Recognize GC_PRINT_VERBOSE_STATS (only if GC_DLL).
5801
5802 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
5803         (ivmai120a.diff, ivmai120b.diff)
5804
5805         * Makefile.direct (GC_PTHREADS_PARAMARK, GC_IGNORE_GCJ_INFO,
5806         GC_PRINT_VERBOSE_STATS, GC_DONT_EXPAND, GC_INITIAL_HEAP_SIZE,
5807         GC_FREE_SPACE_DIVISOR, GC_TIME_LIMIT, GC_FULL_FREQ): Add the
5808         comment for.
5809         * misc.c (GC_init_inner): Recognize GC_PRINT_VERBOSE_STATS (new
5810         macro).
5811         * dyn_load.c (GC_wnt): Change definition to TRUE for WinCE; add
5812         FIXME and the comment for WinCE.
5813         * gcj_mlc.c (GC_init_gcj_malloc): Recognize GC_IGNORE_GCJ_INFO
5814         (new macro).
5815         * include/gc.h (GC_HAVE_BUILTIN_BACKTRACE): Don't define for VC++
5816         WinCE (since backtrace() is unimplemented).
5817         * include/private/gc_priv.h (GC_n_heap_bases): Remove declaration
5818         (since static).
5819         * os_dep.c (GC_n_heap_bases): Define as STATIC; move the
5820         definition to be above GC_is_heap_base().
5821         * include/private/gcconfig.h: Don't define NOSYS for WinCE on ARM
5822         (both for MinGW and CeGCC toolchains).
5823         * include/private/gcconfig.h: Recognize __CEGCC__ and
5824         __MINGW32CE__ (as synonyms for __WIN32_WCE).
5825         * include/private/gcconfig.h: If SH4 then don't set config
5826         parameters for SH.
5827         * include/private/thread_local_alloc.h (GC_key_create): Don't
5828         abort on failures, just return -1 in these cases (this also
5829         prevents compilation error for targets where ABORT is defined
5830         indirectly as an inline assembler sequence).
5831         * mark.c (WRAP_MARK_SOME): Also define for WinCE; add FIXME for
5832         the GCC-based cross-compiler.
5833         * mark.c (ext_ex_regn, mark_ex_handler): Don't define unless
5834         WRAP_MARK_SOME is defined; define also for WinCE case; don't
5835         check for _WIN64 (since WRAP_MARK_SOME is undefined for it).
5836         * mark.c (GC_mark_some): Use __try/__except also for WinCE; update
5837         the comment.
5838         * misc.c: Include signal.h after gc_pmark.h included; check for
5839         MSWINCE instead of _WIN32_WCE.
5840         * misc.c (GC_init_inner): Remove duplicate GC_setpagesize() call.
5841         * misc.c: Don't include <crtdbg.h> for WinCE targets.
5842         * misc.c (GC_write): Define _MAX_PATH if undefined (workaround for
5843         CeGCC toolchain).
5844         * misc.c (GC_write): Use OutputDebugStringW() instead of
5845         _CrtDbgReport() for WinCE targets.
5846         * os_dep.c (GC_least_described_address): Define as STATIC.
5847         * os_dep.c (GC_register_data_segments): Fix code indentation.
5848         * os_dep.c (GC_wince_get_mem): Initialize "result" local variable
5849         (to prevent a compiler warning).
5850         * os_dep.c (GC_dirty_init): Add comment for WinCE target.
5851         * tests/test.c: Don't include winbase.h directly if GCC for WinCE,
5852         include assert.h instead.
5853         * tests/test.c (tiny_reverse_test): Define and use
5854         TINY_REVERSE_UPPER_VALUE macro (4 if VERY_SMALL_CONFIG else 10);
5855         useful for WinCE.
5856         * win32_threads.c (GC_Thread_Rep): Don't declare "handle" field
5857         for WinCE (since thread Id is used as a "real" thread handle).
5858         * win32_threads.c (THREAD_HANDLE): New macro.
5859         * win32_threads.c (GC_register_my_thread_inner): Don't recognize
5860         DONT_IMPORT_GETCURTHREAD anymore; don't record thread handle on
5861         WinCE.
5862         * Makefile.direct (DONT_IMPORT_GETCURTHREAD): Remove comment for.
5863         * win32_threads.c (UNPROTECT, GC_fault_handler_lock): Don't check
5864         for MSWINCE.
5865         * win32_threads.c (GC_delete_gc_thread, GC_delete_thread): Don't
5866         close thread handle on WinCE (since it's a thread Id).
5867         * win32_threads.c (GC_suspend): Don't check for MSWINCE in the
5868         MPROTECT-related code (for the case if MPROTECT_VDB would be
5869         implemented for WinCE).
5870         * win32_threads.c (GC_suspend, GC_start_world, GC_push_stack_for):
5871         Use THREAD_HANDLE(t) to obtain thread handle.
5872         * win32_threads.c (GC_PTHREADS_PARAMARK): New macro recognized;
5873         implicitly define GC_PTHREADS_PARAMARK if GC_PTHREADS; include
5874         pthread.h; define NUMERIC_THREAD_ID(id) if undefined yet; replace
5875         GC_PTHREADS with GC_PTHREADS_PARAMARK where appropriate (for the
5876         parallel mark support).
5877         * win32_threads.c (start_mark_threads): Use int type for "i" local
5878         variable (instead of "unsigned") to prevent a compiler warning.
5879         * win32_threads.c (start_mark_threads): Don't check CreateThread()
5880         result for -1; call CloseHandle() for the handle created by
5881         CreateThread() (on WinCE); don't use errno (since errno.h is
5882         missing on some targets like WinCE) when printing warning on a
5883         marker thread creation failure.
5884         * win32_threads.c (signalObjectAndWait_func): Define for WinCE.
5885         * win32_threads.c (GC_wait_marker): Remove unnecessary assertion
5886         for non-zero signalObjectAndWait_func (to make the code compilable
5887         for WinCE).
5888         * win32_threads.c (GC_thr_init): Allow PARALLEL_MARK for WinCE;
5889         use GC_sysinfo to get processors count if WinCE; don't check for
5890         SignalObjectAndWait() if WinCE; replace GC_PTHREADS with
5891         GC_PTHREADS_PARAMARK.
5892         * win32_threads.c (GC_thr_init): Recognize GC_MIN_MARKERS new
5893         macro (useful for testing parallel marking on WinCE).
5894         * win32_threads.c (GC_win32_start, main_thread_start): Define as
5895         STATIC.
5896         * win32_threads.c: Don't define main_thread_args,
5897         main_thread_start(), WinMain() for WinCE if GC_DLL.
5898         * win32_threads.c (WINCE_MAIN_STACK_SIZE): Remove useless macro
5899         (since the stack size parameter is ignored on WinCE).
5900         * win32_threads.c (main_thread_start): Remove forward declaration;
5901         place its definition before WinMain() one.
5902         * win32_threads.c (WinMain): Abort if GC_CreateThread() or
5903         WaitForSingleObject() failed (for the main thread).
5904
5905 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
5906         (diff118_cvs - superseding diff53)
5907
5908         * allchblk.c (MUNMAP_THRESHOLD): Move macro definition out of
5909         a function.
5910         * allchblk.c (GC_unmap_threshold): New global variable definition
5911         (initialized to MUNMAP_THRESHOLD).
5912         * allchblk.c (GC_unmap_old): Use GC_unmap_threshold instead of
5913         MUNMAP_THRESHOLD; skip unmapping if GC_unmap_threshold is 0.
5914         * doc/README.environment (GC_UNMAP_THRESHOLD): Add information.
5915         * misc.c (GC_unmap_threshold): New variable declaration.
5916         * misc.c (GC_init_inner): Recognize "GC_UNMAP_THRESHOLD"
5917         environment variable to set GC_unmap_threshold value (only if
5918         USE_MUNMAP).
5919
5920 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
5921         (diff117)
5922
5923         * dbg_mlc.c (OFN_UNSET): New macro (to detect
5924         GC_register_finalizer() failures).
5925         * dbg_mlc.c (store_old): Add a check for register_finalizer()
5926         failure caused by an out-of-memory event (leave *ofn and *ocd
5927         unmodified in that case).
5928         * dbg_mlc.c (GC_debug_register_finalizer,
5929         GC_debug_register_finalizer_no_order,
5930         GC_debug_register_finalizer_unreachable,
5931         GC_debug_register_finalizer_ignore_self): Initialize my_old_fn
5932         to OFN_UNSET; clear *ocd and *ofn for non-heap objects (the same
5933         as in GC_register_finalizer_inner()).
5934
5935 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
5936         (diff116a, diff116b, diff116c)
5937
5938         * Makefile.direct (GC_DLL): Add the comment for.
5939         * doc/README.macros: Fix a typo.
5940         * doc/README.macros (_DLL, GC_DLL, GC_NOT_DLL): Update info.
5941         * doc/README.macros (__STDC__): Remove info.
5942         * dbg_mlc.c (GC_get_back_ptr_info, GC_generate_random_heap_address,
5943         GC_generate_random_valid_address, GC_print_backtrace,
5944         GC_generate_random_backtrace, GC_register_describe_type_fn): Add
5945         GC_API and GC_CALL to function definition.
5946         * malloc.c (GC_generic_malloc): Ditto.
5947         * mallocx.c (GC_incr_bytes_allocd, GC_incr_bytes_freed): Ditto.
5948         * mark.c (GC_mark_and_push): Ditto.
5949         * misc.c (GC_new_free_list_inner, GC_new_free_list,
5950         GC_new_kind_inner, GC_new_kind, GC_new_proc_inner, GC_new_proc):
5951         Ditto.
5952         * include/gc_backptr.h (GC_get_back_ptr_info,
5953         GC_generate_random_heap_address, GC_generate_random_valid_address,
5954         GC_generate_random_backtrace, GC_print_backtrace): Add GC_API and
5955         GC_CALL to function prototype.
5956         * include/gc_mark.h (GC_mark_and_push, GC_new_free_list,
5957         GC_new_free_list_inner, GC_new_kind, GC_new_kind_inner,
5958         GC_new_proc, GC_new_proc_inner, GC_generic_malloc,
5959         GC_register_describe_type_fn): Ditto.
5960         * include/new_gc_alloc.h (GC_incr_bytes_allocd, GC_incr_mem_freed,
5961         GC_generic_malloc_words_small): Ditto.
5962         * gc_cpp.cc: Include "config.h" (if HAVE_CONFIG_H defined).
5963         * include/private/gc_pmark.h: Ditto.
5964         * include/private/gc_priv.h: Ditto.
5965         * tests/test.c: Ditto.
5966         * gc_cpp.cc: Define GC_BUILD.
5967         * include/private/gc_pmark.h: Ditto.
5968         * include/private/gc_priv.h: Ditto.
5969         * gc_dlopen.c (WRAP_FUNC, REAL_FUNC): New macro.
5970         * gc_dlopen.c (dlopen): Add GC_API to the wrapper function
5971         definition.
5972         * pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
5973         GC_pthread_join, GC_pthread_detach, pthread_sigmask, pthread_join,
5974         pthread_detach, pthread_create): Ditto.
5975         * win32_threads.c (GC_pthread_join, GC_pthread_create,
5976         GC_pthread_sigmask, GC_pthread_detach): Ditto.
5977         * gc_dlopen.c (dlopen): Use WRAP_FUNC and REAL_FUNC macros.
5978         * include/gc_backptr.h: Include "gc.h".
5979         * include/gc_backptr.h: Use extern "C" for the exported functions.
5980         * include/gc_mark.h: Ditto.
5981         * include/gc_config_macros.h (GC_THREADS): Define the macro if any
5982         GC_XXX_THREADS is defined.
5983         * include/gc_config_macros.h (_PTHREADS, _POSIX4A_DRAFT10_SOURCE):
5984         Move the definitions below the place where GC_NETBSD_THREADS and
5985         GC_DGUX386_THREADS are defined.
5986         * include/gc_config_macros.h (GC_DLL): Don't define (even if _DLL
5987         is defined) for GCC.
5988         * include/gc_config_macros.h (GC_API): Define for Cygwin (in the
5989         same way as for VC++); define for GCC v4+ (other than already
5990         recognized MinGW/Cygwin) as a "default" visibility attribute if
5991         GC_DLL is defined.
5992         * include/gc_config_macros.h (GC_ATTR_MALLOC, GC_ATTR_ALLOC_SIZE):
5993         New macro.
5994         * include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup,
5995         GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign,
5996         GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page,
5997         GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
5998         GC_debug_malloc_atomic, GC_debug_strdup,
5999         GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn,
6000         GC_debug_malloc_ignore_off_page,
6001         GC_debug_malloc_atomic_ignore_off_page,
6002         GC_debug_malloc_replacement): Add GC_ATTR_MALLOC attribute.
6003         * include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc,
6004         GC_gcj_malloc_ignore_off_page): Ditto.
6005         * include/gc.h (GC_malloc, GC_malloc_atomic,
6006         GC_malloc_uncollectable, GC_malloc_stubborn,
6007         GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page,
6008         GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
6009         GC_debug_malloc_atomic, GC_debug_malloc_uncollectable,
6010         GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page,
6011         GC_debug_malloc_atomic_ignore_off_page,
6012         GC_debug_malloc_replacement: Add GC_ATTR_ALLOC_SIZE attribute
6013         (for the first argument).
6014         * include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc,
6015         GC_gcj_malloc_ignore_off_page): Ditto.
6016         * include/gc.h (GC_memalign, GC_realloc, GC_debug_realloc,
6017         GC_debug_realloc_replacement): Add GC_ATTR_ALLOC_SIZE attribute
6018         (for the second argument).
6019         * include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup,
6020         GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign,
6021         GC_malloc_atomic_uncollectable, GC_free, GC_base, GC_size,
6022         GC_realloc, GC_expand_hp, GC_set_max_heap_size,
6023         GC_exclude_static_roots, GC_add_roots, GC_remove_roots,
6024         GC_register_displacement, GC_debug_register_displacement,
6025         GC_try_to_collect, GC_malloc_ignore_off_page,
6026         GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
6027         GC_debug_malloc_atomic, GC_debug_strdup,
6028         GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn,
6029         GC_debug_malloc_ignore_off_page,
6030         GC_debug_malloc_atomic_ignore_off_page, GC_debug_free,
6031         GC_debug_realloc, GC_debug_malloc_replacement,
6032         GC_debug_realloc_replacement, GC_finalization_proc,
6033         GC_register_finalizer, GC_debug_register_finalizer,
6034         GC_register_finalizer_ignore_self,
6035         GC_debug_register_finalizer_ignore_self,
6036         GC_register_finalizer_no_order,
6037         GC_debug_register_finalizer_no_order,
6038         GC_register_finalizer_unreachable,
6039         GC_debug_register_finalizer_unreachable,
6040         GC_register_disappearing_link,
6041         GC_general_register_disappearing_link,
6042         GC_unregister_disappearing_link, GC_noop1, GC_warn_proc,
6043         GC_set_warn_proc, GC_ignore_warn_proc, GC_fn_type,
6044         GC_call_with_alloc_lock, GC_stack_base_func,
6045         GC_call_with_stack_base, GC_same_obj, GC_pre_incr, GC_post_incr,
6046         GC_is_visible, GC_is_valid_displacement, GC_same_obj_print_proc,
6047         GC_is_valid_displacement_print_proc, GC_is_visible_print_proc,
6048         GC_malloc_many, GC_CreateThread, GC_beginthreadex,
6049         GC_endthreadex): Comment out (or remove if single and meaningless)
6050         function argument names (to avoid identifiers out of the name
6051         space).
6052         * include/gc_gcj.h (GC_init_gcj_malloc, GC_gcj_malloc,
6053         GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Ditto.
6054         * include/gc.h (GC_try_to_collect): Update the comment.
6055         * include/gc.h (GC_size, GC_register_my_thread): Add const
6056         qualifier for the argument referent.
6057         * misc.c (GC_size): Ditto.
6058         * pthread_support.c (GC_register_my_thread_inner,
6059         GC_register_my_thread): Ditto.
6060         * win32_threads.c (GC_register_my_thread_inner,
6061         GC_register_my_thread): Ditto.
6062         * include/gc.h (GC_INIT_CONF_ROOTS): New macro for internal use
6063         (define instead of GC_INIT() for Cygwin and AIX).
6064         * include/gc.h (GC_DONT_EXPAND, GC_MAX_RETRIES,
6065         GC_FREE_SPACE_DIVISOR, GC_FULL_FREQ, GC_TIME_LIMIT, GC_IGNORE_WARN,
6066         GC_INITIAL_HEAP_SIZE): Recognize new macro.
6067         * include/gc.h (GC_INIT_CONF_DONT_EXPAND, GC_INIT_CONF_MAX_RETRIES,
6068         GC_INIT_CONF_FREE_SPACE_DIVISOR, GC_INIT_CONF_FULL_FREQ,
6069         GC_INIT_CONF_TIME_LIMIT, GC_INIT_CONF_IGNORE_WARN,
6070         GC_INIT_CONF_INITIAL_HEAP_SIZE): New macro for internal use.
6071         * include/gc.h (GC_INIT): Use GC_INIT_CONF_XXX macros.
6072         * include/gc_mark.h: Prefix GC_H with '_'.
6073         * include/gc_mark.h (GC_least_plausible_heap_addr,
6074         GC_greatest_plausible_heap_addr, GC_debug_header_size): Use GC_API
6075         for the public variable declaration.
6076         * include/new_gc_alloc.h (GC_objfreelist_ptr, GC_aobjfreelist_ptr,
6077         GC_uobjfreelist_ptr, GC_auobjfreelist_ptr): Ditto.
6078         * include/gc_pthread_redirects.h (GC_pthread_create,
6079         GC_pthread_sigmask, GC_dlopen, GC_pthread_join, GC_pthread_detach):
6080         Use GC_API for the wrapper prototype.
6081         * include/gc_pthread_redirects.h (pthread_create, pthread_join,
6082         pthread_detach, pthread_sigmask, dlopen): Undefine unconditionally
6083         before redirecting.
6084         * include/new_gc_alloc.h: Replace GC_incr_mem_freed() with
6085         GC_incr_bytes_freed(); remove FIXME.
6086         * include/private/gc_priv.h (GC_make_closure,
6087         GC_debug_invoke_finalizer, GC_noop): Remove GC_API for the private
6088         function.
6089         * tests/test.c (GC_print_stats): Handle GC_DLL case regardless of
6090         the target.
6091
6092 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
6093         (diff115)
6094
6095         * finalize.c (GC_general_register_disappearing_link,
6096         GC_register_finalizer_inner): Remove unnecessary "ifdef THREADS"
6097         guard for LOCK/UNLOCK().
6098         * finalize.c (GC_general_register_disappearing_link,
6099         GC_register_finalizer_inner): Get GC_oom_fn value before releasing
6100         the lock (to prevent data races).
6101         * gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc,
6102         GC_gcj_malloc_ignore_off_page): Ditto.
6103         * mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.
6104         * include/gc_inline.h (GC_FAST_MALLOC_GRANS): Use GC_get_oom_fn()
6105         instead of GC_oom_fn (to prevent data races).
6106         * malloc.c (GC_generic_malloc): Ditto.
6107         * mallocx.c (GC_memalign): Ditto.
6108         * pthread_support.c (pthread_create): Ditto.
6109         * gcj_mlc.c (maybe_finalize): Acquire the lock before setting
6110         last_finalized_no value to prevent data races.
6111         * include/gc.h (GC_gc_no, GC_get_gc_no, GC_oom_fn, GC_set_oom_fn,
6112         GC_set_find_leak, GC_set_finalize_on_demand,
6113         GC_set_java_finalization, GC_set_finalizer_notifier,
6114         GC_set_dont_expand, GC_set_full_freq, GC_set_non_gc_bytes,
6115         GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries,
6116         GC_set_dont_precollect, GC_set_time_limit, GC_warn_proc): Refine
6117         the comment.
6118         * misc.c (GC_set_oom_fn): Ditto.
6119         * include/gc.h (GC_general_register_disappearing_link): Refine the
6120         comment (replace "soft" word with "weak").
6121         * misc.c (GC_oom_fn, GC_get_gc_no, GC_get_parallel,
6122         GC_set_finalizer_notifier, GC_set_find_leak): Add the comment.
6123         * misc.c (GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier,
6124         GC_get_finalizer_notifier): Use LOCK/UNLOCK to prevent data races.
6125
6126 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
6127         (diff114a, diff114b, diff114c)
6128
6129         * dbg_mlc.c: Guard include <errno.h> with ifndef MSWINCE; include
6130         "private/dbg_mlc.h" before it.
6131         * malloc.c: Ditto.
6132         * dbg_mlc.c (GC_debug_strdup): Use memcpy() instead of strcpy()
6133         for WinCE (since deprecated); evaluate strlen() only once; don't
6134         set errno for WinCE.
6135         * malloc.c (GC_strdup): Ditto.
6136         * dyn_load.c (GC_wnt): Define as macro (FALSE) for WinCE.
6137         * include/gc.h (GC_unregister_my_thread): Refine the comment.
6138         * include/gc.h (GC_uintptr_t, GC_beginthreadex, GC_endthreadex):
6139         Don't declare for WinCE.
6140         * include/gc.h (GC_WINMAIN_WINCE_LPTSTR): New macro (WinCE only).
6141         * include/gc.h (GC_WinMain): Remove GC_API.
6142         * include/gc.h (GC_WinMain): Use GC_WINMAIN_WINCE_LPTSTR for
6143         lpCmdLine.
6144         * tests/test.c (GC_WinMain): Ditto.
6145         * win32_threads.c (main_thread_args, GC_WinMain): Ditto.
6146         * include/gc_config_macros.h (ptrdiff_t): Guard with
6147         ifndef _PTRDIFF_T_DEFINED; define _PTRDIFF_T_DEFINED macro.
6148         * include/private/gc_locks.h: Guard include "atomic_ops.h" with
6149         ifdef GC_PTHREADS (and not GC_WIN32_THREADS).
6150         * mark.c: Include "atomic_ops.h" if PARALLEL_MARK.
6151         * thread_local_alloc.c: Include "atomic_ops.h" if GC_GCJ_SUPPORT.
6152         * win32_threads.c: Include "atomic_ops.h" if MPROTECT_VDB.
6153         * include/private/gc_locks.h: Use include "atomic_ops.h" instead
6154         of include <atomic_ops.h>.
6155         * include/private/gc_priv.h: Ditto.
6156         * include/private/gc_locks.h (GC_allocate_ml, GC_need_to_lock):
6157         Don't export (replace GC_API to "extern").
6158         * win32_threads.c (GC_allocate_ml): Don't export.
6159         * include/private/gc_priv.h (DebugBreak): Define as macro for
6160         WinCE (if not UNDER_CE and DebugBreak is not defined yet).
6161         * include/private/gc_priv.h (UNALIGNED): Rename to UNALIGNED_PTRS
6162         (since "UNALIGNED" is defined in winnt.h of WinCE).
6163         * mark.c (UNALIGNED): Ditto.
6164         * include/private/gcconfig.h (ARM32): Recognize _M_ARM and _ARM_.
6165         * include/private/gcconfig.h (ALIGNMENT): Check always defined.
6166         * include/private/gcconfig.h: Allow GC_WIN32_THREADS for WinCE.
6167         * include/private/thread_local_alloc.h: Define USE_WIN32_SPECIFIC
6168         for WinCE (since __declspec(thread) is unsupported).
6169         * include/private/thread_local_alloc.h (TLS_OUT_OF_INDEXES):
6170         Define for WinCE (if undefined).
6171         * malloc.c (GC_malloc): Remove outdated comment about disabling
6172         signals.
6173         * misc.c: Don't include <tchar.h> (since not used anymore and may
6174         break TEXT() macro defined in winnt.h).
6175         * misc.c (GC_init_inner): Don't use GetModuleHandle() and
6176         InitializeCriticalSectionAndSpinCount() for WinCE.
6177         * misc.c (GC_init_inner): Replace GetModuleHandleA() with
6178         GetModuleHandle() (and use TEXT() macro controlled by UNICODE).
6179         * misc.c (LOG_FILE): Remove unused macro; don't use _T() macro.
6180         * misc.c (GC_CreateLogFile): New static function (Win32/WinCE
6181         only); move the code from GC_write(); replace GETENV() with
6182         GetEnvironmentVariable(); replace CreateFileA() with
6183         CreateFile(); use TEXT() macro (for Unicode support); replace
6184         strcat() with memcpy() (since deprecated in WinCE).
6185         * misc.c (GC_write): Define as STATIC.
6186         * win32_threads.c (GC_attached_thread): Ditto.
6187         * misc.c (GC_write): Use GC_CreateLogFile().
6188         * misc.c: Define vsnprintf macro as StringCchVPrintfA for WinCE.
6189         * misc.c (GC_abort): Try to invoke MessageBoxA() dynamically
6190         (Win32 only) if DONT_USE_USER32_DLL is defined.
6191         * misc.c (GC_abort): Duplicate msg to GC log file (for Win32 and
6192         WinCE).
6193         * misc.c (GC_abort): Use a more user-friendly abort if
6194         NO_DEBUGGING (Win32 only).
6195         * os_dep.c: Include "atomic_ops.h" only if MPROTECT_VDB (and
6196         THREADS).
6197         * os_dep.c (detect_GetWriteWatch): Use TEXT() for GetModuleHandle
6198         (for Unicode support); check GetModuleHandle() result.
6199         * tests/test.c: Don't define assert for WinCE (since may be
6200         redefined by "assert.h" included from libatomic_ops).
6201         * tests/test.c (FAIL): Define as ABORT for all targets (except
6202         for PCR).
6203         * tests/test.c (n_tests): Don't use AO_t.
6204         * tests/test.c (check_heap_stats): Don't cast n_tests.
6205         * tests/test.c (inc_int_counter): New function (for n_tests atomic
6206         incrementation).
6207         * tests/test.c (run_one_test): Test GC_memalign() for all targets.
6208         * tests/test.c (run_one_test): Avoid unbalanced brackets in
6209         #if-#else-#endif blocks.
6210         * tests/test.c (run_one_test): Replace AO_fetch_and_add1() and
6211         private LOCK/UNLOCK with GC_call_with_alloc_lock(inc_int_counter).
6212         * tests/test.c (check_heap_stats): Replace
6213         "if (sizeof(char *) > 4)" with "#if CPP_WORDSZ == 64" to suppress
6214         "unreachable code" compiler warning.
6215         * tests/test.c (WinMain): Set cmd type to LPWSTR (for WinCE
6216         "UNDER_CE" mode); else use LPSTR type (for Win32 and WinCE).
6217         * tests/test.c (thr_window): Replace "L" string prefix with
6218         TEXT().
6219         * thread_local_alloc.c: Check THREADS is defined (to prevent other
6220         compiler errors and warnings otherwise).
6221         * tests/test.c (WinMain): Recognize GC_NO_DLLMAIN macro (for
6222         GC_use_DllMain()).
6223         * Makefile.direct (GC_NO_DLLMAIN, DONT_IMPORT_GETCURTHREAD): Add
6224         the comments for.
6225         * win32_threads.c (GC_register_my_thread_inner): Recognize
6226         DONT_IMPORT_GETCURTHREAD macro.
6227         * win32_threads.c: Recognize GC_NO_DLLMAIN macro (to exclude
6228         DllMain support if needed).
6229         * win32_threads.c (GC_NO_DLLMAIN): Define implicitly if DllMain
6230         thread registration is unsupported for a given configuration.
6231         * win32_threads.c (GC_use_DllMain): Update the comment; refine
6232         ABORT message.
6233         * win32_threads.c (GC_use_DllMain,
6234         GC_started_thread_while_stopped, GC_register_my_thread_inner,
6235         GC_lookup_thread_inner, GC_delete_gc_thread,
6236         GC_allow_register_threads, GC_lookup_pthread,
6237         GC_push_thread_structures, GC_stop_world, GC_push_all_stacks):
6238         Check for GC_NO_DLLMAIN.
6239         * win32_threads.c (GC_Thread_Rep.tm_in_use, GC_attached_thread,
6240         DllMain): Don't define if GC_NO_DLLMAIN.
6241         * win32_threads.c (GC_stop_world): Declare "i" and "max" local
6242         variables only if not GC_NO_DLLMAIN (to suppress compiler
6243         warning).
6244         * win32_threads.c (GC_mark_thread, start_mark_threads): Use
6245         CreateThread() instead of _beginthreadex() for WinCE.
6246         * win32_threads.c (MARK_THREAD_STACK_SIZE, WINCE_MAIN_STACK_SIZE):
6247         New macros defined (used by start_mark_threads(), WinMain()).
6248         * win32_threads.c (GC_thr_init): Exclude parallel-specific code on
6249         WinCE for now (since getenv(), GetProcessAffinityMask() and
6250         SignalObjectAndWait() are missing on WinCE).
6251         * win32_threads.c (GC_thr_init): replace GetModuleHandleA() with
6252         GetModuleHandle(); replace CreateEventA() with CreateEvent(); use
6253         TEXT() macro (for Unicode support).
6254
6255 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
6256         (diff113)
6257
6258         * include/gc.h (GC_has_static_roots_func): New typedef (user filter
6259         callback).
6260         * include/gc.h (GC_register_has_static_roots_callback): Use
6261         GC_has_static_roots_func type.
6262         * dyn_load.c (GC_has_static_roots,
6263         GC_register_has_static_roots_callback): Ditto.
6264         * dyn_load.c (GC_has_static_roots,
6265         GC_register_has_static_roots_callback): Define on all platforms.
6266         * dyn_load.c (GC_register_dynlib_callback,
6267         GC_register_dynamic_libraries, GC_init_dyld): Replace K&R-style
6268         functions definition with the ANSI C one.
6269         * dyn_load.c (GC_register_dynlib_callback): Use new local variable
6270         "callback" (initialized from GC_has_static_roots) to minimize data
6271         races.
6272         * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr,
6273         GC_cond_add_roots): Define as STATIC.
6274         * mark_rts.c (GC_remove_roots_inner): Ditto.
6275         * dyn_load.c (GC_dyld_image_add): Don't call GC_add_roots() for
6276         sections smaller than pointer size (just to avoid acquiring the
6277         lock unnecessarily).
6278         * dyn_load.c (GC_dyld_name_for_hdr): Define unconditionally (not
6279         only for DARWIN_DEBUG).
6280         * dyn_load.c (GC_dyld_image_add): Replace GC_add_roots() call with
6281         LOCK + GC_add_roots_inner() + UNLOCK.
6282         * dyn_load.c (GC_dyld_image_add): Call GC_has_static_roots() user
6283         callback (if set) holding the lock; if it returns 0 then don't call
6284         GC_add_roots_inner() for that region.
6285         * dyn_load.c (GC_register_has_static_roots_callback): Put
6286         "callback" value to GC_has_static_roots on all platforms.
6287         * dyn_load.c (GC_has_static_roots): Update the comments.
6288         * include/gc.h (GC_exclude_static_roots, GC_add_roots,
6289         GC_remove_roots, GC_register_has_static_roots_callback): Ditto.
6290         * include/private/gc_priv.h (struct roots): Ditto.
6291         * include/private/gc_priv.h (GC_remove_roots_inner): Move prototype
6292         to mark_rts.c and declare it as STATIC.
6293         * include/private/gc_priv.h (GC_exclude_static_roots_inner): New
6294         prototype.
6295         * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Use
6296         GC_exclude_static_roots_inner() instead of GC_exclude_static_roots.
6297         * misc.c (GC_init_inner): Ditto.
6298         * mark_rts.c (GC_exclude_static_roots_inner): New function (move
6299         all the code from GC_exclude_static_roots(); add the comment.
6300         * mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots_inner):
6301         add alignment assertion for the lower bound; add assertion for the
6302         lower bound to be less than the upper one.
6303         * mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots): Adjust
6304         the upper bound (round down to be of a pointer-aligned value);
6305         return in case of an empty range.
6306         * mark_rts.c (GC_exclude_static_roots): Acquire the lock and call
6307         GC_exclude_static_roots_inner().
6308         * mark_rts.c (GC_remove_roots): Quickly check the bounds and return
6309         in case of a do-nothing case (before acquiring the lock).
6310
6311 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
6312         (diff112)
6313
6314         * finalize.c (GC_fail_count): New external variable declaration.
6315         * finalize.c (GC_reset_finalizer_nested,
6316         GC_check_finalizer_nested): New function declarations (if THREADS
6317         only).
6318         * finalize.c (GC_finalizer_nested, GC_finalizer_skipped): New
6319         static global variables (used internally by GC_finalize() and
6320         GC_check_finalizer_nested()).
6321         * finalize.c (GC_check_finalizer_nested): New static function
6322         definition (only if not THREADS, used internally by
6323         GC_notify_or_invoke_finalizers() to minimize the probability of
6324         a deep recursion when a client finalizer tries to allocate GC
6325         memory).
6326         * finalize.c (GC_finalize): Reset GC_finalizer_nested value (or
6327         call GC_reset_finalizer_nested()) if last heap expansion failed.
6328         * finalize.c (GC_notify_or_invoke_finalizers): Access GC_gc_no,
6329         GC_finalizer_now, GC_finalize_on_demand, GC_finalizer_notifier,
6330         last_finalizer_notification variables holding the lock (to avoid
6331         data races).
6332         * finalize.c (GC_finalizer_notifier): Add comment.
6333         * finalize.c (GC_notify_or_invoke_finalizers): Add "quick" check
6334         for an empty finalization queue (only if THREADS and not
6335         KEEP_BACK_PTRS/MAKE_BACK_GRAPH).
6336         * finalize.c (GC_notify_or_invoke_finalizers): Call
6337         GC_check_finalizer_nested() and skip GC_invoke_finalizers() call
6338         if appropriate.
6339         * include/private/pthread_support.h (GC_Thread_Rep): Add unsigned
6340         finalizer_nested and finalizer_skipped fields (for internal use
6341         by the multi-threaded GC_check_finalizer_nested()).
6342         * win32_threads.c (GC_Thread_Rep): Ditto.
6343         * pthread_support.c (GC_reset_finalizer_nested,
6344         GC_check_finalizer_nested): New function definitions (the
6345         multi-threaded variants of that in finalize.c).
6346         * win32_threads.c (GC_reset_finalizer_nested,
6347         GC_check_finalizer_nested): Ditto.
6348
6349 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
6350         (diff103_cvs - resembling diff78, diff88_cvs, diff99_cvs,
6351         diff100_cvs, diff101_cvs, diff102_cvs)
6352
6353         * alloc.c (GC_stopped_mark): Remove GC_log_printf("") (not needed
6354         anymore and GCC produces a warning for it).
6355         * alloc.c (GC_stopped_mark): Adjust printf argument type
6356         specifier.
6357         * backgraph.c: Include dbg_mlc.h before ifdef MAKE_BACK_GRAPH (for
6358         the case when the configuration information comes from aconfig
6359         file).
6360         * checksums.c: Ditto (for gc_priv.h and CHECKSUMS, respectively).
6361         * include/gc_allocator.h (GC_ATTR_UNUSED): Use "__unused__"
6362         keyword instead of "unused".
6363         * include/gc_allocator.h: Fix typos in comments.
6364         * thread_local_alloc.c: Ditto.
6365         * include/javaxfc.h (GC_finalize_all): Update comment.
6366         * include/private/gc_priv.h (GC_API_PRIV): New macro (defined as
6367         GC_API and serves only as a marker for the private but exported
6368         symbols used by test.c only).
6369         * include/private/gc_priv.h (GC_abort, GC_arrays, GC_is_marked,
6370         GC_printf, GC_err_printf, GC_log_printf): Replace GC_API decl with
6371         GC_API_PRIV one.
6372         * include/private/gc_priv.h (GC_fo_entries): Don't export it
6373         outside a DLL.
6374         * include/private/gc_priv.h (GC_ATTR_FORMAT_PRINTF): New macro
6375         designated to check the arguments correctness of printf-like
6376         functions (currently works only for GCC v3+).
6377         * include/private/gc_priv.h (GC_printf, GC_err_printf,
6378         GC_log_printf): Use GC_ATTR_FORMAT_PRINTF attribute.
6379
6380 2009-09-03  Hans Boehm <Hans.Boehm@hp.com> (really Loren J. Rittle)
6381
6382         * dyn_load.c (HAVE_DL_ITERATE_PHDR): Break definition from use.
6383         Define for FreeBSD 7.0+.
6384
6385 2009-09-02  Hans Boehm <Hans.Boehm@hp.com> (with help from Victor Ivrii and
6386                                             others)
6387
6388         * mach_dep.c: Don't include ucontext.h with NO_GETCONTEXT.
6389
6390 2009-08-19  Hans Boehm <Hans.Boehm@hp.com>
6391
6392         * include/gc_gcj.h (GC_init_gcj_malloc): Improve descriptive
6393         comment.
6394
6395 2009-08-11  Hans Boehm <Hans.Boehm@hp.com>
6396         (Replacement for Ivan Maidanski's diff99_cvs.  Hopefully fixes
6397         the same bugs, and then some.)
6398
6399         * allchblk.c (GC_merge_unmapped): Don't assume that adjacent
6400         free blocks have different mapping status.  Correctly handle gap
6401         between blocks.
6402         (GC_split_block): Remove dead code setting hb_flags.  Add comment.
6403         (GC_allochblk): Split blocks also in generational-only mode.
6404         * os_dep.c (GC_unmap_gap): Don't really use munmap.
6405
6406 2009-08-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6407         (Mistakenly omitted from last check-in)
6408
6409         * include/private/gc_priv.h (GC_unmapped_bytes): Define as 0 for
6410         not USE_MUNMAP case.
6411
6412 2009-08-07  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6413         diff111 (supersedes diff101_cvs which, in turn, resembles diff52,
6414         diff75, diff83 partly)
6415
6416         * Makefile.direct (MARK_BIT_PER_OBJ, PRINT_BLACK_LIST,
6417         USE_PROC_FOR_LIBRARIES): Fix typo in the comments.
6418         * Makefile.direct (USE_MMAP, USE_MUNMAP, THREAD_LOCAL_ALLOC,
6419         PARALLEL_MARK, STATIC): Update the comments.
6420         * include/private/gcconfig.h (GC_PREFER_MPROTECT_VDB): New macro
6421         recognized (only if MPROTECT_VDB).
6422         * Makefile.direct (DONT_USE_USER32_DLL, GC_PREFER_MPROTECT_VDB):
6423         Add the comments for.
6424         * os_dep.c (detect_GetWriteWatch): Recognize "GC_USE_GETWRITEWATCH"
6425         environment variable (only if MPROTECT_VDB, if the variable is
6426         unset when GC_PREFER_MPROTECT_VDB macro controls the strategy).
6427         * doc/README.environment (GC_USE_GETWRITEWATCH): New variable.
6428         * include/private/gcconfig.h (MPROTECT_VDB): Add FIXME for
6429         USE_MUNMAP and PARALLEL_MARK cases (to relax the conditions in
6430         the future).
6431         * misc.c (GC_get_heap_size, GC_get_free_bytes): Ignore the memory
6432         space returned to OS (GC_unmapped_bytes).
6433         * include/gc.h (GC_get_heap_size, GC_get_free_bytes): Update the
6434         comments.
6435         * misc.c (GC_get_unmapped_bytes): New API function.
6436         * include/gc.h (GC_get_unmapped_bytes): New API prototype.
6437         * os_dep.c (GC_dirty_init): Move "ifdef GWW_VDB" block out of
6438         "ifdef MSWIN32" one (for Cygwin).
6439
6440 2009-08-01  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6441         diff100_cvs (diff51 and diff55, partly)
6442
6443         * pthread_support.c (GC_allow_register_threads): New API function.
6444         * win32_threads.c (GC_allow_register_threads): Ditto.
6445         * include/gc.h (GC_allow_register_threads): New API prototype.
6446         * include/gc.h (GC_register_my_thread, GC_unregister_my_thread):
6447         Update the comments.
6448         * pthread_support.c (GC_register_my_thread): Check the collector
6449         is in the multi-threaded mode.
6450         * win32_threads.c (GC_register_my_thread): Ditto.
6451
6452 2009-07-10  Hans Boehm <Hans.Boehm@hp.com>
6453
6454         * finalize.c (GC_finalize_all): Always call GC_invoke_finalizers
6455         instead, following Ivan's original patch.
6456
6457 2009-06-20  Hans Boehm <Hans.Boehm@hp.com>
6458
6459         * allchblk.c (GC_allochblk_nth): Add assertion.
6460         * checksums.c: Add GC_record_fault, GC_was_faulted,
6461         CC_n_faulted_dirty_errors.
6462         (GC_check_dirty): Remove register declarations, print
6463         dirty bit errors on faulted pages.
6464         * os_dep.c (GC_write_fault_handler): Call GC_record_fault().
6465         * os_dep.c (GC_remove_protection): Compute index correctly.
6466
6467 2009-06-12  Hans Boehm <Hans.Boehm@hp.com>
6468
6469         * include/gc_version.h, configure.ac, doc/README:
6470         Change to version 7.2alpha3.
6471         * configure: Regenerate.
6472
6473 [7.2alpha2]
6474
6475 2009-06-12  Hans Boehm <Hans.Boehm@hp.com>
6476
6477         * include/gc_version.h, configure.ac, doc/README:
6478         Change to version 7.2alpha2.
6479         * configure: Regenerate.
6480
6481 2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
6482         diff98_cvs(resembling diff3, diff27, diff59, diff61, diff66,
6483         diff73 partly)
6484
6485         * dbg_mlc.c (GC_print_smashed_obj): Convert a group of printf()
6486         calls into a single one (for output atomicity).
6487         * typd_mlc.c (GC_calloc_explicitly_typed): Don't declare and use
6488         GC_finalization_failures variable; check the result of
6489         GC_general_register_disappearing_link() (for lack of memory)
6490         instead.
6491         * finalize.c (GC_finalization_failures): Remove unused global
6492         variable.
6493         * finalize.c (GC_general_register_disappearing_link,
6494         GC_general_register_disappearing_link): Don't update the value of
6495         GC_finalization_failures (since unused).
6496         * include/private/gc_pmark.h (PUSH_ONE_CHECKED_STACK,
6497         GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP): The first parameter is of
6498         word type now (as FIXUP_POINTER requires numeric argument).
6499         * finalize.c (GC_ignore_self_finalize_mark_proc): GC_PUSH_ONE_HEAP
6500         requires the first parameter of word type.
6501         * mark.c (PUSH_GRANULE): Ditto.
6502         * mark.c (GC_push_one, GC_push_all_eager): Ditto (for
6503         GC_PUSH_ONE_STACK).
6504         * finalize.c (GC_finalize_all): Call GC_invoke_finalizers() or
6505         GC_finalizer_notifier directly, instead
6506         of GC_INVOKE_FINALIZERS() to prevent infinite looping.
6507         * include/javaxfc.h: Clarify GC_finalize_all comment.
6508         * gcj_mlc.c: Include gc_pmark.h before "ifdef GC_GCJ_SUPPORT" (not
6509         after) for configuration information.
6510         * gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Add comment.
6511         * gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Check "op" local
6512         variable for NULL before dereferencing it, return GC_oom_fn() in
6513         this case.
6514         * typd_mlc.c (GC_malloc_explicitly_typed,
6515         GC_malloc_explicitly_typed_ignore_off_page): Transform the code to
6516         suppress compiler warning (for uninitialized "lg" variable).
6517
6518 2009-06-12  Hans Boehm <Hans.Boehm@hp.com>
6519
6520         * win32_threads.c (GC_unregister_my_thread): add false assertion
6521         in unreachable code.
6522
6523 2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6524         diff97_cvs (resembling diff43, diff51, diff67, diff76, diff83 partly)
6525
6526         * pthread_support.c (GC_inner_start_routine): Don't release the
6527         GC lock between GC_register_my_thread_inner() and
6528         GC_init_thread_local() calls (post the "registered" even after
6529         calling GC_init_thread_local()).
6530         * win32_threads.c (GC_register_my_thread, GC_unregister_my_thread):
6531         Use GC_lookup_thread_inner() instead of GC_lookup_thread() and
6532         acquire the GC lock only once.
6533         * win32_threads.c (GC_thr_init): Call GC_register_my_thread_inner()
6534         directly instead of GC_register_my_thread() since I_HOLD_LOCK
6535         and our (main) thread is not registered yet (add assertion for it).
6536         * win32_threads.c (GC_init_parallel): Call GC_lookup_thread_inner()
6537         directly instead of GC_lookup_thread() (since I_HOLD_LOCK).
6538         * win32_threads.c (GC_lookup_thread): Remove unused function.
6539         * win32_threads.c: Remove "#error GC_DLL untested with Cygwin".
6540         * win32_threads.c (GC_win32_dll_threads): Define as FALSE macro
6541         also if THREAD_LOCAL_ALLOC or GC_PTHREADS.
6542         * win32_threads.c (GC_use_DllMain): Call ABORT also if GC_PTHREADS
6543         (for Cygwin).
6544         * win32_threads.c (GC_push_stack_for): Add parentheses around "&&"
6545         (inside GC_ASSERT) to prevent compiler warning.
6546         * win32_threads.c (GC_push_all_stacks): Remove FIXME for
6547         PARALLEL_MARK.
6548         * win32_threads.c (MAX_MARKERS, GC_markers): Move the definitions
6549         to a place before GC_get_next_stack().
6550         * win32_threads.c (marker_sp, marker_bsp): New static arrays (same
6551         as in pthread_support.c).
6552         * win32_threads.c (marker_last_stack_min): New static arrays (the
6553         same semantics as for last_stack_min of GC_Thread_Rep).
6554         * win32_threads.c (GC_get_next_stack): Handle marker threads.
6555         * win32_threads.c (GC_mark_thread): Save the current stack pointer
6556         to marker_[b]sp.
6557         * win32_threads.c (start_mark_threads): Initialize
6558         marker_last_stack_min elements (to "unset" value).
6559
6560 2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6561         (diff96_cvs, partly from diff45 and diff75)
6562
6563         * misc.c (GC_set_oom_fn, GC_set_all_interior_pointers,
6564         GC_set_finalize_on_demand, GC_set_java_finalization,
6565         GC_set_finalizer_notifier, GC_set_dont_expand, GC_set_full_freq,
6566         GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries,
6567         GC_set_dont_precollect, GC_set_time_limit, GC_set_warn_proc):
6568         Change return type to void (these API functions no longer return
6569         the old value).
6570         * include/gc.h: Ditto (for prototypes).
6571         * tests/test.c (main, WinMain, test): Remove explicit cast to void
6572         for GC_set_warn_proc().
6573         * misc.c (GC_get_oom_fn, GC_get_all_interior_pointers,
6574         GC_get_finalize_on_demand, GC_get_java_finalization,
6575         GC_get_finalizer_notifier, GC_get_dont_expand, GC_get_full_freq,
6576         GC_get_no_dls, GC_get_free_space_divisor, GC_get_max_retries,
6577         GC_get_dont_precollect, GC_get_time_limit, GC_get_warn_proc): New
6578         API functions (to get the current value of the corresponding R/W
6579         public variables).
6580         * include/gc.h: Ditto (for prototypes).
6581         * include/gc.h (GC_set_warn_proc, GC_set_free_space_divisor):
6582         Update the comment.
6583         * misc.c (GC_ignore_warn_proc): New API call-back function.
6584         * include/gc.h (GC_ignore_warn_proc): Ditto (for the prototype).
6585         * misc.c (GC_set_find_leak, GC_get_find_leak, GC_set_non_gc_bytes,
6586         GC_get_non_gc_bytes): New API setter and getter functions (for the
6587         public GC_find_leak and GC_non_gc_bytes variables, respectively).
6588         * include/gc.h: Ditto (for prototypes).
6589         * include/gc.h (GC_memalign): Add proto to GC API.
6590         * mallocx.c (GC_memalign): Use GC_API, GC_CALL for the definition.
6591         * tests/test.c (run_one_test): Test GC_memalign() on Win32 too,
6592         remove GC_memalign() proto.
6593         * misc.c (GC_write): Use multi-byte (A) variants of Win32
6594         GetModuleFileName() and CreateFile().
6595         * tests/test.c (main): Replace K&R-style function definition with the
6596         ANSI C one.
6597
6598 2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski and
6599                                             George Talbot)
6600         (diff95_cvs)
6601
6602         * include/private/gcconfig.h (PLATFORM_ANDROID): New macro
6603         recognized (for Linux on ARM32 without glibc).
6604         * include/private/gcconfig.h (STRTOULL): Define for all targets
6605         (define as "strtoul" for most targets except for LLP64/Win64).
6606         * misc.c (GC_init_inner): Use STRTOULL instead of atoi/atol()
6607         (cast the result to word type) to decode values of "GC_TRACE",
6608         "GC_INITIAL_HEAP_SIZE", "GC_MAXIMUM_HEAP_SIZE" environment
6609         variables.
6610
6611 2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly George Talbot)
6612
6613         * include/gc_allocator.h: Add gc_allocator_ignore_off_page.
6614         * tests/test_cpp.cc: Add call to gc_allocator_ignore_off_page.
6615
6616 2009-06-11  Hans Boehm <Hans.Boehm@hp.com>
6617
6618         * win32_threads.c (GC_release_mark_lock): Correct misspelling of
6619         AO_load in assertion.
6620
6621 2009-06-11  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
6622         (diff93_cvs: resembling diff27, diff30, diff43, diff44, diff66,
6623         diff76, diff79, diff83 partly)
6624
6625         * win32_threads.c (MAX_THREADS): Define as 1 if GC_win32_dll_threads
6626         is defined as FALSE (otherwise the size of dll_thread_table is near
6627         200 KiB for 32-bit).
6628         * win32_threads.c (GC_use_DllMain): Optimize for THREAD_LOCAL_ALLOC.
6629         * win32_threads.c (GC_Thread_Rep): Add backing_store_end and
6630         backing_store_ptr fields for IA64 support.
6631         * win32_threads.c (GC_register_my_thread_inner): Set
6632         backing_store_end field to reg_base value for IA64 (same as in
6633         pthread_support.c).
6634         * win32_threads.c (SET_PTHREAD_MAP_CACHE): Put parentheses in the
6635         "right" places, remove ';'.
6636         * win32_threads.c (GC_fault_handler_lock): Declare only
6637         if MPROTECT_VDB (and not WinCE).
6638         * win32_threads.c (GC_suspend): Acquire and release
6639         GC_fault_handler_lock only if MPROTECT_VDB (and not WinCE).
6640         * win32_threads.c (GC_suspend): Define as STATIC.
6641         * win32_threads.c (GC_push_stack_for): Fix WARN() format specifier
6642         (should be word-compliant, "%p" is used w/o "0x"), don't cast sp.
6643         * win32_threads.c (GC_push_all_stacks): Convert a group of printf()
6644         calls into a single one (for output atomicity).
6645         * win32_threads.c (GC_get_next_stack): Unprotect thread descriptor
6646         before altering its last_stack_min ("thread" variable is added).
6647         * win32_threads.c (GC_get_next_stack): Remove unnecessary checks for
6648         "s" is non-NULL.
6649         * win32_threads.c (GC_get_next_stack): Don't call GC_may_be_in_stack
6650         if WinCE.
6651         * win32_threads.c (GC_get_next_stack): Pass current_min value to
6652         GC_get_stack_min as-is (without -1).
6653         * win32_threads.c (GC_wait_marker): Remove FIXME and use "release"
6654         version of AO_fetch_and_sub1().
6655         * win32_threads.c (GC_win32_start_inner, GC_win32_start): convert int
6656         to pointer (and vice versa) thru word type to suppress warnings.
6657         * win32_threads.c (GC_mark_mutex_waitcnt): Fix comment, always
6658         access atomically.
6659         * misc.c: Change GC_THREADS tests back to THREADS.
6660
6661
6662 2009-06-11  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6663         (diff92_cvs: resembling diff20, diff27, diff34, diff38, diff43, diff45,
6664         diff46, diff56, diff60, diff62, diff74, diff75, diff81 partly)
6665
6666         * allchblk.c (GC_print_hblkfreelist, GC_dump_regions): Convert
6667         a group of printf() calls into a single one (for output atomicity).
6668         * include/gc.h (GC_set_all_interior_pointers, GC_set_full_freq,
6669         GC_set_time_limit): New prototypes.
6670         * misc.c (GC_set_all_interior_pointers, GC_set_full_freq,
6671         GC_set_time_limit): New public setter/getter functions.
6672         * include/gc.h: Fix (and remove outdated) comments for thread-local
6673         allocation.
6674         * include/gc.h: Fix typos in comments.
6675         * misc.c (GC_init_inner, GC_printf): Ditto.
6676         * include/gc.h (GC_unregister_disappearing_link): Refine comment.
6677         * include/gc.h (GC_stack_base): Recognize _M_IA64 macro.
6678         * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
6679         GC_bytes_allocd_at_reset, DEGRADE_RATE): Define only if THREADS.
6680         * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
6681         GC_bytes_allocd_at_reset): Define as STATIC.
6682         * misc.c (GC_get_heap_size, GC_get_free_bytes,
6683         GC_get_bytes_since_gc, GC_get_total_bytes): Acquire the GC lock to
6684         avoid data races.
6685         * misc.c (GC_write_cs): Define only if THREADS (Win32/WinCE only).
6686         * misc.c (GC_init_inner): Initialize GC_write_cs only if THREADS.
6687         * misc.c (GC_init_inner): Use GC_INITIAL_HEAP_SIZE (if available) to
6688         set the default initial value of initial_heap_sz.
6689         * misc.c (GC_deinit): Destroy GC_write_cs only if THREADS.
6690         * misc.c (GC_init_inner): Fix WARN() format specifier (should be
6691         word-compliant, "%p" is used w/o "0x").
6692         * misc.c (GC_init_inner): Don't recognize "GC_PAUSE_TIME_TARGET"
6693         environment variable if SMALL_CONFIG.
6694         * misc.c (GC_init_inner): Recognize "GC_FULL_FREQUENCY" environment
6695         variable to set initial GC_full_freq value (if not SMALL_CONFIG).
6696         * doc/README.environment (GC_FULL_FREQUENCY): Add information.
6697         * doc/README.environment (GC_MARKERS): Refine information.
6698         * misc.c (GC_init_inner): Change GC_ASSERT to GC_STATIC_ASSERT where
6699         possible.
6700         * misc.c (IF_NEED_TO_LOCK): New macro (instead of GC_need_to_lock).
6701         * misc.c (GC_write): Use IF_NEED_TO_LOCK for handling GC_write_cs.
6702         * misc.c (GC_abort): Don't define if SMALL_CONFIG.
6703         * misc.c (GC_abort): Directly use WRITE() instead of GC_err_printf()
6704         (to prevent possible infinite recursion).
6705
6706 2009-06-09  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6707         diff90_cvs (resembling diff28, diff30, diff32, diff34, diff47,
6708         diff49, diff60, diff62, diff66, diff67, diff68, diff72 partly)
6709
6710         * finalize.c (finalization_mark_proc): Replace K&R-style declaration
6711         with ANSI C one.
6712         * finalize.c (GC_grow_table, GC_register_finalizer_inner,
6713         GC_enqueue_all_finalizers): Remove outdated comments about disabling
6714         signals.
6715         * finalize.c (GC_general_register_disappearing_link): Fix assertion
6716         to catch NULL "obj" value.
6717         * finalize.c (GC_unregister_disappearing_link): Check "link"
6718         alignment before gaining the lock.
6719         * finalize.c (GC_finalize): Refine comment.
6720         * finalize.c (GC_finalize): Fix WARN() format specifier (should be
6721         word-compliant, "%p" is used w/o "0x").
6722         * finalize.c (GC_invoke_finalizers): Initialize "bytes_freed_before"
6723         variable (to 0) to suppress compiler warning.
6724         * include/gc_gcj.h (MARK_DESCR_OFFSET): Move to private/gc_pmark.h.
6725         * include/gc_gcj.h: add "extern C" header and tail.
6726         * include/private/gc_pmark.h: Remove GC_do_parallel_mark(),
6727         GC_help_wanted, GC_helper_count, GC_active_count declarations (move
6728         the comments to the place where these symbols are defined in mark.c).
6729         * mark.c: Add STATIC GC_do_parallel_mark() declaration (for use by
6730         GC_mark_some_inner, if PARALLEL_MARK only).
6731         * mark.c (GC_mark_some_inner, GC_help_wanted, GC_helper_count,
6732         GC_active_count, GC_do_parallel_mark): Define as STATIC.
6733         * pthread_support.c (GC_mark_thread): Ditto.
6734         * typd_mlc.c (GC_explicit_typing_initialized, GC_explicit_kind,
6735         GC_array_kind, GC_ext_descriptors, GC_ed_size, GC_avail_descr,
6736         GC_typed_mark_proc_index, GC_array_mark_proc_index, GC_eobjfreelist,
6737         GC_arobjfreelist): Ditto.
6738         * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Change GC_ASSERT
6739         for HBLKSIZE to GC_STATIC_ASSERT.
6740         * mark.c (GC_noop): Define for Borland C the same as for Watcom.
6741         * mark.c (GC_noop, GC_mark_and_push): Add ARGSUSED tag.
6742         * pthread_support.c (GC_do_blocking_inner): Ditto.
6743         * mark.c (GC_mark_from): Initialize "limit" (to 0) in the default
6744         switch branch to suppress compiler warning.
6745         * mark.c (GC_return_mark_stack): Append new-line to printf message.
6746         * mark.c: Remove unused GC_true_func(), GC_PUSH_ALL().
6747         * pthread_support.c (GC_mark_thread): Add dummy "return 0" to
6748         suppress compiler warning.
6749         * pthread_support.c (start_mark_threads): Move the code limiting
6750         "GC_markers" value (and printing a warning) to GC_thr_init().
6751         * pthread_support.c (GC_thr_init): Silently limit "GC_markers" value
6752         if based on the number of CPUs.
6753         * pthread_support.c (GC_thr_init): Treat incorrect "GC_markers"
6754         values as one.
6755         * pthread_support.c (GC_register_my_thread_inner): Add a check for
6756         "stack_end" is non-NULL (the same as in win32_threads.c).
6757         * pthread_support.c (pthread_create): Call GC_oom_fn before giving up
6758         with ENOMEM.
6759         * thread_local_alloc.c (return_single_freelist): Convert "for" loop
6760         to "while" one to suppress "possible extraneous ';'" warning.
6761
6762 2009-06-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski
6763                                             and Zoltan Varga)
6764
6765         * darwin_stop_world.c (GC_push_all_stacks): Recognize ARM32.
6766         * include/private/gc_priv.h (GC_THREAD_STATE_T): Define for ARM32
6767         (Darwin only).
6768         * include/private/gcconfig.h: Add machine-specific part for DARWIN.
6769         * include/private/gcconfig.h (ARM32): Define config parameters for
6770         DARWIN (iPhone).
6771
6772 2009-06-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6773         (diff91_cvs: resembling diff3, diff27, diff33, diff45, diff47, diff49,
6774         diff60, diff67, diff68 partly)
6775
6776         * alloc.c (GC_FULL_FREQ, GC_DONT_EXPAND, GC_FREE_SPACE_DIVISOR,
6777         GC_TIME_LIMIT): New macros (used to control the default initial
6778         values of GC_full_freq variable, GC_dont_expand,
6779         GC_free_space_divisor, GC_time_limit respectively).
6780         * include/private/gc_priv.h (TIME_LIMIT): Remove macro (replaced
6781         with GC_TIME_LIMIT in alloc.c).
6782         * alloc.c (GC_need_full_gc, GC_stopped_mark, GC_finish_collection):
6783         Define as STATIC.
6784         * mark_rts.c (GC_push_current_stack, GC_push_gc_structures): Ditto.
6785         * include/private/gc_priv.h (GC_stopped_mark, GC_finish_collection):
6786         Move the prototypes to alloc.c, make STATIC.
6787         * include/private/gc_priv.h (GC_push_current_stack,
6788         GC_push_gc_structures, GC_push_regs_and_stack): Remove prototypes
6789         (move the comments to the places where these functions are defined).
6790         * mach_dep.c (GC_push_regs_and_stack): Move to mark_rts.c and define
6791         as STATIC.
6792         * alloc.c (GC_timeout_stop_func, GC_stopped_mark,
6793         GC_print_heap_sects): Convert a group of printf() calls into
6794         a single one (for output atomicity).
6795         * mark_rts.c (GC_print_static_roots): Ditto.
6796         * alloc.c (GC_stopped_mark): Output blank line (when logging) for
6797         convenience to delimit collections.
6798         * alloc.c (GC_clear_a_few_frames): Rename NWORDS to CLEAR_NWORDS;
6799         make "frames" local variable volatile (to prevent optimization).
6800         * alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
6801         GC_finish_collection, GC_allocobj): Remove outdated comments about
6802         disabling signals.
6803         * include/private/gc_priv.h (GC_register_displacement_inner,
6804         GC_gcollect_inner): Ditto.
6805         * alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
6806         GC_finish_collection): Initialize "start_time" local variable (to 0)
6807         to suppress compiler warning.
6808         * mark_rts.c (GC_add_roots_inner): Ditto (for "old" variable).
6809         * alloc.c (GC_RATE, MAX_PRIOR_ATTEMPTS): Guard with "ifndef".
6810         * include/private/gc_priv.h (clock, GC_stop_world, GC_start_world,
6811         GC_acquire_mark_lock, GC_release_mark_lock, GC_notify_all_builder,
6812         GC_wait_for_reclaim, GC_notify_all_marker, GC_wait_marker): Replace
6813         K&R-style function prototypes with ANSI C one.
6814         * include/private/gc_priv.h (ABORT): Define as DebugBreak() for
6815         Win32/WinCE if SMALL_CONFIG (the same as in GC_abort()).
6816         * include/private/gc_priv.h (ROUNDED_UP_WORDS, abs): Remove unused
6817         macros.
6818         * include/private/gc_priv.h (GC_noop): Declare for Borland C the
6819         same as for Watcom.
6820         * mark_rts.c (GC_push_conditional_with_exclusions): Add ARGSUSED tag.
6821
6822 2009-06-04  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6823         (diff89_cvs, resembling diff3, diff27, diff34, diff38, diff47, diff49,
6824         diff59, diff60, diff66, diff67, diff68, diff69a, diff70, diff81
6825         partly)
6826
6827         * dbg_mlc.c (GC_store_debug_info, GC_store_debug_info_inner): Remove
6828         outdated comment about disabling signals.
6829         * mallocx.c (GC_malloc_uncollectable,
6830         GC_malloc_atomic_uncollectable): Ditto.
6831         * os_dep.c: Ditto.
6832         * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change):
6833         Add ARGSUSED tag.
6834         * pthread_stop_world.c (GC_suspend_handler,
6835         GC_suspend_handler_inner): Ditto.
6836         * dbg_mlc.c (GC_debug_free, GC_debug_realloc): Fix printf message.
6837         * dbg_mlc.c (GC_debug_realloc): Set "result" to NULL in the default
6838         switch branch to suppress compiler warning.
6839         * dyn_load.c (GC_init_dyld): Use ABORT() instead of GC_abort().
6840         * include/private/darwin_semaphore.h (sem_init): Ditto.
6841         * include/javaxfc.h: Replace "GC_H" with "_GC_H".
6842         * include/private/dbg_mlc.h (GC_has_other_debug_info,
6843         GC_store_debug_info): Replace K&R-style function prototypes with ANSI
6844         C one.
6845         * include/private/gcconfig.h (GC_FreeBSDGetDataStart, real_malloc,
6846         GC_win32_get_mem, GC_wince_get_mem, GC_unix_get_mem): Ditto.
6847         * include/private/pthread_support.h (GC_stop_init): Ditto.
6848         * include/private/gcconfig.h: Refine comment about setting
6849         GC_stackbottom.
6850         * include/private/gcconfig.h (FIXUP_POINTER): Put parentheses in the
6851         "right" places.
6852         * include/private/pthread_support.h (GC_Thread_Rep): Refine comment
6853         for "stack_end" field.
6854         * mallocx.c (GC_malloc_uncollectable,
6855         GC_malloc_atomic_uncollectable): Remove cast to undefined "hbklk".
6856         * os_dep.c (GC_USE_MEM_TOP_DOWN): New macro (for setting
6857         GC_mem_top_down to MEM_TOP_DOWN for debug purposes).
6858         * os_dep.c (GC_gww_read_dirty, catch_exception_raise): Fix WARN()
6859         format specifier (should be word-compliant, "%p" is used w/o "0x").
6860         * pthread_stop_world.c (GC_suspend_handler_inner): Ditto.
6861         * os_dep.c (GC_dirty_init): Append new-line to printf messages.
6862         * os_dep.c (GC_mprotect_thread): Fix GC_err_printf message.
6863         * os_dep.c (GC_save_callers): Change GC_ASSERT to GC_STATIC_ASSERT.
6864         * pthread_stop_world.c (GC_retry_signals, GC_suspend_ack_sem): Define
6865         as STATIC.
6866         * pthread_stop_world.c (GC_push_all_stacks): Add assertion for that
6867         "thread_blocked" is not set for the current thread.
6868         * real_malloc.c: Add "extern GC_quiet" to suppress compiler warning.
6869         * reclaim.c (GC_reclaim_all): Initialize "start_time" (to 0) to
6870         suppress compiler warning.
6871
6872 2009-06-02  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6873         (adding last bit of diff86_cvs)
6874
6875         * tests/test.c (check_heap_stats): Avoid unbalanced brackets in ifdef.
6876
6877 2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6878         (diff26)
6879
6880         * win32_threads.c: restructure parallel marking mutex initialization.
6881         * win32_threads.c, alloc.c, darwin_stop_world.c, mallocx.c, mark.c,
6882         pthread_stop_world.c, pthread_support.c: Add runtime conditions
6883         on GC_parallel were appropriate.
6884         * pthread_support.c: Condition marker_bsp on ia64.
6885         (GC_segment_is_thread_stack): Fix loop upper bound.
6886         * reclaim.c: Limit some assertions to PARALLEL_MARK.
6887         * pthread_support.c: Don't acquire mark lock for thread-local
6888         allocation.
6889         * include/private/gc_priv.h: Don't define parallel mark sync
6890         support just for THREAD_LOCAL_ALLOC.
6891
6892 2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6893         (diff39)
6894
6895         * include/private/gcconfig.h: refine MINGW32 test.
6896         * mark.c: Add win64/gcc tests.
6897
6898 2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6899         (diff86_cvs, resembling diff28, diff32, diff33, diff38, diff68 partly)
6900
6901         * test.c (fork_a_thread, reverse_test, alloc8bytes, tree_test,
6902         typed_test, run_one_test, check_heap_stats, main, test): Replace
6903         all K&R-style function definitions with ANSI C ones.
6904         * trace_test.c (main): Ditto.
6905         * test.c (GC_COND_INIT): Define as GC_INIT() also in case of
6906         THREAD_LOCAL_ALLOC.
6907         * test.c (reverse_test): Call fork_a_thread() only if GC_PTHREADS
6908         or GC_WIN32_THREADS; remove fork_a_thread() macros definition.
6909         * test.c (reverse_test): Use "volatile" when clearing "b" and "c"
6910         local variables (to suppress "assigned value is never used"
6911         compiler warning).
6912         * test.c (tree_test): Use public GC_noop1() instead of private
6913         GC_noop().
6914         * test.c (typed_test): Ditto.
6915         * test.c (check_heap_stats): Define and assign value to
6916         "late_finalize_count" local variable only if its value is used
6917         (if FINALIZE_ON_DEMAND defined).
6918         * test.c (main): Remove DJGPP-specific initialization of
6919         GC_stackbottom (not needed anymore, handled in gcconfig.h).
6920         * trace_test.c: Guard #define GC_DEBUG with #ifndef.
6921         * trace_test.c: Include "gc_backptr.h".
6922         * trace_test.c (main): Call GC_INIT().
6923         * trace_test.c (main): Add "return 0" statement.
6924
6925 2009-05-25  Hans Boehm <Hans.Boehm@hp.com> (Really Petter Urkedal)
6926
6927         * dyn_load.c (GC_register_dynlib_callback): Use new index j
6928         instead of i in the inner loop.
6929
6930 2009-05-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6931         (diff85)
6932
6933         * tests/test.c: Increment n_tests with fetch_and_add when possible,
6934         avoiding need to export lock.
6935
6936 2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6937         (diff63,diff65)
6938
6939         * include/gc_pthread_redirects.h:
6940                 - dlfcn.h is included for dlopen() proto before undefining
6941                 "dlopen" (so, it's possible now to include dlfcn.h after
6942                 gc.h from user code);
6943                 - GC_dlopen() proto is added (except for Darwin as
6944                 it's missing there);
6945                 - "dlopen" is explicitly undefined (before its redefinition).
6946         * include/gc.h:
6947                 - "process.h" is included besides "windows.h"
6948                 (for _beginthreadex/_endthreadex); win32 only.
6949                 - GC_NO_THREAD_DECLS is moved to the right place
6950                 (before closing "extern C").
6951         * pthread_support.c: Fix out of memory handling for Thread_Reps.
6952         * win32_threads.c: Don't include process.h on winCE,
6953         improve out of memory handling for thread structures, don't
6954         define GC_beginthreadex and GC_endthreadex for winCE.
6955
6956 2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski
6957         (diff71)
6958
6959         * tests/test.c: Change gcj vtable decriptor type from size_t to
6960         GC_word.
6961
6962 2009-05-22  Hans Boehm <Hans.Boehm@hp.com>
6963
6964         * gcj_mlc.c: Add comment.
6965         * tests/test.c: Change NTEST to NTHREADS.  Fork 5 threads by default.
6966         Run reverse_test a second time in each thread.Add comments.
6967         Don't rely on AO_fetch_and_add.
6968
6969 2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Largely from Ludovic Cortes)
6970
6971         * dyn_load.c (GC_register_dynlib_callback,
6972         GC_register_dynamic_libraries_dl_iterate_phdr): Add support
6973         for GNU_PT_RELRO relocations.
6974
6975 2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
6976         (diff61)
6977
6978         * Makefile, Makefile.direct: GC_SOLARIS_PTHREADS was replaced
6979         by GC_SOLARIS_THREADS.
6980         * include/gc.h: Improve finalizer documentation.
6981         * mips_sgi_mach_dep.s: Replace _MIPS_SIM_ABI32 with _ABIO32.
6982         * pthread_stop_world.c, Makefile.dj: Fix typos.
6983
6984 2009-05-21  Hans Boehm <Hans.Boehm@hp.com>
6985
6986         * win32_threads.c (GC_new_thread): Make first_thread
6987         visible to the whole file.
6988         (UNPROTECT): New macro.
6989         (GC_push_stack_for, GC_suspend, GC_start_world): unprotect
6990         thread structures before writing.
6991         (GC_suspend): Acquire GC_fault_handler_lock before suspending
6992         thread.
6993         * os_dep.c: export GC_fault_handler_lock.
6994         (GC_remove_protection): Check if already unprotected.
6995
6996 2009-05-20  Hans Boehm <Hans.Boehm@hp.com> (really Ivan Maidanski)
6997
6998         * doc/README.win32: Add OpenWatcom warning.
6999         * include/private/gcconfig.h: Really check it in.
7000
7001 2009-05-19  Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidanski, Dave Korn)
7002
7003         * os_dep.c (GC_get_stack_base, windows): Replace with Dave Korn's
7004         code from gcc version.
7005         * os_dep.c: make gc compilable (optionally) for Cygwin with
7006         GetWriteWatch-based virtual dirty bit implementation ("os_dep.c" file).
7007         * os_dep.c: Make non-win32 GC_write_fault_handler STATIC.
7008         * mark.c (GC_noop): fix declaration definition mismatch for DMC.
7009         * include/private/gcconfig.h: Enable MPROTECT_VDB and GWW_VDB for
7010         Watcom (Win32 only).  It works.
7011
7012 2009-05-07  Hans Boehm <Hans.Boehm@hp.com> (and Mark Sibly)
7013
7014         * mach_dep.c: Don't use __builtin_unwind_init for register
7015         state on PowerPC/Darwin.
7016
7017 2009-04-24  Hans Boehm <Hans.Boehm@hp.com>
7018
7019         * doc/gcdescr.html: Improve description of object freelist
7020         structure.
7021         * include/private/gc_priv.h: Fix comment for _size_map.
7022
7023 2009-03-16  Hans Boehm <Hans.Boehm@hp.com>
7024
7025         * os_dep.c (GC_linux_stack_base): Relax sanity test.
7026
7027 2009-03-11  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
7028
7029         * include/private/gc_pmark.h (PUSH_CONTENTS_HDR for
7030         MARK_BIT_PER_OBJ): Add missing backslash before eoln.
7031
7032 2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
7033
7034         * misc.c (GC_set_warn_proc): Implicitly intialize GC on
7035         non-Cygwin win32.
7036
7037 2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Petr Krajca)
7038
7039         * configure.ac: Enable thread-local allocation for sparc-linux.
7040         * configure: Regenerate.
7041
7042 2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
7043
7044         * alloc.c (GC_try_to_collect): Remove duplicate initialization
7045         check.
7046         * malloc.c (GC_generic_malloc): Remove lw to eliminate single-
7047         threaded warnings.
7048         * mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.
7049
7050 2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidansky)
7051
7052         * allchblk.c, backgraph.c, dbg_mlc.c, dyn_load.c,
7053         finalize.c, include/private/gc_pmark.h, malloc.c, mark.c,
7054         os_dep.c, pthread_stop_world.c, pthread_support.c, reclaim.c,
7055         thread_local_alloc.c.
7056         * misc.c: Refine comment.
7057
7058 2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
7059
7060         * os_dep.c: Define GC_GWW_BUF_LEN more intelligently.  Add FIXME
7061         comment.
7062
7063 2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (With input from Ivan Maidansky)
7064
7065         * win32_threads.c (GC_push_stack_for): Yet another attempt
7066         at the stack_min finding logic.  Try to clean up the existing code
7067         while minimizing VirtualQuery calls.
7068         (GC_win32_start_inner): Register thread before GC_printf.
7069         Produce more output with DEBUG_THREADS.
7070         *include/gc.h: Update obsolete comments.
7071
7072 2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
7073
7074         * tests/test.c:
7075         (gcj_class_struct2): Use cast instead of l suffix.
7076         Cast GetLastError to int in various places.
7077         Avoid unused result warning from incr/decr macros.
7078         Add cast for fake_gcj_mark_proc.
7079         Cast GC_gc_no to unsigned in printf.
7080
7081 2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
7082
7083         * include/gc.h: Fix two typos in comments.
7084
7085 2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
7086
7087         * finalize.c: Fix typo in comment.
7088
7089 2008-12-03  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
7090
7091         * blacklst.c (GC_print_source_pointer): Don't call GC_print_heap_obj
7092         with lock.
7093
7094 2008-12-01  Hans Boehm <Hans.Boehm@hp.com>
7095
7096         * reclaim.c: (GC_reclaim_block): Scan even nearly full blocks
7097         if we are checking for leaks.
7098
7099 2008-11-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
7100
7101         * win32_threads.c: Remove mark lock spinning.
7102         * win32_threads.c, pthread_support.c: Update GC_unlocked_count,
7103         GC_spin_count, and GC_block_count using atomic operations.
7104         * tests/test.c: Declare n_tests as AO_t only if we have threads.
7105
7106 2008-11-11  Hans Boehm <Hans.Boehm@hp.com>
7107         (Really almost entirely Ivan Maidansky)
7108
7109         * win32_threads.c: Support PARALLEL_MARK.  Make printf arg
7110         types agree with format specifiers.  Add missing copyright header.
7111         Add STATIC for GC_threads.
7112         * include/private/gcconfig.h: Add FIXME comment.
7113         * tests/test.c (run_ine_test): Replace LOCK/UNLOCK use with
7114         AO_fetch_and_add1_full.  Declare n_tests as AO_t.
7115         (WinMain): Don't call GC_use_DllMain.
7116         with PARALLEL_MARK or THREAD_LOCAL_ALLOC.
7117
7118 2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
7119
7120         * alloc.c (GC_try_to_collect_inner): Don't print redundant
7121         GC_bytes_allocd and GC_gc_no.
7122         (GC_stopped_mark): Print average world stop time.
7123         * include/private/gc_priv.h (MS_TIME_DIFF): Add cast.
7124
7125 2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
7126
7127         * misc.c, doc/README.environment: Add support  for
7128         GC_FREE_SPACE_DIVISOR and GC-disable-incremental.
7129         * include/gc.h: Make GC_set_free_space_divisor correspond to
7130         (somewhat unfortunate) reality.
7131
7132 2008-11-07  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
7133
7134         (Mostly improves LLP64 support.)
7135         * backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c,
7136         misc.c, reclaim.c: Changed some int and long type to word or size_t
7137         (and vice versa where appropriate)
7138         * gcj_mlc.c, include/private/dbg_mlc.h, include/private/gcconfig.h,
7139         include/private/thread_local_alloc.h, mark.c,
7140         misc.c, thread_local_alloc.c, win32_threads.c: Added intermediate
7141         casts to word type when casting from int to pointer (or pointer
7142         to int, or data pointer to code pointer) - just to remove the
7143         corresponding compiler warning.
7144         * ptr_chck.c (GC_is_visible): cast int const to word type to
7145         prevent left shift overflow.
7146         * os_dep.c: change the type of GC_mem_top_down global variable
7147         (containing a flag) to DWORD.
7148         * include/gc_config_macros.h: define GC_SOLARIS_THREADS if GC_THREADS
7149         is defined on SunOS x86_64.
7150         * misc.c (GC_init_size_map): Ifdef out GC_ASSERT as a workaround
7151         for VC++ 2008 amd64 (v15.00.21022.08 for x64) compiler bug
7152         (the compiler gets hung if invoked with -Ox -D
7153         ALL_INTERIOR_POINTERS -D GC_ASSERTIONS)
7154         * backgraph.c: cast GC_gc_no value to unsigned short when
7155         assigned/compared to height_gc_no field of back_edges.
7156         * os_dep.c (GC_remove_protection): Add ARGSUSED.
7157         * win32_threads.c (GC_thread_exit_proc): Remove unused local
7158         variable.
7159         * mark.c (GC_check_dirty): Move declaration out of func body.
7160
7161 2008-11-06  Hans Boehm <Hans.Boehm@hp.com>
7162
7163         * doc/gcinterface.html: Improve REDIRECT_MALLOC documentation.
7164         * include/gc.h (GC_register_my_thread): Improve comment.
7165
7166 2008-11-04  Hans Boehm <Hans.Boehm@hp.com>
7167
7168         * Makefile.direct: Add comment for -DCHECKSUMS.
7169
7170 2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
7171
7172         * thread_local_alloc.c, include/private/thread_local_alloc.h:
7173         Fix typos in comments.
7174         * finalize.c: Declare mark_procs and GC_register_finalizer_inner
7175         STATIC.
7176         * malloc.c (GC_free): Move size calculation below assertion.
7177
7178 2008-10-27  Hans Boehm <Hans.Boehm@hp.com>
7179
7180         * win32_threads.c (GC_get_stack_min, GC_may_be_in_stack):
7181         Add one entry VirtualQuery cache, I_HOLD_LOCK assertions.
7182         (GC_push_stack_for, GC_get_next_stack) : Hopefully fix WINCE support.
7183
7184 2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Thanks to Klaus Treichel)
7185
7186         * finalize.c (GC_general_register_disappearing_link): Add
7187         assertion.
7188         * malloc.c (GC_generic_malloc): Round lb to granules, not words.
7189         * mallocx.c (GC_generic_malloc_ignore_off_page): Round lb to
7190         granules, not words.
7191
7192 2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Really Rex Dieter and
7193                                             Petr Krajca)
7194
7195         * mach_dep.c (NO_GETCONTEXT): Define for sparc linux.
7196         * configure.ac: Define mach_dep for sparc-linux.
7197         * configure: Regenerate.
7198
7199 2008-10-25  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
7200
7201         * mark_rts.c (GC_approx_sp): Use volatile to avoid common
7202         warning.
7203
7204 2008-10-25  Hans Boehm <Hans.Boehm@hp.com>
7205
7206         * dyn_load.c (GC_cond_add_roots): Fix GC_get_next_stack argument
7207         order.
7208
7209 2008-10-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
7210
7211         * alloc.c, dbg_mlc.c, dyn_load.c, finalize.c, gcj_mlc.c,
7212         include/gc.h, include/gc_config_macros.h, include/gc_cpp.h,
7213         include/gc_gcj.h, include/gc_mark.h, include/gc_typed.h,
7214         include/javaxfc.h, include/private/gc_locks.h,
7215         include/private/gc_priv.h, malloc.c, mallocx.c, mark.c, mark_rts.c,
7216         misc.c, obj_map.c, os_dep.c, pthread_support.c, ptr_chck.c,
7217         stubborn.c, tests/test.c, thread_local_alloc.c, typd_mlc.c
7218         win32_threads.c: Add GC_CALL and GC_CALLBACK macro invocations.
7219         * test.c: Remove some old K&R code.
7220
7221 2008-10-24  Hans Boehm <Hans.Boehm@hp.com>
7222         (Partially based loosely on patch from Ivan Maidanski)
7223
7224         * win32_threads.c (GC_may_be_in_stack): New.  (GC_Thread_Rep):
7225         Add last_stack_min.  (GC_push_stack_for): Use last_stack_min.
7226         (GC_get_next_stack): Add limit argument, use_last_stack_min.
7227         (GC_suspend): make stack_base assignment conditional.
7228         * dyn_load.c (win32 GC_cod_add_roots): Pass limit to
7229         GC_get_next_stack.
7230         * configure_atomic_ops.sh: Remove.
7231         * build_atomic_ops.sh, build_atomic_ops.sh.cygwin, doc/README.win32,
7232         Makefile.direct: Partially support build directories whose path
7233         name contains blanks.
7234         * Makefile.am: Support new files (build_atomic_ops.sh,
7235         build_atomic_ops.sh.cygwin)
7236         * Makefile.in: Regenerate.
7237
7238 2008-10-21  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
7239
7240         * include/private/gc_locks.h, include/private/gc_pmark.h,
7241         include/private/gc_priv.h, include/private/gcconfig.h,
7242         mach_dep.c, mark_rts.c, misc.c, os_dep.c, pthread_stop_world.c,
7243         pthread_support.c, thread_local_alloc.c, typd_mlc.c, win32_threads.c:
7244         Fix comments.
7245
7246 2008-10-21  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
7247
7248         * pthread_support.c: Comment out LOCK_STATS.
7249         * include/gc.h: Fix comments.
7250
7251 2008-10-20  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
7252
7253         * misc.c (GC_init_inner): Enable GC_LOG_FILE on Cygwin.
7254         * include/private/gcconfig.h: Consider USE_MMAP for Cygwin.
7255         * os_dep.c (GC_get_main_stack_base): Use alternate definition
7256         with USE_MMAP.
7257         * include/private/gc_priv.h: Sometimes define SETJMP on Cygwin.
7258
7259 2008-10-20  Hans Boehm <Hans.Boehm@hp.com>
7260
7261         * doc/README: Make it clearer when Makefile.direct is assumed.
7262         * cord/cord.am: install include/cord.h.
7263         * Makefile.in: Regenerate.
7264
7265 2008-09-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
7266
7267         * win32_threads.c (GC_pthread_join, GC_pthread_start_inner):
7268         Remove unused variables.
7269         * darwin_stop_world.c: Always declare GC_thr_init().
7270         * dbg_mlc.c (GC_debug_free_inner): Don't touch oh_sz if
7271         SHORT_DBG_HDRS is defined.
7272         * include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET, parallel
7273         mark, USE_MARK_BITS version): Refer to correct parameter name.
7274
7275 2008-09-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
7276
7277         * finalize.c (GC_general_register_disappearing_link): Remove
7278         redundant code.
7279         * gcj_mlc.c (GC_init_gcj_malloc): Add cast to signed.
7280         * os_dep.c: (GC_write_fault_handler): Remove remaining
7281         references to deleted variable "code".  Remove redundant
7282         FREEBSD definitions.
7283         * include/private/gcconfig.h (GWW_VDB): Define for X86_64 when
7284         defined for X86. (STATIC): Define as "static" with NO_DEBUGGING.
7285
7286 2008-09-24  Hans Boehm <Hans.Boehm@hp.com>
7287
7288         * include/private/gc_priv.h: Update MAX_HEAP_SECTS.
7289
7290 2008-09-10  Hans Boehm <Hans.Boehm@hp.com>
7291
7292         * dbg_mlc.c (GC_print_smashed_obj): Increase robustness with
7293         smashed string, (GC_debug_free_inner): Mark as free.
7294         * mallocx.c (GC_malloc_many): Always clear new block if
7295         GC_debugging_started.
7296         * reclaim.c: Move GC_debugging_started from
7297         GC_reclaim_small_nonempty_block() to GC_reclaim_generic(),
7298         which is also called directly.
7299         * doc/README: Fix spelling error.  Update license summary.
7300         * include/gc.h (GC_PRE_INCR3, GC_POST_INCR3): add (void **) casts.
7301         * tests/test.c: Don't define GC_DEBUG if already defined.
7302
7303 2008-08-27  Hans Boehm <Hans.Boehm@hp.com>
7304
7305         * doc/simple_example.html: update --enable-full-debug reference,
7306         Make HTML formatting standards compliant.
7307         * doc/debugging.html, doc/leak.html: Fix HTML formatting bugs.
7308         * doc/gcinterface.html: specify encoding.
7309
7310 2008-08-27  Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
7311
7312         * doc/simple_example.html: Update thread-local allocation
7313         description.
7314
7315 2008-08-26  Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
7316
7317         * configure.ac: Check for gc-debug earlier; replace remaining
7318         full-debug tests.
7319         * configure: Regenerate.
7320         * include/gc.h, ptr_chck.c (GC_pre_incr, GC_post_incr):
7321         Use signed offset type.  Use ptr_t internally.
7322         * doc/gcinterface.html: Update LOCAL_MALLOC description.
7323         * doc/README.autoconf, doc/leak.html, doc/README.DGUX386:
7324         Fix full-debug reference.
7325         * include/gc.h: Rewrite GC_..._INCR and friends.
7326         * tests/test.c: Minimally test GC_..._INCR and friends.
7327
7328 2008-08-21  Hans Boehm <Hans.Boehm@hp.com>
7329
7330         * mark.c: (GC_push_next_marked, GC_push_next_marked_dirty,
7331         GC_push_next_marked_uncollectable): Never invoke GC_push_marked
7332         on free hblk.
7333         * headers.c: Test COUNT_HDR_CACHE_HITS not USE_HDR_CACHE.
7334         (GC_header_cache_miss): Always blacklist pointers for free
7335         hblks.  Add assertion and comment.
7336         * pthread_support.c (GC_register_my_thread): Fix #if indentation.
7337         * include/private/gc_hdrs.h: USE_HDR_CACHE is no longer tested.
7338         Delete it.
7339         * include/private/gc_pmark.h: (PUSH_OBJ): Add assertion.
7340
7341 2008-08-21  Hans Boehm <Hans.Boehm@hp.com>
7342
7343         * alloc.c, include/gc_mark.h, Makefile.direct: Improve comments.
7344
7345 2008-08-01  Hans Boehm <Hans.Boehm@hp.com> (Really Klaus Treichel)
7346
7347         * configure.ac: Set win32_threads on MinGW.
7348         * configure: Regenerate.
7349
7350 2008-07-25  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
7351
7352         Ivan's description of the patch follows. Note that a few pieces like
7353         the GC_malloc(0) patch, were not applied since an alternate had been
7354         previously applied.  A few differed stylistically from the rest of
7355         the code (mostly casts to void * instead of target type),
7356         or were classified as too minor to bother.  Note that
7357         all of Ivan's static declarations which did not correct outright
7358         naming bugs (as a few did), where replaced by STATIC, which is
7359         ignored by default.
7360
7361         - minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for
7362         GC_malloc(0));
7363         - addition of missing getter/setter functions for public variables
7364         (may be useful if compiled as Win32 DLL);
7365         - addition of missing GC_API for some exported functions;
7366         - addition of missing "static" declarator for internal functions
7367         and variables (where possible);
7368         - replacement of all remaining K&R-style definitions with ANSI
7369         C ones (__STDC__ macro is not used anymore);
7370         - addition of some Win32 macro definitions (that may be missing in
7371         the standard headers supplied with a compiler) for GWW_VDB mode;
7372         - elimination of most compiler warnings (except for
7373         "uninitialized data" warning);
7374         - several typos correction;
7375         - missing parenthesis addition in macros in some header files of
7376         "libatomic_ops" module.
7377
7378         My highlights based on reading the patch:
7379
7380         * allchblk.c: Remove GC_freehblk_ptr decl.
7381         Make free_list_index_of() static.
7382         * include/gc.h: Use __int64 on win64, define GC_oom_func,
7383         GC_finalizer_notifier_proc, GC_finalizer_notifier_proc,
7384         add getter and setters: GC_get_gc_no, GC_get_parallel,
7385         GC_set_oom_fn, GC_set_finalize_on_demand,
7386         GC_set_java_finalization, GC_set_dont_expand,
7387         GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect,
7388         GC_set_finalizer_notifier.  Always define GC_win32_free_heap.
7389         gc_config_macros.h: Define _REENTRANT after processing
7390         GC_THREADS.
7391         * include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test,
7392         handling of operator new[] for old Windows compilers.
7393         * include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses
7394         around arguments.
7395         * dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs.
7396         * mark.c (GC_mark_and_push_stack): Fix source argument for
7397         blacklist printing.
7398         * misc.c: Fix log file naming based on environment variable
7399         for Windows.  Make GC_set_warn_proc and GC_set_free_space_divisor
7400         just return current value with 0 argument.  Add DONT_USE_USER32_DLL.
7401         Add various getters and setters as in gc.h.
7402         * os_dep.c: Remove no longer used GC_disable/enable_signals
7403         implementations.  (GC_get_stack_base): Add pthread_attr_destroy
7404         call.  No longer set GC_old_bus_handler in DARWIN workaround.
7405         * pthread_support.c: GC_register_my_thread must also
7406         call GC_init_thread_local.
7407
7408 2008-07-21  Hans Boehm <Hans.Boehm@hp.com>
7409
7410         * Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
7411         * mach_dep.c: Include signal.h.
7412         * gc_priv.h: Factor out INLINE declaration.
7413
7414 2008-07-03  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Thiemo Seufer)
7415
7416         * include/private/gcconfig.h: Update MIPS/LINUX config.
7417         * doc/gcdescr.html: Fix typo.
7418         * mach_dep.c (GC_with_callee_saves_pushed): Don't rely on getcontext
7419         for MIPS/LINUX.
7420
7421 2008-05-30  Hans Boehm <Hans.Boehm@hp.com> (some really dmcmahill)
7422
7423         * configure.ac: SPARC fixes.
7424         * configure: Regenerate.
7425         * thread_local_alloc.c(GC_mark_thread_local_fls_for): Include
7426         size 0, except for gcj.
7427         * doc/gc.man: Expand C++ cautions.
7428         * include/gc_inline.h: Fix comments.
7429
7430 2008-05-03  Hans Boehm <Hans.Boehm@hp.com>
7431
7432         * include/gc_version.h, configure.ac, doc/README:
7433         Change to version 7.2alpha1.
7434         * configure: Regenerate.
7435
7436 [7.1]
7437
7438 2008-05-03  Hans Boehm <Hans.Boehm@hp.com>
7439
7440         * include/gc_version.h, configure.ac, doc/README:
7441         Change to version 7.1.
7442         * configure: Regenerate.
7443
7444 2008-05-03  Hans Boehm <Hans.Boehm@hp.com>
7445
7446         * doc/gcinterface.html: Improve C++ interface documentation.
7447
7448 2008-03-10  Hans Boehm <Hans.Boehm@hp.com>
7449
7450         * allchblk.c (GC_allochblk): Check for overflow during size
7451         rounding.
7452         * tests/huge_test.c: New.
7453         * Makefile.direct, tests/tests.am: Add huge_test.c
7454         * Makefile.in: Regenerate.
7455
7456 2008-02-29  Hans Boehm <Hans.Boehm@hp.com>
7457
7458         * pthread_support.c: Fix typo in comment.
7459         * os_dep.c (GC_win32_get_mem): Add heap section only if
7460         allocation succeeded.
7461
7462 2008-02-28  Hans Boehm <Hans.Boehm@hp.com>
7463
7464         * malloc.c: (free replacement) Fix caller address space check.
7465
7466 2008-02-25  Hans Boehm <Hans.Boehm@hp.com>
7467
7468         * finalize.c (GC_grow_table): Dereference table in null-check.
7469
7470 2008-02-24  Hans Boehm <Hans.Boehm@hp.com>
7471
7472         * win32_threads.c (GC_delete_gc_thread, GC_delete_thread):
7473         Consistently call CloseHandle. (GC_suspend): Call
7474         GC_delete_gc_thread.
7475         * tests/test.c: Don't reference GC_print_stats if not exported.
7476
7477 2008-02-20  Hans Boehm <Hans.Boehm@hp.com>
7478
7479         * tests/test.c (run_one_test): Don't mention pthread_self().
7480         * misc.c: Declare GC_thr_init().
7481
7482 2008-02-20  Hans Boehm <Hans.Boehm@hp.com>
7483
7484         * allchblk.c (add_to_fl): disable assertions with USE_MUNMAP,
7485         and refine assertions to handle huge unmergable blocks.
7486         (GC_allochblk_nth): Add comment.
7487
7488 2008-02-20  Hans Boehm <Hans.Boehm@hp.com>
7489
7490         * include/private/gcconfig.h: Add missing FREEBSD macro
7491         consistency test.
7492
7493 2008-02-20  Hans Boehm <Hans.Boehm@hp.com>
7494
7495         * allchblk.c (GC_enough_large_bytes_left): No longer take
7496         parameters; return free list index bound.
7497         (GC_merge_unmapped): Don't access nexthdr until after null test.
7498         (Fixes bug in 1/29/08 check-in.)  (GC_allochblk): Calculate
7499         when splitting is allowable only once here, not when considering each
7500         block. (GC_allchblk_nth): Accept new may_split parameter.
7501         Avoid some redundant tests for exact size matches.
7502         * alloc.c (GC_should_collect): Cache min_bytes_allocd.
7503         (GC_maybe_gc): Make locking assertion testable.
7504         * mark_rts.c: Fix indentation.
7505         * pthread_stop_world.c: Replace old GC_err_printf1 reference.
7506         * tests/test.c: Remove (void) casts.  Optionally print some
7507         timing information.
7508
7509 2008-02-15  Hans Boehm <Hans.Boehm@hp.com>
7510
7511         * windows-untested/gc.def: Remove CreateThread line.
7512         * windows-untested/README: New file.
7513         * win32_threads.c (GC_use_DllMain): Force collector initialization.
7514         (GC_init_parallel): Reformat comment.
7515         * include/gc.h (GC_use_DllMain): Clarify usage rules in comment.
7516         * mark.c (GC_mark_from): Slightly simplify GC_DS_PER_OBJECT code.
7517         * include/gc_cpp.h: Add matching placement delete overloads
7518         everywhere.
7519         * include/private/gc_locks.h (NO_THREAD): Add cast.
7520         * include/private/gcconfig.h: Add test for __HP_aCC.
7521         * configure.ac, tests/tests.am:  Avoid libgccpp on HP/UX.
7522         * Makefile.in, configure: Regenerate.
7523
7524 2008-02-11  Hans Boehm <Hans.Boehm@hp.com> (partly David Leonard)
7525
7526         * doc/README.win32: Fix typo.
7527         * configure.ac: Fix printing of enable-shared result.
7528         * configure: Regenerate.
7529
7530 2008-02-08  Hans Boehm <Hans.Boehm@hp.com>
7531
7532         * misc.c (GC_init_inner): Assert !GC_need_to_lock only when
7533         defined.  (GC_call_with_stack_base): Add GC_API.
7534         * os_dep.c (GC_get_stack_base): Add GC_API.
7535         * win32_threads.c: (GC_register_my_thread, GC_unregister_my_thread):
7536         Add GC_API.
7537         * include/gc.h: Add GC_API annotations.
7538         * include/private/gc_locks.h: Define UNCOND_LOCK etc. also for
7539         PCR.
7540         * include/private/gc_pmark.h: Fix comments.
7541
7542 2008-02-06  Hans Boehm <Hans.Boehm@hp.com> (mostly from Henning Makholm)
7543
7544         * include/private/gc_priv.h, mark_rts.c, typd_mlc.c:
7545         Add GC_push_typed_structures() to push GC_ext_descriptors.
7546
7547 2008-01-31  Hans Boehm <Hans.Boehm@hp.com> (mostly from Andreas Tobler)
7548
7549         * tests/test.c: Call GC_INIT for DARWIN; test system type using
7550         gcconfig.h-defined macros.
7551
7552 2008-01-29  Hans Boehm <Hans.Boehm@hp.com>
7553
7554         * allchblk.c (GC_merge_unmapped, GC_freehblk): Refuse to create
7555         blocks large enough that their size, when interpreted as a signed
7556         value, would be negative.
7557         * include/private/gc_priv.h: Comment hb_sz range limit.
7558
7559 2008-01-29  Hans Boehm <Hans.Boehm@hp.com>  (with help from Manuel Serrano)
7560
7561         * mark.c (GC_push_next_marked): correct comment.
7562         * Makefile.direct: document NO_PROC_STAT.
7563         * include/private/gcconfig.h: Accomodate NO_PROC_STAT.
7564
7565 2008-01-10  Hans Boehm <Hans.Boehm@hp.com>
7566
7567         * include/gc_version.h, configure.ac, doc/README:
7568         Change to version 7.1alpha3.
7569         * configure: Regenerate.
7570
7571 [7.1alpha2]
7572
7573 2008-01-10  Hans Boehm <Hans.Boehm@hp.com>
7574
7575         * include/gc_version.h, configure.ac, doc/README:
7576         Change to version 7.1alpha2.
7577         * configure: Regenerate.
7578
7579 2008-01-10  Hans Boehm <Hans.Boehm@hp.com>
7580
7581         * Makefile.am: Mention atomic_ops.c and atomic_ops_sysdeps.S
7582         again.  Refer to build directory as ".".
7583         * Makefile.in: Regenerate.
7584
7585 2008-01-10  Hans Boehm <Hans.Boehm@hp.com>
7586
7587         * configure.ac: Ignore --enable-parallel-mark on Darwin for now.
7588         * configure: Regenerate.
7589         * darwin_stop_world.c: Add FIXME comment for parallel marker.
7590
7591 2008-01-09  Hans Boehm <Hans.Boehm@hp.com>
7592
7593         * include/private/gc_priv.h: Update MAX_ROOT_SETS
7594         and LOG_PHT_ENTRIES to handle larger heaps.
7595
7596 2008-01-03  Hans Boehm <Hans.Boehm@hp.com>
7597
7598         * include/gc.h (GC_INIT,GC_init): Update comments.
7599
7600 2008-01-03  Hans Boehm <Hans.Boehm@hp.com> (based on a patch from
7601         John Bowman, and an ancient patch from Fergus Henderson)
7602
7603         * allchblk.c, alloc.c, include/private/gc_priv.h:
7604         Track GC_bytes_dropped and use in GC triggering decisions.
7605         * alloc.c (min_bytes_allocd): Weight atomic blocks less.
7606
7607 2008-01-02  Hans Boehm <Hans.Boehm@hp.com>
7608
7609         * alloc.c (GC_add_to_heap): Call GC_install_header(p) AFTER
7610         adjusting p.
7611
7612 2007-12-23  Hans Boehm <Hans.Boehm@hp.com>
7613
7614         * Makefile.am: Add NT_X64_THREADS_MAKEFILE.
7615
7616 2007-12-23  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Friedrich Dominicus)
7617
7618         * NT_X64_STATIC_THREADS_MAKEFILE: Clean up obsolete comment.
7619         * alloc.c: Add declaration for GC_add_current_malloc_heap.
7620         * win32_threads.c (GC_beginthreadex): Clean up error
7621         return code.
7622         * doc/README.win64, NT_X64_THREADS_MAKEFILE, Makefile.direct:
7623         Add NT_X64_THREADS_MAKEFILE.
7624
7625 2007-12-21  Hans Boehm <Hans.Boehm@hp.com>
7626
7627         * alloc.c: Define GC_version instead of in version.h.
7628         * version.h: Remove.
7629         * include/gc_version.h: Move most of version.h here.
7630         * include/gc.h: Include gc_version.h.
7631         * gcname.c, add_gc_prefix.c: include gc.h instead of version.h.
7632         * Makefile.direct, Makefile.dj, Makefile.am, include/include.am:
7633         Adjust for version.h rename.
7634         * Makefile.in: Regenerate.
7635
7636 2007-12-21  Hans Boehm <Hans.Boehm@hp.com> (Really mostly russ sludge dot net)
7637
7638         * configure.ac: Put libatomic_ops links in build directory.
7639         * configure: Regenerate.
7640         * Makefile.am: Don't mention atomic_ops.c and atomic_ops_sysdeps.S
7641         as nodist sources.
7642
7643 2007-12-20  Hans Boehm <Hans.Boehm@hp.com>
7644
7645         * include/gc.h, doc/README.macros: Add GC_NO_THREAD_REDIRECTS,
7646         GC_NO_THREAD_DECLS, don't test explicitly for GC_SOLARIS_THREADS.
7647
7648 2007-12-20  Hans Boehm <Hans.Boehm@hp.com>
7649
7650         * alloc.c: Deal correctly with address wrapping for
7651         GC_greatest_plausible_heap_addr and GC_least_plausible_heap_addr.
7652         * finalize.c, include/gc.h (GC_register_disappearing_link,
7653         GC_register_finalizer_inner): Improve out-of-memory handling.
7654         * include/private/gc_pmark.h: Fix comment spelling.
7655
7656 2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really mainly Peter Wang)
7657
7658         * include/gc_inline.h, include/gc_tiny_fl.h: cleanups to make usable
7659         in other contexts.
7660
7661 2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really Radek Polak)
7662
7663         * include/gc.h: Don't define GC_HAVE_BUILTIN_BACKTRACE for uclibc.
7664
7665 2007-12-18  Hans Boehm <Hans.Boehm@hp.com>
7666
7667         * gc_cpp.cc: Don't include gc_cpp.h from local directory.
7668
7669 2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really Adam Megacz)
7670
7671         * allchblk.c, configure.ac (add --enable-munmap)
7672         * configure: Regenerate.
7673
7674 2007-12-10  Andreas Tobler <a.tobler@schweiz.org>
7675
7676         * dyn_load.c (GC_dyld_image_add): Remove ifdef clause and use the macro
7677         GC_GETSECTBYNAME instead.
7678         * include/private/gc_priv.h: Define GC_GETSECTBYNAME according to the
7679         architecture (Darwin).
7680
7681 2007-10-24  Hans Boehm <Hans.Boehm@hp.com>
7682
7683         * reclaim.c (GC_bytes_found): Expand comment.
7684         * thread_local_alloc.c (GC_malloc_atomic, GC_gcj_malloc): Pass
7685         granules, not bytes, to GC_FAST_MALLOC_GRANS.
7686         * include/gc.h: Never include gc_local_alloc.h.
7687         * tests/test.c: Add size zero allocation tests.
7688
7689 2007-10-23  Hans Boehm <Hans.Boehm@hp.com>
7690
7691         * malloc.c: Update GC_large_allocd_bytes on explicit deallocation.
7692         * allchblk.c: Sanity check GC_max_large_allocd_bytes.
7693
7694 2007-10-23  Hans Boehm <Hans.Boehm@hp.com> (Really Manuel Serrano)
7695
7696         * Makefile.direct: Invoke $(MAKE) instead of make.
7697
7698 2007-10-23  Hans Boehm <Hans.Boehm@hp.com>
7699
7700         * doc/scale.html: Reflect gc7 thread local allocation behavior.
7701
7702 2007-10-23  Hans Boehm <Hans.Boehm@hp.com> (really Petter Urkedal)
7703
7704         * include/extra/gc.h, include/extra/gc_cpp.h: New.
7705         * include/include.am: Install gc.h and gc_cpp.h in $(prefix)/include
7706         again.
7707         * Makefile.in: Regenerate.
7708
7709 2007-08-15  Hans Boehm <Hans.Boehm@hp.com> (really Samuel Thibault)
7710
7711         * pthread_support.c (GC_thr_init): Use sysconf(_SC_NPROCESSORS_ONLN)
7712         for HURD.
7713
7714 2007-08-14  Hans Boehm <Hans.Boehm@hp.com> (really David Daney)
7715
7716         * include/private/gcconfig.h: Add Linux/mips-64 support.
7717
7718 2007-08-14  Hans Boehm <Hans.Boehm@hp.com> (really mostly Samuel Thibault)
7719
7720         * dbg_mlc.c: Use random() on all glibc systems.
7721         * mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext() on
7722         HURD.  Add comment.
7723         * pthread_stop_world.c (GC_suspend_handler, GC_stop_init): Accomodate
7724         systems without SA_SIGINFO.
7725
7726 2007-08-14  Hans Boehm <Hans.Boehm@hp.com> (partly really Henrik Theiling)
7727
7728         * include/gc.h (GC_PTR_STORE): Fix non-DEBUG parentheses.
7729         * tests/test.c (run_one_test): Add GC_PTR_STORE test.
7730         No longer test for RS6000.
7731
7732 2007-08-03  Hans Boehm <Hans.Boehm@hp.com>
7733
7734         * alloc.c, backgraph.c, headers.c, include/private/gc_priv.h:
7735         Maintain GC_our_memory and GC_n_memory.
7736         * dbg_mlc.c (GC_print_smashed_obj): Improve message.
7737         (GC_print_all_smashed_proc): Pass client object address instead of
7738         base.
7739         * dyn_load.c (sort_heap_sects): New.  (GC_register_map_entries):
7740         Register sections that are contiguous and merged with our heap.
7741         * malloc.c, os_dep.c (GC_text_mapping): Check for just base name
7742         of libraries.
7743         * malloc.c (calloc): Check for special callers even with
7744         USE_PROC_FOR_LIBRARIES. Move assertion.  Add rudimentary
7745         malloc/free tracing.
7746         * misc.c: No longer call GC_init_lib_bounds explicitly.
7747         * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Always
7748         initialize on demand.
7749         * tests/test.c: Call GC_INIT only when required.
7750
7751 2007-08-03  Hans Boehm <Hans.Boehm@hp.com>
7752
7753         * Makefile.direct: Remove comment fragment.
7754         * tests/tests.am: Add smashtest.
7755         * Makefile.in: Regenerate.
7756         * configure.ac: Define GC_USE_DLOPEN_WRAP with redirect-malloc.
7757         * configure: Regenerate.
7758         * pthread_support.c: Fix comment spelling.
7759         * include/private/gcconfig.h: Define USE_PROC_FOR_LIBRARIES with
7760         GC_LINUX_THREADS and REDIRECT_MALLOC.
7761         * tests/smash_test.c: Initial check-in.
7762         * obj_map.c: Print log entry to correct file.
7763         * include/private/thread_local_alloc.h: Add TlsAlloc error check.
7764
7765 2007-07-23  Hans Boehm <Hans.Boehm@hp.com>
7766
7767         * alloc.c (GC_stopped_mark): Call GC_add_current_malloc_heap()
7768         while world is still running.
7769         * os_dep.c (GC_is_heap_base): Don't call GC_add_current_malloc_heap()
7770         with world stopped.
7771         * include/gc.h (GC_INIT for cygwin): Always call GC_add_roots.
7772         * misc.c (GC_init/GC_init_inner): Perform all work in
7773         GC_init_inner.
7774         * Makefile.direct: Expand -DUSE_MUNMAP comment.
7775
7776 2007-07-23  Hans Boehm <Hans.Boehm@hp.com> (really Jim Marshall)
7777
7778         * include/gc.h: Define uintptr_t explicitly for VC++6.
7779         * msvc_dbg.c (GetModuleBase): Revert to strcat if strcat_s doesn't
7780         exist.
7781
7782 2007-07-02  Hans Boehm <Hans.Boehm@hp.com>
7783
7784         * version.h, configure.ac, doc/README: Change to version 7.1alpha1.
7785         * configure: Regenerate.
7786
7787 2007-07-02  Hans Boehm <Hans.Boehm@hp.com>
7788
7789         * version.h, configure.ac, doc/README: Change to version 7.0.
7790         * configure: Regenerate.
7791
7792 2007-07-02  Hans Boehm <Hans.Boehm@hp.com>
7793
7794         * include/gc_config_macros.h: Also check for IA64 when setting
7795         GC_HPUX_THREADS.
7796         * mallocx.c: Change my_bytes_allocd to signed_word.
7797         * include/gc_pthread_redirects.h: Remove obsolete Solaris threads
7798         (as opposed to pthreads) support.
7799
7800 2007-07-02  Hans Boehm <Hans.Boehm@hp.com>
7801
7802         * mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext()
7803         on ARM/Linux.  Check getcontext() return value.
7804
7805 2007-06-29  Hans Boehm <Hans.Boehm@hp.com>
7806
7807         * backgraph.c (per_object_func): Make argument types consistent.
7808         (GC_traverse_back_graph): Mark GC_deepest_obj.
7809
7810 2007-06-29  Hans Boehm <Hans.Boehm@hp.com>
7811
7812         * finalize.c (GC_finalize): Change dl_size and fo_size to size_t.
7813         * os_dep.c (GC_win32_get_mem): Add GC_mem_top_down option.
7814
7815 2007-06-28  Hans Boehm <Hans.Boehm@hp.com>
7816
7817         * doc/README.win32, doc/README, README.QUICK: Fix some of the worst
7818         anachronisms.
7819         * dyn_load.c: Partially support cygwin, but don't enable it yet.
7820
7821 2007-06-28  Hans Boehm <Hans.Boehm@hp.com>
7822
7823         * Makefile.am: Use -no-undefined for libgc.
7824         * Makefile.in: Regenerate.
7825         * Makefile.direct: Document USE_PROC_FOR_LIBRARIES.
7826         * dyn_load.c (GC_register_map_entries): Rename prot_buf to prot
7827         consistently.
7828         * misc.c: Fix some WARN calls.  Move GC_is_initialized setting and
7829         GC_thr_init() call.
7830         * os_dep.c: Consistently use WARN where appropriate.
7831         * thread_local_alloc.c: Revert change to GC_WIN32_THREADS test.  Instead
7832         remove inappropriate pthread.h include.
7833         * doc/README.linux: Remove some anachronisms.
7834
7835 2007-06-23  Hans Boehm <Hans.Boehm@hp.com>
7836
7837         * alloc.c: Also use GC_check_tls on non-Linux systems.
7838         * mallocx.c (GC_reclaim_generic): Remove bogus declaration.
7839         * include/private/gc_priv.h (GC_reclaim_generic): Declare correctly
7840         with prototype.
7841
7842 2007-06-19  Hans Boehm <Hans.Boehm@hp.com>
7843
7844         * alloc.c (GC_adj_bytes_allocd): Avoid (long) casts, fix comment.
7845         (GC_print_heap_sects): Use size_t instead of unsigned long.
7846         * thread_local_alloc.c (GC_lookup_thread): Define in the correct
7847         context.
7848         * win32_threads.c, include/gc_config_macros.h: The last of Romano
7849         Paolo Tenca's patch.  Move stdint.h include to gc_config_macros.h.
7850         * include/gc_inline.h: Avoid gc_priv.h dependencies.
7851         * tests/test.c (check_heap_stats): Replace unsigned long with size_t.
7852
7853 2007-06-12  Hans Boehm <Hans.Boehm@hp.com>
7854
7855         * aclocal.m4: Regenerate to update date.
7856
7857 2007-06-10  Hans Boehm <Hans.Boehm@hp.com>
7858
7859         * NT_X64_STATIC_THREADS_MAKEFILE: Replace obsolete -debugtype:cv.
7860         * mark_rts.c (GC_push_roots): Fix kind type.
7861
7862 2007-06-06  Hans Boehm <Hans.Boehm@hp.com>
7863
7864         * doc/README.win64: New file.
7865         * doc/doc.am, Makefile.direct: Add README.win64.
7866         * Makefile.in: Regenerate.
7867
7868 2007-06-06  Hans Boehm <Hans.Boehm@hp.com>
7869
7870         * Makefile.am, Makefile.direct: Add NT_X64_STATIC_THREADS_MAKEFILE.
7871         * Makefile.in: Regenerate.
7872         * NT_X64_STATIC_THREADS_MAKEFILE: Fix warning flags.
7873         * allochblk.c, alloc.c, blacklst.c, dbg_mlc.c, dyn_load.c,
7874         finalize.c, headers.c, mach_dep.c, malloc.c, mark.c, misc.c,
7875         obj_map.c, os_dep.c, ptr_chck.c, reclaim.c, typd_mlc.c,
7876         win32_threads.c, cord/de_win.c, include/gc_mark.h,
7877         include/private/gc_hdrs.h, include/private/gc_pmark.h,
7878         include/private/gc_priv.h, tests/test_cpp.cc:
7879         Replace old style function declarations.  Clean up integral types.
7880         Remove register declarations.  The change in malloc.c and the
7881         "int descr" declaration in mark.c are the most likely to have
7882         been real bugs outside of win64.
7883         * msvc_dbg.c: Disable on win64.
7884         * win32_threads.c: Add AMD64 support.
7885         * include/gc.h: no backtrace on AMD64 for now.
7886
7887 2007-06-06  Hans Boehm <Hans.Boehm@hp.com>
7888
7889         * msvc_dbg.c(GetModuleBase): Replace strcat with strcat_s.
7890
7891 2007-06-06  Hans Boehm <Hans.Boehm@hp.com>
7892
7893         * include/gc.h: (GC_word, GC_signed_word): Fix win64 definitions.
7894         Don't include windows.h in an extern "C" context.
7895         * include/private/gcconfig.h: Fix win64/X86_64 configuration.
7896         * tests/test.c: Eliminate more old style function definitions.
7897         Cleanup pointer and integer casts for win64.
7898         * tests/test_cpp.cc: Don't include gc_priv.h.
7899         * NT_STATIC_THREADS_MAKEFILE: Restrict suffixes for VC++ 2005.
7900         * NT_X64_STATIC_THREADS_MAKEFILE: New.
7901
7902 2007-06-06  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Romano Paolo Tenca)
7903
7904         * win32_threads.c: Separate out DEBUG_WIN32_PTHREADS_STACK.  Ignore
7905         FINISHED threads for suspension.  (GC_pthread_join): Add
7906         pthread_self() cast.  (GC_pthread_start_inner): Execute cleanup
7907         handler when popping it.
7908         * include/private/gc_locks.h: Inline THREAD_EQUAL for
7909         GC_WIN32_PTHREADS.  Define USE_PTHREAD_LOCKS only if we have
7910         pthreads.
7911
7912 2007-05-23  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Romano Paolo Tenca)
7913
7914         * gc_dlopen.c, thread_local_alloc.c, threadlibs.c, win32_threads.c,
7915         tests/test.c: Accomodate GC_WIN32_PTHREADS.
7916         * include/gc.h: Don't include windows.h for GC_WIN32_PTHREADS.
7917         * include/gc_config_macros.h: Define both PTHREADS and
7918         GC_WIN32_THREADS.
7919         * include/private/gc_locks.h: Nonstandard definitions of
7920         NUMERIC_THREAD_ID for GC_WIN32_PTHREADS.
7921         * doc/README.win32, Makefile.direct: Include documentation
7922         for GC_WIN32_PTHREADS.
7923         * Makefile.direct: Remove some anachronisms in the documentation.
7924
7925 2007-05-23  Hans Boehm <Hans.Boehm@hp.com>
7926
7927         * Makefile.am: Move includes to bottom.  Add better library
7928         dependencies.  Increment library version.  Remove "SUBDIRS += .".
7929         * cord/cord.am, tests/tests.am: Add better library dependencies.
7930         Remove now unnecessary dependencies.
7931         * Makefile.in: Regenerate.
7932         * include/gc.h (GC_beginthreadex, GC_endthreadex, GC_ExitThread):
7933         Move to define on all Windows platforms.  (_beginthread): define
7934         to generate error if used.
7935
7936 2007-05-22  Hans Boehm <Hans.Boehm@hp.com>
7937
7938         * include/private/gc_locks.h: Format to 80 columns.
7939
7940 2007-05-22  Hans Boehm <Hans.Boehm@hp.com>
7941
7942         * malloc.c(GC_free): Ignore bad frees on MSWIN32 with REDIRECT_MALLOC.
7943         * NT_MAKEFILE: msvc_dbg.h is in include/private.  Don't use cvars
7944         rc.
7945         * misc.c (WIN32 GC_write): Define GC_need_to_lock in single-threaded
7946         case.
7947         * win32_threads.c: Test for __MINGW32__ in addition to _MINGW_VER.
7948         (GC_CreateThread, GC_beginthreadex): Deallocate args even if we fail.
7949         * include/gc.h: Add GC_reachable_here().  (GC_WinMain): Add GC_API.
7950         (GC_beginthreadex, GC_endthreadex, GC_ExitThread): Declare.
7951         * tests/test.c: Add GC_reachable_here() call.
7952
7953 2007-05-21  Hans Boehm <Hans.Boehm@hp.com>
7954
7955         * alloc.c (GC_try_to_collect): Call GC_init if necessary.
7956         * tests/thread_leak_test.c: Don't unconditionally define
7957         GC_LINUX_THREADS.
7958
7959 2007-05-21  Andreas Tobler <a.tobler@schweiz.org>
7960
7961         * Makefile.am: Remove extra_ldflags_libgc definition.
7962         * Makefile.in: Regenerate.
7963
7964 2007-05-17  Hans Boehm <Hans.Boehm@hp.com>
7965
7966         * include/private/gc_priv.h: Define AO_REQUIRE_CAS.
7967
7968 2007-05-16  Hans Boehm <Hans.Boehm@hp.com>
7969
7970         * finalize.c (GC_unreachable_finalize_mark_proc): Don't return void
7971         value.
7972
7973 2007-05-15  Hans Boehm <Hans.Boehm@hp.com>
7974
7975         * configure.ac, version.h, doc/README: Change version to 7.0alpha10.
7976         * configure: Regenerate.
7977
7978 [7.0alpha9 release]
7979
7980 2007-05-15  Hans Boehm <Hans.Boehm@hp.com>
7981
7982         * configure.ac, version.h, doc/README: Change version to 7.0alpha9.
7983         * configure: Regenerate.
7984
7985 2007-05-15  Hans Boehm <Hans.Boehm@hp.com>
7986
7987         * Makefile.am: Include NT_STSTIC_THREADS_MAKEFILE in dist.
7988         * Makefile.in: Regenerate.
7989         * include/private/gc_locks.h: GC_compare_and_exchange, GC_atomic_add:
7990         remove. NUMERIC_THREAD_ID, THREAD_EQUAL: New.  GC_lock_holder: now
7991         unsigned long.  I_DONT_HOLD_LOCK, I_HOLD_LOCK: Update.
7992         * pthread_stop_world.c, pthread_support.c, win32_threads.c: Use
7993         NUMERIC_THREAD_ID, THREAD_EQUAL.
7994         * include/private/gcconfig.h: GENERIC_COMPARE_AND_SWAP: Remove.
7995         * include/private/thread_local_alloc.h: Don't USE_COMPILER_TLS on
7996         ARM.
7997
7998 2007-05-11  Hans Boehm <Hans.Boehm@hp.com>
7999
8000         * dbg_mlc.c, include/gc.h, finalize.c: Merge Alexandre Oliva's
8001         GC_debug_register_finalizer_unreachable() patch from gcc tree.
8002         * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Add assertions
8003         to check GC has been initialized.
8004
8005 2007-05-10  Hans Boehm <Hans.Boehm@hp.com>
8006
8007         * include/gc_cpp.h: Documentation updates.
8008         * include/gc_config_macros.h: Don't check for __ppc__ to set
8009         DARWIN_THREADS.
8010         * Makefile.am: Include configure_atomic_ops.sh in dist.
8011         * Makefile.in: Regenerate.
8012
8013 2007-05-08  Hans Boehm <Hans.Boehm@hp.com>
8014
8015         * Makefile.am: Don't distribute copied atomic_ops files.  Include
8016         libatomic_ops with "make dist".
8017         * Makefile.in: Regenerate.
8018         * configure: Regenerate.
8019         * configure.ac: Enable THREAD_LOCAL_ALLOC for Cygwin with threads.
8020         * win32_threads.c: Report error for Cygwin + GC_DLL.
8021
8022 2007-05-08  Hans Boehm <Hans.Boehm@hp.com>
8023
8024         * Makefile.direct: Update THREAD_LOCAL_ALLOC documentation.
8025         * cord/de_win.c: Rename and move AboutBox.  Call GC_INIT.  Remove
8026         MakeProcInstance anachronism.
8027         * doc/README.macros: Officially remove elif prohibition.
8028         Remove documentation for defunct SRC_M3 support.
8029         * include/gc.h: Remove more SRC_M3 references.
8030         * include/private/gcconfig.h: Remove still more SRC_M3 references.
8031         GC_SOLARIS_THREADS no longer needs to be checked separately.
8032
8033 2007-05-08  Hans Boehm <Hans.Boehm@hp.com>
8034
8035         * thread_local_alloc.c, include/private/thread_local_alloc.h:
8036         Spell __declspec correctly.
8037         * NT_STATIC_THREADS_MAKEFILE: Enable thread-local allocation.
8038
8039 2007-05-07  Hans Boehm <Hans.Boehm@hp.com>
8040
8041         * doc/README.win32: Adjust GC_win32_dll_threads rules again.
8042
8043 2007-05-07  Hans Boehm <Hans.Boehm@hp.com>
8044
8045         * mark.c (GC_mark_some wrapper): Restructure for readability, handle
8046         GC_started_thread_while_stopped.
8047         * misc.c (Win32 GC_write): Lock GC_write_cs only if needed.
8048         * win32_threads.c: (client_has_run): remove,
8049         GC_started_thread_while_stopped, GC_attached_thread: add.
8050         (GC_push_all_stacks): Add verbose output.
8051         (DllMain): Avoid initializing collector or the like.
8052         Never update both thread tables.
8053         * doc/README.win32: Adjust GC_win32_dll_threads rules.
8054
8055 2007-05-07  Hans Boehm <Hans.Boehm@hp.com>
8056
8057         * pthread_stop_world.c (GC_push_all_stacks): Print thread count with
8058         GC_PRINT_VERBOSE_STATS.
8059
8060 2007-05-01  Hans Boehm <Hans.Boehm@hp.com>
8061                 (and Manuel Serrano, Craig McDaniel)
8062
8063         * configure.ac: Comment out redundant
8064           AC_DEFINE(NO_EXECUTE_PERMISSION).
8065         * configure: Regenerate.
8066         * sparc_mach_dep.S: Remove single quote in comment.
8067         * include/private/gcconfig.h: Fix DATAEND for NONSTOP.
8068         * win32_threads.c: Include stdint.h for Mingw.  Add GC_API for DllMain.
8069         (GC_use_DllMain): Fix assertion.
8070
8071 2007-02-14  Andreas Tobler <a.tobler@schweiz.org>
8072
8073         * configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin.
8074         * configure: Regenerate.
8075         * Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc.
8076         * Makefile.in: Regenerate.
8077         * include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin
8078         targets. Remove comments.
8079         Prepare ppc64 support for Darwin.
8080
8081 2007-01-29  Andreas Tobler <a.tobler@schweiz.org>
8082
8083         * darwin_stop_world.c: Clean up and reformat code.
8084
8085 2007-01-28  Andreas Tobler <a.tobler@schweiz.org>
8086
8087         * darwin_stop_world.c (GC_push_all_stacks): Fix compiler warnings.
8088         Make i unsigned.
8089         (GC_stop_world): Likewise. Remove unused GC_thread p.
8090         (GC_start_world): Likewise.
8091
8092         * os_dep.c: Define GC_darwin_register_mach_handler_thread extern.
8093         Remove double SIG_HNDLR_PTR definition.
8094         (GC_forward_exception): Fix compiler warnings, make i unsigned.
8095         Initialize thread_state to NULL.
8096         (catch_exception_raise): Fix compiler warnings, make i unsigned.
8097
8098 2007-01-25  Petr Salinger and Hans Boehm <Hans.Boehm@hp.com>
8099
8100         * include/private/gc_priv.h (NEED_FIND_LIMIT, FREEBSD variant):
8101         also define for X86_64.
8102         * configure.ac: Move generic gnu (Hurd) case to below kfreebsd case.
8103         * configure: Regenerate.
8104         * README.changes: Point to ChangeLog.
8105
8106 2007-01-25  Andreas Tobler <a.tobler@schweiz.org>
8107
8108         * darwin_stop_world.c: Move THREAD_FLD defines to ...
8109         * include/private/gc_priv.h: ... here.
8110         Fix THREAD_STATE definitions for ppc64.
8111         * os_dep.c (catch_exception_raise): Use THREAD_FLD for exc_state member
8112         access.
8113
8114 2007-01-18  Andreas Tobler <a.tobler@schweiz.org>
8115
8116         * os_dep.c (if defined(MPROTECT_VDB) && defined(DARWIN)): Clean up and
8117         reformat code.
8118         Correct email reference.
8119
8120 2007-01-11  Andreas Tobler <a.tobler@schweiz.org>
8121
8122         * configure.ac (i?86*-*-darwin*): Replaced HAS_I386_THREAD_STATE_* with
8123         HAS_X86_THREAD_STATE32_*.
8124         (x86_64-*-darwin*): Extended the above check for x86_64-*-darwin* with
8125         HAS_X86_THREAD_STATE64_*.
8126         Added value 1 in the above AC_DEFINE's. Important for the upcoming
8127         Leopard.
8128         * configure: Regenerated.
8129         * include/private/gcconfig.h: Modified X86_64 define for Darwin.
8130         Removed __x86_64__ check in POWERPC section. Added base definitions
8131         for the X86_64 Darwin port.
8132         * include/private/gc_priv.h: Added GC_MACH_HEADER and GC_MACH_SECTION
8133         to distinguish between 32 and 64-bit applications. Added definitions
8134         for X86_64 Darwin.
8135         * darwin_stop_world.c: Added HAS_X86_THREAD_STATE64___RAX. And
8136         replaced HAS_I386_THREAD_STATE___EAX with HAS_X86_THREAD_STATE32___EAX.
8137         (GC_push_all_stacks): Added code for X86_64 Darwin. Even for the
8138         !DARWIN_DONT_PARSE_STACK. Maybe obsolete.
8139         * dyn_load.c (GC_dyld_name_for_hdr): Use GC_MACH_HEADER.
8140         (GC_dyld_image_add): Use GC_MACH_HEADER and GC_MACH_SECTION.
8141         Distinguish between getsectbynamefromheader_64 and
8142         getsectbynamefromheader.
8143         * os_dep.c (catch_exception_raise): Introduce exception definition for
8144         X86_64 Darwin. Replaced old i386_EXCEPTION_STATE_* definition with
8145         x86_EXCEPTION_STATE32_*. Add X86_64 for exc_state.faultvaddr.
8146
8147 2007-01-09  Andreas Tobler <a.tobler@schweiz.org>
8148
8149         * libtool.m4: Update to version from libtool-1.5.22.
8150         * ltmain.sh: Likewise.
8151         * ChangeLog: Created.
8152
8153 See doc/README.changes for earlier changes.