Upgrade Boehm GC to 7.2alpha4.
[cacao.git] / src / mm / boehm-gc / ChangeLog
1 [7.2alpha4]
2
3 2009-12-01  Ivan Maidanski <ivmai@mail.ru>
4
5         * include/gc_version.h, configure.ac, doc/README: Change to
6         version 7.2alpha4.
7         * configure: Regenerate.
8
9 2009-11-21  Ivan Maidanski <ivmai@mail.ru>
10
11         * configure.ac (AC_CONFIG_COMMANDS): Quote srcdir value.
12         * configure: Regenerate.
13
14 2009-11-18  Ivan Maidanski <ivmai@mail.ru> (really mostly Zoltan Varga)
15
16         * include/gc.h (GC_get_suspend_signal): New function declaration.
17         * misc.c (GC_get_suspend_signal): New API function (only if
18         THREADS).
19
20 2009-11-16  Ivan Maidanski <ivmai@mail.ru>
21
22         * alloc.c (min_bytes_allocd): Multiply GC_free_space_divisor by
23         two if GC_incremental (instead of TRUE_INCREMENTAL).
24
25 2009-11-10  Ivan Maidanski <ivmai@mail.ru>
26
27         * sparc_mach_dep.S (GC_push_regs): Remove the reference.
28
29 2009-11-09  Ivan Maidanski <ivmai@mail.ru>
30
31         * os_dep.c (SIZE_T, PULONG_PTR): Remove.
32         * os_dep.c (ULONG_PTR): Replace with GC_ULONG_PTR (defined as GC
33         "word"); add the comment.
34         * os_dep.c (GetWriteWatch_type, detect_GetWriteWatch,
35         GC_gww_read_dirty): Prefix ULONG_PTR with "GC_".
36
37 2009-11-07  Ivan Maidanski <ivmai@mail.ru>
38
39         * win32_threads.c (THREAD_TABLE_SZ): Change back to a power-of-two
40         const value (for speed).
41         * win32_threads.c (THREAD_TABLE_INDEX): New macro.
42         * win32_threads.c (GC_new_thread, GC_lookup_thread_inner,
43         GC_delete_gc_thread, GC_delete_thread, GC_lookup_pthread): Use
44         THREAD_TABLE_INDEX instead of THREAD_TABLE_SZ.
45         * win32_threads.c (PTHREAD_MAP_HASH): Rename to PTHREAD_MAP_INDEX.
46
47 2009-11-07  Ivan Maidanski <ivmai@mail.ru>
48
49         * win32_threads.c (THREAD_TABLE_SZ): Make the const value prime.
50
51 2009-11-06  Ivan Maidanski <ivmai@mail.ru>
52
53         * backgraph.c: Remove apostrophe char from "#error".
54
55 2009-11-06  Ivan Maidanski <ivmai@mail.ru>
56
57         * doc/README.macros (GC_DISABLE_INCREMENTAL): Document.
58         * include/private/gcconfig.h (GC_DISABLE_INCREMENTAL): Recognize
59         new macro; implicitly define it if SMALL_CONFIG.
60         * alloc.c (GC_incremental, GC_timeout_stop_func): Check for
61         GC_DISABLE_INCREMENTAL instead of SMALL_CONFIG.
62         * include/private/gc_priv.h (GC_incremental, TRUE_INCREMENTAL,
63         GC_push_conditional): Ditto.
64         * mark.c (GC_push_next_marked_dirty, GC_push_selected,
65         GC_push_conditional, GC_block_was_dirty): Ditto.
66         * misc.c (GC_enable_incremental): Ditto.
67         * misc.c (GC_init): Ditto (for "GC_PAUSE_TIME_TARGET" and
68         "GC_ENABLE_INCREMENTAL" environment variables).
69         * misc.c (GC_enable_incremental): Reformat the code.
70
71 2009-11-06  Ivan Maidanski <ivmai@mail.ru>
72
73         * dyn_load.c (WIN32_LEAN_AND_MEAN): Guard with ifndef.
74         * misc.c (WIN32_LEAN_AND_MEAN): Ditto.
75         * os_dep.c (WIN32_LEAN_AND_MEAN): Ditto.
76         * allchblk.c (GC_allochblk_nth): Fix a minor typo (don't/doesn't)
77         in a comment.
78         * backgraph.c: Ditto.
79         * dyn_load.c (GC_register_dynamic_libraries): Ditto.
80         * extra/threadlibs.c (main): Ditto.
81         * pthread_support.c (pthread_join): Ditto.
82         * tests/test.c (main): Ditto.
83
84 2009-11-06  Ivan Maidanski <ivmai@mail.ru>
85
86         * mach_dep.c (GC_push_regs): Remove STATIC (just to catch
87         a duplicate symbol definition linker error).
88         * misc.c (GC_clear_stack_inner): Ditto.
89         * sparc_mach_dep.S (GC_push_regs): Comment out the reference.
90         * sparc_mach_dep.S: Remove trailing spaces at EOLn; remove
91         multiple trailing blank lines.
92
93 2009-11-06  Ivan Maidanski <ivmai@mail.ru>
94
95         * include/private/gc_priv.h (GC_write_disabled): New variable
96         declaration (only if GC_ASSERTIONS and Win32 threads).
97         * misc.c (GC_write): Add assertion for GC_write_disabled value is
98         not on (only if THREADS).
99         * win32_threads.c (GC_write_disabled): New variable (only if
100         GC_ASSERTIONS and not Cygwin).
101         * win32_threads.c (GC_stop_world): Set and clear GC_write_disabled
102         (while holding GC_write_cs).
103
104 2009-11-05  Ivan Maidanski <ivmai@mail.ru>
105
106         * win32_threads.c (GC_please_stop): If DllMain-based thread
107         registration is not compiled in then define GC_please_stop as
108         a non-volatile variable for assertion only.
109         * win32_threads.c (GC_stop_world): Set and clear only if defined.
110         * win32_threads.c (GC_stop_world): Add the comment for GC_printf()
111         usage (while holding GC_write_cs).
112         * win32_threads.c (GC_delete_gc_thread): Ditto.
113         * os_dep.c (GC_remove_protection): Ditto.
114
115 2009-11-05  Ivan Maidanski <ivmai@mail.ru>
116
117         * pthread_support.c (GC_inner_start_routine): Join 3 sequential
118         GC_printf() calls into a single one (for DEBUG_THREADS).
119
120 2009-11-05  Ivan Maidanski <ivmai@mail.ru>
121
122         * include/private/gc_priv.h (GC_total_stacksize): New variable
123         declaration (only if THREADS).
124         * alloc.c (GC_total_stacksize): New variable (only if THREADS).
125         * alloc.c (min_bytes_allocd): Calculate stack_size using
126         GC_stackbottom only in the single-threaded case; otherwise use
127         GC_total_stacksize; print GC_total_stacksize value if
128         DEBUG_THREADS.
129         * darwin_stop_world.c (GC_push_all_stacks): Use "%p" printf type
130         specifier for lo/hi values (instead of "%lx").
131         * darwin_stop_world.c (GC_push_all_stacks): Use
132         GC_push_all_stack_frames() instead of GC_push_all_stack().
133         * darwin_stop_world.c (GC_push_all_stacks): Recalculate
134         GC_total_stacksize value.
135         * pthread_stop_world.c (GC_push_all_stacks): Ditto.
136         * win32_threads.c (GC_push_all_stacks): Ditto.
137         * win32_threads.c (GC_push_stack_for): Pass "me" argument; return
138         stack size; don't check for non-zero value of thread->stack_base.
139         * win32_threads.c (GC_push_all_stacks): Don't call
140         GC_push_stack_for() and don't check for "t->id == me" if
141         thread->stack_base is zero.
142
143 2009-11-05  Ivan Maidanski <ivmai@mail.ru>
144
145         * dyn_load.c (GC_dump_meminfo): Prefix "%lx" printf type specifier
146         with "0x".
147         * os_dep.c (PROTECT): Ditto.
148         * win32_threads.c (GC_mark_thread_local_free_lists): Cast p->id to
149         int (to match printf type specifier).
150
151 2009-11-05  Ivan Maidanski <ivmai@mail.ru>
152
153         * tests/test.c (check_heap_stats): Take into account the unmapped
154         memory size when checking for "Unexpected heap growth"; remove
155         FIXME.
156
157 2009-11-03  Hans Boehm <Hans.Boehm@hp.com>
158
159         * alloc.c: Revert last change.
160
161 2009-11-02  Ivan Maidanski <ivmai@mail.ru>
162
163         * include/private/gcconfig.h (STACKBOTTOM): Add a presence check
164         for eCos/NOSYS.
165         * misc.c (GC_write): Comment out _Jv_diag_write() call (since no
166         longer defined in GCJ).
167
168 2009-11-02  Ivan Maidanski <ivmai@mail.ru>
169
170         * os_dep.c (brk): Rename to ecos_gc_brk.
171
172 2009-11-01  Ivan Maidanski <ivmai@mail.ru>
173
174         * alloc.c (min_bytes_allocd): Use GC_stackbottom value to compute
175         stack_size even if THREADS.
176         * doc/README.macros (DEBUG_THREADS): Document.
177         * pthread_support.c (DEBUG_THREADS): Remove the commented out
178         definition.
179         * win32_threads.c (DEBUG_WIN32_THREADS): Remove duplicate
180         definition.
181         * win32_threads.c: Include errno.h (except for WinCE).
182         * win32_threads.c (GC_win32_start_inner): Copy "start" and "param"
183         to local variables, and free "arg" parameter before "start"
184         invocation.
185         * win32_threads.c (GC_beginthreadex): Set errno to EAGAIN on error
186         (instead of calling SetLastError(ERROR_NOT_ENOUGH_MEMORY)).
187         * win32_threads.c (GC_beginthreadex): Return 0 on error (instead
188         of -1).
189
190 2009-10-23  Ivan Maidanski <ivmai@mail.ru>
191
192         * darwin_stop_world.c (GC_darwin_register_mach_handler_thread):
193         Use GC_INNER for the function definition.
194         * include/private/darwin_stop_world.h
195         (GC_darwin_register_mach_handler_thread): Remove the prototype.
196         * include/private/darwin_stop_world.h: Add copyright header.
197         * os_dep.c (GC_darwin_register_mach_handler_thread): Use GC_INNER
198         for the function prototype.
199         * include/private/gc_priv.h (NDEBUG): Explicitly define if
200         NO_DEBUGGING and not GC_ASSERTIONS (before the standard headers
201         inclusion).
202
203 2009-10-22  Ivan Maidanski <ivmai@mail.ru>
204
205         * include/private/gcconfig.h: Move DebugBreak() workaround (for
206         x86mingw32ce toolchain) to gc_priv.h (after windows.h inclusion).
207
208 2009-10-22  Ivan Maidanski <ivmai@mail.ru>
209
210         * allchblk.c (GC_unmap_old, GC_merge_unmapped, GC_allochblk,
211         GC_freehblk): Use GC_INNER for the function definition.
212         * alloc.c (GC_never_stop_func, GC_should_collect,
213         GC_try_to_collect_inner, GC_collect_a_little_inner,
214         GC_set_fl_marks, GC_add_to_our_memory, GC_add_to_heap,
215         GC_expand_hp_inner, GC_collect_or_expand, GC_allocobj): Ditto.
216         * backgraph.c (GC_build_back_graph, GC_traverse_back_graph):
217         Ditto.
218         * blacklst.c (GC_default_print_heap_obj_proc, GC_bl_init,
219         GC_promote_black_lists, GC_unpromote_black_lists,
220         GC_add_to_black_list_normal, GC_add_to_black_list_stack,
221         GC_is_black_listed): Ditto.
222         * darwin_stop_world.c (GC_push_all_stacks, GC_push_all_stacks,
223         GC_stop_init, GC_stop_world, GC_start_world): Ditto.
224         * dbg_mlc.c (GC_has_other_debug_info, GC_store_back_pointer,
225         GC_marked_for_finalization, GC_generate_random_backtrace_no_gc,
226         GC_store_debug_info, GC_start_debugging,
227         GC_debug_generic_malloc_inner,
228         GC_debug_generic_malloc_inner_ignore_off_page,
229         GC_debug_malloc_uncollectable, GC_debug_free_inner): Ditto.
230         * dyn_load.c (GC_register_dynamic_libraries,
231         GC_register_main_static_data, GC_init_dyld): Ditto.
232         * finalize.c (GC_push_finalizer_structures, GC_finalize,
233         GC_notify_or_invoke_finalizers, GC_print_finalization_stats):
234         Ditto.
235         * gcj_mlc.c (GC_core_gcj_malloc): Ditto.
236         * headers.c (GC_find_header, GC_header_cache_miss,
237         GC_scratch_alloc, GC_init_headers, GC_install_header,
238         GC_install_counts, GC_remove_header, GC_remove_counts,
239         GC_next_used_block, GC_prev_block): Ditto.
240         * mach_dep.c (GC_with_callee_saves_pushed): Ditto.
241         * malloc.c (GC_collect_or_expand, GC_alloc_large,
242         GC_generic_malloc_inner, GC_generic_malloc_inner_ignore_off_page,
243         GC_core_malloc_atomic, GC_core_malloc, GC_free_inner): Ditto.
244         * mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.
245         * mark.c (GC_collection_in_progress, GC_clear_hdr_marks,
246         GC_set_hdr_marks, GC_set_mark_bit, GC_clear_mark_bit,
247         GC_clear_marks, GC_initiate_gc, GC_mark_some,
248         GC_mark_stack_empty, GC_invalidate_mark_state,
249         GC_signal_mark_stack_overflow, GC_mark_from, GC_help_marker,
250         GC_mark_init, GC_push_all, GC_push_conditional,
251         GC_mark_and_push_stack, GC_push_all_eager, GC_push_all_stack):
252         Ditto.
253         * mark_rts.c (GC_is_static_root, GC_roots_present, GC_approx_sp,
254         GC_exclude_static_roots_inner, GC_push_all_register_frames,
255         GC_push_all_stack_frames, GC_cond_register_dynamic_libraries,
256         GC_push_roots): Ditto.
257         * misc.c (GC_extend_size_map, GC_clear_stack, GC_err_write):
258         Ditto.
259         * new_hblk.c (GC_build_fl, GC_new_hblk): Ditto.
260         * obj_map.c (GC_register_displacement_inner, GC_add_map_entry,
261         GC_initialize_offsets): Ditto.
262         * os_dep.c (GC_get_maps, GC_parse_map_entry, GC_text_mapping,
263         GC_init_linux_data_start, GC_init_netbsd_elf, GC_setpagesize,
264         GC_set_and_save_fault_handler, GC_setup_temporary_fault_handler,
265         GC_reset_fault_handler, GC_get_register_stack_base, GC_init_win32,
266         GC_add_current_malloc_heap, GC_is_heap_base, GC_unmap, GC_remap,
267         GC_unmap_gap, GC_push_all_stacks, GC_gww_dirty_init,
268         GC_dirty_init, GC_read_dirty, GC_page_was_dirty,
269         GC_page_was_ever_dirty, GC_remove_protection,
270         GC_write_fault_handler, GC_mprotect_stop, GC_mprotect_resume,
271         GC_save_callers, GC_print_callers): Ditto.
272         * pthread_stop_world.c (GC_push_all_stacks, GC_stop_world,
273         GC_start_world, GC_stop_init): Ditto.
274         * pthread_support.c (GC_mark_thread_local_free_lists,
275         GC_lookup_thread, GC_reset_finalizer_nested,
276         GC_check_finalizer_nested, GC_segment_is_thread_stack,
277         GC_greatest_stack_base_below, GC_thr_init, GC_init_parallel,
278         GC_do_blocking_inner, GC_lock, GC_acquire_mark_lock,
279         GC_release_mark_lock, GC_wait_for_reclaim, GC_notify_all_builder,
280         GC_wait_marker, GC_notify_all_marker): Ditto.
281         * reclaim.c (GC_print_all_errors, GC_block_empty,
282         GC_reclaim_generic, GC_start_reclaim, GC_continue_reclaim,
283         GC_reclaim_all): Ditto.
284         * thread_local_alloc.c (GC_init_thread_local,
285         GC_destroy_thread_local, GC_mark_thread_local_fls_for): Ditto.
286         * win32_threads.c (GC_reset_finalizer_nested,
287         GC_check_finalizer_nested, GC_do_blocking_inner, GC_stop_world,
288         GC_start_world, GC_push_all_stacks, GC_get_next_stack,
289         GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_for_reclaim,
290         GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker,
291         GC_thr_init, GC_init_parallel, GC_lock,
292         GC_mark_thread_local_free_lists): Ditto.
293         * alloc.c (GC_add_current_malloc_heap, GC_build_back_graph,
294         GC_traverse_back_graph): Use GC_INNER for the function prototype.
295         * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
296         Ditto.
297         * dbg_mlc.c (GC_default_print_heap_obj_proc): Ditto.
298         * dyn_load.c (GC_parse_map_entry, GC_get_maps,
299         GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base,
300         GC_get_next_stack): Ditto.
301         * finalize.c (GC_reset_finalizer_nested,
302         GC_check_finalizer_nested): Ditto.
303         * gcj_mlc.c (GC_start_debugging): Ditto.
304         * include/private/dbg_mlc.h (GC_save_callers, GC_print_callers,
305         GC_has_other_debug_info, GC_store_debug_info): Ditto.
306         * include/private/gc_hdrs.h (GC_header_cache_miss): Ditto.
307         * include/private/gc_locks.h (GC_lock): Ditto.
308         * include/private/gc_pmark.h (GC_signal_mark_stack_overflow,
309         GC_mark_from): Ditto.
310         * include/private/pthread_support.h (GC_lookup_thread,
311         GC_stop_init): Ditto.
312         * include/private/thread_local_alloc.h (GC_init_thread_local,
313         GC_destroy_thread_local, GC_mark_thread_local_fls_for): Ditto.
314         * malloc.c (GC_extend_size_map, GC_text_mapping): Ditto.
315         * mark.c (GC_page_was_ever_dirty): Ditto.
316         * mark_rts.c (GC_mark_thread_local_free_lists): Ditto.
317         * misc.c (GC_register_main_static_data, GC_init_win32,
318         GC_setpagesize, GC_init_linux_data_start,
319         GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf,
320         GC_do_blocking_inner): Ditto.
321         * os_dep.c (GC_greatest_stack_base_below): Ditto.
322         * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init):
323         Ditto.
324         * include/private/gc_priv.h: Ditto (for most prototypes).
325         * include/private/gc_priv.h (GC_INNER): Update the comment.
326         * doc/README.macros (GC_DLL): Update.
327
328 2009-10-22  Ivan Maidanski <ivmai@mail.ru>
329
330         * alloc.c (GC_collection_in_progress): Move the prototype to
331         gc_priv.h.
332         * gc_dlopen.c (GC_collection_in_progress): Ditto.
333         * pthread_support.c (GC_collection_in_progress): Ditto.
334         * misc.c (GC_init_parallel): Ditto.
335         * pthread_support.c (GC_init_parallel): Ditto.
336         * win32_threads.c (GC_init_parallel): Ditto.
337         * darwin_stop_world.c (GC_thr_init): Ditto.
338         * misc.c (GC_thr_init): Ditto.
339         * pthread_stop_world.c (GC_thr_init): Ditto.
340         * pthread_support.c (GC_thr_init): Ditto.
341         * blacklst.c (GC_clear_bl, GC_copy_bl,
342         GC_number_stack_black_listed): Make STATIC.
343         * dbg_mlc.c (GC_print_obj, GC_make_closure,
344         GC_debug_invoke_finalizer): Ditto.
345         * malloc.c (GC_alloc_large_and_clear): Ditto.
346         * mark.c (GC_push_selected, GC_push_marked1, GC_push_marked2,
347         GC_push_marked4, GC_push_marked, GC_push_next_marked,
348         GC_push_next_marked_dirty, GC_push_next_marked_uncollectable):
349         Ditto.
350         * misc.c (GC_clear_stack_inner): Ditto.
351         * os_dep.c (GC_repeat_read, GC_default_push_other_roots): Ditto.
352         * darwin_stop_world.c (FindTopOfStack): Make static; define only
353         if not DARWIN_DONT_PARSE_STACK.
354         * dbg_mlc.c (GC_debug_free_inner): Define only if DBG_HDRS_ALL.
355         * dyn_load.c (GC_repeat_read): Remove unused prototype.
356         * include/private/gc_pmark.h (GC_find_start): Ditto.
357         * misc.c (GC_read, GC_register_finalizer_no_order): Ditto.
358         * dyn_load.c (GC_segment_is_thread_stack): Add prototype (only if
359         THREADS).
360         * dyn_load.c (GC_register_main_static_data): Define only if
361         DYNAMIC_LOADING.
362         * finalize.c (GC_enqueue_all_finalizers): Remove unnecessary tail
363         "return" statement.
364         * gc_dlopen.c (GC_SOLARIS_THREADS): Don't recognize (since implies
365         GC_PTHREADS).
366         * include/gc.h: Fix a typo.
367         * include/gc_inline.h (GC_ASSERT): Define (if not defined) since
368         the header is public.
369         * include/gc_inline.h (GC_generic_malloc_many): New public
370         function declaration.
371         * mallocx.c (GC_generic_malloc_many): Make public.
372         * include/private/gc_priv.h (GC_INNER): Use visibility attribute
373         (if available).
374         * include/private/gc_priv.h (GC_EXTERN): Define using GC_INNER.
375         * include/private/gc_priv.h: Include atomic_ops.h if THREADS and
376         MPROTECT_VDB.
377         * os_dep.c: Don't include atomic_ops.h
378         * win32_threads.c: Ditto.
379         * include/private/gc_priv.h (GC_push_selected, GC_push_regs,
380         GC_push_marked, GC_number_stack_black_listed,
381         GC_alloc_large_and_clear, GC_reclaim_or_delete_all,
382         GC_generic_malloc_many, GC_make_closure,
383         GC_debug_invoke_finalizer, GC_print_obj, GC_page_was_ever_dirty):
384         Remove the prototype.
385         * mark.c (GC_page_was_ever_dirty): Add prototype (only if
386         PROC_VDB).
387         * include/private/gc_priv.h (GC_push_next_marked_dirty,
388         GC_push_next_marked, GC_push_next_marked_uncollectable): Move
389         the prototype to mark.c.
390         * include/private/gc_priv.h (GC_is_static_root): Declare only if
391         not THREADS.
392         * include/private/gc_priv.h (GC_free_inner): Declare only if
393         THREADS.
394         * include/private/gc_priv.h (GC_debug_free_inner): Declare only if
395         THREADS and DBG_HDRS_ALL.
396         * include/private/gc_priv.h (GC_markers): Declare GC_markers only
397         if PARALLEL_MARK.
398         * include/private/gc_priv.h (GC_register_main_static_data): Move
399         the prototype to misc.c.
400         * mach_dep.c (GC_push_regs): Make STATIC; define only along with
401         HAVE_PUSH_REGS definition.
402         * mach_dep.c (GC_clear_stack_inner): Replace K&R-style function
403         definition with the ANSI C one.
404         * mark.c (GC_started_thread_while_stopped): Declared only if not
405         GNU C.
406         * win32_threads.c (GC_started_thread_while_stopped): Don't define
407         if GNU C.
408         * mark.c (GC_mark_from): Avoid unbalanced brackets in
409         #if-#else-#endif blocks.
410         * mark_rts.c (GC_is_static_root): Define only if not THREADS.
411         * os_dep.c (GC_get_stack_base): Make public (for OpenBSD).
412         * os_dep.c (GC_page_was_ever_dirty): Comment out the function
413         except for PROC_VDB.
414         * tests/test.c (main): Don't reference GC_print_obj,
415         GC_make_closure, GC_debug_invoke_finalizer,
416         GC_page_was_ever_dirty, GC_is_fresh (in GC_noop).
417         * thread_local_alloc.c: Don't include "gc_inline.h".
418         * win32_threads.c (GC_write_fault_handler): Declare only if
419         MPROTECT_VDB.
420
421 2009-10-21  Ivan Maidanski <ivmai@mail.ru>
422
423         * allchblk.c (DEBUG): Remove macro (since unused).
424         * allchblk.c: Include private/gc_priv.h before other includes and
425         definitions.
426         * alloc.c: Ditto.
427         * gc_dlopen.c: Ditto.
428         * headers.c: Ditto.
429         * mallocx.c: Ditto.
430         * mark_rts.c: Ditto.
431         * new_hblk.c: Ditto.
432         * reclaim.c: Ditto.
433         * mark.c: Include private/gc_pmark.h before other includes.
434         * misc.c: Ditto.
435         * dyn_load.c (_GNU_SOURCE): Move the definition to gc_priv.h.
436         * pthread_support.c (_USING_POSIX4A_DRAFT10): Ditto.
437         * pthread_support.c (_POSIX4A_DRAFT10_SOURCE): Remove (since
438         already defined in gc_config_macros.h).
439         * dyn_load.c (GC_init_dyld): Remove parameter cast for
440         _dyld_register_func_for_add_image() and
441         _dyld_register_func_for_remove_image(); add the comment about
442         possible warnings; add FIXME for the deprecated
443         _dyld_bind_fully_image_containing_address().
444         * include/private/gc_priv.h: Include gc.h before the standard
445         headers inclusion.
446         * tests/test.c: Ditto.
447         * include/private/gcconfig.h (DebugBreak): Update the comment.
448         * typd_mlc.c (ED_INITIAL_SIZE): Remove ';'.
449         * alloc.c: Reformat the code (partly adjust indentation).
450         * backgraph.c: Ditto.
451         * blacklst.c: Ditto.
452         * checksums.c: Ditto.
453         * finalize.c: Ditto.
454         * gcj_mlc.c: Ditto.
455         * mach_dep.c: Ditto.
456         * mark_rts.c: Ditto.
457         * obj_map.c: Ditto.
458         * os_dep.c: Ditto.
459         * ptr_chck.c: Ditto.
460         * stubborn.c: Ditto.
461         * thread_local_alloc.c: Ditto.
462         * typd_mlc.c: Ditto.
463
464 2009-10-20  Ivan Maidanski <ivmai@mail.ru> (really mostly OpenBSD contributors)
465
466         * configure.ac (openbsd): Define GC_OPENBSD_THREADS.
467         * configure.ac: Add AM_CONDITIONAL(OPENBSD_THREADS).
468         * configure.ac: Add sparc-openbsd case.
469         * doc/README.macros (GC_NETBSD_THREADS, GC_OPENBSD_THREADS):
470         Document.
471         * tests/test.c (main): Handle OpenBSD case.
472         * extra/threadlibs.c: Add the copyright header; expand all tabs to
473         spaces; remove trailing spaces at EOLn.
474         * include/private/pthread_stop_world.h: Ditto.
475         * extra/threadlibs.c (main): Replace K&R-style function definition
476         with the ANSI C one.
477         * extra/threadlibs.c (main): Handle GC_OPENBSD_THREADS case.
478         * dyn_load.c (OPENBSD): Recognize (similar to NETBSD).
479         * include/gc_config_macros.h (GC_SOLARIS_THREADS): Recognize;
480         define it for OpenBSD.
481         * include/gc_pthread_redirects.h (GC_pthread_sigmask,
482         pthread_sigmask): Don't declare and redefine for OpenBSD.
483         * include/private/gcconfig.h: Handle OpenBSD (on arm, sh, i386,
484         amd64, powerpc).
485         * mach_dep.c (NO_GETCONTEXT): Ditto.
486         * include/private/pthread_stop_world.h (thread_stop_info): Don't
487         define last_stop_count field if OpenBSD.
488         * misc.c (GC_init_dyld): Add declaration (if NetBSD).
489         * misc.c (GC_init): Don't call GC_init_netbsd_elf() for OpenBSD.
490         * os_dep.c (GC_init_netbsd_elf): Don't define for OpenBSD.
491         * os_dep.c (old_segv_act, GC_jmp_buf_openbsd): New static variable
492         (only if OpenBSD).
493         * os_dep.c (GC_fault_handler_openbsd, GC_find_limit_openbsd,
494         GC_skip_hole_openbsd): New static function (only if OpenBSD).
495         * os_dep.c (GC_get_stack_base, GC_get_main_stack_base,
496         GC_register_data_segments): Define specially for OpenBSD case.
497         * os_dep.c (GC_fault_handler_lock): Initialize to
498         AO_TS_INITIALIZER (instead of 0).
499         * pthread_support.c (GC_allocate_lock): Ditto.
500         * pthread_stop_world.c (NSIG, GC_print_sig_mask,
501         GC_remove_allowed_signals, suspend_handler_mask, GC_stop_count,
502         GC_world_is_stopped, GC_retry_signals, SIG_THR_RESTART,
503         GC_suspend_ack_sem, GC_suspend_handler_inner, GC_suspend_handler,
504         GC_restart_handler): Don't define and use if OpenBSD.
505         * pthread_stop_world.c (GC_suspend_all, GC_stop_world,
506         GC_start_world): Handle OpenBSD case.
507         * pthread_stop_world.c (GC_stop_init): Define as empty if OpenBSD.
508         * pthread_support.c (pthread_sigmask): Don't undefine the macro and
509         don't define the wrapper function if OpenBSD.
510         * pthread_support.c (GC_thr_init): Handle OpenBSD case.
511         * configure: Regenerate.
512         * include/private/config.h.in: Ditto.
513
514 2009-10-20  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
515
516         * dyn_load.c: Move the inclusion of private/gc_priv.h below
517         definition of a feature macro (_GNU_SOURCE).
518
519 2009-10-20  Ivan Maidanski <ivmai@mail.ru>
520
521         * include/gc.h (REVEAL_POINTER): Remove redundant parentheses.
522         * include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): New macros
523         (only if GC_I_HIDE_POINTERS).
524         * backgraph.c (GET_OH_BG_PTR): Prefix REVEAL_POINTER() with "GC_".
525         * dbg_mlc.c (GC_get_back_ptr_info): Ditto.
526         * finalize.c (GC_grow_table, GC_dump_finalization, GC_finalize,
527         GC_enqueue_all_finalizers): Ditto.
528         * backgraph.c (SET_OH_BG_PTR): Prefix HIDE_POINTER() with "GC_".
529         * finalize.c (GC_general_register_disappearing_link,
530         GC_unregister_disappearing_link, GC_register_finalizer_inner,
531         GC_finalize): Ditto.
532         * include/private/dbg_mlc.h (HIDE_BACK_PTR): Ditto.
533         * include/private/dbg_mlc.h (GC_I_HIDE_POINTERS): Define instead
534         of I_HIDE_POINTERS.
535         * include/private/gc_priv.h (GC_I_HIDE_POINTERS): Ditto.
536         * include/gc.h (_GC_H): Strip leading underscore.
537         * include/gc_backptr.h (_GC_H): Ditto.
538         * include/gc_gcj.h (_GC_H): Ditto.
539         * include/gc_mark.h (_GC_H): Ditto.
540         * include/gc_typed.h (_GC_TYPED_H, _GC_H): Ditto.
541         * include/javaxfc.h (_GC_H): Ditto.
542         * include/new_gc_alloc.h (__GC_SPECIALIZE): Ditto.
543         * include/private/dbg_mlc.h (_GC_H): Ditto.
544         * include/private/gc_priv.h (_GC_H): Ditto.
545         * include/gc_backptr.h: Reformat the code (adjust indentation,
546         comment out function parameter names).
547         * include/gc_gcj.h: Ditto.
548         * include/gc_mark.h: Ditto.
549         * include/gc_typed.h: Ditto.
550         * include/javaxfc.h: Ditto.
551         * include/private/dbg_mlc.h: Ditto.
552         * include/private/gc_priv.h: Ditto.
553
554 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
555
556         * gc_cpp.cc: Include "gc_cpp.h" instead of <gc_cpp.h>.
557
558 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
559
560         * include/private/gc_priv.h (GC_INNER): New macro (for GC-scope
561         variable definitions).
562         * include/private/gc_priv.h (GC_EXTERN): Update the comment.
563         * allchblk.c (GC_unmap_threshold): Define as GC_INNER.
564         * alloc.c (GC_incremental, GC_world_stopped, GC_n_heap_sects,
565         GC_n_memory, GC_fail_count): Ditto.
566         * blacklst.c (GC_black_list_spacing, GC_print_heap_obj): Ditto.
567         * gcj_mlc.c (GC_gcj_malloc_initialized, GC_gcjobjfreelist): Ditto.
568         * mach_dep.c (GC_save_regs_ret_val): Ditto.
569         * mark.c (GC_n_mark_procs, GC_obj_kinds, GC_n_kinds,
570         GC_mark_stack, GC_mark_stack_limit, GC_mark_stack_size,
571         GC_mark_stack_top, GC_mark_state, GC_mark_stack_too_small,
572         GC_mark_no, GC_markers): Ditto.
573         * mark_rts.c (GC_root_size, GC_push_typed_structures): Ditto.
574         * misc.c (GC_allocate_ml, GC_debugging_started, GC_check_heap,
575         GC_print_all_smashed, GC_print_back_height, GC_dump_regularly,
576         GC_backtraces, GC_force_unmap_on_gcollect,
577         GC_large_alloc_warn_interval, GC_is_initialized, GC_write_cs,
578         GC_current_warn_proc, GC_blocked_sp, GC_activation_frame): Ditto.
579         * os_dep.c (GC_page_size, GC_dont_query_stack_min,
580         GC_no_win32_dlls, GC_wnt, GC_sysinfo, GC_push_other_roots,
581         GC_dirty_maintained, GC_fault_handler_lock): Ditto.
582         * pthread_support.c (GC_allocate_ml, GC_lock_holder,
583         GC_need_to_lock, GC_thr_initialized, GC_threads,
584         GC_in_thread_creation, GC_collecting, GC_allocate_lock,
585         GC_mark_lock_holder): Ditto.
586         * reclaim.c (GC_bytes_found, GC_fl_builder_count, GC_have_errors):
587         Ditto.
588         * win32_threads.c (GC_allocate_ml, GC_lock_holder,
589         GC_need_to_lock, GC_mark_lock_holder, GC_collecting): Ditto.
590         * extra/gc.c (GC_INNER, GC_EXTERN): Define as STATIC.
591         * mach_dep.c (GC_with_callee_saves_pushed): Remove redundant {}.
592         * os_dep.c (GC_init_win32): Reformat the comment.
593
594 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
595
596         * include/private/gc_priv.h (GC_bytes_allocd, GC_objfreelist,
597         GC_aobjfreelist): Replace GC_EXTERN to extern for SEPARATE_GLOBALS
598         case (since they are not defined inside GC at present).
599         * include/private/gc_priv.h (GC_objects_are_marked): Remove the
600         declaration (since made static).
601         * mark.c (GC_objects_are_marked): Define as STATIC.
602         * win32_threads.c (GC_thr_initialized, GC_in_thread_creation):
603         Ditto.
604         * mark.c (GC_N_KINDS_INITIAL_VALUE): New macro (defined and used
605         to initialize GC_n_kinds).
606         * win32_threads.c (start_mark_threads): Adjust the comment.
607
608 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
609
610         * alloc.c (GC_notify_full_gc): Use GC_INLINE for a tiny static
611         function.
612         * backgraph.c (pop_in_progress, GC_apply_to_each_object): Ditto.
613         * mark_rts.c (add_roots_to_index): Ditto.
614
615 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
616
617         * extra/gc.c: New file.
618         * Makefile.am (EXTRA_DIST): Add "extra/gc.c".
619         * configure: Regenerate.
620         * Makefile.in: Ditto.
621
622 2009-10-19  Ivan Maidanski <ivmai@mail.ru>
623
624         * misc.c (GC_log): Remove the declaration; move the definition (to
625         the place where it is used); make STATIC.
626         * misc.c (GC_init): Use GC_err_printf() instead of GC_log_printf()
627         to print open log failure.
628         * misc.c (GC_write): Don't abort on open log failure if the GC is
629         compiled with GC_PRINT_VERBOSE_STATS (useful for WinCE).
630
631 2009-10-19  Ivan Maidanski <ivmai@mail.ru> (really Andreas Tobler)
632
633         * include/private/gcconfig.h (USE_MMAP): Guard with ifndef.
634
635 2009-10-18  Ivan Maidanski <ivmai@mail.ru>
636
637         * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Move
638         the variable declaration to gc_priv.h.
639         * alloc.c (GC_bytes_found, GC_unmap_threshold,
640         GC_force_unmap_on_gcollect): Ditto.
641         * dyn_load.c (GC_no_win32_dlls, GC_wnt): Ditto.
642         * finalize.c (GC_fail_count): Ditto.
643         * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
644         GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Ditto.
645         * include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size,
646         GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack,
647         GC_mark_stack_too_small, GC_mark_state): Ditto.
648         * include/private/pthread_support.h (GC_threads,
649         GC_thr_initialized, GC_in_thread_creation): Ditto.
650         * mallocx.c (GC_bytes_found): Ditto.
651         * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Ditto.
652         * misc.c (GC_unmap_threshold): Ditto.
653         * os_dep.c (GC_unmap_threshold): Ditto.
654         * pthread_support.c (GC_markers): Ditto.
655         * thread_local_alloc.c (GC_gcjobjfreelist,
656         GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
657         * win32_threads.c (GC_fault_handler_lock, GC_write_cs,
658         GC_dont_query_stack_min, GC_markers, GC_wnt): Ditto.
659         * include/private/gc_priv.h (GC_EXTERN): New macro (used mostly as
660         a tag for now); defined after "gcconfig.h" inclusion.
661         * include/private/gc_priv.h: Use GC_EXTERN instead of "extern"
662         keyword for most global variables.
663         * alloc.c (GC_copyright): Add the comment about the symbol
664         visibility.
665         * finalize.c (GC_fo_entries): Ditto.
666         * include/private/gc_priv.h (GC_print_stats): Ditto.
667         * misc.c (GC_quiet): Ditto.
668         * mallocx.c (GC_bytes_allocd_tmp): Make the volatile variable
669         STATIC.
670         * pthread_support.c (GC_threads): Add explicit zero initializer
671         (to make the variable definition differ from the declaration).
672
673 2009-10-18  Ivan Maidanski <ivmai@mail.ru>
674
675         * backgraph.c (GC_quiet): Remove the declaration (not needed
676         anymore since gc_priv.h is always included).
677         * checksums.c (GC_quiet): Ditto.
678         * gcj_mlc.c (GC_quiet): Ditto.
679         * headers.c (GC_hdr_cache_hits, GC_hdr_cache_misses): Add the
680         comment.
681         * include/private/gc_hdrs.h (GC_hdr_cache_hits,
682         GC_hdr_cache_misses): Ditto.
683         * mark.c (GC_first_nonempty): Make the volatile variable STATIC.
684         * pthread_stop_world.c (GC_stop_count, GC_world_is_stopped):
685         Ditto.
686         * win32_threads.c (GC_please_stop, GC_max_thread_index,
687         GC_mark_mutex_waitcnt): Ditto.
688
689 2009-10-18  Ivan Maidanski <ivmai@mail.ru>
690
691         * pthread_support.c (GC_USE_LD_WRAP): Fix a typo (swapped 'L' and
692         'D') in the name.
693
694 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
695
696         * gc_dlopen.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Define if dlopen
697         redirection is turned off; turn it on later when dlopen real
698         symbol is no longer needed (according to the comment and the same
699         as in dyn_load.c).
700         * gc_dlopen.c (WRAP_FUNC, REAL_FUNC): Rename to WRAP_DLFUNC and
701         REAL_DLFUNC, respectively (to have unique names since the
702         definitions may differ from that of the similar ones in
703         pthread_support.c).
704         * mark.c (source): Undefine the macro when no longer needed.
705         * os_dep.c (handler): Rename the type to GC_fault_handler_t (to
706         have the unique name across the project).
707         * os_dep.c (STAT_BUF_SIZE, STAT_READ); Guard with ifndef; add the
708         comment.
709         * pthread_support.c (STAT_BUF_SIZE, STAT_READ): Ditto.
710         * os_dep.c (sbrk): Undo sbrk() redirection (for ECOS) when no
711         longer needed.
712
713 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
714
715         * pthread_stop_world.c (pthread_sigmask): Undefine before using
716         in GC_print_sig_mask() (only if DEBUG_THREADS); add the comment.
717         * win32_threads.c (dlopen, _beginthread): Don't undefine (since
718         neither redirected nor used here).
719         * win32_threads.c (GC_Thread_Rep): Rename "table_management" to
720         "tm" for short; remove "tm_" prefix.
721         * win32_threads.c (in_use, next): Don't define the macros; use
722         tm.in_use and tm.next fields, respectively (to ease debugging).
723         * win32_threads.c (HASH): Rename to PTHREAD_MAP_HASH (to have
724         unique name across the project).
725
726 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
727
728         * include/private/gc_priv.h (I_HIDE_POINTERS): Define before gc.h
729         inclusion.
730         * include/private/gc_pmark.h (I_HIDE_POINTERS): Define if gc.h is
731         not included yet.
732         * finalize.c (I_HIDE_POINTERS): Don't define.
733         * include/private/dbg_mlc.h (I_HIDE_POINTERS): Ditto.
734         * misc.c (I_HIDE_POINTERS): Ditto.
735         * include/private/dbg_mlc.h (HIDE_POINTER, REVEAL_POINTER,
736         GC_hidden_pointer): Don't define if HIDE_POINTER is undefined.
737         * include/private/gc_pmark.h: Remove the comment about gc_priv.h
738         inclusion order.
739
740 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
741
742         * dyn_load.c: Include gc_priv.h before using configuration
743         information (MACOS).
744         * dyn_load.c (GC_must_restore_redefined_dlopen): Rename to
745         GC_MUST_RESTORE_REDEFINED_DLOPEN.
746
747 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
748
749         * backgraph.c (SET_OH_BG_PTR): Place outermost parenthesis
750         properly.
751         * darwin_stop_world.c: Replace "if DEBUG_THREADS" with
752         "ifdef DEBUG_THREADS".
753         * pthread_stop_world.c: Ditto.
754         * pthread_support.c: Ditto.
755         * include/gc_inline.h: Guard with GC_INLINE_H.
756
757 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
758
759         * alloc.c (GC_copyright): Define as const.
760         * alloc.c (GC_collect_at_heapsize): Replace "static" with "STATIC"
761         (since the name starts with "GC_" prefix).
762         * dbg_mlc.c (GC_describe_type_fns): Ditto.
763         * dyn_load.c (GC_FirstDLOpenedLinkMap,
764         GC_register_dynlib_callback, GC_dyld_sections,
765         GC_dyld_name_for_hdr, GC_dyld_image_add, GC_dyld_image_remove):
766         Ditto.
767         * malloc.c (GC_libpthread_start, GC_libpthread_end,
768         GC_libld_start, GC_libld_end): Ditto.
769         * mark_rts.c (GC_remove_root_at_pos, GC_rebuild_root_index):
770         Ditto.
771         * os_dep.c (GC_gww_read_dirty, GC_gww_page_was_dirty,
772         GC_gww_page_was_ever_dirty, GC_mprotect_thread_notify,
773         GC_mprotect_thread_reply, GC_mprotect_thread, GC_darwin_sigbus,
774         GC_forward_exception): Ditto.
775         * pthread_support.c (GC_syms_initialized): Ditto.
776         * typd_mlc.c (GC_push_typed_structures_proc): Ditto.
777         * win32_threads.c (GC_win32_dll_threads,
778         GC_register_my_thread_inner, GC_lookup_pthread, GC_get_stack_min,
779         GC_waitForSingleObjectInfinite): Ditto.
780         * darwin_stop_world.c (GC_use_mach_handler_thread,
781         GC_use_mach_handler_thread, GC_mach_threads_count): Replace
782         "static" with "STATIC" and add zero initializer.
783         * os_dep.c (GC_task_self, GC_ports, GC_mprotect_state,
784         GC_sigbus_count): Ditto.
785         * headers.c (free_hdr): Replace "static" with GC_INLINE.
786         * misc.c (GC_tmp): Rename static variable to fwrite_gc_res.
787         * os_dep.c (memory): Rename static variable to ecos_gc_memory.
788         * os_dep.c (async_set_pht_entry_from_index): Make static (for
789         MPROTECT_VDB case).
790         * pthread_support.c (GC_real_pthread_create,
791         GC_real_pthread_sigmask, GC_real_pthread_join,
792         GC_real_pthread_detach, GC_init_real_syms): Use REAL_FUNC() macro
793         for static GC_real_XXX symbols.
794         * win32_threads.c (GC_may_be_in_stack): Remove "GC_" prefix.
795
796 2009-10-17  Ivan Maidanski <ivmai@mail.ru>
797
798         * alloc.c (GC_never_stop_func, GC_check_fl_marks,
799         GC_finish_collection): Reformat the code (make opening bracket
800         style uniform across the file).
801         * allchblk.c (GC_allochblk): Ditto.
802         * backgraph.c (add_edge): Ditto.
803         * dbg_mlc.c (GC_marked_for_finalization): Ditto.
804         * dyn_load.c (GC_register_dynamic_libraries, GC_init_dyld): Ditto.
805         * finalize.c (GC_null_finalize_mark_proc): Ditto.
806         * gc_dlopen.c (GC_dlopen): Ditto.
807         * mark.c (GC_push_marked1, GC_push_marked2, GC_push_marked4):
808         Ditto.
809         * misc.c (looping_handler, GC_call_with_gc_active,
810         GC_do_blocking_inner, GC_do_blocking): Ditto.
811         * os_dep.c (GC_get_main_stack_base, GC_read_dirty): Ditto.
812         * pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
813         GC_pthread_join, GC_pthread_detach, GC_check_tls,
814         GC_do_blocking_inner, GC_call_with_gc_active): Ditto.
815         * reclaim.c (GC_reclaim_clear, GC_reclaim_block,
816         GC_print_free_list): Ditto.
817         * os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty,
818         GC_remove_protection): Reformat the code (wrap long lines).
819
820 2009-10-16  Ivan Maidanski <ivmai@mail.ru>
821
822         * alloc.c (GC_finish_collection): Replace getenv() with GETENV().
823         * dyn_load.c (GC_init_dyld): Ditto.
824         * os_dep.c (GC_print_callers): Ditto.
825         * dyn_load.c (GC_dyld_name_for_hdr): Cast _dyld_get_image_name()
826         result (since it's always of "struct mach_header" type).
827         * dyn_load.c (GC_init_dyld): Cast GC_dyld_image_add and
828         GC_dyld_image_remove (to always have the first argument of
829         "struct mach_header" pointer type).
830
831 2009-10-16  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
832
833         * configure.ac: Add threads support for OpenBSD case (threads may
834         not work correctly for it).
835         * configure: Regenerate.
836
837 2009-10-15  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
838
839         * acinclude.m4: Rename to m4/gc_set_version.m4.
840         * aclocal.m4: Regenerate.
841         * configure: Ditto.
842         * Makefile.in: Ditto.
843         * m4/libtool.m4: Delete the file.
844         * m4/lt~obsolete.m4: Ditto.
845         * m4/ltoptions.m4: Ditto.
846         * m4/ltsugar.m4: Ditto.
847         * m4/ltversion.m4: Ditto.
848
849 2009-10-15  Ivan Maidanski <ivmai@mail.ru>
850
851         * include/private/gcconfig.h: Define DebugBreak() as _exit(-1) for
852         x86mingw32ce toolchain to workaround the incorrect DebugBreak()
853         declaration in winbase.h (the workaround would turn into a no-op
854         when DebugBreak() will be defined as a macro in the toolchain).
855
856 2009-10-15  Ivan Maidanski <ivmai@mail.ru>
857
858         * include/private/gcconfig.h: Recognize __i386__ if WinCE (for
859         x86mingw32ce toolchain).
860         * include/private/gcconfig.h (NO_GETENV): Don't define for CeGCC
861         toolchain (or if already defined).
862         * include/private/gcconfig.h (NO_GETENV_WIN32): New macro (always
863         defined for WinCE or if NO_GETENV is defined).
864         * misc.c (GC_CreateLogFile): Use NO_GETENV_WIN32 macro instead of
865         NO_GETENV one.
866
867 2009-10-15  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
868
869         * configure.ac: Add AC_CONFIG_MACRO_DIR([m4]).
870         * Makefile.am: Add "ACLOCAL_AMFLAGS = -I m4".
871         * libtool.m4: Remove.
872         * aclocal.m4: Regenerate.
873         * configure: Ditto.
874         * Makefile.in: Ditto.
875         * m4/libtool.m4: New file (generated).
876         * m4/lt~obsolete.m4: Ditto.
877         * m4/ltoptions.m4: Ditto.
878         * m4/ltsugar.m4: Ditto.
879         * m4/ltversion.m4: Ditto.
880
881 2009-10-10  Ivan Maidanski <ivmai@mail.ru>
882
883         * include/gc.h (GC_UNDERSCORE_STDCALL): Recognize new macro;
884         prefix GC_CreateThread and GC_ExitThread with '_' if defined.
885         * doc/README.macros (GC_UNDERSCORE_STDCALL): Document.
886
887 2009-10-09  Ivan Maidanski <ivmai@mail.ru>
888
889         * alloc.c (GC_collect_or_expand): Add "retry" argument; add the
890         comments; don't use "default" stop_func on a retry if
891         GC_dont_expand.
892         * alloc.c (GC_collect_or_expand): Reformat the code (make the
893         indentation style uniform across the function).
894         * alloc.c (GC_allocobj): Pass "retry" argument to
895         GC_collect_or_expand().
896         * malloc.c (GC_alloc_large): Ditto.
897         * include/private/gc_priv.h (GC_collect_or_expand): Move the
898         declaration to malloc.c; add "retry" argument.
899
900 2009-10-09  Ivan Maidanski <ivmai@mail.ru>
901
902         * alloc.c (GC_start_call_back): Move the variable definition from
903         misc.c.
904         * include/private/gc_priv.h (GC_start_call_back): Remove the
905         declaration.
906         * alloc.c (GC_notify_full_gc): Remove unnecessary cast of 0.
907         * alloc.c (GC_try_to_collect_inner): Also call stop_func at the
908         beginning of the function.
909         * include/gc.h (GC_try_to_collect): Refine the comment about
910         stop_func.
911
912 2009-10-08  Ivan Maidanski <ivmai@mail.ru>
913
914         * alloc.c (GC_default_stop_func, GC_try_to_collect_general,
915         GC_gcollect): Add the comment.
916         * alloc.c (GC_try_to_collect_general): Move the assertion on
917         stop_func != 0 to GC_try_to_collect().
918         * alloc.c (GC_try_to_collect_general): If stop_func == 0 then use
919         GC_default_stop_func instead (holding the lock).
920         * alloc.c (GC_gcollect): Pass 0 as stop_func instead of
921         GC_default_stop_func (to prevent data races).
922
923 2009-10-08  Ivan Maidanski <ivmai@mail.ru>
924
925         * Makefile.direct: Move "define arguments" documentation to
926         doc/README.macros; add reference to doc/README.macros.
927         * Makefile.dj: Change the documentation reference to
928         doc/README.macros.
929         * README.QUICK: Ditto.
930         * configure.ac: Ditto.
931         * allchblk.c: Remove unnecessary "-D" from the comment.
932         * doc/README.macros: Ditto.
933         * README.environment: Ditto.
934         * include/gc.h: Ditto.
935         * include/gc_inline.h: Ditto.
936         * include/private/gcconfig.h: Ditto.
937         * README.QUICK: Fix a typo.
938         * README.QUICK: Expand all tabs to spaces.
939         * configure: Regenerate.
940         * include/private/config.h.in: Ditto.
941
942 2009-10-07  Ivan Maidanski <ivmai@mail.ru>
943
944         * misc.c (GC_CreateLogFile): Use FILE_ATTRIBUTE_NORMAL for
945         CreateFile(); don't immediately flush every write if very verbose.
946
947 2009-10-07  Ivan Maidanski <ivmai@mail.ru>
948
949         * doc/README.win32: Replace ".exe.log" to ".gc.log".
950         * doc/README.win64: Ditto.
951         * doc/README.win64: Fix a typo.
952         * misc.c (GC_CreateLogFile): Strip executable file extension for
953         the log file; use ".gc.log" extension (instead of ".log").
954
955 2009-10-07  Ivan Maidanski <ivmai@mail.ru>
956
957         * include/gc_config_macros.h: Avoid the redefinition of
958         GC_xxx_THREADS macros.
959
960 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
961
962         * alloc.c (GC_try_to_collect_general): Change the type of "result"
963         local variable to GC_bool.
964
965 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
966
967         * include/gc_config_macros.h: Use old behavior for FreeBSD and
968         NetBSD platform detection code (check that other GC_xxx_THREADS
969         are undefined); add FIXME.
970
971 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
972
973         * include/gc_config_macros.h: Rearrange the platform detection
974         code (GC_WIN32_PTHREADS implies GC_WIN32_THREADS; define
975         GC_THREADS first if GC_XXX_THREADS already set; define proper
976         GC_XXX_THREADS if GC_THREADS; define GC_PTHREADS in a single
977         place; define _REENTRANT if posix threads except for Win32).
978         * include/gc_config_macros.h: Reformat the code (make the
979         indentation style uniform across the file).
980
981 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
982
983         * alloc.c (GC_try_to_collect_general): New function (move the code
984         from GC_try_to_collect, pass force_unmap argument).
985         * alloc.c (GC_try_to_collect, GC_gcollect): Call
986         GC_try_to_collect_general().
987         * alloc.c (GC_gcollect_and_unmap): New public function.
988         * include/gc.h (GC_gcollect_and_unmap): New function declaration.
989         * tests/test.c (window_proc): Call GC_gcollect_and_unmap() on
990         WM_HIBERNATE event (instead of GC_set_force_unmap_on_gcollect()
991         and GC_gcollect()).
992
993 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
994
995         * include/gc.h (GC_allow_register_threads, GC_register_my_thread,
996         GC_unregister_my_thread, GC_malloc_many): Refine the comment.
997         * include/gc.h (GC_malloc_many, GC_NEXT): Declare unconditionally
998         (that is, don't depend on GC_THREADS macro).
999         * include/gc.h: Don't check for __CYGWIN32__ and __CYGWIN__ along
1000         with a check for GC_PTHREADS (since the former implies the
1001         latter).
1002
1003 2009-10-06  Ivan Maidanski <ivmai@mail.ru>
1004
1005         * include/gc.h: Reformat the code (make the indentation style
1006         uniform across the file).
1007         * include/gc.h (GC_SOLARIS_THREADS): Don't check for.
1008         * include/gc.h (GC_MIN, GC_MAX): Don't define.
1009         * mallocx.c (GC_malloc_many): Add comment to #endif.
1010
1011 2009-10-02  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
1012
1013         * configure.ac: Drop the subdir-objects Automake option, since
1014         it's incompatible with picking source files from libatomic_ops.
1015         * Makefile.in: Regenerate.
1016
1017 2009-10-01  Ivan Maidanski <ivmai@mail.ru> (really mostly Andreas Tobler)
1018
1019         * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Add
1020         "extern" keyword to a global variable declaration (some compilers
1021         require it).
1022         * alloc.c (GC_bytes_found, GC_unmap_threshold,
1023         GC_force_unmap_on_gcollect): Ditto.
1024         * dyn_load.c (GC_no_win32_dlls, GC_wnt): Ditto.
1025         * finalize.c (GC_fail_count): Ditto.
1026         * include/private/gc_hdrs.h (GC_hdr_cache_hits,
1027         GC_hdr_cache_misses): Ditto.
1028         * mallocx.c (GC_bytes_found): Ditto.
1029         * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Ditto.
1030         * misc.c (GC_unmap_threshold): Ditto.
1031         * os_dep.c (GC_unmap_threshold, GC_old_allocator): Ditto.
1032         * pthread_support.c (GC_markers): Ditto.
1033         * thread_local_alloc.c (GC_gcjobjfreelist,
1034         GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
1035         * win32_threads.c (GC_fault_handler_lock, GC_write_cs,
1036         GC_dont_query_stack_min, GC_markers, GC_wnt): Ditto.
1037
1038 2009-10-01  Ivan Maidanski <ivmai@mail.ru>
1039
1040         * Makefile.in: Regenerate (by autoreconf -vif, deleting libtool.m4
1041         first and using libtool-2.2, automake-1.10.2, autoconf-2.64).
1042         * aclocal.m4: Ditto.
1043         * config.guess: Ditto.
1044         * config.sub: Ditto.
1045         * configure: Ditto.
1046         * depcomp: Ditto.
1047         * install-sh: Ditto.
1048         * ltmain.sh: Ditto.
1049         * missing: Ditto.
1050         * mkinstalldirs: Ditto.
1051         * include/private/config.h.in: Ditto.
1052
1053 2009-10-01  Ivan Maidanski <ivmai@mail.ru>
1054
1055         * tests/huge_test.c: Define GC_IGNORE_WARN (if not defined) to
1056         suppress misleading GC "Out of Memory!" warning printed on every
1057         GC_MALLOC(LONG_MAX) call.
1058         * tests/huge_test.c: Include "gc.h" instead of <gc.h>.
1059         * tests/huge_test.c (main): Replace K&R-style function definition
1060         with the ANSI C one.
1061         * tests/huge_test.c: Expand all tabs to spaces.
1062
1063 2009-10-01  Ivan Maidanski <ivmai@mail.ru>
1064
1065         * dyn_load.c (GC_register_dynamic_libraries): Always use
1066         lpMaximumApplicationAddress value for WinCE (even for old
1067         versions).
1068         * os_dep.c (VER_PLATFORM_WIN32_CE): Define if not in winbase.h.
1069         * os_dep.c (GC_dont_query_stack_min): New global variable (only if
1070         WinCE and THREADS).
1071         * os_dep.c (GC_setpagesize): Adjust lpMaximumApplicationAddress
1072         for WinCE (prior to version 6) if not _WIN32_WCE_EMULATION; set
1073         GC_dont_query_stack_min for older WinCE (prior to version 5).
1074         * win32_threads.c (GC_dont_query_stack_min): Declare.
1075         * win32_threads.c (GC_get_stack_min): Rename the macro to
1076         GC_wince_evaluate_stack_min for WinCE; update the comment.
1077         * win32_threads.c (GC_push_stack_for, GC_get_next_stack): Use
1078         GC_wince_evaluate_stack_min() instead of GC_get_stack_min() for
1079         WinCE and don't update thread's last_stack_min value (only if
1080         GC_dont_query_stack_min).
1081         * win32_threads.c (GC_push_stack_for): Skip assertion for WinCE if
1082         GC_dont_query_stack_min (since the evaluated stack_min value may
1083         be incorrect if the stack is bigger than 64 KiB).
1084
1085 2009-10-01  Ivan Maidanski <ivmai@mail.ru>
1086
1087         * gc_dlopen.c (GC_dlopen): Add function redirector (only if
1088         GC_USE_LD_WRAP).
1089         * include/gc.h: Include "gc_pthread_redirects.h" even if
1090         GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS.
1091         * include/gc_pthread_redirects.h (GC_PTHREAD_REDIRECTS_H): Don't
1092         define and check for (since included only from gc.h).
1093         * include/gc_pthread_redirects.h: Declare "GC_" symbols even if
1094         GC_USE_LD_WRAP or GC_NO_THREAD_REDIRECTS.
1095         * include/gc_pthread_redirects.h: Include signal.h only to get
1096         sigset_t definition.
1097
1098 2009-09-30  Ivan Maidanski <ivmai@mail.ru>
1099
1100         * configure: Regenerate (by autoreconf -vif, deleting libtool.m4
1101         first).
1102         * Makefile.in: Ditto.
1103         * aclocal.m4: Ditto.
1104         * include/private/config.h.in: Ditto.
1105
1106 2009-09-30  Ivan Maidanski <ivmai@mail.ru>
1107
1108         * Makefile.direct: Remove trailing spaces at EOLn.
1109         * Makefile.direct: Document GC_REGISTER_MEM_PRIVATE.
1110         * mark_rts.c (GC_is_tmp_root): Define also for WinCE unless
1111         NO_DEBUGGING (that is, replace _WIN32_WCE_EMULATION with MSWINCE).
1112         * os_dep.c (GC_sysinfo): Remove explicit global variable
1113         initialization to "{0}" (revert back the previous change) since it
1114         might produce a warning.
1115
1116 2009-09-30  Ivan Maidanski <ivmai@mail.ru>
1117
1118         * allchblk.c (GC_large_alloc_warn_interval): Move declaration from
1119         gc_priv.h.
1120         * allchblk.c (GC_large_alloc_warn_suppressed): Move definition
1121         from misc.c; define as STATIC.
1122         * include/private/gc_priv.h (GC_large_alloc_warn_interval,
1123         GC_large_alloc_warn_suppressed): Remove declaration.
1124         * alloc.c (GC_bytes_found): Add "defined in" comment.
1125         * mallocx.c (GC_bytes_found): Ditto.
1126         * misc.c (GC_unmap_threshold): Ditto.
1127         * os_dep.c (GC_old_allocator): Ditto.
1128         * pthread_support.c (GC_markers): Ditto.
1129         * thread_local_alloc.c (GC_gcjobjfreelist,
1130         GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
1131         * win32_threads.c (GC_markers): Ditto.
1132         * alloc.c (GC_start_time): Explicitly initialize to 0 or NULL (to
1133         be distinctive from a variable declaration).
1134         * backgraph.c (GC_max_height, GC_deepest_obj): Ditto.
1135         * blacklst.c (GC_old_normal_bl, GC_incomplete_normal_bl,
1136         GC_old_stack_bl, GC_incomplete_stack_bl): Ditto.
1137         * checksums.c (GC_faulted, GC_n_dirty_errors,
1138         GC_n_faulted_dirty_errors, GC_n_changed_errors, GC_n_clean,
1139         GC_n_dirty, GC_bytes_in_used_blocks): Ditto.
1140         * dbg_mlc.c (GC_smashed): Ditto.
1141         * finalize.c (GC_old_dl_entries): Ditto.
1142         * gcj_mlc.c (GC_gcj_kind, GC_gcj_debug_kind, GC_gcjobjfreelist,
1143         GC_gcjdebugobjfreelist): Ditto.
1144         * mach_dep.c (GC_save_regs_ret_val): Ditto.
1145         * mark.c (GC_n_rescuing_pages, GC_mark_stack, GC_mark_stack_limit,
1146         GC_mark_stack_top): Ditto.
1147         * misc.c (GC_min_sp, GC_high_water, GC_bytes_allocd_at_reset):
1148         Ditto.
1149         * os_dep.c (GC_data_start, GC_page_size, GC_sysinfo,
1150         GC_old_segv_handler, GC_old_bus_handler,
1151         GC_old_bus_handler_used_si, GC_old_segv_handler_used_si,
1152         GC_proc_buf, GC_proc_fd, GC_vd_base): Ditto.
1153         * pthread_stop_world.c (GC_stop_count, GC_stopping_pid): Ditto.
1154         * reclaim.c (GC_leaked): Ditto.
1155         * typd_mlc.c (GC_explicit_kind, GC_array_kind, GC_ext_descriptors,
1156         GC_typed_mark_proc_index, GC_array_mark_proc_index,
1157         GC_eobjfreelist, GC_arobjfreelist): Ditto.
1158         * win32_threads.c (GC_pthread_map_cache, GC_marker_cv,
1159         GC_marker_Id): Ditto.
1160         * dbg_mlc.c (GC_smashed, GC_n_smashed): Define as STATIC.
1161         * gcj_mlc.c (GC_gcjdebugobjfreelist): Ditto.
1162         * os_dep.c (GC_vd_base): Ditto.
1163         * pthread_support.c (GC_mark_threads): Ditto.
1164         * reclaim.c (GC_leaked): Ditto.
1165         * typd_mlc.c (GC_bm_table): Ditto.
1166         * mark_rts.c (GC_save_regs_ret_val): Change declaration type to
1167         that of definition; add "defined in" comment.
1168         * mark_rts.c (GC_push_current_stack): Remove unnecessary cast for
1169         GC_save_regs_ret_val.
1170         * misc.c (GC_check_heap, GC_print_all_smashed,
1171         GC_start_call_back): Remove unnecessary cast (of 0).
1172         * misc.c (GC_LARGE_ALLOC_WARN_INTERVAL): New tuning macro.
1173         * misc.c (GC_large_alloc_warn_interval): Initialize to
1174         GC_LARGE_ALLOC_WARN_INTERVAL value.
1175         * misc.c (GC_tmp): Change to "static".
1176         * os_dep.c (GC_setpagesize): Reformat the code (collapse multiple
1177         function definitions).
1178         * os_dep.c (GC_mprotect_state): Define as static.
1179         * pthread_support.c (dummy_thread_local): Prefix with "GC_".
1180         * win32_threads.c (WinMain): Remove FIXME for WinCE.
1181
1182 2009-09-30  Ivan Maidanski <ivmai@mail.ru> (really Hans Boehm)
1183
1184         * os_dep.c (PROTECT, UNPROTECT): Use distinct ABORT messages.
1185
1186 2009-09-30  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
1187
1188         * configure.ac: Rewrite the tests for external or internal
1189         libatomic_ops.
1190         * configure.ac: In particular, drop the symbolic links. Add option
1191         --with-libatomic-ops for forced selection.
1192         * Makefile.am: Adjust the path of source files from libatomic_ops
1193         to not use the links.
1194         * Makefile.am (libgc_la_LIBADD): Add $(ATOMIC_OPS_LIBS). This will
1195         be empty if we use the bundled AO sources.
1196         * configure: Regenerate.
1197         * Makefile.in: Ditto.
1198
1199 2009-09-29  Ivan Maidanski <ivmai@mail.ru>
1200
1201         * Makefile.am: Strip version suffix for libatomic_ops directory.
1202         * build_atomic_ops.sh: Ditto.
1203         * build_atomic_ops.sh.cygwin: Ditto.
1204         * configure_atomic_ops.sh: Ditto.
1205         * Makefile.direct: Remove AO_VERSION definition; strip version
1206         suffix for libatomic_ops directory.
1207         * NT_STATIC_THREADS_MAKEFILE: Ditto.
1208         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
1209         * NT_X64_THREADS_MAKEFILE: Ditto.
1210         * gc.mak: Ditto.
1211         * Makefile.in: Regenerate.
1212
1213 2009-09-29  Ivan Maidanski <ivmai@mail.ru>
1214
1215         * libatomic_ops: Rename from "libatomic_ops-1.2".
1216
1217 2009-09-28  Ivan Maidanski <ivmai@mail.ru>
1218
1219         * alloc.c (GC_version): Add "const" keyword.
1220         * alloc.c (GC_get_version): New public function.
1221         * include/gc.h (GC_get_version): New function declaration; update
1222         the comment for the GC version.
1223
1224 2009-09-27  Ivan Maidanski <ivmai@mail.ru>
1225
1226         * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
1227         GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Use "extern"
1228         (for the global variable declaration) again.
1229         * include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size,
1230         GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack,
1231         GC_mark_stack_too_small, GC_mark_state): Ditto.
1232         * include/private/gcconfig.h (GC_register_stackbottom): Ditto.
1233         * include/private/pthread_support.h (GC_threads,
1234         GC_thr_initialized, GC_in_thread_creation): Ditto.
1235         * include/private/gc_priv.h: Ditto (for all global variables).
1236
1237 2009-09-27  Ivan Maidanski <ivmai@mail.ru>
1238
1239         * real_malloc.c: Include private/config.h if HAVE_CONFIG_H.
1240
1241 2009-09-27  Ivan Maidanski <ivmai@mail.ru>
1242
1243         * allchblk.c (GC_hblkfreelist): Define as STATIC.
1244         * blacklst.c (GC_total_stack_black_listed): Ditto.
1245         * include/private/gc_priv.h (GC_hblkfreelist, GC_stopped_mark,
1246         GC_total_stack_black_listed, GC_push_stubborn_structures): Remove
1247         declaration.
1248         * mark_rts.c (GC_stopped_mark): Add declaration (only if
1249         THREAD_LOCAL_ALLOC).
1250         * allchblk.c (GC_fail_count): Move the declaration out of
1251         GC_allochblk_nth(); remove "extern".
1252         * alloc.c (IF_THREADS): Remove unused macro.
1253         * alloc.c (GC_world_stopped): Define only if THREAD_LOCAL_ALLOC.
1254         * alloc.c (GC_stopped_mark): Set GC_world_stopped value only if
1255         THREAD_LOCAL_ALLOC.
1256         * alloc.c (GC_bytes_found, GC_collection_in_progress,
1257         GC_check_tls, GC_unmap_threshold, GC_force_unmap_on_gcollect):
1258         Remove K&R-style "extern" for the declaration.
1259         * dbg_mlc.c (GC_free_inner): Ditto.
1260         * dyn_load.c (GC_repeat_read, GC_roots_present, GC_is_heap_base,
1261         GC_get_next_stack, GC_no_win32_dlls, GC_wnt): Ditto.
1262         * finalize.c (GC_fail_count): Ditto.
1263         * include/private/gc_hdrs.h (GC_hdr_cache_hits,
1264         GC_hdr_cache_misses): Ditto.
1265         * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
1266         GC_lock, GC_collecting, GC_mark_lock_holder, GC_need_to_lock):
1267         Ditto.
1268         * include/private/gc_pmark.h (GC_mark_procs, GC_n_mark_procs,
1269         GC_mark_stack_size, GC_mark_stack_limit, GC_mark_stack_top,
1270         GC_mark_stack, GC_mark_stack_too_small, GC_mark_state): Ditto.
1271         * include/private/gc_priv.h (GC_current_warn_proc, GC_obj_kinds,
1272         GC_n_kinds, GC_fo_entries, GC_n_heap_sects, GC_n_memory,
1273         GC_page_size, GC_sysinfo, GC_black_list_spacing,
1274         GC_objects_are_marked, GC_incremental, GC_dirty_maintained,
1275         GC_root_size, GC_debugging_started, GC_large_alloc_warn_interval,
1276         GC_large_alloc_warn_suppressed, GC_blocked_sp,
1277         GC_activation_frame, GC_push_other_roots,
1278         GC_push_finalizer_structures, GC_push_thread_structures,
1279         GC_push_typed_structures, GC_start_call_back, GC_is_initialized,
1280         GC_check_heap, GC_print_all_smashed, GC_print_all_errors,
1281         GC_print_heap_obj, GC_have_errors, GC_print_stats,
1282         GC_dump_regularly, GC_backtraces, GC_print_back_height,
1283         GC_debug_generic_malloc_inner,
1284         GC_debug_generic_malloc_inner_ignore_off_page,
1285         GC_fl_builder_count, GC_mark_no, GC_help_marker,
1286         GC_setup_temporary_fault_handler, GC_reset_fault_handler): Ditto.
1287         * include/private/gcconfig.h (GC_SysVGetDataStart,
1288         GC_FreeBSDGetDataStart, GC_register_stackbottom,
1289         GC_MacTemporaryNewPtr, GC_amiga_get_mem): Ditto.
1290         * include/private/pthread_support.h (GC_threads,
1291         GC_thr_initialized, GC_in_thread_creation): Ditto.
1292         * malloc.c (GC_text_mapping): Ditto.
1293         * mallocx.c (GC_bytes_found): Ditto.
1294         * mark.c (GC_check_dirty, GC_started_thread_while_stopped): Ditto.
1295         * mark_rts.c (GC_save_regs_ret_val): Ditto.
1296         * misc.c (GC_clear_stack_inner, GC_init_parallel, GC_init_win32,
1297         GC_setpagesize, GC_init_linux_data_start,
1298         GC_set_and_save_fault_handler, GC_unmap_threshold): Ditto.
1299         * os_dep.c (GC_unmap_threshold, GC_push_all_stacks,
1300         GC_darwin_register_mach_handler_thread): Ditto.
1301         * pthread_support.c (GC_markers, GC_collection_in_progress):
1302         Ditto.
1303         * tests/test.c (GC_amiga_free_all_mem): Ditto.
1304         * thread_local_alloc.c (GC_gcjobjfreelist,
1305         GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
1306         * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init,
1307         GC_fault_handler_lock, GC_write_cs, GC_markers): Ditto.
1308         * misc.c (GC_read, GC_register_finalizer_no_order, GC_init_dyld):
1309         Move the declaration out of GC_init(); remove "extern".
1310         * os_dep.c (GC_abort): Add the comment; add workaround to suppress
1311         compiler "unreachable code" warnings for ABORT callers (where
1312         ABORT is followed by a dummy return statement).
1313         * os_dep.c (GC_old_allocator): Move the declaration out of
1314         GC_default_push_other_roots(); remove "extern".
1315         * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
1316         Move the declaration out of GC_stop_world() and GC_start_world()
1317         (only if MPROTECT_VDB); remove "extern".
1318
1319 2009-09-27  Ivan Maidanski <ivmai@mail.ru>
1320
1321         * win32_threads.c (GC_get_stack_min, GC_push_stack_for,
1322         GC_get_next_stack): Recognize _WIN32_WCE_EMULATION macro (used for
1323         WinCE emulation and for custom WinCE 6 devices); add the comment.
1324         * win32_threads.c (GC_get_stack_min): Cast pointer to word instead
1325         of DWORD.
1326         * win32_threads.c (GC_get_next_stack): Don't use and maintain the
1327         latest known stack_min value for WinCE (if GC_get_stack_min is
1328         defined as a macro); update the comments.
1329         * win32_threads.c (GC_wnt): Don't declare for WinCE.
1330
1331 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
1332
1333         * Makefile.direct: Document EMPTY_GETENV_RESULTS.
1334         * gcj_mlc.c (GC_clear_stack): Remove declaration.
1335         * malloc.c (GC_clear_stack): Ditto.
1336         * mallocx.c (GC_clear_stack): Ditto.
1337         * typd_mlc.c (GC_clear_stack): Ditto.
1338         * gcj_mlc.c (GENERAL_MALLOC, GENERAL_MALLOC_IOP): Rename to
1339         GENERAL_MALLOC_INNER and GENERAL_MALLOC_INNER_IOP, respectively;
1340         remove "lb" unnecessary cast to word.
1341         * include/private/gc_priv.h (GC_clear_stack): Add declaration.
1342         * include/private/gc_priv.h (GENERAL_MALLOC, GENERAL_MALLOC_IOP):
1343         Move common declaration from typd_mlc.c and malloc.c; remove
1344         unnecessary result and "lb" parameter casts.
1345         * include/private/thread_local_alloc.h: Guard against duplicate
1346         header file inclusion.
1347         * os_dep.c (USE_MUNMAP): Replace "-->" with an error directive for
1348         the case when USE_MMAP is not defined.
1349         * pthread_support.c (GC_is_thread_tsd_valid): New internal
1350         function (only if GC_ASSERTIONS and THREAD_LOCAL_ALLOC); move the
1351         code from thread-local GC_malloc(); add FIXME for the condition.
1352         * win32_threads.c (GC_is_thread_tsd_valid): Ditto.
1353         * thread_local_alloc.c (GC_gcjobjfreelist): Change the type (to
1354         match that of its definition).
1355         * thread_local_alloc.c (GC_destroy_thread_local): Add a cast for
1356         GC_gcjobjfreelist.
1357         * thread_local_alloc.c (GC_lookup_thread, GC_lookup_thread_inner):
1358         Remove unused declaration; don't include pthread.h.
1359         * thread_local_alloc.c (GC_is_thread_tsd_valid): New declaration
1360         (only if GC_ASSERTIONS).
1361         * thread_local_alloc.c (GC_malloc): Use GC_is_thread_tsd_valid()
1362         instead of GC_lookup_thread().
1363         * win32_threads.c (GC_lookup_thread_inner): Define as STATIC.
1364         * win32_threads.c (UNPROTECT): Rename to UNPROTECT_THREAD (to have
1365         id different from that in os_dep.c).
1366
1367 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
1368
1369         * allchblk.c (GC_enough_large_bytes_left): Replace "inline static"
1370         with GC_INLINE.
1371         * include/private/gc_priv.h (fixed_getenv): Ditto.
1372         * alloc.c (GC_max, GC_min): Replace "static INLINE" with
1373         GC_INLINE.
1374         * mark_rts.c (rt_hash): Ditto.
1375         * win32_threads.c (GC_get_max_thread_index): Ditto.
1376         * include/private/gc_priv.h (INLINE): Prefix with "GC_"; include
1377         "static"; define for Sun CC; define for VC++ (and other
1378         compilers).
1379         * pthread_support.c: Don't define __inline__ for non-GNU compilers
1380         (not needed anymore).
1381
1382 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
1383
1384         * NT_THREADS_MAKEFILE: Remove file (since it duplicates gc.mak).
1385         * Makefile.in: Remove reference to NT_THREADS_MAKEFILE.
1386         * Makefile.am: Ditto.
1387         * Makefile.dj: Ditto.
1388         * Makefile.direct: Ditto.
1389         * doc/README.win32: Add reference to gc.mak.
1390         * NT_X64_THREADS_MAKEFILE: Ditto.
1391
1392 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
1393
1394         * Makefile.in: Regenerate (by autoreconf -vif).
1395         * aclocal.m4: Ditto.
1396         * compile: Ditto.
1397         * config.guess: Ditto.
1398         * config.sub: Ditto.
1399         * configure: Ditto.
1400         * depcomp: Ditto.
1401         * install-sh: Ditto.
1402         * ltmain.sh: Ditto.
1403         * missing: Ditto.
1404         * mkinstalldirs: Ditto.
1405         * include/private/config.h.in: New file (generated).
1406         * Makefile.direct: Remove references to acinclude.m4, libtool.m4.
1407
1408 2009-09-26  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
1409
1410         * autogen.sh: Update.
1411
1412 2009-09-26  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
1413
1414         * Makefile.am: Don't add libtool.m4 to EXTRA_DIST.
1415         * acinclude.m4: Fix underquoting of GC_SET_VERSION.
1416         * README.QUICK: Update information for Makefile.
1417         * Makefile.am: Do not distribute the substituted bdw-gc.pc.
1418         * configure.ac: Add AM conditional analog to KEEP_BACK_PTRS.
1419         * tests/tests.am: Use it here to conditionally enable tracetest
1420         when possible.
1421
1422 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
1423
1424         * dyn_load.c (GC_wnt): Update the comment.
1425         * dyn_load.c (GC_register_dynamic_libraries): Add the comment for
1426         _WIN32_WCE_EMULATION; recognize GC_REGISTER_MEM_PRIVATE (new
1427         macro); call GC_is_heap_base() only if check for Type succeeded.
1428
1429 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
1430
1431         * mark_rts.c (GC_is_tmp_root): Don't define unless NO_DEBUGGING;
1432         update the comment.
1433         * include/private/gc_priv.h (GC_is_tmp_root): Remove declaration.
1434
1435 2009-09-26  Ivan Maidanski <ivmai@mail.ru>
1436
1437         * alloc.c: Expand all tabs to spaces; remove trailing spaces at
1438         EOLn; remove multiple trailing blank lines.
1439         * misc.c: Ditto.
1440         * os_dep.c: Ditto.
1441         * pthread_support.c: Ditto.
1442         * include/private/gc_priv.h: Ditto.
1443         * include/private/gcconfig.h: Ditto.
1444
1445 2009-09-25  Hans Boehm <Hans.Boehm@hp.com>
1446
1447         * include/private/gcconfig.h (CANCEL_SAFE, IF_CANCEL): new macros.
1448         * include/private/gc_priv.h (DISABLE_CANCEL, RESTORE_CANCEL,
1449         ASSERT_CANCEL_DISABLED): New macros.
1450         * alloc.c (GC_maybe_gc): Assert cancellation disabled.
1451         (GC_collect_a_little_inner,GC_try_to_collect, GC_collect_or_expand):
1452         Disable cancellation.
1453         (GC_add_to_our_memory): Check for overflow.
1454         * misc.c (GC_cancel_disable_count): declare.
1455         (GC_init, GC_write): Disable cancellation.
1456         (GC_init): Remove redundant GC_is_initialized test.
1457         * os_dep.c (GC_repeat_read): Assert cancellation disabled.
1458         (GC_get_stack_base): Disable cancellation.
1459         * pthread_stop_world.c (GC_suspend_handler_inner): Disable
1460         cancellation.
1461         * pthread_support.c (GC_mark_thread): Permanently disable
1462         cancellation.
1463         (GC_wait_for_gc_completion, GC_wait_builder, GC_wait_marker):
1464         Assert cancellation disabled.
1465         (fork handling): Disable cancellation, fix comment.
1466         (GC_pthread_create): Disable cancellation.
1467         (GC_unregister_my_thread): Disable cancellation.
1468         * Makefile.direct: Document NO_CANCEL_SAFE.
1469
1470 2009-09-25  Ivan Maidanski <ivmai@mail.ru>
1471
1472         * Makefile: Remove outdated file (Makefile.direct should be used
1473         instead).
1474
1475 2009-09-25  Ivan Maidanski <ivmai@mail.ru>
1476
1477         * win32_threads.c: Reformat the code (make indentation and
1478         opening bracket style uniform across the file; wrap long code and
1479         comment lines).
1480
1481 2009-09-25  Ivan Maidanski <ivmai@mail.ru>
1482
1483         * include/gc.h (GC_use_DllMain): Refine (and reformat) the
1484         comment.
1485
1486 2009-09-25  Ivan Maidanski <ivmai@mail.ru> (really mostly Petter Urkedal)
1487
1488         * configure.ac: Add documentation to AC_DEFINE for GC_THREADS and
1489         EMPTY_GETENV_RESULTS.
1490         * configure.ac: Fix a typo.
1491         * Makefile.am: Ditto.
1492
1493 2009-09-25  Ivan Maidanski <ivmai@mail.ru>
1494
1495         * checksums.c (GC_checksum, GC_update_check_page): Remove
1496         "register" keyword in local variable declarations (for the code
1497         used only for debugging or which is not time-critical).
1498         * dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info,
1499         GC_store_debug_info_inner, GC_check_annotated_obj, GC_print_obj,
1500         GC_print_smashed_obj, GC_debug_end_stubborn_change,
1501         GC_debug_invoke_finalizer): Ditto.
1502         * dyn_load.c (GC_register_dynamic_libraries): Ditto.
1503         * mallocx.c (GC_realloc): Ditto.
1504         * mark_rts.c (GC_print_static_roots, GC_is_static_root,
1505         GC_clear_roots): Ditto.
1506         * misc.c (GC_write): Ditto.
1507         * os_dep.c (GC_print_callers): Ditto.
1508         * dyn_load.c (GC_register_dynamic_libraries): Rename "i" local
1509         variable to "j" for the nested loop (just not to hide the similar
1510         variable in the outer one).
1511         * mark_rts.c (GC_print_static_roots): Output an error message
1512         using GC_err_printf() (instead of GC_printf()).
1513
1514 2009-09-25  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
1515
1516         * configure.ac: Move include flag from ${INCLUDE} ...
1517         * Makefile.am: ... to AM_CPPFLAGS and also add the build directory.
1518         * configure.ac: Call AM_CONFIG_HEADER([include/private/config.h]).
1519         * configure.ac: Add documentation to all AC_DEFINE either directly
1520         or using AH_TEMPLATE.
1521
1522 2009-09-24  Ivan Maidanski <ivmai@mail.ru>
1523
1524         * win32_threads.c (GC_waitForSingleObjectInfinite): New static
1525         function (only if GC_WINMAIN_REDIRECT).
1526         * win32_threads.c (WinMain): Call GC_waitForSingleObjectInfinite()
1527         thru GC_do_blocking() instead of calling WaitForSingleObject()
1528         directly.
1529
1530 2009-09-24  Ivan Maidanski <ivmai@mail.ru>
1531
1532         * pthread_support.c (start_mark_threads): Refine printed message.
1533         * win32_threads.c (GC_thr_init): Ditto.
1534         * win32_threads.c: Reformat some code pieces (wrap too long code
1535         lines).
1536
1537 2009-09-24  Ivan Maidanski <ivmai@mail.ru>
1538         (ivmai145.diff)
1539
1540         * Makefile.direct (GC_WINMAIN_REDIRECT): Add the comment for.
1541         * Makefile.direct (NO_GETENV): Update the comment.
1542         * include/gc.h (GC_WINMAIN_WINCE_LPTSTR): Remove macro.
1543         * include/gc.h (GC_WinMain): Remove declaration.
1544         * include/gc.h (WinMain): Define (as GC_WinMain) if and only if
1545         GC_WINMAIN_REDIRECT.
1546         * tests/test.c (GC_COND_INIT): Define as GC_INIT() also in case of
1547         WinCE target unless GC_WINMAIN_REDIRECT is defined.
1548         * tests/test.c (WINMAIN_LPTSTR): New macro.
1549         * tests/test.c (WinMain): Use WINMAIN_LPTSTR instead of LP[W]STR
1550         and GC_WINMAIN_WINCE_LPTSTR.
1551         * win32_threads.c (start_mark_threads): Add the comment for
1552         MARK_THREAD_STACK_SIZE.
1553         * win32_threads.c: Recognize new GC_WINMAIN_REDIRECT macro.
1554         * win32_threads.c (WINMAIN_LPTSTR, WINMAIN_THREAD_STACK_SIZE): New
1555         macro (only if GC_WINMAIN_REDIRECT).
1556         * win32_threads.c: Undefine WinMain macro if GC_WINMAIN_REDIRECT.
1557         * win32_threads.c (GC_WinMain): Add prototype (only if
1558         GC_WINMAIN_REDIRECT).
1559         * win32_threads.c (main_thread_args, WinMain): Rename
1560         GC_WINMAIN_WINCE_LPTSTR to WINMAIN_LPTSTR.
1561         * win32_threads.c (WinMain): Call GC_INIT() instead of GC_init();
1562         use WINMAIN_THREAD_STACK_SIZE.
1563         * win32_threads.c (WinMain): Call GC_deinit() and
1564         DeleteCriticalSection() only if WinCE; add FIXME.
1565
1566 2009-09-24  Ivan Maidanski <ivmai@mail.ru>
1567
1568         * os_dep.c (GC_get_main_stack_base): add assertion for mem_base
1569         value returned by GC_get_stack_base().
1570
1571 2009-09-23  Ivan Maidanski <ivmai@mail.ru>
1572         (ivmai150.diff)
1573
1574         * Makefile.direct (MUNMAP_THRESHOLD, GC_FORCE_UNMAP_ON_GCOLLECT):
1575         Add the comment for.
1576         * alloc.c (GC_unmap_threshold, GC_force_unmap_on_gcollect):
1577         Declare external variable (only if USE_MUNMAP).
1578         * alloc.c (GC_try_to_collect): Temporarily set GC_unmap_threshold
1579         value to 1 if GC_force_unmap_on_gcollect and restore it before
1580         unlocking (only if USE_MUNMAP).
1581         * doc/README.environment (GC_FORCE_UNMAP_ON_GCOLLECT): Add
1582         information for.
1583         * include/gc.h (GC_set_force_unmap_on_gcollect,
1584         GC_get_force_unmap_on_gcollect): New public function prototype.
1585         * include/gc.h (GC_FORCE_UNMAP_ON_GCOLLECT): New macro is
1586         recognized.
1587         * misc.c (GC_FORCE_UNMAP_ON_GCOLLECT): Ditto.
1588         * include/gc.h (GC_INIT_CONF_FORCE_UNMAP_ON_GCOLLECT): New
1589         internal macro (used by GC_INIT only).
1590         * misc.c (GC_force_unmap_on_gcollect): New global variable.
1591         * misc.c (GC_init): Recognize new "GC_FORCE_UNMAP_ON_GCOLLECT"
1592         environment variable (and set GC_force_unmap_on_gcollect).
1593         * misc.c (GC_set_force_unmap_on_gcollect,
1594         GC_get_force_unmap_on_gcollect): New public function.
1595         * tests/test.c (window_proc): Call GC_set_force_unmap_on_gcollect
1596         to force the mode on if WM_HIBERNATE; restore the mode after
1597         GC_gcollect().
1598
1599 2009-09-23  Ivan Maidanski <ivmai@mail.ru>
1600
1601         * Makefile.direct (LARGE_CONFIG): Update information.
1602         * include/gc.h (GC_stop_func): Refine the comment.
1603
1604 2009-09-21  Ivan Maidanski <ivmai@mail.ru>
1605
1606         * configure.ac: Use EMPTY_GETENV_RESULTS instead of NO_GETENV for
1607         Win32 (workaround for Wine bug).
1608
1609 2009-09-20  Ivan Maidanski <ivmai@mail.ru>
1610
1611         * allchblk.c (GC_freehblk): Adjust local variables indentation.
1612         * mallocx.c (GC_generic_malloc_many): Ditto.
1613         * typd_mlc.c (GC_malloc_explicitly_typed_ignore_off_page,
1614         GC_calloc_explicitly_typed): Ditto.
1615         * typd_mlc.c (GC_make_array_descriptor): Remove unnecessary
1616         brackets.
1617
1618 2009-09-20  Ivan Maidanski <ivmai@mail.ru>
1619
1620         * configure.ac: Replace GC_WIN32_THREADS with GC_THREADS.
1621         * configure.ac: Process enable_parallel_mark option for Cygwin and
1622         Win32; define THREAD_LOCAL_ALLOC for Win32.
1623
1624 2009-09-20  Ivan Maidanski <ivmai@mail.ru>
1625
1626         * include/private/gc_priv.h: Define AO_ASSUME_WINDOWS98 if
1627         PARALLEL_MARK (required for VC++ x86).
1628
1629 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
1630         (ivmai149.diff)
1631
1632         * dbg_mlc.c (GC_generate_random_backtrace): Call
1633         GC_try_to_collect(GC_never_stop_func) instead of GC_gcollect();
1634         if GC is disabled then print error message and return.
1635         * include/gc.h (GC_try_to_collect): Refine the comment.
1636         * include/private/gc_priv.h (GC_never_stop_func): Fix return type;
1637         refine the comment.
1638
1639 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
1640         (ivmai147.diff)
1641
1642         * add_gc_prefix.c: Move the file to the new "extra" directory.
1643         * AmigaOS.c: Ditto.
1644         * gcname.c: Ditto.
1645         * if_mach.c: Ditto.
1646         * if_not_there.c: Ditto.
1647         * MacOS.c: Ditto.
1648         * msvc_dbg.c: Ditto.
1649         * setjmp_t.c: Ditto.
1650         * threadlibs.c: Ditto.
1651         * EMX_MAKEFILE: Prepend setjmp_t.c with "extra" directory.
1652         * Makefile: Prepend AmigaOS.c, MacOS.c, add_gc_prefix.c, gcname.c,
1653         if_mach.c, if_not_there.c, msvc_dbg.c, setjmp_t.c, threadlibs.c
1654         with "extra" directory.
1655         * Makefile.am: Ditto.
1656         * Makefile.direct: Ditto.
1657         * Makefile.dj: Ditto.
1658         * Makefile.in: Ditto.
1659         * NT_MAKEFILE: Prepend msvc_dbg.obj with "extra" directory.
1660         * NT_STATIC_THREADS_MAKEFILE: Ditto.
1661         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
1662         * NT_X64_THREADS_MAKEFILE: Ditto.
1663         * NT_THREADS_MAKEFILE: Prepend msvc_dbg.c with "extra" directory.
1664         * gc.mak: Ditto.
1665         * PCR-Makefile: Prepend if_mach.c, if_not_there.c with "extra"
1666         directory.
1667         * SMakefile.amiga: Prepend AmigaOS.c, setjmp_t.c with "extra"
1668         directory.
1669         * doc/simple_example.html: Update for threadlibs.c.
1670         * os_dep.c: Prepend included AmigaOS.c with "extra" directory.
1671
1672 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
1673
1674         * allchblk.c: Expand all tabs to spaces; remove trailing spaces at
1675         EOLn; remove multiple trailing blank lines.
1676         * mark.c: Ditto.
1677         * mark_rts.c: Ditto.
1678         * pthread_stop_world.c: Ditto.
1679         * win32_threads.c: Ditto.
1680         * include/gc.h: Ditto.
1681         * include/private/gc_priv.h: Ditto.
1682         * pthread_stop_world.c: Add copyright header.
1683         * include/gc.h: Reformat some comments.
1684
1685 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
1686         (ivmai130a.diff, ivmai130b.diff - superseding diff44, diff69)
1687
1688         * include/gc.h (GC_do_blocking, GC_call_with_gc_active): New
1689         function prototype.
1690         * include/private/gc_priv.h (STOP_WORLD): Replace a no-op (for the
1691         single-threaded case) with an assertion check for the state to be
1692         not a "do-blocking" one.
1693         * include/private/gc_priv.h (blocking_data): Move the structure
1694         definition from pthread_support.c; change "fn" return type to void
1695         pointer.
1696         * include/private/gc_priv.h (GC_activation_frame_s): New structure
1697         type.
1698         * include/private/gc_priv.h (GC_push_all_stack_frames): New
1699         function declaration (only if THREADS).
1700         * include/private/gc_priv.h (GC_world_stopped): Don't declare
1701         unless THREADS.
1702         * include/private/gc_priv.h (GC_blocked_sp,
1703         GC_activation_frame_s): New declaration (only if not THREADS).
1704         * include/private/gc_priv.h (GC_push_all_register_frames): New
1705         function declaration (only for IA-64).
1706         * include/private/gc_priv.h (NURSERY, GC_push_proc): Remove
1707         obsolete (unused) symbols.
1708         * include/private/gc_priv.h (GC_push_all_stack_partially_eager):
1709         Remove declaration (since it is static now).
1710         * mark_rts.c (GC_push_all_stack_partially_eager): Move from mark.c
1711         (for code locality) and make STATIC.
1712         * mark_rts.c (GC_push_all_register_frames): New function (only for
1713         IA-64).
1714         * mark_rts.c (GC_push_all_stack_frames): New function (only if
1715         THREADS).
1716         * mark_rts.c (GC_add_trace_entry): New function prototype (used by
1717         GC_push_all_stack_partially_eager(), only if TRACE_BUF).
1718         * mark_rts.c (GC_push_all_stack_part_eager_frames): New function.
1719         * mar_rts.c (GC_save_regs_ret_val): Move the declaration out of a
1720         function body (only for IA-64).
1721         * mark_rts.c (GC_push_current_stack): Call
1722         GC_push_all_stack_part_eager_frames() instead of
1723         GC_push_all_stack_partially_eager().
1724         * mark_rts.c (GC_push_current_stack): Call
1725         GC_push_all_register_frames() instead of GC_push_all_eager() for
1726         IA-64 backing store.
1727         * misc.c (GC_do_blocking_inner): Declare function (if THREADS
1728         only).
1729         * misc.c (GC_blocked_sp, GC_blocked_register_sp,
1730         GC_activation_frame): New global variables (only if not THREADS).
1731         * misc.c (GC_call_with_gc_active, GC_do_blocking_inner): New API
1732         function (only if not THREADS).
1733         * misc.c (GC_do_blocking): Move the function from
1734         pthread_support.c.
1735         * include/private/pthread_support.h (GC_Thread_Rep): Add
1736         "activation_frame" field.
1737         * pthread_stop_world.c (GC_push_all_stacks): Call
1738         GC_push_all_stack_frames() and GC_push_all_register_frames instead
1739         of GC_push_all_stack() and/or GC_push_all_eager(); don't check for
1740         STACK_GROWS_UP here.
1741         * pthread_support.c (GC_do_blocking_inner): Remove "static"; store
1742         "fn" result back to "client_data" field.
1743         * pthread_support.c (GC_call_with_gc_active): New API function.
1744         * win32_threads.c (GC_call_with_gc_active): Ditto.
1745         * win32_threads.c (GC_Thread_Rep): Add "thread_blocked_sp" and
1746         "activation_frame" fields.
1747         * win32_threads.c (GC_new_thread): Add assertion checking for
1748         thread_blocked_sp is NULL.
1749         * win32_threads.c (GC_do_blocking_inner): New function.
1750         * win32_threads.c (GC_stop_world): Don't suspend a thread if its
1751         thread_blocked_sp is non-NULL.
1752         * win32_threads.c (GC_push_stack_for): Use thread
1753         "activation_frame" (if non-NULL); use "thread_blocked_sp" if
1754         non-NULL (instead of calling GetThreadContext()); "UNPROTECT" the
1755         thread before modifying its last_stack_min; call
1756         GC_push_all_stack_frames() instead of GC_push_all_stack(); update
1757         the comments.
1758
1759 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
1760         (ivmai129.diff - superseding diff47)
1761
1762         * alloc.c (GC_default_stop_func): New static variable (initialized
1763         to GC_never_stop_func).
1764         * alloc.c (GC_set_stop_func, GC_get_stop_func): New function.
1765         * alloc.c (GC_timeout_stop_func): Define as GC_default_stop_func
1766         (instead of GC_never_stop_func) if SMALL_CONFIG (or NO_CLOCK),
1767         else call GC_default_stop_func() before getting "current_time".
1768         * alloc.c (GC_maybe_gc): Expand GC_gcollect_inner() macro (for
1769         FIXME comment).
1770         * alloc.c (GC_maybe_gc, GC_collect_a_little_inner): add FIXME for
1771         replacing GC_never_stop_func with GC_default_stop_func (if
1772         possible).
1773         * alloc.c (GC_gcollect): Use GC_default_stop_func.
1774         * alloc.c (GC_collect_or_expand): Use GC_default_stop_func
1775         (instead of GC_never_stop_func) unless it is trigged due to out of
1776         memory; don't increment GC_fail_count and don't output warning
1777         (before trying to collect again) in case the collection has been
1778         interrupted (by GC_default_stop_func) and the heap expansion has
1779         failed too.
1780         * include/gc.h (GC_set_stop_func, GC_get_stop_func): New function
1781         prototypes.
1782
1783 2009-09-19  Ivan Maidanski <ivmai@mail.ru>
1784
1785         * os_dep.c (GC_get_stack_base): Add FIXME; add assertion for
1786         GC_get_writable_length() result.
1787
1788 2009-09-18  Ivan Maidanski <ivmai@mail.ru> (really Ludovic Courtes)
1789
1790         * configure.ac: Don't use -lpthread -ldl for Cygwin.
1791
1792 2009-09-18  Ivan Maidanski <ivmai@mail.ru>
1793
1794         * NT_THREADS_MAKEFILE: Make it back equal to gc.mak.
1795
1796 2009-09-18  Ivan Maidanski <ivmai@mail.ru>
1797         (ivmai142.diff)
1798
1799         * include/private/gcconfig.h (GWW_VDB): Undefine if
1800         USE_GLOBAL_ALLOC (since incompatible).
1801         * os_dep.c (GetWriteWatch_alloc_flag): Define as 0 unless GWW_VDB
1802         is defined.
1803         * os_dep.c (GC_unmap_threshold): Declare (for use in
1804         GC_init_win32) if USE_MUNMAP.
1805         * os_dep.c (GC_init_win32): Turn off memory unmapping if
1806         GlobalAlloc() is used.
1807         * os_dep.c (GC_win32_get_mem): Define and use new
1808         VIRTUAL_ALLOC_PAD macro; don't waste a extra memory page unless
1809         MPROTECT_VDB is in use.
1810
1811 2009-09-17  Ivan Maidanski <ivmai@mail.ru>
1812
1813         * Makefile: Replace "version.h" with "include/gc_version.h".
1814         * include/gc_version.h: Ditto.
1815
1816 2009-09-17  Ivan Maidanski <ivmai@mail.ru>
1817
1818         * alloc.c (GC_collect_or_expand): Output heap size in WARN()
1819         (before returning FALSE) for convenience.
1820
1821 2009-09-17  Ivan Maidanski <ivmai@mail.ru>
1822         (ivmai139.diff)
1823
1824         * allchblk.c (GC_allochblk_nth): Use GC_PRIdPTR in WARN() format
1825         string.
1826         * pthread_support.c (start_mark_threads, GC_thr_init): Ditto.
1827         * win32_threads.c (GC_delete_thread): Ditto.
1828         * include/private/gc_priv.h (GC_PRIdPTR): New macro.
1829         * pthread_stop_world.c (GC_suspend_handler_inner): Remove
1830         unnecessary cast for WARN argument.
1831         * pthread_support.c (start_mark_threads): if pthread_create()
1832         failed then don't try to create other marker threads and (after
1833         printing a warning) adjust GC_markers and GC_parallel values; log
1834         GC_markers value (possibly adjusted) after that.
1835
1836 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
1837         (ivmai140.diff)
1838
1839         * win32_threads.c (start_mark_threads): if pthread_create() is
1840         failed then don't try to create other marker threads and (after
1841         printing a warning) adjust GC_markers and GC_parallel values.
1842         * win32_threads.c (mark_mutex_event, builder_cv, mark_cv): Move
1843         the definition upper (to be visible in start_mark_threads()).
1844         * win32_threads.c (start_mark_threads): if CreateThread() or
1845         _beginthreadex() is failed then don't try to create other marker
1846         threads and (after printing a warning) adjust GC_markers,
1847         GC_parallel values, and destroy the event objects (either only
1848         some for the uncreated threads if DONT_USE_SIGNALANDWAIT or all if
1849         not a single thread is created).
1850         * win32_threads.c (GC_thr_init): Log GC_markers value (possibly
1851         adjusted) after start_mark_threads() call.
1852
1853 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
1854
1855         * Makefile.am: Back remove "GC_" prefix for PTHREADS,
1856         DARWIN_THREADS, WIN32_THREADS (for configure.ac).
1857
1858 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
1859
1860         * ChangeLog: Remove trailing spaces at EOLn; insert blank lines
1861         where missed.
1862         * doc/README: Expand all tabs to spaces; remove trailing spaces at
1863         EOLn; remove multiple trailing blank lines.
1864         * doc/README.autoconf: Ditto.
1865         * doc/README.DGUX386: Ditto.
1866         * doc/README.environment: Ditto.
1867         * doc/README.macros: Ditto.
1868         * doc/README.win32: Ditto.
1869         * tests/test.c: Ditto.
1870         * tests/test_cpp.cc: Ditto.
1871         * backgraph.c: Ditto.
1872         * blacklst.c: Ditto.
1873         * checksums.c: Ditto.
1874         * darwin_stop_world.c: Ditto.
1875         * dbg_mlc.c: Ditto.
1876         * dyn_load.c: Ditto.
1877         * finalize.c: Ditto.
1878         * gc_dlopen.c: Ditto.
1879         * gcj_mlc.c: Ditto.
1880         * headers.c: Ditto.
1881         * mach_dep.c: Ditto.
1882         * malloc.c: Ditto.
1883         * mallocx.c: Ditto.
1884         * new_hblk.c: Ditto.
1885         * obj_map.c: Ditto.
1886         * ptr_chck.c: Ditto.
1887         * real_malloc.c: Ditto.
1888         * reclaim.c: Ditto.
1889         * stubborn.c: Ditto.
1890         * thread_local_alloc.c: Ditto.
1891         * typd_mlc.c: Ditto.
1892         * gc_cpp.cc: Ditto.
1893         * include/gc_allocator.h: Ditto.
1894         * include/gc_backptr.h: Ditto.
1895         * include/gc_config_macros.h: Ditto.
1896         * include/gc_cpp.h: Ditto.
1897         * include/gc_gcj.h: Ditto.
1898         * include/gc_inline.h: Ditto.
1899         * include/gc_mark.h: Ditto.
1900         * include/gc_pthread_redirects.h: Ditto.
1901         * include/gc_typed.h: Ditto.
1902         * include/gc_version.h: Ditto.
1903         * include/javaxfc.h: Ditto.
1904         * include/new_gc_alloc.h: Ditto.
1905         * include/private/darwin_semaphore.h: Ditto.
1906         * include/private/dbg_mlc.h: Ditto.
1907         * include/private/gc_hdrs.h: Ditto.
1908         * include/private/gc_locks.h: Ditto.
1909         * include/private/gc_pmark.h: Ditto.
1910         * include/private/gcconfig.h: Ditto.
1911         * include/private/pthread_support.h: Ditto.
1912         * include/private/thread_local_alloc.h: Ditto.
1913         * darwin_stop_world.c: Add copyright header.
1914         * include/gc_backptr.h: Ditto.
1915         * include/gc_config_macros.h: Ditto.
1916         * include/gc_pthread_redirects.h: Ditto.
1917         * include/gc_version.h: Ditto.
1918         * include/javaxfc.h: Ditto.
1919         * include/private/darwin_semaphore.h: Ditto.
1920         * include/private/pthread_support.h: Ditto.
1921         * gc_cpp.cc: Make copyright header uniform across the package.
1922         * include/gc_cpp.h: Ditto.
1923
1924 2009-09-16  Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
1925         (gc_config_h_6a.patch with a minor correction)
1926
1927         * include/private/gc_priv.h: Change include of config.h to
1928         private/config.h.
1929         * include/private/gc_pmark.h: Ditto.
1930         * gc_cpp.cc: Ditto.
1931         * tests/test.c: Ditto.
1932         * tests/test_cpp.cc: Include private/config.h (if HAVE_CONFIG_H);
1933         undefine GC_BUILD.
1934
1935 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
1936         (ivmai128.diff - superseding diff62, diff66 partly)
1937
1938         * finalize.c (GC_general_register_disappearing_link): Return
1939         GC_SUCCESS, GC_DUPLICATE, GC_NO_MEMORY (instead of 0, 1 and 2,
1940         respectively).
1941         * include/gc.h (GC_NO_MEMORY): New macro (defined as 2).
1942         * include/gc.h (GC_register_disappearing_link,
1943         GC_general_register_disappearing_link): Update the comment.
1944         * typd_mlc.c (GC_calloc_explicitly_typed): Use GC_NO_MEMORY macro.
1945         * finalize.c (GC_general_register_disappearing_link,
1946         GC_register_finalizer_inner): Recalculate the hash table index
1947         after GC_oom_fn succeeded (since the table may grow while not
1948         holding the lock) and check again that the entry is still not in
1949         the table (free the unused entry otherwise unless DBG_HDRS_ALL).
1950         * finalize.c (GC_register_finalizer_inner): Initialize "hhdr"
1951         local variable (to prevent a compiler warning).
1952         * finalize.c (GC_register_finalizer_inner): Don't modify the data
1953         pointed by "ocd" and "ofn" in GC_register_finalizer_inner() failed
1954         (due to out of memory).
1955
1956 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
1957         (ivmai124.diff - superseding diff67 partly)
1958
1959         * alloc.c (GC_set_fl_marks, GC_clear_fl_marks): Transform loop to
1960         suppress compiler "variable might be uninitialized" warnings.
1961
1962 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
1963         (ivmai138.diff)
1964
1965         * Makefile.direct (DONT_USE_SIGNALANDWAIT): Add the comment for.
1966         * win32_threads.c (DONT_USE_SIGNALANDWAIT): Always define for
1967         WinCE.
1968         * win32_threads.c (THREAD_HANDLE): Cast Id (of DWORD type) to
1969         HANDLE thru word type (to avoid a compiler warning) for WinCE.
1970         * win32_threads.c (GC_marker_cv, GC_marker_Id): New static array
1971         (only if DONT_USE_SIGNALANDWAIT).
1972         * win32_threads.c (start_mark_threads): Initialize GC_marker_Id
1973         and GC_marker_cv for each helper thread (only if
1974         DONT_USE_SIGNALANDWAIT).
1975         * win32_threads.c (GC_mark_mutex_state): New static variable (only
1976         if DONT_USE_SIGNALANDWAIT).
1977         * win32_threads.c (GC_mark_mutex_waitcnt,
1978         signalObjectAndWait_func): Don't define if DONT_USE_SIGNALANDWAIT.
1979         * win32_threads.c (GC_acquire_mark_lock, GC_release_mark_lock):
1980         Use InterlockedExchange() over GC_mark_mutex_state (instead of
1981         AO_fetch_and_add()) if DONT_USE_SIGNALANDWAIT.
1982         * win32_threads.c (GC_wait_marker, GC_notify_all_marker):
1983         Implement wait/broadcast primitives using Win32 multiple events
1984         (one for each marker thread) if DONT_USE_SIGNALANDWAIT (instead of
1985         using Win32 SignalObjectAndWait).
1986         * win32_threads.c (GC_thr_init): Don't declare hK32 local
1987         variable, don't check for GC_wnt, and don't initialize
1988         signalObjectAndWait_func if DONT_USE_SIGNALANDWAIT.
1989
1990 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
1991         (ivmai127.diff - superseding diff49)
1992
1993         * alloc.c (GC_finish_collection): Call GC_print_finalization_stats
1994         if GC_print_stats (after getting "done_time").
1995         * finalize.c (GC_old_dl_entries): New static variable (only if not
1996         SMALL_CONFIG).
1997         * finalize.c (GC_finalize): Save current GC_dl_entries value (only
1998         if not SMALL_CONFIG).
1999         * finalize.c (GC_print_finalization_stats): Define if and only if
2000         not SMALL_CONFIG; use GC_old_dl_entries value; use GC_log_printf()
2001         instead of GC_printf(); use "%lu" (instead of "%u") print format
2002         specifier; use unsigned long type for "ready" counter (for LP64
2003         targets).
2004         * misc.c (GC_dump): No longer call GC_print_finalization_stats()
2005         here (since it is called from GC_finish_collection()).
2006         * misc.c (STACKBASE): Remove unused macro undef (for NOSYS and
2007         ECOS).
2008
2009 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
2010         (ivmai134.diff)
2011
2012         * alloc.c (GC_expand_hp): Replace GC_init_inner() call with
2013         GC_init() one.
2014         * malloc.c (GC_alloc_large, GC_generic_malloc_inner): Ditto.
2015         * mallocx.c (GC_generic_malloc_many): Ditto.
2016         * misc.c (GC_enable_incremental): Ditto.
2017         * alloc.c (GC_expand_hp): Update the comment.
2018         * mark.c (GC_obj_kinds): Ditto.
2019         * win32_threads.c (GC_allow_register_threads): Ditto.
2020         * private/gc_priv.h (GC_init_inner): Remove function declaration.
2021         * misc.c (GC_init_inner): Replace with public GC_init().
2022
2023 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
2024         (ivmai126.diff)
2025
2026         * gcj_mlc.c (GC_gcj_fake_mark_proc): New static function.
2027         * gcj_mlc.c (GC_init_gcj_malloc): If mp is 0 then supply
2028         GC_gcj_fake_mark_proc (aborting with the appropriate message)
2029         instead.
2030
2031 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
2032         (ivmai125.diff)
2033
2034         * os_dep.c (GC_wince_get_mem): If VirtualAlloc() returns NULL (due
2035         to out of memory) then don't increment GC_n_heap_bases and don't
2036         call VirtualAlloc() again (with MEM_COMMIT).
2037         * os_dep.c (GC_remap): Abort with a more informatory message if
2038         VirtualAlloc() fails due to out of memory; update FIXME.
2039
2040 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
2041         (ivmai132.diff - superseding diff41a, diff64, diff84 partly)
2042
2043         * Makefile: Fix typo for msvc_dbg.c.
2044         * Makefile.direct: Ditto.
2045         * Makefile.am: Prefix PTHREADS, DARWIN_THREADS, WIN32_THREADS with
2046         "GC_".
2047         * Makefile.dj: Don't reference remove files (nursery.c,
2048         gc_nursery.h, gc_copy_descr.h).
2049         * NT_MAKEFILE: Don't define __STDC__ macro (no longer used).
2050         * NT_STATIC_THREADS_MAKEFILE: Ditto.
2051         * NT_THREADS_MAKEFILE: Ditto.
2052         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
2053         * NT_X64_THREADS_MAKEFILE: Ditto.
2054         * gc.mak: Ditto.
2055         * NT_MAKEFILE: Remove unnecessary -DGC_BUILD (since it is always
2056         defined in the source files).
2057         * NT_THREADS_MAKEFILE: Ditto.
2058         * NT_X64_THREADS_MAKEFILE: Ditto.
2059         * gc.mak: Ditto.
2060         * NT_X64_THREADS_MAKEFILE: Fix typo for -DGC_NOT_DLL.
2061         * NT_STATIC_THREADS_MAKEFILE: Replace GC_WIN32_THREADS with
2062         GC_THREADS.
2063         * NT_THREADS_MAKEFILE: Ditto.
2064         * NT_X64_STATIC_THREADS_MAKEFILE: Ditto.
2065         * NT_X64_THREADS_MAKEFILE: Ditto.
2066         * gc.mak: Ditto.
2067         * NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE to suppress the
2068         compiler warnings.
2069         * NT_STATIC_THREADS_MAKEFILE: Ditto.
2070         * NT_X64_STATIC_THREADS_MAKEFILE: Place -D_CRT_SECURE_NO_DEPRECATE
2071         before "$*.C" (and "$*.CPP").
2072         * NT_X64_THREADS_MAKEFILE: Ditto.
2073
2074 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
2075         (ivmai131.diff - superseding diff83, diff84 partly)
2076
2077         * doc/README.solaris2: Replace GC_SOLARIS_THREADS with GC_THREADS.
2078         * doc/README.win32: Replace GC_WIN32_THREADS with GC_THREADS.
2079         * doc/README.win64: Add info about mingw-w64; add note for VC++
2080         warnings suppression.
2081
2082 2009-09-15  Hans Boehm <Hans.Boehm@hp.com> (Mostly Juan Jose Garcia-Ripoll)
2083         (Also similar to, but not the same as, Ivan's diff104_cvs)
2084
2085         * os_dep.c (GC_forward_exception): Fix logic in several places.
2086         (OSX-specific)
2087
2088 2009-09-15  Ivan Maidanski <ivmai@mail.ru>
2089         (ivmai137v2.diff)
2090
2091         * include/private/gc_priv.h (MAX_HEAP_SECTS): Guard with ifndef.
2092
2093 2009-09-14  Ivan Maidanski <ivmai@mail.ru>
2094         (ivmai136v2.diff)
2095
2096         * Makefile.direct: Copy missing information for -DSHORT_DBG_HDRS
2097         from Makefile.
2098         * Makefile: Remove the information about "define arguments" (which
2099         is incomplete and outdated compared to that in Makefile.direct);
2100         add help reference to Makefile.direct.
2101         * Makefile.dj: Ditto.
2102
2103 2009-09-14  Ivan Maidanski <ivmai@mail.ru>
2104         (ivmai135.diff)
2105
2106         * alloc.c (world_stopped_total_time, world_stopped_total_divisor):
2107         Replace "STATIC" with "static" in the definition (since the
2108         symbols aren't prefixed with "GC_").
2109         * win32_threads.c (marker_sp, marker_bsp, marker_last_stack_min,
2110         start_mark_threads, mark_mutex, builder_cv, mark_cv,
2111         mark_mutex_event, signalObjectAndWait_func, main_thread_start):
2112         Ditto.
2113         * pthread_support.c (GC_wait_builder): Define as STATIC.
2114         * win32_threads.c (GC_wait_builder): Ditto.
2115
2116 2009-09-14  Ivan Maidanski <ivmai@mail.ru>
2117         (ivmai133.diff)
2118
2119         * misc.c (GC_get_heap_size_inner, GC_get_free_bytes_inner): New
2120         API function.
2121         * include/gc_pmark.h (GC_get_heap_size_inner,
2122         GC_get_free_bytes_inner): New function declaration.
2123
2124 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
2125         (ivmai121.diff)
2126
2127         * include/gc.h: Recognize __CEGCC__ (as a synonym for _WIN32_WCE).
2128         * include/gc_config_macros.h: Ditto.
2129         * include/gc.h (GC_MAXIMUM_HEAP_SIZE): Recognize new macro.
2130         * include/gc.h (GC_INIT_CONF_MAXIMUM_HEAP_SIZE): New macro (for
2131         internal use).
2132         * include/gc_config_macros.h: Always include stddef.h if GCC.
2133         * include/gc_config_macros.h (GC_API): Define for CeGCC in the
2134         same way as for MinGW.
2135         * include/gc_config_macros.h (GC_API): Group the definition for
2136         all cases together (check for GC_DLL only once).
2137         * include/gc_pthread_redirects.h: Group non-Darwin code together.
2138         * tests/test.c: Recognize GC_PRINT_VERBOSE_STATS (only if GC_DLL).
2139
2140 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
2141         (ivmai120a.diff, ivmai120b.diff)
2142
2143         * Makefile.direct (GC_PTHREADS_PARAMARK, GC_IGNORE_GCJ_INFO,
2144         GC_PRINT_VERBOSE_STATS, GC_DONT_EXPAND, GC_INITIAL_HEAP_SIZE,
2145         GC_FREE_SPACE_DIVISOR, GC_TIME_LIMIT, GC_FULL_FREQ): Add the
2146         comment for.
2147         * misc.c (GC_init_inner): Recognize GC_PRINT_VERBOSE_STATS (new
2148         macro).
2149         * dyn_load.c (GC_wnt): Change definition to TRUE for WinCE; add
2150         FIXME and the comment for WinCE.
2151         * gcj_mlc.c (GC_init_gcj_malloc): Recognize GC_IGNORE_GCJ_INFO
2152         (new macro).
2153         * include/gc.h (GC_HAVE_BUILTIN_BACKTRACE): Don't define for VC++
2154         WinCE (since backtrace() is unimplemented).
2155         * include/private/gc_priv.h (GC_n_heap_bases): Remove declaration
2156         (since static).
2157         * os_dep.c (GC_n_heap_bases): Define as STATIC; move the
2158         definition to be above GC_is_heap_base().
2159         * include/private/gcconfig.h: Don't define NOSYS for WinCE on ARM
2160         (both for MinGW and CeGCC toolchains).
2161         * include/private/gcconfig.h: Recognize __CEGCC__ and
2162         __MINGW32CE__ (as synonyms for __WIN32_WCE).
2163         * include/private/gcconfig.h: If SH4 then don't set config
2164         parameters for SH.
2165         * include/private/thread_local_alloc.h (GC_key_create): Don't
2166         abort on failures, just return -1 in these cases (this also
2167         prevents compilation error for targets where ABORT is defined
2168         indirectly as an inline assembler sequence).
2169         * mark.c (WRAP_MARK_SOME): Also define for WinCE; add FIXME for
2170         the GCC-based cross-compiler.
2171         * mark.c (ext_ex_regn, mark_ex_handler): Don't define unless
2172         WRAP_MARK_SOME is defined; define also for WinCE case; don't
2173         check for _WIN64 (since WRAP_MARK_SOME is undefined for it).
2174         * mark.c (GC_mark_some): Use __try/__except also for WinCE; update
2175         the comment.
2176         * misc.c: Include signal.h after gc_pmark.h included; check for
2177         MSWINCE instead of _WIN32_WCE.
2178         * misc.c (GC_init_inner): Remove duplicate GC_setpagesize() call.
2179         * misc.c: Don't include <crtdbg.h> for WinCE targets.
2180         * misc.c (GC_write): Define _MAX_PATH if undefined (workaround for
2181         CeGCC toolchain).
2182         * misc.c (GC_write): Use OutputDebugStringW() instead of
2183         _CrtDbgReport() for WinCE targets.
2184         * os_dep.c (GC_least_described_address): Define as STATIC.
2185         * os_dep.c (GC_register_data_segments): Fix code indentation.
2186         * os_dep.c (GC_wince_get_mem): Initialize "result" local variable
2187         (to prevent a compiler warning).
2188         * os_dep.c (GC_dirty_init): Add comment for WinCE target.
2189         * tests/test.c: Don't include winbase.h directly if GCC for WinCE,
2190         include assert.h instead.
2191         * tests/test.c (tiny_reverse_test): Define and use
2192         TINY_REVERSE_UPPER_VALUE macro (4 if VERY_SMALL_CONFIG else 10);
2193         useful for WinCE.
2194         * win32_threads.c (GC_Thread_Rep): Don't declare "handle" field
2195         for WinCE (since thread Id is used as a "real" thread handle).
2196         * win32_threads.c (THREAD_HANDLE): New macro.
2197         * win32_threads.c (GC_register_my_thread_inner): Don't recognize
2198         DONT_IMPORT_GETCURTHREAD anymore; don't record thread handle on
2199         WinCE.
2200         * Makefile.direct (DONT_IMPORT_GETCURTHREAD): Remove comment for.
2201         * win32_threads.c (UNPROTECT, GC_fault_handler_lock): Don't check
2202         for MSWINCE.
2203         * win32_threads.c (GC_delete_gc_thread, GC_delete_thread): Don't
2204         close thread handle on WinCE (since it's a thread Id).
2205         * win32_threads.c (GC_suspend): Don't check for MSWINCE in the
2206         MPROTECT-related code (for the case if MPROTECT_VDB would be
2207         implemented for WinCE).
2208         * win32_threads.c (GC_suspend, GC_start_world, GC_push_stack_for):
2209         Use THREAD_HANDLE(t) to obtain thread handle.
2210         * win32_threads.c (GC_PTHREADS_PARAMARK): New macro recognized;
2211         implicitly define GC_PTHREADS_PARAMARK if GC_PTHREADS; include
2212         pthread.h; define NUMERIC_THREAD_ID(id) if undefined yet; replace
2213         GC_PTHREADS with GC_PTHREADS_PARAMARK where appropriate (for the
2214         parallel mark support).
2215         * win32_threads.c (start_mark_threads): Use int type for "i" local
2216         variable (instead of "unsigned") to prevent a compiler warning.
2217         * win32_threads.c (start_mark_threads): Don't check CreateThread()
2218         result for -1; call CloseHandle() for the handle created by
2219         CreateThread() (on WinCE); don't use errno (since errno.h is
2220         missing on some targets like WinCE) when printing warning on a
2221         marker thread creation failure.
2222         * win32_threads.c (signalObjectAndWait_func): Define for WinCE.
2223         * win32_threads.c (GC_wait_marker): Remove unnecessary assertion
2224         for non-zero signalObjectAndWait_func (to make the code compilable
2225         for WinCE).
2226         * win32_threads.c (GC_thr_init): Allow PARALLEL_MARK for WinCE;
2227         use GC_sysinfo to get processors count if WinCE; don't check for
2228         SignalObjectAndWait() if WinCE; replace GC_PTHREADS with
2229         GC_PTHREADS_PARAMARK.
2230         * win32_threads.c (GC_thr_init): Recognize GC_MIN_MARKERS new
2231         macro (useful for testing parallel marking on WinCE).
2232         * win32_threads.c (GC_win32_start, main_thread_start): Define as
2233         STATIC.
2234         * win32_threads.c: Don't define main_thread_args,
2235         main_thread_start(), WinMain() for WinCE if GC_DLL.
2236         * win32_threads.c (WINCE_MAIN_STACK_SIZE): Remove useless macro
2237         (since the stack size parameter is ignored on WinCE).
2238         * win32_threads.c (main_thread_start): Remove forward declaration;
2239         place its definition before WinMain() one.
2240         * win32_threads.c (WinMain): Abort if GC_CreateThread() or
2241         WaitForSingleObject() failed (for the main thread).
2242
2243 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
2244         (diff118_cvs - superseding diff53)
2245
2246         * allchblk.c (MUNMAP_THRESHOLD): Move macro definition out of
2247         a function.
2248         * allchblk.c (GC_unmap_threshold): New global variable definition
2249         (initialized to MUNMAP_THRESHOLD).
2250         * allchblk.c (GC_unmap_old): Use GC_unmap_threshold instead of
2251         MUNMAP_THRESHOLD; skip unmapping if GC_unmap_threshold is 0.
2252         * doc/README.environment (GC_UNMAP_THRESHOLD): Add information.
2253         * misc.c (GC_unmap_threshold): New variable declaration.
2254         * misc.c (GC_init_inner): Recognize "GC_UNMAP_THRESHOLD"
2255         environment variable to set GC_unmap_threshold value (only if
2256         USE_MUNMAP).
2257
2258 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
2259         (diff117)
2260
2261         * dbg_mlc.c (OFN_UNSET): New macro (to detect
2262         GC_register_finalizer() failures).
2263         * dbg_mlc.c (store_old): Add a check for register_finalizer()
2264         failure caused by an out-of-memory event (leave *ofn and *ocd
2265         unmodified in that case).
2266         * dbg_mlc.c (GC_debug_register_finalizer,
2267         GC_debug_register_finalizer_no_order,
2268         GC_debug_register_finalizer_unreachable,
2269         GC_debug_register_finalizer_ignore_self): Initialize my_old_fn
2270         to OFN_UNSET; clear *ocd and *ofn for non-heap objects (the same
2271         as in GC_register_finalizer_inner()).
2272
2273 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
2274         (diff116a, diff116b, diff116c)
2275
2276         * Makefile.direct (GC_DLL): Add the comment for.
2277         * doc/README.macros: Fix a typo.
2278         * doc/README.macros (_DLL, GC_DLL, GC_NOT_DLL): Update info.
2279         * doc/README.macros (__STDC__): Remove info.
2280         * dbg_mlc.c (GC_get_back_ptr_info, GC_generate_random_heap_address,
2281         GC_generate_random_valid_address, GC_print_backtrace,
2282         GC_generate_random_backtrace, GC_register_describe_type_fn): Add
2283         GC_API and GC_CALL to function definition.
2284         * malloc.c (GC_generic_malloc): Ditto.
2285         * mallocx.c (GC_incr_bytes_allocd, GC_incr_bytes_freed): Ditto.
2286         * mark.c (GC_mark_and_push): Ditto.
2287         * misc.c (GC_new_free_list_inner, GC_new_free_list,
2288         GC_new_kind_inner, GC_new_kind, GC_new_proc_inner, GC_new_proc):
2289         Ditto.
2290         * include/gc_backptr.h (GC_get_back_ptr_info,
2291         GC_generate_random_heap_address, GC_generate_random_valid_address,
2292         GC_generate_random_backtrace, GC_print_backtrace): Add GC_API and
2293         GC_CALL to function prototype.
2294         * include/gc_mark.h (GC_mark_and_push, GC_new_free_list,
2295         GC_new_free_list_inner, GC_new_kind, GC_new_kind_inner,
2296         GC_new_proc, GC_new_proc_inner, GC_generic_malloc,
2297         GC_register_describe_type_fn): Ditto.
2298         * include/new_gc_alloc.h (GC_incr_bytes_allocd, GC_incr_mem_freed,
2299         GC_generic_malloc_words_small): Ditto.
2300         * gc_cpp.cc: Include "config.h" (if HAVE_CONFIG_H defined).
2301         * include/private/gc_pmark.h: Ditto.
2302         * include/private/gc_priv.h: Ditto.
2303         * tests/test.c: Ditto.
2304         * gc_cpp.cc: Define GC_BUILD.
2305         * include/private/gc_pmark.h: Ditto.
2306         * include/private/gc_priv.h: Ditto.
2307         * gc_dlopen.c (WRAP_FUNC, REAL_FUNC): New macro.
2308         * gc_dlopen.c (dlopen): Add GC_API to the wrapper function
2309         definition.
2310         * pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
2311         GC_pthread_join, GC_pthread_detach, pthread_sigmask, pthread_join,
2312         pthread_detach, pthread_create): Ditto.
2313         * win32_threads.c (GC_pthread_join, GC_pthread_create,
2314         GC_pthread_sigmask, GC_pthread_detach): Ditto.
2315         * gc_dlopen.c (dlopen): Use WRAP_FUNC and REAL_FUNC macros.
2316         * include/gc_backptr.h: Include "gc.h".
2317         * include/gc_backptr.h: Use extern "C" for the exported functions.
2318         * include/gc_mark.h: Ditto.
2319         * include/gc_config_macros.h (GC_THREADS): Define the macro if any
2320         GC_XXX_THREADS is defined.
2321         * include/gc_config_macros.h (_PTHREADS, _POSIX4A_DRAFT10_SOURCE):
2322         Move the definitions below the place where GC_NETBSD_THREADS and
2323         GC_DGUX386_THREADS are defined.
2324         * include/gc_config_macros.h (GC_DLL): Don't define (even if _DLL
2325         is defined) for GCC.
2326         * include/gc_config_macros.h (GC_API): Define for Cygwin (in the
2327         same way as for VC++); define for GCC v4+ (other than already
2328         recognized MinGW/Cygwin) as a "default" visibility attribute if
2329         GC_DLL is defined.
2330         * include/gc_config_macros.h (GC_ATTR_MALLOC, GC_ATTR_ALLOC_SIZE):
2331         New macro.
2332         * include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup,
2333         GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign,
2334         GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page,
2335         GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
2336         GC_debug_malloc_atomic, GC_debug_strdup,
2337         GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn,
2338         GC_debug_malloc_ignore_off_page,
2339         GC_debug_malloc_atomic_ignore_off_page,
2340         GC_debug_malloc_replacement): Add GC_ATTR_MALLOC attribute.
2341         * include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc,
2342         GC_gcj_malloc_ignore_off_page): Ditto.
2343         * include/gc.h (GC_malloc, GC_malloc_atomic,
2344         GC_malloc_uncollectable, GC_malloc_stubborn,
2345         GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page,
2346         GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
2347         GC_debug_malloc_atomic, GC_debug_malloc_uncollectable,
2348         GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page,
2349         GC_debug_malloc_atomic_ignore_off_page,
2350         GC_debug_malloc_replacement: Add GC_ATTR_ALLOC_SIZE attribute
2351         (for the first argument).
2352         * include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc,
2353         GC_gcj_malloc_ignore_off_page): Ditto.
2354         * include/gc.h (GC_memalign, GC_realloc, GC_debug_realloc,
2355         GC_debug_realloc_replacement): Add GC_ATTR_ALLOC_SIZE attribute
2356         (for the second argument).
2357         * include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup,
2358         GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign,
2359         GC_malloc_atomic_uncollectable, GC_free, GC_base, GC_size,
2360         GC_realloc, GC_expand_hp, GC_set_max_heap_size,
2361         GC_exclude_static_roots, GC_add_roots, GC_remove_roots,
2362         GC_register_displacement, GC_debug_register_displacement,
2363         GC_try_to_collect, GC_malloc_ignore_off_page,
2364         GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
2365         GC_debug_malloc_atomic, GC_debug_strdup,
2366         GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn,
2367         GC_debug_malloc_ignore_off_page,
2368         GC_debug_malloc_atomic_ignore_off_page, GC_debug_free,
2369         GC_debug_realloc, GC_debug_malloc_replacement,
2370         GC_debug_realloc_replacement, GC_finalization_proc,
2371         GC_register_finalizer, GC_debug_register_finalizer,
2372         GC_register_finalizer_ignore_self,
2373         GC_debug_register_finalizer_ignore_self,
2374         GC_register_finalizer_no_order,
2375         GC_debug_register_finalizer_no_order,
2376         GC_register_finalizer_unreachable,
2377         GC_debug_register_finalizer_unreachable,
2378         GC_register_disappearing_link,
2379         GC_general_register_disappearing_link,
2380         GC_unregister_disappearing_link, GC_noop1, GC_warn_proc,
2381         GC_set_warn_proc, GC_ignore_warn_proc, GC_fn_type,
2382         GC_call_with_alloc_lock, GC_stack_base_func,
2383         GC_call_with_stack_base, GC_same_obj, GC_pre_incr, GC_post_incr,
2384         GC_is_visible, GC_is_valid_displacement, GC_same_obj_print_proc,
2385         GC_is_valid_displacement_print_proc, GC_is_visible_print_proc,
2386         GC_malloc_many, GC_CreateThread, GC_beginthreadex,
2387         GC_endthreadex): Comment out (or remove if single and meaningless)
2388         function argument names (to avoid identifiers out of the name
2389         space).
2390         * include/gc_gcj.h (GC_init_gcj_malloc, GC_gcj_malloc,
2391         GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Ditto.
2392         * include/gc.h (GC_try_to_collect): Update the comment.
2393         * include/gc.h (GC_size, GC_register_my_thread): Add const
2394         qualifier for the argument referent.
2395         * misc.c (GC_size): Ditto.
2396         * pthread_support.c (GC_register_my_thread_inner,
2397         GC_register_my_thread): Ditto.
2398         * win32_threads.c (GC_register_my_thread_inner,
2399         GC_register_my_thread): Ditto.
2400         * include/gc.h (GC_INIT_CONF_ROOTS): New macro for internal use
2401         (define instead of GC_INIT() for Cygwin and AIX).
2402         * include/gc.h (GC_DONT_EXPAND, GC_MAX_RETRIES,
2403         GC_FREE_SPACE_DIVISOR, GC_FULL_FREQ, GC_TIME_LIMIT, GC_IGNORE_WARN,
2404         GC_INITIAL_HEAP_SIZE): Recognize new macro.
2405         * include/gc.h (GC_INIT_CONF_DONT_EXPAND, GC_INIT_CONF_MAX_RETRIES,
2406         GC_INIT_CONF_FREE_SPACE_DIVISOR, GC_INIT_CONF_FULL_FREQ,
2407         GC_INIT_CONF_TIME_LIMIT, GC_INIT_CONF_IGNORE_WARN,
2408         GC_INIT_CONF_INITIAL_HEAP_SIZE): New macro for internal use.
2409         * include/gc.h (GC_INIT): Use GC_INIT_CONF_XXX macros.
2410         * include/gc_mark.h: Prefix GC_H with '_'.
2411         * include/gc_mark.h (GC_least_plausible_heap_addr,
2412         GC_greatest_plausible_heap_addr, GC_debug_header_size): Use GC_API
2413         for the public variable declaration.
2414         * include/new_gc_alloc.h (GC_objfreelist_ptr, GC_aobjfreelist_ptr,
2415         GC_uobjfreelist_ptr, GC_auobjfreelist_ptr): Ditto.
2416         * include/gc_pthread_redirects.h (GC_pthread_create,
2417         GC_pthread_sigmask, GC_dlopen, GC_pthread_join, GC_pthread_detach):
2418         Use GC_API for the wrapper prototype.
2419         * include/gc_pthread_redirects.h (pthread_create, pthread_join,
2420         pthread_detach, pthread_sigmask, dlopen): Undefine unconditionally
2421         before redirecting.
2422         * include/new_gc_alloc.h: Replace GC_incr_mem_freed() with
2423         GC_incr_bytes_freed(); remove FIXME.
2424         * include/private/gc_priv.h (GC_make_closure,
2425         GC_debug_invoke_finalizer, GC_noop): Remove GC_API for the private
2426         function.
2427         * tests/test.c (GC_print_stats): Handle GC_DLL case regardless of
2428         the target.
2429
2430 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
2431         (diff115)
2432
2433         * finalize.c (GC_general_register_disappearing_link,
2434         GC_register_finalizer_inner): Remove unnecessary "ifdef THREADS"
2435         guard for LOCK/UNLOCK().
2436         * finalize.c (GC_general_register_disappearing_link,
2437         GC_register_finalizer_inner): Get GC_oom_fn value before releasing
2438         the lock (to prevent data races).
2439         * gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc,
2440         GC_gcj_malloc_ignore_off_page): Ditto.
2441         * mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.
2442         * include/gc_inline.h (GC_FAST_MALLOC_GRANS): Use GC_get_oom_fn()
2443         instead of GC_oom_fn (to prevent data races).
2444         * malloc.c (GC_generic_malloc): Ditto.
2445         * mallocx.c (GC_memalign): Ditto.
2446         * pthread_support.c (pthread_create): Ditto.
2447         * gcj_mlc.c (maybe_finalize): Acquire the lock before setting
2448         last_finalized_no value to prevent data races.
2449         * include/gc.h (GC_gc_no, GC_get_gc_no, GC_oom_fn, GC_set_oom_fn,
2450         GC_set_find_leak, GC_set_finalize_on_demand,
2451         GC_set_java_finalization, GC_set_finalizer_notifier,
2452         GC_set_dont_expand, GC_set_full_freq, GC_set_non_gc_bytes,
2453         GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries,
2454         GC_set_dont_precollect, GC_set_time_limit, GC_warn_proc): Refine
2455         the comment.
2456         * misc.c (GC_set_oom_fn): Ditto.
2457         * include/gc.h (GC_general_register_disappearing_link): Refine the
2458         comment (replace "soft" word with "weak").
2459         * misc.c (GC_oom_fn, GC_get_gc_no, GC_get_parallel,
2460         GC_set_finalizer_notifier, GC_set_find_leak): Add the comment.
2461         * misc.c (GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier,
2462         GC_get_finalizer_notifier): Use LOCK/UNLOCK to prevent data races.
2463
2464 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
2465         (diff114a, diff114b, diff114c)
2466
2467         * dbg_mlc.c: Guard include <errno.h> with ifndef MSWINCE; include
2468         "private/dbg_mlc.h" before it.
2469         * malloc.c: Ditto.
2470         * dbg_mlc.c (GC_debug_strdup): Use memcpy() instead of strcpy()
2471         for WinCE (since deprecated); evaluate strlen() only once; don't
2472         set errno for WinCE.
2473         * malloc.c (GC_strdup): Ditto.
2474         * dyn_load.c (GC_wnt): Define as macro (FALSE) for WinCE.
2475         * include/gc.h (GC_unregister_my_thread): Refine the comment.
2476         * include/gc.h (GC_uintptr_t, GC_beginthreadex, GC_endthreadex):
2477         Don't declare for WinCE.
2478         * include/gc.h (GC_WINMAIN_WINCE_LPTSTR): New macro (WinCE only).
2479         * include/gc.h (GC_WinMain): Remove GC_API.
2480         * include/gc.h (GC_WinMain): Use GC_WINMAIN_WINCE_LPTSTR for
2481         lpCmdLine.
2482         * tests/test.c (GC_WinMain): Ditto.
2483         * win32_threads.c (main_thread_args, GC_WinMain): Ditto.
2484         * include/gc_config_macros.h (ptrdiff_t): Guard with
2485         ifndef _PTRDIFF_T_DEFINED; define _PTRDIFF_T_DEFINED macro.
2486         * include/private/gc_locks.h: Guard include "atomic_ops.h" with
2487         ifdef GC_PTHREADS (and not GC_WIN32_THREADS).
2488         * mark.c: Include "atomic_ops.h" if PARALLEL_MARK.
2489         * thread_local_alloc.c: Include "atomic_ops.h" if GC_GCJ_SUPPORT.
2490         * win32_threads.c: Include "atomic_ops.h" if MPROTECT_VDB.
2491         * include/private/gc_locks.h: Use include "atomic_ops.h" instead
2492         of include <atomic_ops.h>.
2493         * include/private/gc_priv.h: Ditto.
2494         * include/private/gc_locks.h (GC_allocate_ml, GC_need_to_lock):
2495         Don't export (replace GC_API to "extern").
2496         * win32_threads.c (GC_allocate_ml): Don't export.
2497         * include/private/gc_priv.h (DebugBreak): Define as macro for
2498         WinCE (if not UNDER_CE and DebugBreak is not defined yet).
2499         * include/private/gc_priv.h (UNALIGNED): Rename to UNALIGNED_PTRS
2500         (since "UNALIGNED" is defined in winnt.h of WinCE).
2501         * mark.c (UNALIGNED): Ditto.
2502         * include/private/gcconfig.h (ARM32): Recognize _M_ARM and _ARM_.
2503         * include/private/gcconfig.h (ALIGNMENT): Check always defined.
2504         * include/private/gcconfig.h: Allow GC_WIN32_THREADS for WinCE.
2505         * include/private/thread_local_alloc.h: Define USE_WIN32_SPECIFIC
2506         for WinCE (since __declspec(thread) is unsupported).
2507         * include/private/thread_local_alloc.h (TLS_OUT_OF_INDEXES):
2508         Define for WinCE (if undefined).
2509         * malloc.c (GC_malloc): Remove outdated comment about disabling
2510         signals.
2511         * misc.c: Don't include <tchar.h> (since not used anymore and may
2512         break TEXT() macro defined in winnt.h).
2513         * misc.c (GC_init_inner): Don't use GetModuleHandle() and
2514         InitializeCriticalSectionAndSpinCount() for WinCE.
2515         * misc.c (GC_init_inner): Replace GetModuleHandleA() with
2516         GetModuleHandle() (and use TEXT() macro controlled by UNICODE).
2517         * misc.c (LOG_FILE): Remove unused macro; don't use _T() macro.
2518         * misc.c (GC_CreateLogFile): New static function (Win32/WinCE
2519         only); move the code from GC_write(); replace GETENV() with
2520         GetEnvironmentVariable(); replace CreateFileA() with
2521         CreateFile(); use TEXT() macro (for Unicode support); replace
2522         strcat() with memcpy() (since deprecated in WinCE).
2523         * misc.c (GC_write): Define as STATIC.
2524         * win32_threads.c (GC_attached_thread): Ditto.
2525         * misc.c (GC_write): Use GC_CreateLogFile().
2526         * misc.c: Define vsnprintf macro as StringCchVPrintfA for WinCE.
2527         * misc.c (GC_abort): Try to invoke MessageBoxA() dynamically
2528         (Win32 only) if DONT_USE_USER32_DLL is defined.
2529         * misc.c (GC_abort): Duplicate msg to GC log file (for Win32 and
2530         WinCE).
2531         * misc.c (GC_abort): Use a more user-friendly abort if
2532         NO_DEBUGGING (Win32 only).
2533         * os_dep.c: Include "atomic_ops.h" only if MPROTECT_VDB (and
2534         THREADS).
2535         * os_dep.c (detect_GetWriteWatch): Use TEXT() for GetModuleHandle
2536         (for Unicode support); check GetModuleHandle() result.
2537         * tests/test.c: Don't define assert for WinCE (since may be
2538         redefined by "assert.h" included from libatomic_ops).
2539         * tests/test.c (FAIL): Define as ABORT for all targets (except
2540         for PCR).
2541         * tests/test.c (n_tests): Don't use AO_t.
2542         * tests/test.c (check_heap_stats): Don't cast n_tests.
2543         * tests/test.c (inc_int_counter): New function (for n_tests atomic
2544         incrementation).
2545         * tests/test.c (run_one_test): Test GC_memalign() for all targets.
2546         * tests/test.c (run_one_test): Avoid unbalanced brackets in
2547         #if-#else-#endif blocks.
2548         * tests/test.c (run_one_test): Replace AO_fetch_and_add1() and
2549         private LOCK/UNLOCK with GC_call_with_alloc_lock(inc_int_counter).
2550         * tests/test.c (check_heap_stats): Replace
2551         "if (sizeof(char *) > 4)" with "#if CPP_WORDSZ == 64" to suppress
2552         "unreachable code" compiler warning.
2553         * tests/test.c (WinMain): Set cmd type to LPWSTR (for WinCE
2554         "UNDER_CE" mode); else use LPSTR type (for Win32 and WinCE).
2555         * tests/test.c (thr_window): Replace "L" string prefix with
2556         TEXT().
2557         * thread_local_alloc.c: Check THREADS is defined (to prevent other
2558         compiler errors and warnings otherwise).
2559         * tests/test.c (WinMain): Recognize GC_NO_DLLMAIN macro (for
2560         GC_use_DllMain()).
2561         * Makefile.direct (GC_NO_DLLMAIN, DONT_IMPORT_GETCURTHREAD): Add
2562         the comments for.
2563         * win32_threads.c (GC_register_my_thread_inner): Recognize
2564         DONT_IMPORT_GETCURTHREAD macro.
2565         * win32_threads.c: Recognize GC_NO_DLLMAIN macro (to exclude
2566         DllMain support if needed).
2567         * win32_threads.c (GC_NO_DLLMAIN): Define implicitly if DllMain
2568         thread registration is unsupported for a given configuration.
2569         * win32_threads.c (GC_use_DllMain): Update the comment; refine
2570         ABORT message.
2571         * win32_threads.c (GC_use_DllMain,
2572         GC_started_thread_while_stopped, GC_register_my_thread_inner,
2573         GC_lookup_thread_inner, GC_delete_gc_thread,
2574         GC_allow_register_threads, GC_lookup_pthread,
2575         GC_push_thread_structures, GC_stop_world, GC_push_all_stacks):
2576         Check for GC_NO_DLLMAIN.
2577         * win32_threads.c (GC_Thread_Rep.tm_in_use, GC_attached_thread,
2578         DllMain): Don't define if GC_NO_DLLMAIN.
2579         * win32_threads.c (GC_stop_world): Declare "i" and "max" local
2580         vars only if not GC_NO_DLLMAIN (to suppress compiler warning).
2581         * win32_threads.c (GC_mark_thread, start_mark_threads): Use
2582         CreateThread() instead of _beginthreadex() for WinCE.
2583         * win32_threads.c (MARK_THREAD_STACK_SIZE, WINCE_MAIN_STACK_SIZE):
2584         New macros defined (used by start_mark_threads(), WinMain()).
2585         * win32_threads.c (GC_thr_init): Exclude parallel-specific code on
2586         WinCE for now (since getenv(), GetProcessAffinityMask() and
2587         SignalObjectAndWait() are missing on WinCE).
2588         * win32_threads.c (GC_thr_init): replace GetModuleHandleA() with
2589         GetModuleHandle(); replace CreateEventA() with CreateEvent(); use
2590         TEXT() macro (for Unicode support).
2591
2592 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
2593         (diff113)
2594
2595         * include/gc.h (GC_has_static_roots_func): New typedef (user filter
2596         callback).
2597         * include/gc.h (GC_register_has_static_roots_callback): Use
2598         GC_has_static_roots_func type.
2599         * dyn_load.c (GC_has_static_roots,
2600         GC_register_has_static_roots_callback): Ditto.
2601         * dyn_load.c (GC_has_static_roots,
2602         GC_register_has_static_roots_callback): Define on all platforms.
2603         * dyn_load.c (GC_register_dynlib_callback,
2604         GC_register_dynamic_libraries, GC_init_dyld): Replace K&R-style
2605         functions definition with the ANSI C one.
2606         * dyn_load.c (GC_register_dynlib_callback): Use new local variable
2607         "callback" (initialized from GC_has_static_roots) to minimize data
2608         races.
2609         * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr,
2610         GC_cond_add_roots): Define as STATIC.
2611         * mark_rts.c (GC_remove_roots_inner): Ditto.
2612         * dyn_load.c (GC_dyld_image_add): Don't call GC_add_roots() for
2613         sections smaller than pointer size (just to avoid acquiring the
2614         lock unnecessarily).
2615         * dyn_load.c (GC_dyld_name_for_hdr): Define unconditionally (not
2616         only for DARWIN_DEBUG).
2617         * dyn_load.c (GC_dyld_image_add): Replace GC_add_roots() call with
2618         LOCK + GC_add_roots_inner() + UNLOCK.
2619         * dyn_load.c (GC_dyld_image_add): Call GC_has_static_roots() user
2620         callback (if set) holding the lock; if it returns 0 then don't call
2621         GC_add_roots_inner() for that region.
2622         * dyn_load.c (GC_register_has_static_roots_callback): Put
2623         "callback" value to GC_has_static_roots on all platforms.
2624         * dyn_load.c (GC_has_static_roots): Update the comments.
2625         * include/gc.h (GC_exclude_static_roots, GC_add_roots,
2626         GC_remove_roots, GC_register_has_static_roots_callback): Ditto.
2627         * include/private/gc_priv.h (struct roots): Ditto.
2628         * include/private/gc_priv.h (GC_remove_roots_inner): Move prototype
2629         to mark_rts.c and declare it as STATIC.
2630         * include/private/gc_priv.h (GC_exclude_static_roots_inner): New
2631         prototype.
2632         * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Use
2633         GC_exclude_static_roots_inner() instead of GC_exclude_static_roots.
2634         * misc.c (GC_init_inner): Ditto.
2635         * mark_rts.c (GC_exclude_static_roots_inner): New function (move
2636         all the code from GC_exclude_static_roots(); add the comment.
2637         * mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots_inner):
2638         add alignment assertion for the lower bound; add assertion for the
2639         lower bound to be less than the upper one.
2640         * mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots): Adjust
2641         the upper bound (round down to be of a pointer-aligned value);
2642         return in case of an empty range.
2643         * mark_rts.c (GC_exclude_static_roots): Acquire the lock and call
2644         GC_exclude_static_roots_inner().
2645         * mark_rts.c (GC_remove_roots): Quickly check the bounds and return
2646         in case of a do-nothing case (before acquiring the lock).
2647
2648 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
2649         (diff112)
2650
2651         * finalize.c (GC_fail_count): New external variable declaration.
2652         * finalize.c (GC_reset_finalizer_nested,
2653         GC_check_finalizer_nested): New function declarations (if THREADS
2654         only).
2655         * finalize.c (GC_finalizer_nested, GC_finalizer_skipped): New
2656         static global variables (used internally by GC_finalize() and
2657         GC_check_finalizer_nested()).
2658         * finalize.c (GC_check_finalizer_nested): New static function
2659         definition (only if not THREADS, used internally by
2660         GC_notify_or_invoke_finalizers() to minimize the probability of
2661         a deep recursion when a client finalizer tries to allocate GC
2662         memory).
2663         * finalize.c (GC_finalize): Reset GC_finalizer_nested value (or
2664         call GC_reset_finalizer_nested()) if last heap expansion failed.
2665         * finalize.c (GC_notify_or_invoke_finalizers): Access GC_gc_no,
2666         GC_finalizer_now, GC_finalize_on_demand, GC_finalizer_notifier,
2667         last_finalizer_notification variables holding the lock (to avoid
2668         data races).
2669         * finalize.c (GC_finalizer_notifier): Add comment.
2670         * finalize.c (GC_notify_or_invoke_finalizers): Add "quick" check
2671         for an empty finalization queue (only if THREADS and not
2672         KEEP_BACK_PTRS/MAKE_BACK_GRAPH).
2673         * finalize.c (GC_notify_or_invoke_finalizers): Call
2674         GC_check_finalizer_nested() and skip GC_invoke_finalizers() call
2675         if appropriate.
2676         * include/private/pthread_support.h (GC_Thread_Rep): Add unsigned
2677         finalizer_nested and finalizer_skipped fields (for internal use
2678         by the multi-threaded GC_check_finalizer_nested()).
2679         * win32_threads.c (GC_Thread_Rep): Ditto.
2680         * pthread_support.c (GC_reset_finalizer_nested,
2681         GC_check_finalizer_nested): New function definitions (the
2682         multi-threaded variants of that in finalize.c).
2683         * win32_threads.c (GC_reset_finalizer_nested,
2684         GC_check_finalizer_nested): Ditto.
2685
2686 2009-09-10  Ivan Maidanski <ivmai@mail.ru>
2687         (diff103_cvs - resembling diff78, diff88_cvs, diff99_cvs,
2688         diff100_cvs, diff101_cvs, diff102_cvs)
2689
2690         * alloc.c (GC_stopped_mark): Remove GC_log_printf("") (not needed
2691         anymore and GCC produces a warning for it).
2692         * alloc.c (GC_stopped_mark): Adjust printf argument type
2693         specifier.
2694         * backgraph.c: Include dbg_mlc.h before ifdef MAKE_BACK_GRAPH (for
2695         the case when the configuration information comes from aconfig
2696         file).
2697         * checksums.c: Ditto (for gc_priv.h and CHECKSUMS, respectively).
2698         * include/gc_allocator.h (GC_ATTR_UNUSED): Use "__unused__"
2699         keyword instead of "unused".
2700         * include/gc_allocator.h: Fix typos in comments.
2701         * thread_local_alloc.c: Ditto.
2702         * include/javaxfc.h (GC_finalize_all): Update comment.
2703         * include/private/gc_priv.h (GC_API_PRIV): New macro (defined as
2704         GC_API and serves only as a marker for the private but exported
2705         symbols used by test.c only).
2706         * include/private/gc_priv.h (GC_abort, GC_arrays, GC_is_marked,
2707         GC_printf, GC_err_printf, GC_log_printf): Replace GC_API decl with
2708         GC_API_PRIV one.
2709         * include/private/gc_priv.h (GC_fo_entries): Don't export it
2710         outside a DLL.
2711         * include/private/gc_priv.h (GC_ATTR_FORMAT_PRINTF): New macro
2712         designated to check the arguments correctness of printf-like
2713         functions (currently works only for GCC v3+).
2714         * include/private/gc_priv.h (GC_printf, GC_err_printf,
2715         GC_log_printf): Use GC_ATTR_FORMAT_PRINTF attribute.
2716
2717 2009-09-03  Hans Boehm <Hans.Boehm@hp.com> (really Loren J. Rittle)
2718
2719         * dyn_load.c (HAVE_DL_ITERATE_PHDR): Break definition from use.
2720         Define for FreeBSD 7.0+.
2721
2722 2009-09-02  Hans Boehm <Hans.Boehm@hp.com> (with help from Victor Ivrii and
2723                                             others)
2724
2725         * mach_dep.c: Don't include ucontext.h with NO_GETCONTEXT.
2726
2727 2009-08-19  Hans Boehm <Hans.Boehm@hp.com>
2728
2729         * include/gc_gcj.h (GC_init_gcj_malloc): Improve descriptive
2730         comment.
2731
2732 2009-08-11  Hans Boehm <Hans.Boehm@hp.com>
2733         (Replacement for Ivan Maidanski's diff99_cvs.  Hopefully fixes
2734         the same bugs, and then some.)
2735
2736         * allchblk.c (GC_merge_unmapped): Don't assume that adjacent
2737         free blocks have different mapping status.  Correctly handle gap
2738         between blocks.
2739         (GC_split_block): Remove dead code setting hb_flags.  Add comment.
2740         (GC_allochblk): Split blocks also in generational-only mode.
2741         * os_dep.c (GC_unmap_gap): Don't really use munmap.
2742
2743 2009-08-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
2744         (Mistakenly omitted from last check-in)
2745
2746         * include/private/gc_priv.h (GC_unmapped_bytes): Define as 0 for
2747         not USE_MUNMAP case.
2748
2749 2009-08-07  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
2750         diff111 (supersedes diff101_cvs which, in turn, resembles diff52,
2751         diff75, diff83 partly)
2752
2753         * Makefile.direct (MARK_BIT_PER_OBJ, PRINT_BLACK_LIST,
2754         USE_PROC_FOR_LIBRARIES): Fix typo in the comments.
2755         * Makefile.direct (USE_MMAP, USE_MUNMAP, THREAD_LOCAL_ALLOC,
2756         PARALLEL_MARK, STATIC): Update the comments.
2757         * include/private/gcconfig.h (GC_PREFER_MPROTECT_VDB): New macro
2758         recognized (only if MPROTECT_VDB).
2759         * Makefile.direct (DONT_USE_USER32_DLL, GC_PREFER_MPROTECT_VDB):
2760         Add the comments for.
2761         * os_dep.c (detect_GetWriteWatch): Recognize "GC_USE_GETWRITEWATCH"
2762         environment variable (only if MPROTECT_VDB, if the variable is
2763         unset when GC_PREFER_MPROTECT_VDB macro controls the strategy).
2764         * doc/README.environment (GC_USE_GETWRITEWATCH): New variable.
2765         * include/private/gcconfig.h (MPROTECT_VDB): Add FIXME for
2766         USE_MUNMAP and PARALLEL_MARK cases (to relax the conditions in
2767         the future).
2768         * misc.c (GC_get_heap_size, GC_get_free_bytes): Ignore the memory
2769         space returned to OS (GC_unmapped_bytes).
2770         * include/gc.h (GC_get_heap_size, GC_get_free_bytes): Update the
2771         comments.
2772         * misc.c (GC_get_unmapped_bytes): New API function.
2773         * include/gc.h (GC_get_unmapped_bytes): New API prototype.
2774         * os_dep.c (GC_dirty_init): Move "ifdef GWW_VDB" block out of
2775         "ifdef MSWIN32" one (for Cygwin).
2776
2777 2009-08-01  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
2778         diff100_cvs (diff51 and diff55, partly)
2779
2780         * pthread_support.c (GC_allow_register_threads): New API function.
2781         * win32_threads.c (GC_allow_register_threads): Ditto.
2782         * include/gc.h (GC_allow_register_threads): New API prototype.
2783         * include/gc.h (GC_register_my_thread, GC_unregister_my_thread):
2784         Update the comments.
2785         * pthread_support.c (GC_register_my_thread): Check the collector
2786         is in the multi-threaded mode.
2787         * win32_threads.c (GC_register_my_thread): Ditto.
2788
2789 2009-07-10  Hans Boehm <Hans.Boehm@hp.com>
2790
2791         * finalize.c (GC_finalize_all): Always call GC_invoke_finalizers
2792         instead, following Ivan's original patch.
2793
2794 2009-06-20  Hans Boehm <Hans.Boehm@hp.com>
2795
2796         * allchblk.c (GC_allochblk_nth): Add assertion.
2797         * checksums.c: Add GC_record_fault, GC_was_faulted,
2798         CC_n_faulted_dirty_errors.
2799         (GC_check_dirty): Remove register declarations, print
2800         dirty bit errors on faulted pages.
2801         * os_dep.c (GC_write_fault_handler): Call GC_record_fault().
2802         * os_dep.c (GC_remove_protection): Compute index correctly.
2803
2804 2009-06-12  Hans Boehm <Hans.Boehm@hp.com>
2805
2806         * include/gc_version.h, configure.ac, doc/README:
2807         Change to version 7.2alpha3.
2808         * configure: Regenerate.
2809
2810 [7.2alpha2]
2811
2812 2009-06-12  Hans Boehm <Hans.Boehm@hp.com>
2813
2814         * include/gc_version.h, configure.ac, doc/README:
2815         Change to version 7.2alpha2.
2816         * configure: Regenerate.
2817
2818 2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
2819         diff98_cvs(resembling diff3, diff27, diff59, diff61, diff66,
2820         diff73 partly)
2821
2822         * dbg_mlc.c (GC_print_smashed_obj): Convert a group of printf()
2823         calls into a single one (for output atomicity).
2824         * typd_mlc.c (GC_calloc_explicitly_typed): Don't declare and use
2825         GC_finalization_failures variable; check the result of
2826         GC_general_register_disappearing_link() (for lack of memory)
2827         instead.
2828         * finalize.c (GC_finalization_failures): Remove unused global
2829         variable.
2830         * finalize.c (GC_general_register_disappearing_link,
2831         GC_general_register_disappearing_link): Don't update the value of
2832         GC_finalization_failures (since unused).
2833         * include/private/gc_pmark.h (PUSH_ONE_CHECKED_STACK,
2834         GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP): The first parameter is of
2835         word type now (as FIXUP_POINTER requires numeric argument).
2836         * finalize.c (GC_ignore_self_finalize_mark_proc): GC_PUSH_ONE_HEAP
2837         requires the first parameter of word type.
2838         * mark.c (PUSH_GRANULE): Ditto.
2839         * mark.c (GC_push_one, GC_push_all_eager): Ditto (for
2840         GC_PUSH_ONE_STACK).
2841         * finalize.c (GC_finalize_all): Call GC_invoke_finalizers() or
2842         GC_finalizer_notifier directly, instead
2843         of GC_INVOKE_FINALIZERS() to prevent infinite looping.
2844         * include/javaxfc.h: Clarify GC_finalize_all comment.
2845         * gcj_mlc.c: Include gc_pmark.h before "ifdef GC_GCJ_SUPPORT" (not
2846         after) for configuration information.
2847         * gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Add comment.
2848         * gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Check "op" local
2849         variable for NULL before dereferencing it, return GC_oom_fn() in
2850         this case.
2851         * typd_mlc.c (GC_malloc_explicitly_typed,
2852         GC_malloc_explicitly_typed_ignore_off_page): Transform the code to
2853         suppress compiler warning (for uninitialized "lg" variable).
2854
2855 2009-06-12  Hans Boehm <Hans.Boehm@hp.com>
2856
2857         * win32_threads.c (GC_unregister_my_thread): add false assertion
2858         in unreachable code.
2859
2860 2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
2861         diff97_cvs (resembling diff43, diff51, diff67, diff76, diff83 partly)
2862
2863         * pthread_support.c (GC_inner_start_routine): Don't release the
2864         GC lock between GC_register_my_thread_inner() and
2865         GC_init_thread_local() calls (post the "registered" even after
2866         calling GC_init_thread_local()).
2867         * win32_threads.c (GC_register_my_thread, GC_unregister_my_thread):
2868         Use GC_lookup_thread_inner() instead of GC_lookup_thread() and
2869         acquire the GC lock only once.
2870         * win32_threads.c (GC_thr_init): Call GC_register_my_thread_inner()
2871         directly instead of GC_register_my_thread() since I_HOLD_LOCK
2872         and our (main) thread is not registered yet (add assertion for it).
2873         * win32_threads.c (GC_init_parallel): Call GC_lookup_thread_inner()
2874         directly instead of GC_lookup_thread() (since I_HOLD_LOCK).
2875         * win32_threads.c (GC_lookup_thread): Remove unused function.
2876         * win32_threads.c: Remove "#error GC_DLL untested with Cygwin".
2877         * win32_threads.c (GC_win32_dll_threads): Define as FALSE macro
2878         also if THREAD_LOCAL_ALLOC or GC_PTHREADS.
2879         * win32_threads.c (GC_use_DllMain): Call ABORT also if GC_PTHREADS
2880         (for Cygwin).
2881         * win32_threads.c (GC_push_stack_for): Add parentheses around "&&"
2882         (inside GC_ASSERT) to prevent compiler warning.
2883         * win32_threads.c (GC_push_all_stacks): Remove FIXME for
2884         PARALLEL_MARK.
2885         * win32_threads.c (MAX_MARKERS, GC_markers): Move the definitions
2886         to a place before GC_get_next_stack().
2887         * win32_threads.c (marker_sp, marker_bsp): New static arrays (same
2888         as in pthread_support.c).
2889         * win32_threads.c (marker_last_stack_min): New static arrays (the
2890         same semantics as for last_stack_min of GC_Thread_Rep).
2891         * win32_threads.c (GC_get_next_stack): Handle marker threads.
2892         * win32_threads.c (GC_mark_thread): Save the current stack pointer
2893         to marker_[b]sp.
2894         * win32_threads.c (start_mark_threads): Initialize
2895         marker_last_stack_min elements (to "unset" value).
2896
2897 2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
2898         (diff96_cvs, partly from diff45 and diff75)
2899
2900         * misc.c (GC_set_oom_fn, GC_set_all_interior_pointers,
2901         GC_set_finalize_on_demand, GC_set_java_finalization,
2902         GC_set_finalizer_notifier, GC_set_dont_expand, GC_set_full_freq,
2903         GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries,
2904         GC_set_dont_precollect, GC_set_time_limit, GC_set_warn_proc):
2905         Change return type to void (these API functions no longer return
2906         the old value).
2907         * include/gc.h: Ditto (for prototypes).
2908         * tests/test.c (main, WinMain, test): Remove explicit cast to void
2909         for GC_set_warn_proc().
2910         * misc.c (GC_get_oom_fn, GC_get_all_interior_pointers,
2911         GC_get_finalize_on_demand, GC_get_java_finalization,
2912         GC_get_finalizer_notifier, GC_get_dont_expand, GC_get_full_freq,
2913         GC_get_no_dls, GC_get_free_space_divisor, GC_get_max_retries,
2914         GC_get_dont_precollect, GC_get_time_limit, GC_get_warn_proc): New
2915         API functions (to get the current value of the corresponding R/W
2916         public variables).
2917         * include/gc.h: Ditto (for prototypes).
2918         * include/gc.h (GC_set_warn_proc, GC_set_free_space_divisor):
2919         Update the comment.
2920         * misc.c (GC_ignore_warn_proc): New API call-back function.
2921         * include/gc.h (GC_ignore_warn_proc): Ditto (for the prototype).
2922         * misc.c (GC_set_find_leak, GC_get_find_leak, GC_set_non_gc_bytes,
2923         GC_get_non_gc_bytes): New API setter and getter functions (for the
2924         public GC_find_leak and GC_non_gc_bytes variables, respectively).
2925         * include/gc.h: Ditto (for prototypes).
2926         * include/gc.h (GC_memalign): Add proto to GC API.
2927         * mallocx.c (GC_memalign): Use GC_API, GC_CALL for the definition.
2928         * tests/test.c (run_one_test): Test GC_memalign() on Win32 too,
2929         remove GC_memalign() proto.
2930         * misc.c (GC_write): Use multi-byte (A) variants of Win32
2931         GetModuleFileName() and CreateFile().
2932         * tests/test.c (main): Replace K&R-style function definition with the
2933         ANSI C one.
2934
2935 2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski and
2936                                             George Talbot)
2937         (diff95_cvs)
2938
2939         * include/private/gcconfig.h (PLATFORM_ANDROID): New macro
2940         recognized (for Linux on ARM32 without glibc).
2941         * include/private/gcconfig.h (STRTOULL): Define for all targets
2942         (define as "strtoul" for most targets except for LLP64/Win64).
2943         * misc.c (GC_init_inner): Use STRTOULL instead of atoi/atol()
2944         (cast the result to word type) to decode values of "GC_TRACE",
2945         "GC_INITIAL_HEAP_SIZE", "GC_MAXIMUM_HEAP_SIZE" environment vars.
2946
2947 2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly George Talbot)
2948
2949         * include/gc_allocator.h: Add gc_allocator_ignore_off_page.
2950         * tests/test_cpp.cc: Add call to gc_allocator_ignore_off_page.
2951
2952 2009-06-11  Hans Boehm <Hans.Boehm@hp.com>
2953
2954         * win32_threads.c (GC_release_mark_lock): Correct misspelling of
2955         AO_load in assertion.
2956
2957 2009-06-11  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
2958         (diff93_cvs: resembling diff27, diff30, diff43, diff44, diff66,
2959         diff76, diff79, diff83 partly)
2960
2961         * win32_threads.c (MAX_THREADS): Define as 1 if GC_win32_dll_threads
2962         is defined as FALSE (otherwise the size of dll_thread_table is near
2963         200 KiB for 32-bit).
2964         * win32_threads.c (GC_use_DllMain): Optimize for THREAD_LOCAL_ALLOC.
2965         * win32_threads.c (GC_Thread_Rep): Add backing_store_end and
2966         backing_store_ptr fields for IA64 support.
2967         * win32_threads.c (GC_register_my_thread_inner): Set
2968         backing_store_end field to reg_base value for IA64 (same as in
2969         pthread_support.c).
2970         * win32_threads.c (SET_PTHREAD_MAP_CACHE): Put parentheses in the
2971         "right" places, remove ';'.
2972         * win32_threads.c (GC_fault_handler_lock): Declare only
2973         if MPROTECT_VDB (and not WinCE).
2974         * win32_threads.c (GC_suspend): Acquire and release
2975         GC_fault_handler_lock only if MPROTECT_VDB (and not WinCE).
2976         * win32_threads.c (GC_suspend): Define as STATIC.
2977         * win32_threads.c (GC_push_stack_for): Fix WARN() format specifier
2978         (should be word-complient, "%p" is used w/o "0x"), don't cast sp.
2979         * win32_threads.c (GC_push_all_stacks): Convert a group of printf()
2980         calls into a single one (for output atomicity).
2981         * win32_threads.c (GC_get_next_stack): Unprotect thread descriptor
2982         before altering its last_stack_min ("thread" variable is added).
2983         * win32_threads.c (GC_get_next_stack): Remove unnecessary checks for
2984         "s" is non-NULL.
2985         * win32_threads.c (GC_get_next_stack): Don't call GC_may_be_in_stack
2986         if WinCE.
2987         * win32_threads.c (GC_get_next_stack): Pass current_min value to
2988         GC_get_stack_min as-is (without -1).
2989         * win32_threads.c (GC_wait_marker): Remove FIXME and use "release"
2990         version of AO_fetch_and_sub1().
2991         * win32_threads.c (GC_win32_start_inner, GC_win32_start): convert int
2992         to pointer (and vice versa) thru word type to suppress warnings.
2993         * win32_threads.c (GC_mark_mutex_waitcnt): Fix comment, always
2994         access atomically.
2995         * misc.c: Change GC_THREADS tests back to THREADS.
2996
2997
2998 2009-06-11  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
2999         (diff92_cvs: resembling diff20, diff27, diff34, diff38, diff43, diff45,
3000         diff46, diff56, diff60, diff62, diff74, diff75, diff81 partly)
3001
3002         * allchblk.c (GC_print_hblkfreelist, GC_dump_regions): Convert
3003         a group of printf() calls into a single one (for output atomicity).
3004         * include/gc.h (GC_set_all_interior_pointers, GC_set_full_freq,
3005         GC_set_time_limit): New prototypes.
3006         * misc.c (GC_set_all_interior_pointers, GC_set_full_freq,
3007         GC_set_time_limit): New public setter/getter functions.
3008         * include/gc.h: Fix (and remove outdated) comments for thread-local
3009         allocation.
3010         * include/gc.h: Fix typos in comments.
3011         * misc.c (GC_init_inner, GC_printf): Ditto.
3012         * include/gc.h (GC_unregister_disappearing_link): Refine comment.
3013         * include/gc.h (GC_stack_base): Recognize _M_IA64 macro.
3014         * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
3015         GC_bytes_allocd_at_reset, DEGRADE_RATE): Define only if THREADS.
3016         * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
3017         GC_bytes_allocd_at_reset): Define as STATIC.
3018         * misc.c (GC_get_heap_size, GC_get_free_bytes,
3019         GC_get_bytes_since_gc, GC_get_total_bytes): Acquire the GC lock to
3020         avoid data races.
3021         * misc.c (GC_write_cs): Define only if THREADS (Win32/WinCE only).
3022         * misc.c (GC_init_inner): Initialize GC_write_cs only if THREADS.
3023         * misc.c (GC_init_inner): Use GC_INITIAL_HEAP_SIZE (if available) to
3024         set the default initial value of initial_heap_sz.
3025         * misc.c (GC_deinit): Destroy GC_write_cs only if THREADS.
3026         * misc.c (GC_init_inner): Fix WARN() format specifier (should be
3027         word-complient, "%p" is used w/o "0x").
3028         * misc.c (GC_init_inner): Don't recognize "GC_PAUSE_TIME_TARGET"
3029         environment variable if SMALL_CONFIG.
3030         * misc.c (GC_init_inner): Recognize "GC_FULL_FREQUENCY" environment
3031         variable to set initial GC_full_freq value (if not SMALL_CONFIG).
3032         * doc/README.environment (GC_FULL_FREQUENCY): Add information.
3033         * doc/README.environment (GC_MARKERS): Refine information.
3034         * misc.c (GC_init_inner): Change GC_ASSERT to GC_STATIC_ASSERT where
3035         possible.
3036         * misc.c (IF_NEED_TO_LOCK): New macro (instead of GC_need_to_lock).
3037         * misc.c (GC_write): Use IF_NEED_TO_LOCK for handling GC_write_cs.
3038         * misc.c (GC_abort): Don't define if SMALL_CONFIG.
3039         * misc.c (GC_abort): Directly use WRITE() instead of GC_err_printf()
3040         (to prevent possible infinite recursion).
3041
3042 2009-06-09  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3043         diff90_cvs (resembling diff28, diff30, diff32, diff34, diff47,
3044         diff49, diff60, diff62, diff66, diff67, diff68, diff72 partly)
3045
3046         * finalize.c (finalization_mark_proc): Replace K&R-style declaration
3047         with ANSI C one.
3048         * finalize.c (GC_grow_table, GC_register_finalizer_inner,
3049         GC_enqueue_all_finalizers): Remove outdated comments about disabling
3050         signals.
3051         * finalize.c (GC_general_register_disappearing_link): Fix assertion
3052         to catch NULL "obj" value.
3053         * finalize.c (GC_unregister_disappearing_link): Check "link"
3054         alignment before gaining the lock.
3055         * finalize.c (GC_finalize): Refine comment.
3056         * finalize.c (GC_finalize): Fix WARN() format specifier (should be
3057         word-complient, "%p" is used w/o "0x").
3058         * finalize.c (GC_invoke_finalizers): Initialize "bytes_freed_before"
3059         variable (to 0) to suppress compiler warning.
3060         * include/gc_gcj.h (MARK_DESCR_OFFSET): Move to private/gc_pmark.h.
3061         * include/gc_gcj.h: add "extern C" header and tail.
3062         * include/private/gc_pmark.h: Remove GC_do_parallel_mark(),
3063         GC_help_wanted, GC_helper_count, GC_active_count declarations (move
3064         the comments to the place where these symbols are defined in mark.c).
3065         * mark.c: Add STATIC GC_do_parallel_mark() declaration (for use by
3066         GC_mark_some_inner, if PARALLEL_MARK only).
3067         * mark.c (GC_mark_some_inner, GC_help_wanted, GC_helper_count,
3068         GC_active_count, GC_do_parallel_mark): Define as STATIC.
3069         * pthread_support.c (GC_mark_thread): Ditto.
3070         * typd_mlc.c (GC_explicit_typing_initialized, GC_explicit_kind,
3071         GC_array_kind, GC_ext_descriptors, GC_ed_size, GC_avail_descr,
3072         GC_typed_mark_proc_index, GC_array_mark_proc_index, GC_eobjfreelist,
3073         GC_arobjfreelist): Ditto.
3074         * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Change GC_ASSERT
3075         for HBLKSIZE to GC_STATIC_ASSERT.
3076         * mark.c (GC_noop): Define for Borland C the same as for Watcom.
3077         * mark.c (GC_noop, GC_mark_and_push): Add ARGSUSED tag.
3078         * pthread_support.c (GC_do_blocking_inner): Ditto.
3079         * mark.c (GC_mark_from): Initialize "limit" (to 0) in the default
3080         switch branch to suppress compiler warning.
3081         * mark.c (GC_return_mark_stack): Append new-line to printf message.
3082         * mark.c: Remove unused GC_true_func(), GC_PUSH_ALL().
3083         * pthread_support.c (GC_mark_thread): Add dummy "return 0" to
3084         suppress compiler warning.
3085         * pthread_support.c (start_mark_threads): Move the code limiting
3086         "GC_markers" value (and printing a warning) to GC_thr_init().
3087         * pthread_support.c (GC_thr_init): Silently limit "GC_markers" value
3088         if based on the number of CPUs.
3089         * pthread_support.c (GC_thr_init): Treat incorrect "GC_markers"
3090         values as one.
3091         * pthread_support.c (GC_register_my_thread_inner): Add a check for
3092         "stack_end" is non-NULL (the same as in win32_threads.c).
3093         * pthread_support.c (pthread_create): Call GC_oom_fn before giving up
3094         with ENOMEM.
3095         * thread_local_alloc.c (return_single_freelist): Convert "for" loop
3096         to "while" one to suppress "possible extraneous ';'" warning.
3097
3098 2009-06-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski
3099                                             and Zoltan Varga)
3100
3101         * darwin_stop_world.c (GC_push_all_stacks): Recognize ARM32.
3102         * include/private/gc_priv.h (GC_THREAD_STATE_T): Define for ARM32
3103         (Darwin only).
3104         * include/private/gcconfig.h: Add machine-specific part for DARWIN.
3105         * include/private/gcconfig.h (ARM32): Define config parameters for
3106         DARWIN (iPhone).
3107
3108 2009-06-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3109         (diff91_cvs: resembling diff3, diff27, diff33, diff45, diff47, diff49,
3110         diff60, diff67, diff68 partly)
3111
3112         * alloc.c (GC_FULL_FREQ, GC_DONT_EXPAND, GC_FREE_SPACE_DIVISOR,
3113         GC_TIME_LIMIT): New macros (used to control the default initial
3114         values of GC_full_freq variable, GC_dont_expand,
3115         GC_free_space_divisor, GC_time_limit respectively).
3116         * include/private/gc_priv.h (TIME_LIMIT): Remove macro (replaced
3117         with GC_TIME_LIMIT in alloc.c).
3118         * alloc.c (GC_need_full_gc, GC_stopped_mark, GC_finish_collection):
3119         Define as STATIC.
3120         * mark_rts.c (GC_push_current_stack, GC_push_gc_structures): Ditto.
3121         * include/private/gc_priv.h (GC_stopped_mark, GC_finish_collection):
3122         Move the prototypes to alloc.c, make STATIC.
3123         * include/private/gc_priv.h (GC_push_current_stack,
3124         GC_push_gc_structures, GC_push_regs_and_stack): Remove prototypes
3125         (move the comments to the places where these functions are defined).
3126         * mach_dep.c (GC_push_regs_and_stack): Move to mark_rts.c and define
3127         as STATIC.
3128         * alloc.c (GC_timeout_stop_func, GC_stopped_mark,
3129         GC_print_heap_sects): Convert a group of printf() calls into
3130         a single one (for output atomicity).
3131         * mark_rts.c (GC_print_static_roots): Ditto.
3132         * alloc.c (GC_stopped_mark): Output blank line (when logging) for
3133         convenience to delimit collections.
3134         * alloc.c (GC_clear_a_few_frames): Rename NWORDS to CLEAR_NWORDS;
3135         make "frames" local variable volatile (to prevent optimization).
3136         * alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
3137         GC_finish_collection, GC_allocobj): Remove outdated comments about
3138         disabling signals.
3139         * include/private/gc_priv.h (GC_register_displacement_inner,
3140         GC_gcollect_inner): Ditto.
3141         * alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
3142         GC_finish_collection): Initialize "start_time" local variable (to 0)
3143         to suppress compiler warning.
3144         * mark_rts.c (GC_add_roots_inner): Ditto (for "old" variable).
3145         * alloc.c (GC_RATE, MAX_PRIOR_ATTEMPTS): Guard with "ifndef".
3146         * include/private/gc_priv.h (clock, GC_stop_world, GC_start_world,
3147         GC_acquire_mark_lock, GC_release_mark_lock, GC_notify_all_builder,
3148         GC_wait_for_reclaim, GC_notify_all_marker, GC_wait_marker): Replace
3149         K&R-style function prototypes with ANSI C one.
3150         * include/private/gc_priv.h (ABORT): Define as DebugBreak() for
3151         Win32/WinCE if SMALL_CONFIG (the same as in GC_abort()).
3152         * include/private/gc_priv.h (ROUNDED_UP_WORDS, abs): Remove unused
3153         macros.
3154         * include/private/gc_priv.h (GC_noop): Declare for Borland C the
3155         same as for Watcom.
3156         * mark_rts.c (GC_push_conditional_with_exclusions): Add ARGSUSED tag.
3157
3158 2009-06-04  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3159         (diff89_cvs, resembling diff3, diff27, diff34, diff38, diff47, diff49,
3160         diff59, diff60, diff66, diff67, diff68, diff69a, diff70, diff81
3161         partly)
3162
3163         * dbg_mlc.c (GC_store_debug_info, GC_store_debug_info_inner): Remove
3164         outdated comment about disabling signals.
3165         * mallocx.c (GC_malloc_uncollectable,
3166         GC_malloc_atomic_uncollectable): Ditto.
3167         * os_dep.c: Ditto.
3168         * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change):
3169         Add ARGSUSED tag.
3170         * pthread_stop_world.c (GC_suspend_handler,
3171         GC_suspend_handler_inner): Ditto.
3172         * dbg_mlc.c (GC_debug_free, GC_debug_realloc): Fix printf message.
3173         * dbg_mlc.c (GC_debug_realloc): Set "result" to NULL in the default
3174         switch branch to suppress compiler warning.
3175         * dyn_load.c (GC_init_dyld): Use ABORT() instead of GC_abort().
3176         * include/private/darwin_semaphore.h (sem_init): Ditto.
3177         * include/javaxfc.h: Replace "GC_H" with "_GC_H".
3178         * include/private/dbg_mlc.h (GC_has_other_debug_info,
3179         GC_store_debug_info): Replace K&R-style function prototypes with ANSI
3180         C one.
3181         * include/private/gcconfig.h (GC_FreeBSDGetDataStart, real_malloc,
3182         GC_win32_get_mem, GC_wince_get_mem, GC_unix_get_mem): Ditto.
3183         * include/private/pthread_support.h (GC_stop_init): Ditto.
3184         * include/private/gcconfig.h: Refine comment about setting
3185         GC_stackbottom.
3186         * include/private/gcconfig.h (FIXUP_POINTER): Put parentheses in the
3187         "right" places.
3188         * include/private/pthread_support.h (GC_Thread_Rep): Refine comment
3189         for "stack_end" field.
3190         * mallocx.c (GC_malloc_uncollectable,
3191         GC_malloc_atomic_uncollectable): Remove cast to undefined "hbklk".
3192         * os_dep.c (GC_USE_MEM_TOP_DOWN): New macro (for setting
3193         GC_mem_top_down to MEM_TOP_DOWN for debug purposes).
3194         * os_dep.c (GC_gww_read_dirty, catch_exception_raise): Fix WARN()
3195         format specifier (should be word-compliant, "%p" is used w/o "0x").
3196         * pthread_stop_world.c (GC_suspend_handler_inner): Ditto.
3197         * os_dep.c (GC_dirty_init): Append new-line to printf messages.
3198         * os_dep.c (GC_mprotect_thread): Fix GC_err_printf message.
3199         * os_dep.c (GC_save_callers): Change GC_ASSERT to GC_STATIC_ASSERT.
3200         * pthread_stop_world.c (GC_retry_signals, GC_suspend_ack_sem): Define
3201         as STATIC.
3202         * pthread_stop_world.c (GC_push_all_stacks): Add assertion for that
3203         "thread_blocked" is not set for the current thread.
3204         * real_malloc.c: Add "extern GC_quiet" to suppress compiler warning.
3205         * reclaim.c (GC_reclaim_all): Initialize "start_time" (to 0) to
3206         suppress compiler warning.
3207
3208 2009-06-02  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3209         (adding last bit of diff86_cvs)
3210
3211         * tests/test.c (check_heap_stats): Avoid unbalanced brackets in ifdef.
3212
3213 2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3214         (diff26)
3215
3216         * win32_threads.c: restructure parallel marking mutex intialization.
3217         * win32_threads.c, alloc.c, darwin_stop_world.c, mallocx.c, mark.c,
3218         pthread_stop_world.c, pthread_support.c: Add runtime conditions
3219         on GC_parallel were appropriate.
3220         * pthread_support.c: Condition marker_bsp on ia64.
3221         (GC_segment_is_thread_stack): Fix loop upper bound.
3222         * reclaim.c: Limit some assertions to PARALLEL_MARK.
3223         * pthread_support.c: Don't acquire mark lock for thread-local
3224         allocation.
3225         * include/private/gc_priv.h: Don't define parallel mark sync
3226         support just for THREAD_LOCAL_ALLOC.
3227
3228 2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3229         (diff39)
3230
3231         * include/private/gcconfig.h: refine MINGW32 test.
3232         * mark.c: Add win64/gcc tests.
3233
3234 2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3235         (diff86_cvs, resembling diff28, diff32, diff33, diff38, diff68 partly)
3236
3237         * test.c (fork_a_thread, reverse_test, alloc8bytes, tree_test,
3238         typed_test, run_one_test, check_heap_stats, main, test): Replace
3239         all K&R-style function definitions with ANSI C ones.
3240         * trace_test.c (main): Ditto.
3241         * test.c (GC_COND_INIT): Define as GC_INIT() also in case of
3242         THREAD_LOCAL_ALLOC.
3243         * test.c (reverse_test): Call fork_a_thread() only if GC_PTHREADS
3244         or GC_WIN32_THREADS; remove fork_a_thread() macros definition.
3245         * test.c (reverse_test): Use "volatile" when clearing "b" and "c"
3246         local variables (to suppress "assigned value is never used"
3247         compiler warning).
3248         * test.c (tree_test): Use public GC_noop1() instead of private
3249         GC_noop().
3250         * test.c (typed_test): Ditto.
3251         * test.c (check_heap_stats): Define and assign value to
3252         "late_finalize_count" local variable only if its value is used
3253         (if FINALIZE_ON_DEMAND defined).
3254         * test.c (main): Remove DJGPP-specific initialization of
3255         GC_stackbottom (not needed anymore, handled in gcconfig.h).
3256         * trace_test.c: Guard #define GC_DEBUG with #ifndef.
3257         * trace_test.c: Include "gc_backptr.h".
3258         * trace_test.c (main): Call GC_INIT().
3259         * trace_test.c (main): Add "return 0" statement.
3260
3261 2009-05-25  Hans Boehm <Hans.Boehm@hp.com> (Really Petter Urkedal)
3262
3263         * dyn_load.c (GC_register_dynlib_callback): Use new index j
3264         instead of i in the inner loop.
3265
3266 2009-05-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3267         (diff85)
3268
3269         * tests/test.c: Increment n_tests with fetch_and_add when possible,
3270         avoiding need to export lock.
3271
3272 2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3273         (diff63,diff65)
3274
3275         * include/gc_pthread_redirects.h:
3276                 - dlfcn.h is included for dlopen() proto before undefining
3277                 "dlopen" (so, it's possible now to include dlfcn.h after
3278                 gc.h from user code);
3279                 - GC_dlopen() proto is added (except for Darwin as
3280                 it's missing there);
3281                 - "dlopen" is explicitly undefined (before its redefinition).
3282         * include/gc.h:
3283                 - "process.h" is included besides "windows.h"
3284                 (for _beginthreadex/_endthreadex); win32 only.
3285                 - GC_NO_THREAD_DECLS is moved to the right place
3286                 (before closing "extern C").
3287         * pthread_support.c: Fix out of memory handling for Thread_Reps.
3288         * win32_threads.c: Don't include process.h on winCE,
3289         improve out of memory handling for thread structures, don't
3290         define GC_beginthreadex and GC_endthreadex for winCE.
3291
3292 2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski
3293         (diff71)
3294
3295         * tests/test.c: Change gcj vtable decriptor type from size_t to
3296         GC_word.
3297
3298 2009-05-22  Hans Boehm <Hans.Boehm@hp.com>
3299
3300         * gcj_mlc.c: Add comment.
3301         * tests/test.c: Change NTEST to NTHREADS.  Fork 5 threads by default.
3302         Run reverse_test a second time in each thread.Add comments.
3303         Don't rely on AO_fetch_and_add.
3304
3305 2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Largely from Ludovic Cortes)
3306
3307         * dyn_load.c (GC_register_dynlib_callback,
3308         GC_register_dynamic_libraries_dl_iterate_phdr): Add support
3309         for GNU_PT_RELRO relocations.
3310
3311 2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3312         (diff61)
3313
3314         * Makefile, Makefile.direct: GC_SOLARIS_PTHREADS was replaced
3315         by GC_SOLARIS_THREADS.
3316         * include/gc.h: Improve finalizer documentation.
3317         * mips_sgi_mach_dep.s: Replace _MIPS_SIM_ABI32 with _ABIO32.
3318         * pthread_stop_world.c, Makefile.dj: Fix typos.
3319
3320 2009-05-21  Hans Boehm <Hans.Boehm@hp.com>
3321
3322         * win32_threads.c (GC_new_thread): Make first_thread
3323         visible to the whole file.
3324         (UNPROTECT): New macro.
3325         (GC_push_stack_for, GC_suspend, GC_start_world): unprotect
3326         thread structures before writing.
3327         (GC_suspend): Acquire GC_fault_handler_lock before suspending
3328         thread.
3329         * os_dep.c: export GC_fault_handler_lock.
3330         (GC_remove_protection): Check if already unprotected.
3331
3332 2009-05-20  Hans Boehm <Hans.Boehm@hp.com> (really Ivan Maidanski)
3333
3334         * doc/README.win32: Add OpenWatcom warning.
3335         * include/private/gcconfig.h: Really check it in.
3336
3337 2009-05-19  Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidanski, Dave Korn)
3338
3339         * os_dep.c (GC_get_stack_base, windows): Replace with Dave Korn's
3340         code from gcc version.
3341         * os_dep.c: make gc compilable (optionally) for Cygwin with
3342         GetWriteWatch-based virtual dirty bit implementation ("os_dep.c" file).
3343         * os_dep.c: Make non-win32 GC_write_fault_handler STATIC.
3344         * mark.c (GC_noop): fix declaration definition mismatch for DMC.
3345         * include/private/gcconfig.h: Enable MPROTECT_VDB and GWW_VDB for
3346         Watcom (Win32 only).  It works.
3347
3348 2009-05-07  Hans Boehm <Hans.Boehm@hp.com> (and Mark Sibly)
3349
3350         * mach_dep.c: Don't use __builtin_unwind_init for register
3351         state on PowerPC/Darwin.
3352
3353 2009-04-24  Hans Boehm <Hans.Boehm@hp.com>
3354
3355         * doc/gcdescr.html: Improve description of object freelist
3356         structure.
3357         * include/private/gc_priv.h: Fix comment for _size_map.
3358
3359 2009-03-16  Hans Boehm <Hans.Boehm@hp.com>
3360
3361         * os_dep.c (GC_linux_stack_base): Relax sanity test.
3362
3363 2009-03-11  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3364
3365         * include/private/gc_pmark.h (PUSH_CONTENTS_HDR for
3366         MARK_BIT_PER_OBJ): Add missing backslash before eoln.
3367
3368 2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
3369
3370         * misc.c (GC_set_warn_proc): Implicitly intialize GC on
3371         non-Cygwin win32.
3372
3373 2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Petr Krajca)
3374
3375         * configure.ac: Enable thread-local allocation for sparc-linux.
3376         * configure: Regenerate.
3377
3378 2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
3379
3380         * alloc.c (GC_try_to_collect): Remove duplicate initialization
3381         check.
3382         * malloc.c (GC_generic_malloc): Remove lw to eliminate single-
3383         threaded warnings.
3384         * mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.
3385
3386 2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidansky)
3387
3388         * allchblk.c, backgraph.c, dbg_mlc.c, dyn_load.c,
3389         finalize.c, include/private/gc_pmark.h, malloc.c, mark.c,
3390         os_dep.c, pthread_stop_world.c, pthread_support.c, reclaim.c,
3391         thread_local_alloc.c.
3392         * misc.c: Refine comment.
3393
3394 2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
3395
3396         * os_dep.c: Define GC_GWW_BUF_LEN more intelligently.  Add FIXME
3397         comment.
3398
3399 2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (With input from Ivan Maidansky)
3400
3401         * win32_threads.c (GC_push_stack_for): Yet another attempt
3402         at the stack_min finding logic.  Try to clean up the existing code
3403         while minimizing VirtualQuery calls.
3404         (GC_win32_start_inner): Register thread before GC_printf.
3405         Produce more output with DEBUG_THREADS.
3406         *include/gc.h: Update obsolete comments.
3407
3408 2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
3409
3410         * tests/test.c:
3411         (gcj_class_struct2): Use cast instead of l suffix.
3412         Cast GetLastError to int in various places.
3413         Avoid unused result warning from incr/decr macros.
3414         Add cast for fake_gcj_mark_proc.
3415         Cast GC_gc_no to unsigned in printf.
3416
3417 2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
3418
3419         * include/gc.h: Fix two typos in comments.
3420
3421 2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
3422
3423         * finalize.c: Fix typo in comment.
3424
3425 2008-12-03  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
3426
3427         * blacklst.c (GC_print_source_pointer): Don't call GC_print_heap_obj
3428         with lock.
3429
3430 2008-12-01  Hans Boehm <Hans.Boehm@hp.com>
3431
3432         * reclaim.c: (GC_reclaim_block): Scan even nearly full blocks
3433         if we are checking for leaks.
3434
3435 2008-11-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
3436
3437         * win32_threads.c: Remove mark lock spinning.
3438         * win32_threads.c, pthread_support.c: Update GC_unlocked_count,
3439         GC_spin_count, and GC_block_count using atomic operations.
3440         * tests/test.c: Declare n_tests as AO_t only if we have threads.
3441
3442 2008-11-11  Hans Boehm <Hans.Boehm@hp.com>
3443         (Really almost entirely Ivan Maidansky)
3444
3445         * win32_threads.c: Support PARALLEL_MARK.  Make printf arg
3446         types agree with format specifiers.  Add missing copyright header.
3447         Add STATIC for GC_threads.
3448         * include/private/gcconfig.h: Add FIXME comment.
3449         * tests/test.c (run_ine_test): Replace LOCK/UNLOCK use with
3450         AO_fetch_and_add1_full.  Declare n_tests as AO_t.
3451         (WinMain): Don't call GC_use_DllMain.
3452         with PARALLEL_MARK or THREAD_LOCAL_ALLOC.
3453
3454 2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
3455
3456         * alloc.c (GC_try_to_collect_inner): Don't print redundant
3457         GC_bytes_allocd and GC_gc_no.
3458         (GC_stopped_mark): Print average world stop time.
3459         * include/private/gc_priv.h (MS_TIME_DIFF): Add cast.
3460
3461 2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
3462
3463         * misc.c, doc/README.environment: Add support  for
3464         GC_FREE_SPACE_DIVISOR and GC-disable-incremental.
3465         * include/gc.h: Make GC_set_free_space_divisor correspond to
3466         (somewhat unfortunate) reality.
3467
3468 2008-11-07  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
3469
3470         (Mostly improves LLP64 support.)
3471         * backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c,
3472         misc.c, reclaim.c: Changed some int and long type to word or size_t
3473         (and vice versa where appropriate)
3474         * gcj_mlc.c, include/private/dbg_mlc.h, include/private/gcconfig.h,
3475         include/private/thread_local_alloc.h, mark.c,
3476         misc.c, thread_local_alloc.c, win32_threads.c: Added intermediate
3477         casts to word type when casting from int to pointer (or pointer
3478         to int, or data pointer to code pointer) - just to remove the
3479         corresponding compiler warning.
3480         * ptr_chck.c (GC_is_visible): cast int const to word type to
3481         prevent left shift overflow.
3482         * os_dep.c: change the type of GC_mem_top_down global var
3483         (containing a flag) to DWORD.
3484         * include/gc_config_macros.h: define GC_SOLARIS_THREADS if GC_THREADS
3485         is defined on SunOS x86_64.
3486         * misc.c (GC_init_size_map): Ifdef out GC_ASSERT as a workaround
3487         for VC++ 2008 amd64 (v15.00.21022.08 for x64) compiler bug
3488         (the compiler gets hung if invoked with -Ox -D
3489         ALL_INTERIOR_POINTERS -D GC_ASSERTIONS)
3490         * backgraph.c: cast GC_gc_no value to unsigned short when
3491         assigned/compared to height_gc_no field of back_edges.
3492         * os_dep.c (GC_remove_protection): Add ARGSUSED.
3493         * win32_threads.c (GC_thread_exit_proc): Remove unused local var.
3494         * mark.c (GC_check_dirty): Move declaration out of func body.
3495
3496 2008-11-06  Hans Boehm <Hans.Boehm@hp.com>
3497
3498         * doc/gcinterface.html: Improve REDIRECT_MALLOC documentation.
3499         * include/gc.h (GC_register_my_thread): Improve comment.
3500
3501 2008-11-04  Hans Boehm <Hans.Boehm@hp.com>
3502
3503         * Makefile.direct: Add comment for -DCHECKSUMS.
3504
3505 2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
3506
3507         * thread_local_alloc.c, include/private/thread_local_alloc.h:
3508         Fix typos in comments.
3509         * finalize.c: Declare mark_procs and GC_register_finalizer_inner
3510         STATIC.
3511         * malloc.c (GC_free): Move size calculation below assertion.
3512
3513 2008-10-27  Hans Boehm <Hans.Boehm@hp.com>
3514
3515         * win32_threads.c (GC_get_stack_min, GC_may_be_in_stack):
3516         Add one entry VirtualQuery cache, I_HOLD_LOCK assertions.
3517         (GC_push_stack_for, GC_get_next_stack) : Hopefully fix WINCE support.
3518
3519 2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Thanks to Klaus Treichel)
3520
3521         * finalize.c (GC_general_register_disappearing_link): Add
3522         assertion.
3523         * malloc.c (GC_generic_malloc): Round lb to granules, not words.
3524         * mallocx.c (GC_generic_malloc_ignore_off_page): Round lb to
3525         granules, not words.
3526
3527 2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Really Rex Dieter and
3528                                             Petr Krajca)
3529
3530         * mach_dep.c (NO_GETCONTEXT): Define for sparc linux.
3531         * configure.ac: Define mach_dep for sparc-linux.
3532         * configure: Regenerate.
3533
3534 2008-10-25  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
3535
3536         * mark_rts.c (GC_approx_sp): Use volatile to avoid common
3537         warning.
3538
3539 2008-10-25  Hans Boehm <Hans.Boehm@hp.com>
3540
3541         * dyn_load.c (GC_cond_add_roots): Fix GC_get_next_stack argument
3542         order.
3543
3544 2008-10-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3545
3546         * alloc.c, dbg_mlc.c, dyn_load.c, finalize.c, gcj_mlc.c,
3547         include/gc.h, include/gc_config_macros.h, include/gc_cpp.h,
3548         include/gc_gcj.h, include/gc_mark.h, include/gc_typed.h,
3549         include/javaxfc.h, include/private/gc_locks.h,
3550         include/private/gc_priv.h, malloc.c, mallocx.c, mark.c, mark_rts.c,
3551         misc.c, obj_map.c, os_dep.c, pthread_support.c, ptr_chck.c,
3552         stubborn.c, tests/test.c, thread_local_alloc.c, typd_mlc.c
3553         win32_threads.c: Add GC_CALL and GC_CALLBACK macro invocations.
3554         * test.c: Remove some old K&R code.
3555
3556 2008-10-24  Hans Boehm <Hans.Boehm@hp.com>
3557         (Partially based loosely on patch from Ivan Maidanski)
3558
3559         * win32_threads.c (GC_may_be_in_stack): New.  (GC_Thread_Rep):
3560         Add last_stack_min.  (GC_push_stack_for): Use last_stack_min.
3561         (GC_get_next_stack): Add limit argument, use_last_stack_min.
3562         (GC_suspend): make stack_base assignment conditional.
3563         * dyn_load.c (win32 GC_cod_add_roots): Pass limit to
3564         GC_get_next_stack.
3565         * configure_atomic_ops.sh: Remove.
3566         * build_atomic_ops.sh, build_atomic_ops.sh.cygwin, doc/README.win32,
3567         Makefile.direct: Partially support build directories whose path
3568         name contains blanks.
3569         * Makefile.am: Support new files (build_atomic_ops.sh,
3570         build_atomic_ops.sh.cygwin)
3571         * Makefile.in: Regenerate.
3572
3573 2008-10-21  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3574
3575         * include/private/gc_locks.h, include/private/gc_pmark.h,
3576         include/private/gc_priv.h, include/private/gcconfig.h,
3577         mach_dep.c, mark_rts.c, misc.c, os_dep.c, pthread_stop_world.c,
3578         pthread_support.c, thread_local_alloc.c, typd_mlc.c, win32_threads.c:
3579         Fix comments.
3580
3581 2008-10-21  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3582
3583         * pthread_support.c: Comment out LOCK_STATS.
3584         * include/gc.h: Fix comments.
3585
3586 2008-10-20  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3587
3588         * misc.c (GC_init_inner): Enable GC_LOG_FILE on Cygwin.
3589         * include/private/gcconfig.h: Consider USE_MMAP for Cygwin.
3590         * os_dep.c (GC_get_main_stack_base): Use alternate definition
3591         with USE_MMAP.
3592         * include/private/gc_priv.h: Sometimes define SETJMP on Cygwin.
3593
3594 2008-10-20  Hans Boehm <Hans.Boehm@hp.com>
3595
3596         * doc/README: Make it clearer when Makefile.direct is assumed.
3597         * cord/cord.am: install include/cord.h.
3598         * Makefile.in: Regenerate.
3599
3600 2008-09-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3601
3602         * win32_threads.c (GC_pthread_join, GC_pthread_start_inner):
3603         Remove unused variables.
3604         * darwin_stop_world.c: Always declare GC_thr_init().
3605         * dbg_mlc.c (GC_debug_free_inner): Don't touch oh_sz if
3606         SHORT_DBG_HDRS is defined.
3607         * include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET, parallel
3608         mark, USE_MARK_BITS version): Refer to correct parameter name.
3609
3610 2008-09-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
3611
3612         * finalize.c (GC_general_register_disappearing_link): Remove
3613         redundant code.
3614         * gcj_mlc.c (GC_init_gcj_malloc): Add cast to signed.
3615         * os_dep.c: (GC_write_fault_handler): Remove remaining
3616         references to deleted variable "code".  Remove redundant
3617         FREEBSD definitions.
3618         * include/private/gcconfig.h (GWW_VDB): Define for X86_64 when
3619         defined for X86. (STATIC): Define as "static" with NO_DEBUGGING.
3620
3621 2008-09-24  Hans Boehm <Hans.Boehm@hp.com>
3622
3623         * include/private/gc_priv.h: Update MAX_HEAP_SECTS.
3624
3625 2008-09-10  Hans Boehm <Hans.Boehm@hp.com>
3626
3627         * dbg_mlc.c (GC_print_smashed_obj): Increase robustness with
3628         smashed string, (GC_debug_free_inner): Mark as free.
3629         * mallocx.c (GC_malloc_many): Always clear new block if
3630         GC_debugging_started.
3631         * reclaim.c: Move GC_debugging_started from
3632         GC_reclaim_small_nonempty_block() to GC_reclaim_generic(),
3633         which is also called directly.
3634         * doc/README: Fix spelling error.  Update license summary.
3635         * include/gc.h (GC_PRE_INCR3, GC_POST_INCR3): add (void **) casts.
3636         * tests/test.c: Don't define GC_DEBUG if already defined.
3637
3638 2008-08-27  Hans Boehm <Hans.Boehm@hp.com>
3639
3640         * doc/simple_example.html: update --enable-full-debug reference,
3641         Make HTML formatting standards compliant.
3642         * doc/debugging.html, doc/leak.html: Fix HTML formatting bugs.
3643         * doc/gcinterface.html: specify encoding.
3644
3645 2008-08-27  Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
3646
3647         * doc/simple_example.html: Update thread-local allocation
3648         description.
3649
3650 2008-08-26  Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
3651
3652         * configure.ac: Check for gc-debug earlier; replace remaining
3653         full-debug tests.
3654         * configure: Regenerate.
3655         * include/gc.h, ptr_chck.c (GC_pre_incr, GC_post_incr):
3656         Use signed offset type.  Use ptr_t internally.
3657         * doc/gcinterface.html: Update LOCAL_MALLOC description.
3658         * doc/README.autoconf, doc/leak.html, doc/README.DGUX386:
3659         Fix full-debug reference.
3660         * include/gc.h: Rewrite GC_..._INCR and friends.
3661         * tests/test.c: Minimally test GC_..._INCR and friends.
3662
3663 2008-08-21  Hans Boehm <Hans.Boehm@hp.com>
3664
3665         * mark.c: (GC_push_next_marked, GC_push_next_marked_dirty,
3666         GC_push_next_marked_uncollectable): Never invoke GC_push_marked
3667         on free hblk.
3668         * headers.c: Test COUNT_HDR_CACHE_HITS not USE_HDR_CACHE.
3669         (GC_header_cache_miss): Always blacklist pointers for free
3670         hblks.  Add assertion and comment.
3671         * pthread_support.c (GC_register_my_thread): Fix #if indentation.
3672         * include/private/gc_hdrs.h: USE_HDR_CACHE is no longer tested.
3673         Delete it.
3674         * include/private/gc_pmark.h: (PUSH_OBJ): Add assertion.
3675
3676 2008-08-21  Hans Boehm <Hans.Boehm@hp.com>
3677
3678         * alloc.c, include/gc_mark.h, Makefile.direct: Improve comments.
3679
3680 2008-08-01  Hans Boehm <Hans.Boehm@hp.com> (Really Klaus Treichel)
3681
3682         * configure.ac: Set win32_threads on MinGW.
3683         * configure: Regenerate.
3684
3685 2008-07-25  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
3686
3687         Ivan's description of the patch follows. Note that a few pieces like
3688         the GC_malloc(0) patch, were not applied since an alternate had been
3689         previously applied.  A few differed stylistically from the rest of
3690         the code (mostly casts to void * instead of target type),
3691         or were classified as too minor to bother.  Note that
3692         all of Ivan's static declarations which did not correct outright
3693         naming bugs (as a few did), where replaced by STATIC, which is
3694         ignored by default.
3695
3696         - minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for
3697         GC_malloc(0));
3698         - addition of missing getter/setter functions for public variables
3699         (may be useful if compiled as Win32 DLL);
3700         - addition of missing GC_API for some exported functions;
3701         - addition of missing "static" declarator for internal functions
3702         and variables (where possible);
3703         - replacement of all remaining K&R-style definitions with ANSI
3704         C ones (__STDC__ macro is not used anymore);
3705         - addition of some Win32 macro definitions (that may be missing in
3706         the standard headers supplied with a compiler) for GWW_VDB mode;
3707         - elimination of most compiler warnings (except for
3708         "uninitialized data" warning);
3709         - several typos correction;
3710         - missing parenthesis addition in macros in some header files of
3711         "libatomic_ops" module.
3712
3713         My highlights based on reading the patch:
3714
3715         * allchblk.c: Remove GC_freehblk_ptr decl.
3716         Make free_list_index_of() static.
3717         * include/gc.h: Use __int64 on win64, define GC_oom_func,
3718         GC_finalizer_notifier_proc, GC_finalizer_notifier_proc,
3719         add getter and setters: GC_get_gc_no, GC_get_parallel,
3720         GC_set_oom_fn, GC_set_finalize_on_demand,
3721         GC_set_java_finalization, GC_set_dont_expand,
3722         GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect,
3723         GC_set_finalizer_notifier.  Always define GC_win32_free_heap.
3724         gc_config_macros.h: Define _REENTRANT after processing
3725         GC_THREADS.
3726         * include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test,
3727         handling of operator new[] for old Windows compilers.
3728         * include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses
3729         around arguments.
3730         * dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs.
3731         * mark.c (GC_mark_and_push_stack): Fix source argument for
3732         blacklist printing.
3733         * misc.c: Fix log file naming based on environment variable
3734         for Windows.  Make GC_set_warn_proc and GC_set_free_space_divisor
3735         just return current value with 0 argument.  Add DONT_USE_USER32_DLL.
3736         Add various getters and setters as in gc.h.
3737         * os_dep.c: Remove no longer used GC_disable/enable_signals
3738         implementations.  (GC_get_stack_base): Add pthread_attr_destroy
3739         call.  No longer set GC_old_bus_handler in DARWIN workaround.
3740         * pthread_support.c: GC_register_my_thread must also
3741         call GC_init_thread_local.
3742
3743 2008-07-21  Hans Boehm <Hans.Boehm@hp.com>
3744
3745         * Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
3746         * mach_dep.c: Include signal.h.
3747         * gc_priv.h: Factor out INLINE declaration.
3748
3749 2008-07-03  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Thiemo Seufer)
3750
3751         * include/private/gcconfig.h: Update MIPS/LINUX config.
3752         * doc/gcdescr.html: Fix typo.
3753         * mach_dep.c (GC_with_callee_saves_pushed): Don't rely on getcontext
3754         for MIPS/LINUX.
3755
3756 2008-05-30  Hans Boehm <Hans.Boehm@hp.com> (some really dmcmahill)
3757
3758         * configure.ac: SPARC fixes.
3759         * configure: Regenerate.
3760         * thread_local_alloc.c(GC_mark_thread_local_fls_for): Include
3761         size 0, except for gcj.
3762         * doc/gc.man: Expand C++ cautions.
3763         * include/gc_inline.h: Fix comments.
3764
3765 2008-05-03  Hans Boehm <Hans.Boehm@hp.com>
3766
3767         * include/gc_version.h, configure.ac, doc/README:
3768         Change to version 7.2alpha1.
3769         * configure: Regenerate.
3770
3771 [7.1]
3772
3773 2008-05-03  Hans Boehm <Hans.Boehm@hp.com>
3774
3775         * include/gc_version.h, configure.ac, doc/README:
3776         Change to version 7.1.
3777         * configure: Regenerate.
3778
3779 2008-05-03  Hans Boehm <Hans.Boehm@hp.com>
3780
3781         * doc/gcinterface.html: Improve C++ interface documentation.
3782
3783 2008-03-10  Hans Boehm <Hans.Boehm@hp.com>
3784
3785         * allchblk.c (GC_allochblk): Check for overflow during size
3786         rounding.
3787         * tests/huge_test.c: New.
3788         * Makefile.direct, tests/tests.am: Add huge_test.c
3789         * Makefile.in: Regenerate.
3790
3791 2008-02-29  Hans Boehm <Hans.Boehm@hp.com>
3792
3793         * pthread_support.c: Fix typo in comment.
3794         * os_dep.c (GC_win32_get_mem): Add heap section only if
3795         allocation succeeded.
3796
3797 2008-02-28  Hans Boehm <Hans.Boehm@hp.com>
3798
3799         * malloc.c: (free replacement) Fix caller address space check.
3800
3801 2008-02-25  Hans Boehm <Hans.Boehm@hp.com>
3802
3803         * finalize.c (GC_grow_table): Dereference table in null-check.
3804
3805 2008-02-24  Hans Boehm <Hans.Boehm@hp.com>
3806
3807         * win32_threads.c (GC_delete_gc_thread, GC_delete_thread):
3808         Consistently call CloseHandle. (GC_suspend): Call
3809         GC_delete_gc_thread.
3810         * tests/test.c: Don't reference GC_print_stats if not exported.
3811
3812 2008-02-20  Hans Boehm <Hans.Boehm@hp.com>
3813
3814         * tests/test.c (run_one_test): Don't mention pthread_self().
3815         * misc.c: Declare GC_thr_init().
3816
3817 2008-02-20  Hans Boehm <Hans.Boehm@hp.com>
3818
3819         * allchblk.c (add_to_fl): disable assertions with USE_MUNMAP,
3820         and refine assertions to handle huge unmergable blocks.
3821         (GC_allochblk_nth): Add comment.
3822
3823 2008-02-20  Hans Boehm <Hans.Boehm@hp.com>
3824
3825         * include/private/gcconfig.h: Add misssing FREEBSD macro
3826         consistency test.
3827
3828 2008-02-20  Hans Boehm <Hans.Boehm@hp.com>
3829
3830         * allchblk.c (GC_enough_large_bytes_left): No longer take
3831         parameters; return free list index bound.
3832         (GC_merge_unmapped): Don't access nexthdr until after null test.
3833         (Fixes bug in 1/29/08 check-in.)  (GC_allochblk): Calculate
3834         when splitting is allowable only once here, not when considering each
3835         block. (GC_allchblk_nth): Accept new may_split parameter.
3836         Avoid some redundant tests for exact size matches.
3837         * alloc.c (GC_should_collect): Cache min_bytes_allocd.
3838         (GC_maybe_gc): Make locking assertion testable.
3839         * mark_rts.c: Fix indentation.
3840         * pthread_stop_world.c: Replace old GC_err_printf1 reference.
3841         * tests/test.c: Remove (void) casts.  Optionally print some
3842         timing information.
3843
3844 2008-02-15  Hans Boehm <Hans.Boehm@hp.com>
3845
3846         * windows-untested/gc.def: Remove CreateThread line.
3847         * windows-untested/README: New file.
3848         * win32_threads.c (GC_use_DllMain): Force collector initialization.
3849         (GC_init_parallel): Reformat comment.
3850         * include/gc.h (GC_use_DllMain): Clarify usage rules in comment.
3851         * mark.c (GC_mark_from): Slightly simplify GC_DS_PER_OBJECT code.
3852         * include/gc_cpp.h: Add matching placement delete overloads
3853         everywhere.
3854         * include/private/gc_locks.h (NO_THREAD): Add cast.
3855         * include/private/gcconfig.h: Add test for __HP_aCC.
3856         * configure.ac, tests/tests.am:  Avoid libgccpp on HP/UX.
3857         * Makefile.in, configure: Regenerate.
3858
3859 2008-02-11  Hans Boehm <Hans.Boehm@hp.com> (partly David Leonard)
3860
3861         * doc/README.win32: Fix typo.
3862         * configure.ac: Fix printing of enable-shared result.
3863         * configure: Regenerate.
3864
3865 2008-02-08  Hans Boehm <Hans.Boehm@hp.com>
3866
3867         * misc.c (GC_init_inner): Assert !GC_need_to_lock only when
3868         defined.  (GC_call_with_stack_base): Add GC_API.
3869         * os_dep.c (GC_get_stack_base): Add GC_API.
3870         * win32_threads.c: (GC_register_my_thread, GC_unregister_my_thread):
3871         Add GC_API.
3872         * include/gc.h: Add GC_API annotations.
3873         * include/private/gc_locks.h: Define UNCOND_LOCK etc. also for
3874         PCR.
3875         * include/private/gc_pmark.h: Fix comments.
3876
3877 2008-02-06  Hans Boehm <Hans.Boehm@hp.com> (mostly from Henning Makholm)
3878
3879         * include/private/gc_priv.h, mark_rts.c, typd_mlc.c:
3880         Add GC_push_typed_structures() to push GC_ext_descriptors.
3881
3882 2008-01-31  Hans Boehm <Hans.Boehm@hp.com> (mostly from Andreas Tobler)
3883
3884         * tests/test.c: Call GC_INIT for DARWIN; test system type using
3885         gcconfig.h-defined macros.
3886
3887 2008-01-29  Hans Boehm <Hans.Boehm@hp.com>
3888
3889         * allchblk.c (GC_merge_unmapped, GC_freehblk): Refuse to create
3890         blocks large enough that their size, when interpreted as a signed
3891         value, would be negative.
3892         * include/private/gc_priv.h: Comment hb_sz range limit.
3893
3894 2008-01-29  Hans Boehm <Hans.Boehm@hp.com>  (with help from Manuel Serrano)
3895
3896         * mark.c (GC_push_next_marked): correct comment.
3897         * Makefile.direct: document NO_PROC_STAT.
3898         * include/private/gcconfig.h: Accomodate NO_PROC_STAT.
3899
3900 2008-01-10  Hans Boehm <Hans.Boehm@hp.com>
3901
3902         * include/gc_version.h, configure.ac, doc/README:
3903         Change to version 7.1alpha3.
3904         * configure: Regenerate.
3905
3906 [7.1alpha2]
3907
3908 2008-01-10  Hans Boehm <Hans.Boehm@hp.com>
3909
3910         * include/gc_version.h, configure.ac, doc/README:
3911         Change to version 7.1alpha2.
3912         * configure: Regenerate.
3913
3914 2008-01-10  Hans Boehm <Hans.Boehm@hp.com>
3915
3916         * Makefile.am: Mention atomic_ops.c and atomic_ops_sysdeps.S
3917         again.  Refer to build directory as ".".
3918         * Makefile.in: Regenerate.
3919
3920 2008-01-10  Hans Boehm <Hans.Boehm@hp.com>
3921
3922         * configure.ac: Ignore --enable-parallel-mark on Darwin for now.
3923         * configure: Regenerate.
3924         * darwin_stop_world.c: Add FIXME comment for parallel marker.
3925
3926 2008-01-09  Hans Boehm <Hans.Boehm@hp.com>
3927
3928         * include/private/gc_priv.h: Update MAX_ROOT_SETS
3929         and LOG_PHT_ENTRIES to handle larger heaps.
3930
3931 2008-01-03  Hans Boehm <Hans.Boehm@hp.com>
3932
3933         * include/gc.h (GC_INIT,GC_init): Update comments.
3934
3935 2008-01-03  Hans Boehm <Hans.Boehm@hp.com> (based on a patch from
3936         John Bowman, and an ancient patch from Fergus Henderson)
3937
3938         * allchblk.c, alloc.c, include/private/gc_priv.h:
3939         Track GC_bytes_dropped and use in GC triggering decisions.
3940         * alloc.c (min_bytes_allocd): Weight atomic blocks less.
3941
3942 2008-01-02  Hans Boehm <Hans.Boehm@hp.com>
3943
3944         * alloc.c (GC_add_to_heap): Call GC_install_header(p) AFTER
3945         adjusting p.
3946
3947 2007-12-23  Hans Boehm <Hans.Boehm@hp.com>
3948
3949         * Makefile.am: Add NT_X64_THREADS_MAKEFILE.
3950
3951 2007-12-23  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Friedrich Dominicus)
3952
3953         * NT_X64_STATIC_THREADS_MAKEFILE: Clean up obsolete comment.
3954         * alloc.c: Add declaration for GC_add_current_malloc_heap.
3955         * win32_threads.c (GC_beginthreadex): Clean up error
3956         return code.
3957         * doc/README.win64, NT_X64_THREADS_MAKEFILE, Makefile.direct:
3958         Add NT_X64_THREADS_MAKEFILE.
3959
3960 2007-12-21  Hans Boehm <Hans.Boehm@hp.com>
3961
3962         * alloc.c: Define GC_version instead of in version.h.
3963         * version.h: Remove.
3964         * include/gc_version.h: Move most of version.h here.
3965         * include/gc.h: Include gc_version.h.
3966         * gcname.c, add_gc_prefix.c: include gc.h instead of version.h.
3967         * Makefile.direct, Makefile.dj, Makefile.am, include/include.am:
3968         Adjust for version.h rename.
3969         * Makefile.in: Regenerate.
3970
3971 2007-12-21  Hans Boehm <Hans.Boehm@hp.com> (Really mostly russ sludge dot net)
3972
3973         * configure.ac: Put libatomic_ops links in build directory.
3974         * configure: Regenerate.
3975         * Makefile.am: Don't mention atomic_ops.c and atomic_ops_sysdeps.S
3976         as nodist sources.
3977
3978 2007-12-20  Hans Boehm <Hans.Boehm@hp.com>
3979
3980         * include/gc.h, doc/README.macros: Add GC_NO_THREAD_REDIRECTS,
3981         GC_NO_THREAD_DECLS, don't test explicitly for GC_SOLARIS_THREADS.
3982
3983 2007-12-20  Hans Boehm <Hans.Boehm@hp.com>
3984
3985         * alloc.c: Deal correctly with address wrapping for
3986         GC_greatest_plausible_heap_addr and GC_least_plausible_heap_addr.
3987         * finalize.c, include/gc.h (GC_register_disappearing_link,
3988         GC_register_finalizer_inner): Improve out-of-memory handling.
3989         * include/private/gc_pmark.h: Fix comment spelling.
3990
3991 2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really mainly Peter Wang)
3992
3993         * include/gc_inline.h, include/gc_tiny_fl.h: cleanups to make usable
3994         in other contexts.
3995
3996 2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really Radek Polak)
3997
3998         * include/gc.h: Don't define GC_HAVE_BUILTIN_BACKTRACE for uclibc.
3999
4000 2007-12-18  Hans Boehm <Hans.Boehm@hp.com>
4001
4002         * gc_cpp.cc: Don't include gc_cpp.h from local directory.
4003
4004 2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really Adam Megacz)
4005
4006         * allchblk.c, configure.ac (add --enable-munmap)
4007         * configure: Regenerate.
4008
4009 2007-12-10  Andreas Tobler <a.tobler@schweiz.org>
4010
4011         * dyn_load.c (GC_dyld_image_add): Remove ifdef clause and use the macro
4012         GC_GETSECTBYNAME instead.
4013         * include/private/gc_priv.h: Define GC_GETSECTBYNAME according to the
4014         architecture (Darwin).
4015
4016 2007-10-24  Hans Boehm <Hans.Boehm@hp.com>
4017
4018         * reclaim.c (GC_bytes_found): Expand comment.
4019         * thread_local_alloc.c (GC_malloc_atomic, GC_gcj_malloc): Pass
4020         granules, not bytes, to GC_FAST_MALLOC_GRANS.
4021         * include/gc.h: Never include gc_local_alloc.h.
4022         * tests/test.c: Add size zero allocation tests.
4023
4024 2007-10-23  Hans Boehm <Hans.Boehm@hp.com>
4025
4026         * malloc.c: Update GC_large_allocd_bytes on explicit deallocation.
4027         * allchblk.c: Sanity check GC_max_large_allocd_bytes.
4028
4029 2007-10-23  Hans Boehm <Hans.Boehm@hp.com> (Really Manuel Serrano)
4030
4031         * Makefile.direct: Invoke $(MAKE) instead of make.
4032
4033 2007-10-23  Hans Boehm <Hans.Boehm@hp.com>
4034
4035         * doc/scale.html: Reflect gc7 thread local allocation behavior.
4036
4037 2007-10-23  Hans Boehm <Hans.Boehm@hp.com> (really Petter Urkedal)
4038
4039         * include/extra/gc.h, include/extra/gc_cpp.h: New.
4040         * include/include.am: Install gc.h and gc_cpp.h in $(prefix)/include
4041         again.
4042         * Makefile.in: Regenerate.
4043
4044 2007-08-15  Hans Boehm <Hans.Boehm@hp.com> (really Samuel Thibault)
4045
4046         * pthread_support.c (GC_thr_init): Use sysconf(_SC_NPROCESSORS_ONLN)
4047         for HURD.
4048
4049 2007-08-14  Hans Boehm <Hans.Boehm@hp.com> (really David Daney)
4050
4051         * include/private/gcconfig.h: Add Linux/mips-64 support.
4052
4053 2007-08-14  Hans Boehm <Hans.Boehm@hp.com> (really mostly Samuel Thibault)
4054
4055         * dbg_mlc.c: Use random() on all glibc systems.
4056         * mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext() on
4057         HURD.  Add comment.
4058         * pthread_stop_world.c (GC_suspend_handler, GC_stop_init): Accomodate
4059         systems without SA_SIGINFO.
4060
4061 2007-08-14  Hans Boehm <Hans.Boehm@hp.com> (partly really Henrik Theiling)
4062
4063         * include/gc.h (GC_PTR_STORE): Fix non-DEBUG parentheses.
4064         * tests/test.c (run_one_test): Add GC_PTR_STORE test.
4065         No longer test for RS6000.
4066
4067 2007-08-03  Hans Boehm <Hans.Boehm@hp.com>
4068
4069         * alloc.c, backgraph.c, headers.c, include/private/gc_priv.h:
4070         Maintain GC_our_memory and GC_n_memory.
4071         * dbg_mlc.c (GC_print_smashed_obj): Improve message.
4072         (GC_print_all_smashed_proc): Pass client object address instead of
4073         base.
4074         * dyn_load.c (sort_heap_sects): New.  (GC_register_map_entries):
4075         Register sections that are contiguous and merged with our heap.
4076         * malloc.c, os_dep.c (GC_text_mapping): Check for just base name
4077         of libraries.
4078         * malloc.c (calloc): Check for special callers even with
4079         USE_PROC_FOR_LIBRARIES. Move assertion.  Add rudimentary
4080         malloc/free tracing.
4081         * misc.c: No longer call GC_init_lib_bounds explicitly.
4082         * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Always
4083         initialize on demand.
4084         * tests/test.c: Call GC_INIT only when required.
4085
4086 2007-08-03  Hans Boehm <Hans.Boehm@hp.com>
4087
4088         * Makefile.direct: Remove comment fragment.
4089         * tests/tests.am: Add smashtest.
4090         * Makefile.in: Regenerate.
4091         * configure.ac: Define GC_USE_DLOPEN_WRAP with redirect-malloc.
4092         * configure: Regenerate.
4093         * pthread_support.c: Fix comment spelling.
4094         * include/private/gcconfig.h: Define USE_PROC_FOR_LIBRARIES with
4095         GC_LINUX_THREADS and REDIRECT_MALLOC.
4096         * tests/smash_test.c: Initial check-in.
4097         * obj_map.c: Print log entry to correct file.
4098         * include/private/thread_local_alloc.h: Add TlsAlloc error check.
4099
4100 2007-07-23  Hans Boehm <Hans.Boehm@hp.com>
4101
4102         * alloc.c (GC_stopped_mark): Call GC_add_current_malloc_heap()
4103         while world is still running.
4104         * os_dep.c (GC_is_heap_base): Don't call GC_add_current_malloc_heap()
4105         with world stopped.
4106         * include/gc.h (GC_INIT for cygwin): Always call GC_add_roots.
4107         * misc.c (GC_init/GC_init_inner): Perform all work in
4108         GC_init_inner.
4109         * Makefile.direct: Expand -DUSE_MUNMAP comment.
4110
4111 2007-07-23  Hans Boehm <Hans.Boehm@hp.com> (really Jim Marshall)
4112
4113         * include/gc.h: Define uintptr_t explicitly for VC++6.
4114         * msvc_dbg.c (GetModuleBase): Revert to strcat if strcat_s doesn't
4115         exist.
4116
4117 2007-07-02  Hans Boehm <Hans.Boehm@hp.com>
4118
4119         * version.h, configure.ac, doc/README: Change to version 7.1alpha1.
4120         * configure: Regenerate.
4121
4122 2007-07-02  Hans Boehm <Hans.Boehm@hp.com>
4123
4124         * version.h, configure.ac, doc/README: Change to version 7.0.
4125         * configure: Regenerate.
4126
4127 2007-07-02  Hans Boehm <Hans.Boehm@hp.com>
4128
4129         * include/gc_config_macros.h: Also check for IA64 when setting
4130         GC_HPUX_THREADS.
4131         * mallocx.c: Change my_bytes_allocd to signed_word.
4132         * include/gc_pthread_redirects.h: Remove obsolete Solaris threads
4133         (as opposed to pthreads) support.
4134
4135 2007-07-02  Hans Boehm <Hans.Boehm@hp.com>
4136
4137         * mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext()
4138         on ARM/Linux.  Check getcontext() return value.
4139
4140 2007-06-29  Hans Boehm <Hans.Boehm@hp.com>
4141
4142         * backgraph.c (per_object_func): Make argument types consistent.
4143         (GC_traverse_back_graph): Mark GC_deepest_obj.
4144
4145 2007-06-29  Hans Boehm <Hans.Boehm@hp.com>
4146
4147         * finalize.c (GC_finalize): Change dl_size and fo_size to size_t.
4148         * os_dep.c (GC_win32_get_mem): Add GC_mem_top_down option.
4149
4150 2007-06-28  Hans Boehm <Hans.Boehm@hp.com>
4151
4152         * doc/README.win32, doc/README, README.QUICK: Fix some of the worst
4153         anachronisms.
4154         * dyn_load.c: Partially support cygwin, but don't enable it yet.
4155
4156 2007-06-28  Hans Boehm <Hans.Boehm@hp.com>
4157
4158         * Makefile.am: Use -no-undefined for libgc.
4159         * Makefile.in: Regenerate.
4160         * Makefile.direct: Document USE_PROC_FOR_LIBRARIES.
4161         * dyn_load.c (GC_register_map_entries): Rename prot_buf to prot
4162         consistently.
4163         * misc.c: Fix some WARN calls.  Move GC_is_initialized setting and
4164         GC_thr_init() call.
4165         * os_dep.c: Consistently use WARN where appropriate.
4166         * thread_local_alloc.c: Revert change to GC_WIN32_THREADS test.  Instead
4167         remove inappropriate pthread.h include.
4168         * doc/README.linux: Remove some anachronisms.
4169
4170 2007-06-23  Hans Boehm <Hans.Boehm@hp.com>
4171
4172         * alloc.c: Also use GC_check_tls on non-Linux systems.
4173         * mallocx.c (GC_reclaim_generic): Remove bogus declaration.
4174         * include/private/gc_priv.h (GC_reclaim_generic): Declare correctly
4175         with prototype.
4176
4177 2007-06-19  Hans Boehm <Hans.Boehm@hp.com>
4178
4179         * alloc.c (GC_adj_bytes_allocd): Avoid (long) casts, fix comment.
4180         (GC_print_heap_sects): Use size_t instead of unsigned long.
4181         * thread_local_alloc.c (GC_lookup_thread): Define in the correct
4182         context.
4183         * win32_threads.c, include/gc_config_macros.h: The last of Romano
4184         Paolo Tenca's patch.  Move stdint.h include to gc_config_macros.h.
4185         * include/gc_inline.h: Avoid gc_priv.h dependencies.
4186         * tests/test.c (check_heap_stats): Replace unsigned long with size_t.
4187
4188 2007-06-12  Hans Boehm <Hans.Boehm@hp.com>
4189
4190         * aclocal.m4: Regenerate to update date.
4191
4192 2007-06-10  Hans Boehm <Hans.Boehm@hp.com>
4193
4194         * NT_X64_STATIC_THREADS_MAKEFILE: Replace obsolete -debugtype:cv.
4195         * mark_rts.c (GC_push_roots): Fix kind type.
4196
4197 2007-06-06  Hans Boehm <Hans.Boehm@hp.com>
4198
4199         * doc/README.win64: New file.
4200         * doc/doc.am, Makefile.direct: Add README.win64.
4201         * Makefile.in: Regenerate.
4202
4203 2007-06-06  Hans Boehm <Hans.Boehm@hp.com>
4204
4205         * Makefile.am, Makefile.direct: Add NT_X64_STATIC_THREADS_MAKEFILE.
4206         * Makefile.in: Regenerate.
4207         * NT_X64_STATIC_THREADS_MAKEFILE: Fix warning flags.
4208         * allochblk.c, alloc.c, blacklst.c, dbg_mlc.c, dyn_load.c,
4209         finalize.c, headers.c, mach_dep.c, malloc.c, mark.c, misc.c,
4210         obj_map.c, os_dep.c, ptr_chck.c, reclaim.c, typd_mlc.c,
4211         win32_threads.c, cord/de_win.c, include/gc_mark.h,
4212         include/private/gc_hdrs.h, include/private/gc_pmark.h,
4213         include/private/gc_priv.h, tests/test_cpp.cc:
4214         Replace old style function declarations.  Clean up integral types.
4215         Remove register declarations.  The change in malloc.c and the
4216         "int descr" declaration in mark.c are the most likely to have
4217         been real bugs outside of win64.
4218         * msvc_dbg.c: Disable on win64.
4219         * win32_threads.c: Add AMD64 support.
4220         * include/gc.h: no backtrace on AMD64 for now.
4221
4222 2007-06-06  Hans Boehm <Hans.Boehm@hp.com>
4223
4224         * msvc_dbg.c(GetModuleBase): Replace strcat with strcat_s.
4225
4226 2007-06-06  Hans Boehm <Hans.Boehm@hp.com>
4227
4228         * include/gc.h: (GC_word, GC_signed_word): Fix win64 definitions.
4229         Don't include windows.h in an extern "C" context.
4230         * include/private/gcconfig.h: Fix win64/X86_64 configuration.
4231         * tests/test.c: Eliminate more old style function definitions.
4232         Cleanup pointer and integer casts for win64.
4233         * tests/test_cpp.cc: Don't include gc_priv.h.
4234         * NT_STATIC_THREADS_MAKEFILE: Restrict suffixes for VC++ 2005.
4235         * NT_X64_STATIC_THREADS_MAKEFILE: New.
4236
4237 2007-06-06  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Romano Paolo Tenca)
4238
4239         * win32_threads.c: Separate out DEBUG_WIN32_PTHREADS_STACK.  Ignore
4240         FINISHED threads for suspension.  (GC_pthread_join): Add
4241         pthread_self() cast.  (GC_pthread_start_inner): Execute cleanup
4242         handler when popping it.
4243         * include/private/gc_locks.h: Inline THREAD_EQUAL for
4244         GC_WIN32_PTHREADS.  Define USE_PTHREAD_LOCKS only if we have
4245         pthreads.
4246
4247 2007-05-23  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Romano Paolo Tenca)
4248
4249         * gc_dlopen.c, thread_local_alloc.c, threadlibs.c, win32_threads.c,
4250         tests/test.c: Accomodate GC_WIN32_PTHREADS.
4251         * include/gc.h: Don't include windows.h for GC_WIN32_PTHREADS.
4252         * include/gc_config_macros.h: Define both PTHREADS and
4253         GC_WIN32_THREADS.
4254         * include/private/gc_locks.h: Nonstandard definitions of
4255         NUMERIC_THREAD_ID for GC_WIN32_PTHREADS.
4256         * doc/README.win32, Makefile.direct: Include documentation
4257         for GC_WIN32_PTHREADS.
4258         * Makefile.direct: Remove some anachronisms in the documentation.
4259
4260 2007-05-23  Hans Boehm <Hans.Boehm@hp.com>
4261
4262         * Makefile.am: Move includes to bottom.  Add better library
4263         dependencies.  Increment library version.  Remove "SUBDIRS += .".
4264         * cord/cord.am, tests/tests.am: Add better library dependencies.
4265         Remove now unnecessary dependencies.
4266         * Makefile.in: Regenerate.
4267         * include/gc.h (GC_beginthreadex, GC_endthreadex, GC_ExitThread):
4268         Move to define on all Windows platforms.  (_beginthread): define
4269         to generate error if used.
4270
4271 2007-05-22  Hans Boehm <Hans.Boehm@hp.com>
4272
4273         * include/private/gc_locks.h: Format to 80 columns.
4274
4275 2007-05-22  Hans Boehm <Hans.Boehm@hp.com>
4276
4277         * malloc.c(GC_free): Ignore bad frees on MSWIN32 with REDIRECT_MALLOC.
4278         * NT_MAKEFILE: msvc_dbg.h is in include/private.  Don't use cvars
4279         rc.
4280         * misc.c (WIN32 GC_write): Define GC_need_to_lock in single-threaded
4281         case.
4282         * win32_threads.c: Test for __MINGW32__ in addition to _MINGW_VER.
4283         (GC_CreateThread, GC_beginthreadex): Deallocate args even if we fail.
4284         * include/gc.h: Add GC_reachable_here().  (GC_WinMain): Add GC_API.
4285         (GC_beginthreadex, GC_endthreadex, GC_ExitThread): Declare.
4286         * tests/test.c: Add GC_reachable_here() call.
4287
4288 2007-05-21  Hans Boehm <Hans.Boehm@hp.com>
4289
4290         * alloc.c (GC_try_to_collect): Call GC_init if necessary.
4291         * tests/thread_leak_test.c: Don't unconditionally define
4292         GC_LINUX_THREADS.
4293
4294 2007-05-21  Andreas Tobler <a.tobler@schweiz.org>
4295
4296         * Makefile.am: Remove extra_ldflags_libgc definition.
4297         * Makefile.in: Regenerate.
4298
4299 2007-05-17  Hans Boehm <Hans.Boehm@hp.com>
4300
4301         * include/private/gc_priv.h: Define AO_REQUIRE_CAS.
4302
4303 2007-05-16  Hans Boehm <Hans.Boehm@hp.com>
4304
4305         * finalize.c (GC_unreachable_finalize_mark_proc): Don't return void
4306         value.
4307
4308 2007-05-15  Hans Boehm <Hans.Boehm@hp.com>
4309
4310         * configure.ac, version.h, doc/README: Change version to 7.0alpha10.
4311         * configure: Regenerate.
4312
4313 [7.0alpha9 release]
4314
4315 2007-05-15  Hans Boehm <Hans.Boehm@hp.com>
4316
4317         * configure.ac, version.h, doc/README: Change version to 7.0alpha9.
4318         * configure: Regenerate.
4319
4320 2007-05-15  Hans Boehm <Hans.Boehm@hp.com>
4321
4322         * Makefile.am: Include NT_STSTIC_THREADS_MAKEFILE in dist.
4323         * Makefile.in: Regenerate.
4324         * include/private/gc_locks.h: GC_compare_and_exchange, GC_atomic_add:
4325         remove. NUMERIC_THREAD_ID, THREAD_EQUAL: New.  GC_lock_holder: now
4326         unsigned long.  I_DONT_HOLD_LOCK, I_HOLD_LOCK: Update.
4327         * pthread_stop_world.c, pthread_support.c, win32_threads.c: Use
4328         NUMERIC_THREAD_ID, THREAD_EQUAL.
4329         * include/private/gcconfig.h: GENERIC_COMPARE_AND_SWAP: Remove.
4330         * include/private/thread_local_alloc.h: Don't USE_COMPILER_TLS on
4331         ARM.
4332
4333 2007-05-11  Hans Boehm <Hans.Boehm@hp.com>
4334
4335         * dbg_mlc.c, include/gc.h, finalize.c: Merge Alexandre Oliva's
4336         GC_debug_register_finalizer_unreachable() patch from gcc tree.
4337         * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Add assertions
4338         to check GC has been initialized.
4339
4340 2007-05-10  Hans Boehm <Hans.Boehm@hp.com>
4341
4342         * include/gc_cpp.h: Documentation updates.
4343         * include/gc_config_macros.h: Don't check for __ppc__ to set
4344         DARWIN_THREADS.
4345         * Makefile.am: Include configure_atomic_ops.sh in dist.
4346         * Makefile.in: Regenerate.
4347
4348 2007-05-08  Hans Boehm <Hans.Boehm@hp.com>
4349
4350         * Makefile.am: Don't distribute copied atomic_ops files.  Include
4351         libatomic_ops with "make dist".
4352         * Makefile.in: Regenerate.
4353         * configure: Regenerate.
4354         * configure.ac: Enable THREAD_LOCAL_ALLOC for Cygwin with threads.
4355         * win32_threads.c: Report error for Cygwin + GC_DLL.
4356
4357 2007-05-08  Hans Boehm <Hans.Boehm@hp.com>
4358
4359         * Makefile.direct: Update THREAD_LOCAL_ALLOC documentation.
4360         * cord/de_win.c: Rename and move AboutBox.  Call GC_INIT.  Remove
4361         MakeProcInstance anachronism.
4362         * doc/README.macros: Officially remove elif prohibition.
4363         Remove documentation for defunct SRC_M3 support.
4364         * include/gc.h: Remove more SRC_M3 references.
4365         * include/private/gcconfig.h: Remove still more SRC_M3 references.
4366         GC_SOLARIS_THREADS no longer needs to be checked separately.
4367
4368 2007-05-08  Hans Boehm <Hans.Boehm@hp.com>
4369
4370         * thread_local_alloc.c, include/private/thread_local_alloc.h:
4371         Spell __declspec correctly.
4372         * NT_STATIC_THREADS_MAKEFILE: Enable thread-local allocation.
4373
4374 2007-05-07  Hans Boehm <Hans.Boehm@hp.com>
4375
4376         * doc/README.win32: Adjust GC_win32_dll_threads rules again.
4377
4378 2007-05-07  Hans Boehm <Hans.Boehm@hp.com>
4379
4380         * mark.c (GC_mark_some wrapper): Restructure for readability, handle
4381         GC_started_thread_while_stopped.
4382         * misc.c (Win32 GC_write): Lock GC_write_cs only if needed.
4383         * win32_threads.c: (client_has_run): remove,
4384         GC_started_thread_while_stopped, GC_attached_thread: add.
4385         (GC_push_all_stacks): Add verbose output.
4386         (DllMain): Avoid initializing collector or the like.
4387         Never update both thread tables.
4388         * doc/README.win32: Adjust GC_win32_dll_threads rules.
4389
4390 2007-05-07  Hans Boehm <Hans.Boehm@hp.com>
4391
4392         * pthread_stop_world.c (GC_push_all_stacks): Print thread count with
4393         GC_PRINT_VERBOSE_STATS.
4394
4395 2007-05-01  Hans Boehm <Hans.Boehm@hp.com>
4396                 (and Manuel Serrano, Craig McDaniel)
4397
4398         * configure.ac: Comment out redundant
4399           AC_DEFINE(NO_EXECUTE_PERMISSION).
4400         * configure: Regenerate.
4401         * sparc_mach_dep.S: Remove single quote in comment.
4402         * include/private/gcconfig.h: Fix DATAEND for NONSTOP.
4403         * win32_threads.c: Include stdint.h for Mingw.  Add GC_API for DllMain.
4404         (GC_use_DllMain): Fix assertion.
4405
4406 2007-02-14  Andreas Tobler <a.tobler@schweiz.org>
4407
4408         * configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin.
4409         * configure: Regenerate.
4410         * Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc.
4411         * Makefile.in: Regenerate.
4412         * include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin
4413         targets. Remove comments.
4414         Prepare ppc64 support for Darwin.
4415
4416 2007-01-29  Andreas Tobler <a.tobler@schweiz.org>
4417
4418         * darwin_stop_world.c: Clean up and reformat code.
4419
4420 2007-01-28  Andreas Tobler <a.tobler@schweiz.org>
4421
4422         * darwin_stop_world.c (GC_push_all_stacks): Fix compiler warnings.
4423         Make i unsigned.
4424         (GC_stop_world): Likewise. Remove unused GC_thread p.
4425         (GC_start_world): Likewise.
4426
4427         * os_dep.c: Define GC_darwin_register_mach_handler_thread extern.
4428         Remove double SIG_HNDLR_PTR definition.
4429         (GC_forward_exception): Fix compiler warnings, make i unsigned.
4430         Initialize thread_state to NULL.
4431         (catch_exception_raise): Fix compiler warnings, make i unsigned.
4432
4433 2007-01-25  Petr Salinger and Hans Boehm <Hans.Boehm@hp.com>
4434
4435         * include/private/gc_priv.h (NEED_FIND_LIMIT, FREEBSD variant):
4436         also define for X86_64.
4437         * configure.ac: Move generic gnu (Hurd) case to below kfreebsd case.
4438         * configure: Regenerate.
4439         * README.changes: Point to ChangeLog.
4440
4441 2007-01-25  Andreas Tobler <a.tobler@schweiz.org>
4442
4443         * darwin_stop_world.c: Move THREAD_FLD defines to ...
4444         * include/private/gc_priv.h: ... here.
4445         Fix THREAD_STATE definitions for ppc64.
4446         * os_dep.c (catch_exception_raise): Use THREAD_FLD for exc_state member
4447         access.
4448
4449 2007-01-18  Andreas Tobler <a.tobler@schweiz.org>
4450
4451         * os_dep.c (if defined(MPROTECT_VDB) && defined(DARWIN)): Clean up and
4452         reformat code.
4453         Correct email reference.
4454
4455 2007-01-11  Andreas Tobler <a.tobler@schweiz.org>
4456
4457         * configure.ac (i?86*-*-darwin*): Replaced HAS_I386_THREAD_STATE_* with
4458         HAS_X86_THREAD_STATE32_*.
4459         (x86_64-*-darwin*): Extended the above check for x86_64-*-darwin* with
4460         HAS_X86_THREAD_STATE64_*.
4461         Added value 1 in the above AC_DEFINE's. Important for the upcoming
4462         Leopard.
4463         * configure: Regenerated.
4464         * include/private/gcconfig.h: Modified X86_64 define for Darwin.
4465         Removed __x86_64__ check in POWERPC section. Added base definitions
4466         for the X86_64 Darwin port.
4467         * include/private/gc_priv.h: Added GC_MACH_HEADER and GC_MACH_SECTION
4468         to distinguish between 32 and 64-bit applications. Added definitions
4469         for X86_64 Darwin.
4470         * darwin_stop_world.c: Added HAS_X86_THREAD_STATE64___RAX. And
4471         replaced HAS_I386_THREAD_STATE___EAX with HAS_X86_THREAD_STATE32___EAX.
4472         (GC_push_all_stacks): Added code for X86_64 Darwin. Even for the
4473         !DARWIN_DONT_PARSE_STACK. Maybe obsolete.
4474         * dyn_load.c (GC_dyld_name_for_hdr): Use GC_MACH_HEADER.
4475         (GC_dyld_image_add): Use GC_MACH_HEADER and GC_MACH_SECTION.
4476         Distinguish between getsectbynamefromheader_64 and
4477         getsectbynamefromheader.
4478         * os_dep.c (catch_exception_raise): Introduce exception definition for
4479         X86_64 Darwin. Replaced old i386_EXCEPTION_STATE_* definition with
4480         x86_EXCEPTION_STATE32_*. Add X86_64 for exc_state.faultvaddr.
4481
4482 2007-01-09  Andreas Tobler <a.tobler@schweiz.org>
4483
4484         * libtool.m4: Update to version from libtool-1.5.22.
4485         * ltmain.sh: Likewise.
4486         * ChangeLog: Created.
4487
4488 See doc/README.changes for earlier changes.