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