platform/upstream/libgc.git
12 years ago2009-09-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 14 Sep 2009 06:25:02 +0000 (06:25 +0000)]
2009-09-14  Ivan Maidanski <ivmai@mail.ru>
(ivmai136v2.diff)

* Makefile.direct: Copy missing information for -DSHORT_DBG_HDRS
from Makefile.
* Makefile: Remove the information about "define arguments" (which
is incomplete and outdated compared to that in Makefile.direct);
add help reference to Makefile.direct.
* Makefile.dj: Ditto.

12 years ago2009-09-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 14 Sep 2009 06:22:19 +0000 (06:22 +0000)]
2009-09-14  Ivan Maidanski <ivmai@mail.ru>
(ivmai135.diff)

* alloc.c (world_stopped_total_time, world_stopped_total_divisor):
Replace "STATIC" with "static" in the definition (since the
symbols aren't prefixed with "GC_").
* win32_threads.c (marker_sp, marker_bsp, marker_last_stack_min,
start_mark_threads, mark_mutex, builder_cv, mark_cv,
mark_mutex_event, signalObjectAndWait_func, main_thread_start):
Ditto.
* pthread_support.c (GC_wait_builder): Define as STATIC.
* win32_threads.c (GC_wait_builder): Ditto.

12 years ago2009-09-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 14 Sep 2009 06:18:02 +0000 (06:18 +0000)]
2009-09-14  Ivan Maidanski <ivmai@mail.ru>
(ivmai133.diff)

* misc.c (GC_get_heap_size_inner, GC_get_free_bytes_inner): New
API function.
* include/gc_pmark.h (GC_get_heap_size_inner,
GC_get_free_bytes_inner): New function declaration.

12 years ago2009-09-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 10 Sep 2009 20:15:38 +0000 (20:15 +0000)]
2009-09-10  Ivan Maidanski <ivmai@mail.ru>
(ivmai121.diff)

* include/gc.h: Recognize __CEGCC__ (as a synonym for _WIN32_WCE).
* include/gc_config_macros.h: Ditto.
* include/gc.h (GC_MAXIMUM_HEAP_SIZE): Recognize new macro.
* include/gc.h (GC_INIT_CONF_MAXIMUM_HEAP_SIZE): New macro (for
internal use).
* include/gc_config_macros.h: Always include stddef.h if GCC.
* include/gc_config_macros.h (GC_API): Define for CeGCC in the
same way as for MinGW.
* include/gc_config_macros.h (GC_API): Group the definition for
all cases together (check for GC_DLL only once).
* include/gc_pthread_redirects.h: Group non-Darwin code together.
* tests/test.c: Recognize GC_PRINT_VERBOSE_STATS (only if GC_DLL).

12 years ago2009-09-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 10 Sep 2009 20:13:03 +0000 (20:13 +0000)]
2009-09-10  Ivan Maidanski <ivmai@mail.ru>
(ivmai120a.diff, ivmai120b.diff)

* Makefile.direct (GC_PTHREADS_PARAMARK, GC_IGNORE_GCJ_INFO,
GC_PRINT_VERBOSE_STATS, GC_DONT_EXPAND, GC_INITIAL_HEAP_SIZE,
GC_FREE_SPACE_DIVISOR, GC_TIME_LIMIT, GC_FULL_FREQ): Add the
comment for.
* misc.c (GC_init_inner): Recognize GC_PRINT_VERBOSE_STATS (new
macro).
* dyn_load.c (GC_wnt): Change definition to TRUE for WinCE; add
FIXME and the comment for WinCE.
* gcj_mlc.c (GC_init_gcj_malloc): Recognize GC_IGNORE_GCJ_INFO
(new macro).
* include/gc.h (GC_HAVE_BUILTIN_BACKTRACE): Don't define for VC++
WinCE (since backtrace() is unimplemented).
* include/private/gc_priv.h (GC_n_heap_bases): Remove declaration
(since static).
* os_dep.c (GC_n_heap_bases): Define as STATIC; move the
definition to be above GC_is_heap_base().
* include/private/gcconfig.h: Don't define NOSYS for WinCE on ARM
(both for MinGW and CeGCC toolchains).
* include/private/gcconfig.h: Recognize __CEGCC__ and
__MINGW32CE__ (as synonyms for __WIN32_WCE).
* include/private/gcconfig.h: If SH4 then don't set config
parameters for SH.
* include/private/thread_local_alloc.h (GC_key_create): Don't
abort on failures, just return -1 in these cases (this also
prevents compilation error for targets where ABORT is defined
indirectly as an inline assembler sequence).
* mark.c (WRAP_MARK_SOME): Also define for WinCE; add FIXME for
the GCC-based cross-compiler.
* mark.c (ext_ex_regn, mark_ex_handler): Don't define unless
WRAP_MARK_SOME is defined; define also for WinCE case; don't
check for _WIN64 (since WRAP_MARK_SOME is undefined for it).
* mark.c (GC_mark_some): Use __try/__except also for WinCE; update
the comment.
* misc.c: Include signal.h after gc_pmark.h included; check for
MSWINCE instead of _WIN32_WCE.
* misc.c (GC_init_inner): Remove duplicate GC_setpagesize() call.
* misc.c: Don't include <crtdbg.h> for WinCE targets.
* misc.c (GC_write): Define _MAX_PATH if undefined (workaround for
CeGCC toolchain).
* misc.c (GC_write): Use OutputDebugStringW() instead of
_CrtDbgReport() for WinCE targets.
* os_dep.c (GC_least_described_address): Define as STATIC.
* os_dep.c (GC_register_data_segments): Fix code indentation.
* os_dep.c (GC_wince_get_mem): Initialize "result" local variable
(to prevent a compiler warning).
* os_dep.c (GC_dirty_init): Add comment for WinCE target.
* tests/test.c: Don't include winbase.h directly if GCC for WinCE,
include assert.h instead.
* tests/test.c (tiny_reverse_test): Define and use
TINY_REVERSE_UPPER_VALUE macro (4 if VERY_SMALL_CONFIG else 10);
useful for WinCE.
* win32_threads.c (GC_Thread_Rep): Don't declare "handle" field
for WinCE (since thread Id is used as a "real" thread handle).
* win32_threads.c (THREAD_HANDLE): New macro.
* win32_threads.c (GC_register_my_thread_inner): Don't recognize
DONT_IMPORT_GETCURTHREAD anymore; don't record thread handle on
WinCE.
* Makefile.direct (DONT_IMPORT_GETCURTHREAD): Remove comment for.
* win32_threads.c (UNPROTECT, GC_fault_handler_lock): Don't check
for MSWINCE.
* win32_threads.c (GC_delete_gc_thread, GC_delete_thread): Don't
close thread handle on WinCE (since it's a thread Id).
* win32_threads.c (GC_suspend): Don't check for MSWINCE in the
MPROTECT-related code (for the case if MPROTECT_VDB would be
implemented for WinCE).
* win32_threads.c (GC_suspend, GC_start_world, GC_push_stack_for):
Use THREAD_HANDLE(t) to obtain thread handle.
* win32_threads.c (GC_PTHREADS_PARAMARK): New macro recognized;
implicitly define GC_PTHREADS_PARAMARK if GC_PTHREADS; include
pthread.h; define NUMERIC_THREAD_ID(id) if undefined yet; replace
GC_PTHREADS with GC_PTHREADS_PARAMARK where appropriate (for the
parallel mark support).
* win32_threads.c (start_mark_threads): Use int type for "i" local
variable (instead of "unsigned") to prevent a compiler warning.
* win32_threads.c (start_mark_threads): Don't check CreateThread()
result for -1; call CloseHandle() for the handle created by
CreateThread() (on WinCE); don't use errno (since errno.h is
missing on some targets like WinCE) when printing warning on a
marker thread creation failure.
* win32_threads.c (signalObjectAndWait_func): Define for WinCE.
* win32_threads.c (GC_wait_marker): Remove unnecessary assertion
for non-zero signalObjectAndWait_func (to make the code compilable
for WinCE).
* win32_threads.c (GC_thr_init): Allow PARALLEL_MARK for WinCE;
use GC_sysinfo to get processors count if WinCE; don't check for
SignalObjectAndWait() if WinCE; replace GC_PTHREADS with
GC_PTHREADS_PARAMARK.
* win32_threads.c (GC_thr_init): Recognize GC_MIN_MARKERS new
macro (useful for testing parallel marking on WinCE).
* win32_threads.c (GC_win32_start, main_thread_start): Define as
STATIC.
* win32_threads.c: Don't define main_thread_args,
main_thread_start(), WinMain() for WinCE if GC_DLL.
* win32_threads.c (WINCE_MAIN_STACK_SIZE): Remove useless macro
(since the stack size parameter is ignored on WinCE).
* win32_threads.c (main_thread_start): Remove forward declaration;
place its definition before WinMain() one.
* win32_threads.c (WinMain): Abort if GC_CreateThread() or
WaitForSingleObject() failed (for the main thread).

12 years ago2009-09-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 10 Sep 2009 20:08:05 +0000 (20:08 +0000)]
2009-09-10  Ivan Maidanski <ivmai@mail.ru>
(diff118_cvs - superseding diff53)

* allchblk.c (MUNMAP_THRESHOLD): Move macro definition out of
a function.
* allchblk.c (GC_unmap_threshold): New global variable definition
(initialized to MUNMAP_THRESHOLD).
* allchblk.c (GC_unmap_old): Use GC_unmap_threshold instead of
MUNMAP_THRESHOLD; skip unmapping if GC_unmap_threshold is 0.
* doc/README.environment (GC_UNMAP_THRESHOLD): Add information.
* misc.c (GC_unmap_threshold): New variable declaration.
* misc.c (GC_init_inner): Recognize "GC_UNMAP_THRESHOLD"
environment variable to set GC_unmap_threshold value (only if
USE_MUNMAP).

12 years ago2009-09-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 10 Sep 2009 19:57:00 +0000 (19:57 +0000)]
2009-09-10  Ivan Maidanski <ivmai@mail.ru>
(diff117)

* dbg_mlc.c (OFN_UNSET): New macro (to detect
GC_register_finalizer() failures).
* dbg_mlc.c (store_old): Add a check for register_finalizer()
failure caused by an out-of-memory event (leave *ofn and *ocd
unmodified in that case).
* dbg_mlc.c (GC_debug_register_finalizer,
GC_debug_register_finalizer_no_order,
GC_debug_register_finalizer_unreachable,
GC_debug_register_finalizer_ignore_self): Initialize my_old_fn
to OFN_UNSET; clear *ocd and *ofn for non-heap objects (the same
as in GC_register_finalizer_inner()).

12 years ago2009-09-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 10 Sep 2009 19:53:07 +0000 (19:53 +0000)]
2009-09-10  Ivan Maidanski <ivmai@mail.ru>
(diff116a, diff116b, diff116c)

* Makefile.direct (GC_DLL): Add the comment for.
* doc/README.macros: Fix a typo.
* doc/README.macros (_DLL, GC_DLL, GC_NOT_DLL): Update info.
* doc/README.macros (__STDC__): Remove info.
* dbg_mlc.c (GC_get_back_ptr_info, GC_generate_random_heap_address,
GC_generate_random_valid_address, GC_print_backtrace,
GC_generate_random_backtrace, GC_register_describe_type_fn): Add
GC_API and GC_CALL to function definition.
* malloc.c (GC_generic_malloc): Ditto.
* mallocx.c (GC_incr_bytes_allocd, GC_incr_bytes_freed): Ditto.
* mark.c (GC_mark_and_push): Ditto.
* misc.c (GC_new_free_list_inner, GC_new_free_list,
GC_new_kind_inner, GC_new_kind, GC_new_proc_inner, GC_new_proc):
Ditto.
* include/gc_backptr.h (GC_get_back_ptr_info,
GC_generate_random_heap_address, GC_generate_random_valid_address,
GC_generate_random_backtrace, GC_print_backtrace): Add GC_API and
GC_CALL to function prototype.
* include/gc_mark.h (GC_mark_and_push, GC_new_free_list,
GC_new_free_list_inner, GC_new_kind, GC_new_kind_inner,
GC_new_proc, GC_new_proc_inner, GC_generic_malloc,
GC_register_describe_type_fn): Ditto.
* include/new_gc_alloc.h (GC_incr_bytes_allocd, GC_incr_mem_freed,
GC_generic_malloc_words_small): Ditto.
* gc_cpp.cc: Include "config.h" (if HAVE_CONFIG_H defined).
* include/private/gc_pmark.h: Ditto.
* include/private/gc_priv.h: Ditto.
* tests/test.c: Ditto.
* gc_cpp.cc: Define GC_BUILD.
* include/private/gc_pmark.h: Ditto.
* include/private/gc_priv.h: Ditto.
* gc_dlopen.c (WRAP_FUNC, REAL_FUNC): New macro.
* gc_dlopen.c (dlopen): Add GC_API to the wrapper function
definition.
* pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
GC_pthread_join, GC_pthread_detach, pthread_sigmask, pthread_join,
pthread_detach, pthread_create): Ditto.
* win32_threads.c (GC_pthread_join, GC_pthread_create,
GC_pthread_sigmask, GC_pthread_detach): Ditto.
* gc_dlopen.c (dlopen): Use WRAP_FUNC and REAL_FUNC macros.
* include/gc_backptr.h: Include "gc.h".
* include/gc_backptr.h: Use extern "C" for the exported functions.
* include/gc_mark.h: Ditto.
* include/gc_config_macros.h (GC_THREADS): Define the macro if any
GC_XXX_THREADS is defined.
* include/gc_config_macros.h (_PTHREADS, _POSIX4A_DRAFT10_SOURCE):
Move the definitions below the place where GC_NETBSD_THREADS and
GC_DGUX386_THREADS are defined.
* include/gc_config_macros.h (GC_DLL): Don't define (even if _DLL
is defined) for GCC.
* include/gc_config_macros.h (GC_API): Define for Cygwin (in the
same way as for VC++); define for GCC v4+ (other than already
recognized MinGW/Cygwin) as a "default" visibility attribute if
GC_DLL is defined.
* include/gc_config_macros.h (GC_ATTR_MALLOC, GC_ATTR_ALLOC_SIZE):
New macro.
* include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup,
GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign,
GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page,
GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
GC_debug_malloc_atomic, GC_debug_strdup,
GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn,
GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page,
GC_debug_malloc_replacement): Add GC_ATTR_MALLOC attribute.
* include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc,
GC_gcj_malloc_ignore_off_page): Ditto.
* include/gc.h (GC_malloc, GC_malloc_atomic,
GC_malloc_uncollectable, GC_malloc_stubborn,
GC_malloc_atomic_uncollectable, GC_malloc_ignore_off_page,
GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
GC_debug_malloc_atomic, GC_debug_malloc_uncollectable,
GC_debug_malloc_stubborn, GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page,
GC_debug_malloc_replacement: Add GC_ATTR_ALLOC_SIZE attribute
(for the first argument).
* include/gc_gcj.h (GC_gcj_malloc, GC_debug_gcj_malloc,
GC_gcj_malloc_ignore_off_page): Ditto.
* include/gc.h (GC_memalign, GC_realloc, GC_debug_realloc,
GC_debug_realloc_replacement): Add GC_ATTR_ALLOC_SIZE attribute
(for the second argument).
* include/gc.h (GC_malloc, GC_malloc_atomic, GC_strdup,
GC_malloc_uncollectable, GC_malloc_stubborn, GC_memalign,
GC_malloc_atomic_uncollectable, GC_free, GC_base, GC_size,
GC_realloc, GC_expand_hp, GC_set_max_heap_size,
GC_exclude_static_roots, GC_add_roots, GC_remove_roots,
GC_register_displacement, GC_debug_register_displacement,
GC_try_to_collect, GC_malloc_ignore_off_page,
GC_malloc_atomic_ignore_off_page, GC_debug_malloc,
GC_debug_malloc_atomic, GC_debug_strdup,
GC_debug_malloc_uncollectable, GC_debug_malloc_stubborn,
GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page, GC_debug_free,
GC_debug_realloc, GC_debug_malloc_replacement,
GC_debug_realloc_replacement, GC_finalization_proc,
GC_register_finalizer, GC_debug_register_finalizer,
GC_register_finalizer_ignore_self,
GC_debug_register_finalizer_ignore_self,
GC_register_finalizer_no_order,
GC_debug_register_finalizer_no_order,
GC_register_finalizer_unreachable,
GC_debug_register_finalizer_unreachable,
GC_register_disappearing_link,
GC_general_register_disappearing_link,
GC_unregister_disappearing_link, GC_noop1, GC_warn_proc,
GC_set_warn_proc, GC_ignore_warn_proc, GC_fn_type,
GC_call_with_alloc_lock, GC_stack_base_func,
GC_call_with_stack_base, GC_same_obj, GC_pre_incr, GC_post_incr,
GC_is_visible, GC_is_valid_displacement, GC_same_obj_print_proc,
GC_is_valid_displacement_print_proc, GC_is_visible_print_proc,
GC_malloc_many, GC_CreateThread, GC_beginthreadex,
GC_endthreadex): Comment out (or remove if single and meaningless)
function argument names (to avoid identifiers out of the name
space).
* include/gc_gcj.h (GC_init_gcj_malloc, GC_gcj_malloc,
GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Ditto.
* include/gc.h (GC_try_to_collect): Update the comment.
* include/gc.h (GC_size, GC_register_my_thread): Add const
qualifier for the argument referent.
* misc.c (GC_size): Ditto.
* pthread_support.c (GC_register_my_thread_inner,
GC_register_my_thread): Ditto.
* win32_threads.c (GC_register_my_thread_inner,
GC_register_my_thread): Ditto.
* include/gc.h (GC_INIT_CONF_ROOTS): New macro for internal use
(define instead of GC_INIT() for Cygwin and AIX).
* include/gc.h (GC_DONT_EXPAND, GC_MAX_RETRIES,
GC_FREE_SPACE_DIVISOR, GC_FULL_FREQ, GC_TIME_LIMIT, GC_IGNORE_WARN,
GC_INITIAL_HEAP_SIZE): Recognize new macro.
* include/gc.h (GC_INIT_CONF_DONT_EXPAND, GC_INIT_CONF_MAX_RETRIES,
GC_INIT_CONF_FREE_SPACE_DIVISOR, GC_INIT_CONF_FULL_FREQ,
GC_INIT_CONF_TIME_LIMIT, GC_INIT_CONF_IGNORE_WARN,
GC_INIT_CONF_INITIAL_HEAP_SIZE): New macro for internal use.
* include/gc.h (GC_INIT): Use GC_INIT_CONF_XXX macros.
* include/gc_mark.h: Prefix GC_H with '_'.
* include/gc_mark.h (GC_least_plausible_heap_addr,
GC_greatest_plausible_heap_addr, GC_debug_header_size): Use GC_API
for the public variable declaration.
* include/new_gc_alloc.h (GC_objfreelist_ptr, GC_aobjfreelist_ptr,
GC_uobjfreelist_ptr, GC_auobjfreelist_ptr): Ditto.
* include/gc_pthread_redirects.h (GC_pthread_create,
GC_pthread_sigmask, GC_dlopen, GC_pthread_join, GC_pthread_detach):
Use GC_API for the wrapper prototype.
* include/gc_pthread_redirects.h (pthread_create, pthread_join,
pthread_detach, pthread_sigmask, dlopen): Undefine unconditionally
before redirecting.
* include/new_gc_alloc.h: Replace GC_incr_mem_freed() with
GC_incr_bytes_freed(); remove FIXME.
* include/private/gc_priv.h (GC_make_closure,
GC_debug_invoke_finalizer, GC_noop): Remove GC_API for the private
function.
* tests/test.c (GC_print_stats): Handle GC_DLL case regardless of
the target.

12 years ago2009-09-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 10 Sep 2009 18:24:52 +0000 (18:24 +0000)]
2009-09-10  Ivan Maidanski <ivmai@mail.ru>
(diff115)

* finalize.c (GC_general_register_disappearing_link,
GC_register_finalizer_inner): Remove unnecessary "ifdef THREADS"
guard for LOCK/UNLOCK().
* finalize.c (GC_general_register_disappearing_link,
GC_register_finalizer_inner): Get GC_oom_fn value before releasing
the lock (to prevent data races).
* gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc,
GC_gcj_malloc_ignore_off_page): Ditto.
* mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.
* include/gc_inline.h (GC_FAST_MALLOC_GRANS): Use GC_get_oom_fn()
instead of GC_oom_fn (to prevent data races).
* malloc.c (GC_generic_malloc): Ditto.
* mallocx.c (GC_memalign): Ditto.
* pthread_support.c (pthread_create): Ditto.
* gcj_mlc.c (maybe_finalize): Acquire the lock before setting
last_finalized_no value to prevent data races.
* include/gc.h (GC_gc_no, GC_get_gc_no, GC_oom_fn, GC_set_oom_fn,
GC_set_find_leak, GC_set_finalize_on_demand,
GC_set_java_finalization, GC_set_finalizer_notifier,
GC_set_dont_expand, GC_set_full_freq, GC_set_non_gc_bytes,
GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries,
GC_set_dont_precollect, GC_set_time_limit, GC_warn_proc): Refine
the comment.
* misc.c (GC_set_oom_fn): Ditto.
* include/gc.h (GC_general_register_disappearing_link): Refine the
comment (replace "soft" word with "weak").
* misc.c (GC_oom_fn, GC_get_gc_no, GC_get_parallel,
GC_set_finalizer_notifier, GC_set_find_leak): Add the comment.
* misc.c (GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier,
GC_get_finalizer_notifier): Use LOCK/UNLOCK to prevent data races.

12 years ago2009-09-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 10 Sep 2009 18:15:46 +0000 (18:15 +0000)]
2009-09-10  Ivan Maidanski <ivmai@mail.ru>
(diff114a, diff114b, diff114c)

* dbg_mlc.c: Guard include <errno.h> with ifndef MSWINCE; include
"private/dbg_mlc.h" before it.
* malloc.c: Ditto.
* dbg_mlc.c (GC_debug_strdup): Use memcpy() instead of strcpy()
for WinCE (since deprecated); evaluate strlen() only once; don't
set errno for WinCE.
* malloc.c (GC_strdup): Ditto.
* dyn_load.c (GC_wnt): Define as macro (FALSE) for WinCE.
* include/gc.h (GC_unregister_my_thread): Refine the comment.
* include/gc.h (GC_uintptr_t, GC_beginthreadex, GC_endthreadex):
Don't declare for WinCE.
* include/gc.h (GC_WINMAIN_WINCE_LPTSTR): New macro (WinCE only).
* include/gc.h (GC_WinMain): Remove GC_API.
* include/gc.h (GC_WinMain): Use GC_WINMAIN_WINCE_LPTSTR for
lpCmdLine.
* tests/test.c (GC_WinMain): Ditto.
* win32_threads.c (main_thread_args, GC_WinMain): Ditto.
* include/gc_config_macros.h (ptrdiff_t): Guard with
ifndef _PTRDIFF_T_DEFINED; define _PTRDIFF_T_DEFINED macro.
* include/private/gc_locks.h: Guard include "atomic_ops.h" with
ifdef GC_PTHREADS (and not GC_WIN32_THREADS).
* mark.c: Include "atomic_ops.h" if PARALLEL_MARK.
* thread_local_alloc.c: Include "atomic_ops.h" if GC_GCJ_SUPPORT.
* win32_threads.c: Include "atomic_ops.h" if MPROTECT_VDB.
* include/private/gc_locks.h: Use include "atomic_ops.h" instead
of include <atomic_ops.h>.
* include/private/gc_priv.h: Ditto.
* include/private/gc_locks.h (GC_allocate_ml, GC_need_to_lock):
Don't export (replace GC_API to "extern").
* win32_threads.c (GC_allocate_ml): Don't export.
* include/private/gc_priv.h (DebugBreak): Define as macro for
WinCE (if not UNDER_CE and DebugBreak is not defined yet).
* include/private/gc_priv.h (UNALIGNED): Rename to UNALIGNED_PTRS
(since "UNALIGNED" is defined in winnt.h of WinCE).
* mark.c (UNALIGNED): Ditto.
* include/private/gcconfig.h (ARM32): Recognize _M_ARM and _ARM_.
* include/private/gcconfig.h (ALIGNMENT): Check always defined.
* include/private/gcconfig.h: Allow GC_WIN32_THREADS for WinCE.
* include/private/thread_local_alloc.h: Define USE_WIN32_SPECIFIC
for WinCE (since __declspec(thread) is unsupported).
* include/private/thread_local_alloc.h (TLS_OUT_OF_INDEXES):
Define for WinCE (if undefined).
* malloc.c (GC_malloc): Remove outdated comment about disabling
signals.
* misc.c: Don't include <tchar.h> (since not used anymore and may
break TEXT() macro defined in winnt.h).
* misc.c (GC_init_inner): Don't use GetModuleHandle() and
InitializeCriticalSectionAndSpinCount() for WinCE.
* misc.c (GC_init_inner): Replace GetModuleHandleA() with
GetModuleHandle() (and use TEXT() macro controlled by UNICODE).
* misc.c (LOG_FILE): Remove unused macro; don't use _T() macro.
* misc.c (GC_CreateLogFile): New static function (Win32/WinCE
only); move the code from GC_write(); replace GETENV() with
GetEnvironmentVariable(); replace CreateFileA() with
CreateFile(); use TEXT() macro (for Unicode support); replace
strcat() with memcpy() (since deprecated in WinCE).
* misc.c (GC_write): Define as STATIC.
* win32_threads.c (GC_attached_thread): Ditto.
* misc.c (GC_write): Use GC_CreateLogFile().
* misc.c: Define vsnprintf macro as StringCchVPrintfA for WinCE.
* misc.c (GC_abort): Try to invoke MessageBoxA() dynamically
(Win32 only) if DONT_USE_USER32_DLL is defined.
* misc.c (GC_abort): Duplicate msg to GC log file (for Win32 and
WinCE).
* misc.c (GC_abort): Use a more user-friendly abort if
NO_DEBUGGING (Win32 only).
* os_dep.c: Include "atomic_ops.h" only if MPROTECT_VDB (and
THREADS).
* os_dep.c (detect_GetWriteWatch): Use TEXT() for GetModuleHandle
(for Unicode support); check GetModuleHandle() result.
* tests/test.c: Don't define assert for WinCE (since may be
redefined by "assert.h" included from libatomic_ops).
* tests/test.c (FAIL): Define as ABORT for all targets (except
for PCR).
* tests/test.c (n_tests): Don't use AO_t.
* tests/test.c (check_heap_stats): Don't cast n_tests.
* tests/test.c (inc_int_counter): New function (for n_tests atomic
incrementation).
* tests/test.c (run_one_test): Test GC_memalign() for all targets.
* tests/test.c (run_one_test): Avoid unbalanced brackets in
#if-#else-#endif blocks.
* tests/test.c (run_one_test): Replace AO_fetch_and_add1() and
private LOCK/UNLOCK with GC_call_with_alloc_lock(inc_int_counter).
* tests/test.c (check_heap_stats): Replace
"if (sizeof(char *) > 4)" with "#if CPP_WORDSZ == 64" to suppress
"unreachable code" compiler warning.
* tests/test.c (WinMain): Set cmd type to LPWSTR (for WinCE
"UNDER_CE" mode); else use LPSTR type (for Win32 and WinCE).
* tests/test.c (thr_window): Replace "L" string prefix with
TEXT().
* thread_local_alloc.c: Check THREADS is defined (to prevent other
compiler errors and warnings otherwise).
* tests/test.c (WinMain): Recognize GC_NO_DLLMAIN macro (for
GC_use_DllMain()).
* Makefile.direct (GC_NO_DLLMAIN, DONT_IMPORT_GETCURTHREAD): Add
the comments for.
* win32_threads.c (GC_register_my_thread_inner): Recognize
DONT_IMPORT_GETCURTHREAD macro.
* win32_threads.c: Recognize GC_NO_DLLMAIN macro (to exclude
DllMain support if needed).
* win32_threads.c (GC_NO_DLLMAIN): Define implicitly if DllMain
thread registration is unsupported for a given configuration.
* win32_threads.c (GC_use_DllMain): Update the comment; refine
ABORT message.
* win32_threads.c (GC_use_DllMain,
GC_started_thread_while_stopped, GC_register_my_thread_inner,
GC_lookup_thread_inner, GC_delete_gc_thread,
GC_allow_register_threads, GC_lookup_pthread,
GC_push_thread_structures, GC_stop_world, GC_push_all_stacks):
Check for GC_NO_DLLMAIN.
* win32_threads.c (GC_Thread_Rep.tm_in_use, GC_attached_thread,
DllMain): Don't define if GC_NO_DLLMAIN.
* win32_threads.c (GC_stop_world): Declare "i" and "max" local
vars only if not GC_NO_DLLMAIN (to suppress compiler warning).
* win32_threads.c (GC_mark_thread, start_mark_threads): Use
CreateThread() instead of _beginthreadex() for WinCE.
* win32_threads.c (MARK_THREAD_STACK_SIZE, WINCE_MAIN_STACK_SIZE):
New macros defined (used by start_mark_threads(), WinMain()).
* win32_threads.c (GC_thr_init): Exclude parallel-specific code on
WinCE for now (since getenv(), GetProcessAffinityMask() and
SignalObjectAndWait() are missing on WinCE).
* win32_threads.c (GC_thr_init): replace GetModuleHandleA() with
GetModuleHandle(); replace CreateEventA() with CreateEvent(); use
TEXT() macro (for Unicode support).

12 years ago2009-09-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 10 Sep 2009 17:38:06 +0000 (17:38 +0000)]
2009-09-10  Ivan Maidanski <ivmai@mail.ru>
(diff113)

* include/gc.h (GC_has_static_roots_func): New typedef (user filter
callback).
* include/gc.h (GC_register_has_static_roots_callback): Use
GC_has_static_roots_func type.
* dyn_load.c (GC_has_static_roots,
GC_register_has_static_roots_callback): Ditto.
* dyn_load.c (GC_has_static_roots,
GC_register_has_static_roots_callback): Define on all platforms.
* dyn_load.c (GC_register_dynlib_callback,
GC_register_dynamic_libraries, GC_init_dyld): Replace K&R-style
functions definition with the ANSI C one.
* dyn_load.c (GC_register_dynlib_callback): Use new local variable
"callback" (initialized from GC_has_static_roots) to minimize data
races.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr,
GC_cond_add_roots): Define as STATIC.
* mark_rts.c (GC_remove_roots_inner): Ditto.
* dyn_load.c (GC_dyld_image_add): Don't call GC_add_roots() for
sections smaller than pointer size (just to avoid acquiring the
lock unnecessarily).
* dyn_load.c (GC_dyld_name_for_hdr): Define unconditionally (not
only for DARWIN_DEBUG).
* dyn_load.c (GC_dyld_image_add): Replace GC_add_roots() call with
LOCK + GC_add_roots_inner() + UNLOCK.
* dyn_load.c (GC_dyld_image_add): Call GC_has_static_roots() user
callback (if set) holding the lock; if it returns 0 then don't call
GC_add_roots_inner() for that region.
* dyn_load.c (GC_register_has_static_roots_callback): Put
"callback" value to GC_has_static_roots on all platforms.
* dyn_load.c (GC_has_static_roots): Update the comments.
* include/gc.h (GC_exclude_static_roots, GC_add_roots,
GC_remove_roots, GC_register_has_static_roots_callback): Ditto.
* include/private/gc_priv.h (struct roots): Ditto.
* include/private/gc_priv.h (GC_remove_roots_inner): Move prototype
to mark_rts.c and declare it as STATIC.
* include/private/gc_priv.h (GC_exclude_static_roots_inner): New
prototype.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Use
GC_exclude_static_roots_inner() instead of GC_exclude_static_roots.
* misc.c (GC_init_inner): Ditto.
* mark_rts.c (GC_exclude_static_roots_inner): New function (move
all the code from GC_exclude_static_roots(); add the comment.
* mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots_inner):
add alignment assertion for the lower bound; add assertion for the
lower bound to be less than the upper one.
* mark_rts.c (GC_add_roots_inner, GC_exclude_static_roots): Adjust
the upper bound (round down to be of a pointer-aligned value);
return in case of an empty range.
* mark_rts.c (GC_exclude_static_roots): Acquire the lock and call
GC_exclude_static_roots_inner().
* mark_rts.c (GC_remove_roots): Quickly check the bounds and return
in case of a do-nothing case (before acquiring the lock).

12 years ago2009-09-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 10 Sep 2009 17:30:19 +0000 (17:30 +0000)]
2009-09-10  Ivan Maidanski <ivmai@mail.ru>
(diff112)

* finalize.c (GC_fail_count): New external variable declaration.
* finalize.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested): New function declarations (if THREADS
only).
* finalize.c (GC_finalizer_nested, GC_finalizer_skipped): New
static global variables (used internally by GC_finalize() and
GC_check_finalizer_nested()).
* finalize.c (GC_check_finalizer_nested): New static function
definition (only if not THREADS, used internally by
GC_notify_or_invoke_finalizers() to minimize the probability of
a deep recursion when a client finalizer tries to allocate GC
memory).
* finalize.c (GC_finalize): Reset GC_finalizer_nested value (or
call GC_reset_finalizer_nested()) if last heap expansion failed.
* finalize.c (GC_notify_or_invoke_finalizers): Access GC_gc_no,
GC_finalizer_now, GC_finalize_on_demand, GC_finalizer_notifier,
last_finalizer_notification variables holding the lock (to avoid
data races).
* finalize.c (GC_finalizer_notifier): Add comment.
* finalize.c (GC_notify_or_invoke_finalizers): Add "quick" check
for an empty finalization queue (only if THREADS and not
KEEP_BACK_PTRS/MAKE_BACK_GRAPH).
* finalize.c (GC_notify_or_invoke_finalizers): Call
GC_check_finalizer_nested() and skip GC_invoke_finalizers() call
if appropriate.
* include/private/pthread_support.h (GC_Thread_Rep): Add unsigned
finalizer_nested and finalizer_skipped fields (for internal use
by the multi-threaded GC_check_finalizer_nested()).
* win32_threads.c (GC_Thread_Rep): Ditto.
* pthread_support.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested): New function definitions (the
multi-threaded variants of that in finalize.c).
* win32_threads.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested): Ditto.

12 years ago2009-09-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 10 Sep 2009 17:22:18 +0000 (17:22 +0000)]
2009-09-10  Ivan Maidanski <ivmai@mail.ru>
(diff103_cvs)

* alloc.c (GC_stopped_mark): Remove GC_log_printf("") (not needed
anymore and GCC produces a warning for it).
* alloc.c (GC_stopped_mark): Adjust printf argument type
specifier.
* backgraph.c: Include dbg_mlc.h before ifdef MAKE_BACK_GRAPH (for
the case when the configuration information comes from aconfig
file).
* checksums.c: Ditto (for gc_priv.h and CHECKSUMS, respectively).
* include/gc_allocator.h (GC_ATTR_UNUSED): Use "__unused__"
keyword instead of "unused".
* include/gc_allocator.h: Fix typos in comments.
* thread_local_alloc.c: Ditto.
* include/javaxfc.h (GC_finalize_all): Update comment.
* include/private/gc_priv.h (GC_API_PRIV): New macro (defined as
GC_API and serves only as a marker for the private but exported
symbols used by test.c only).
* include/private/gc_priv.h (GC_abort, GC_arrays, GC_is_marked,
GC_printf, GC_err_printf, GC_log_printf): Replace GC_API decl with
GC_API_PRIV one.
* include/private/gc_priv.h (GC_fo_entries): Don't export it
outside a DLL.
* include/private/gc_priv.h (GC_ATTR_FORMAT_PRINTF): New macro
designated to check the arguments correctness of printf-like
functions (currently works only for GCC v3+).
* include/private/gc_priv.h (GC_printf, GC_err_printf,
GC_log_printf): Use GC_ATTR_FORMAT_PRINTF attribute.

12 years ago2009-09-03 Hans Boehm <Hans.Boehm@hp.com> (really Loren J. Rittle)
hboehm [Thu, 3 Sep 2009 17:52:22 +0000 (17:52 +0000)]
2009-09-03  Hans Boehm <Hans.Boehm@hp.com> (really Loren J. Rittle)

* dyn_load.c (HAVE_DL_ITERATE_PHDR): Break definition from use.
Define for FreeBSD 7.0+.

12 years ago2009-09-02 Hans Boehm <Hans.Boehm@hp.com> (with help from Victor Ivrii and
hboehm [Thu, 3 Sep 2009 00:01:13 +0000 (00:01 +0000)]
2009-09-02  Hans Boehm <Hans.Boehm@hp.com> (with help from Victor Ivrii and
    others)

* mach_dep.c: Don't include ucontext.h with NO_GETCONTEXT.

12 years ago2009-08-19 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Thu, 20 Aug 2009 02:25:32 +0000 (02:25 +0000)]
2009-08-19  Hans Boehm <Hans.Boehm@hp.com>

* include/gc_gcj.h (GC_init_gcj_malloc): Improve descriptive
comment.

12 years ago2009-08-11 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Wed, 12 Aug 2009 00:42:01 +0000 (00:42 +0000)]
2009-08-11  Hans Boehm <Hans.Boehm@hp.com>
(Replacement for Ivan Maidanski's diff99_cvs.  Hopefully fixes
the same bugs, and then some.)

* allchblk.c (GC_merge_unmapped): Don't assume that adjacent
free blocks have different mapping status.  Correctly handle gap
between blocks.
(GC_split_block): Remove dead code setting hb_flags.  Add comment.
(GC_allochblk): Split blocks also in generational-only mode.
* os_dep.c (GC_unmap_gap): Dont really use munmap.

12 years ago2009-08-08 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Sun, 9 Aug 2009 01:34:50 +0000 (01:34 +0000)]
2009-08-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(Mistakenly omitted from last check-in)
* include/private/gc_priv.h (GC_unmapped_bytes): Define as 0 for
not USE_MUNMAP case.

12 years ago2009-08-07 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Sat, 8 Aug 2009 00:49:29 +0000 (00:49 +0000)]
2009-08-07  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
diff111 (supersedes diff101_cvs which, in turn, resembles diff52, diff75, diff83 partly)

* Makefile.direct (MARK_BIT_PER_OBJ, PRINT_BLACK_LIST,
USE_PROC_FOR_LIBRARIES): Fix typo in the comments.
* Makefile.direct (USE_MMAP, USE_MUNMAP, THREAD_LOCAL_ALLOC,
PARALLEL_MARK, STATIC): Update the comments.
* include/private/gcconfig.h (GC_PREFER_MPROTECT_VDB): New macro
recognized (only if MPROTECT_VDB).
* Makefile.direct (DONT_USE_USER32_DLL, GC_PREFER_MPROTECT_VDB):
Add the comments for.
* os_dep.c (detect_GetWriteWatch): Recognize "GC_USE_GETWRITEWATCH"
environment variable (only if MPROTECT_VDB, if the variable is
unset when GC_PREFER_MPROTECT_VDB macro controls the strategy).
* doc/README.environment (GC_USE_GETWRITEWATCH): New variable.
* include/private/gcconfig.h (MPROTECT_VDB): Add FIXME for
USE_MUNMAP and PARALLEL_MARK cases (to relax the conditions in
the future).
* misc.c (GC_get_heap_size, GC_get_free_bytes): Ignore the memory
space returned to OS (GC_unmapped_bytes).
* include/gc.h (GC_get_heap_size, GC_get_free_bytes): Update the
comments.
* misc.c (GC_get_unmapped_bytes): New API function.
* include/gc.h (GC_get_unmapped_bytes): New API prototype.
* include/private/gc_priv.h (GC_unmapped_bytes): Define as 0 for
not USE_MUNMAP case.
* os_dep.c (GC_dirty_init): Move "ifdef GWW_VDB" block out of
"ifdef MSWIN32" one (for Cygwin).

12 years ago2009-08-01 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Sat, 1 Aug 2009 18:01:22 +0000 (18:01 +0000)]
2009-08-01  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
diff100_cvs (diff51 and diff55, partly)

* pthread_support.c (GC_allow_register_threads): New API function.
        * win32_threads.c (GC_allow_register_threads): Ditto.
        * include/gc.h (GC_allow_register_threads): New API prototype.
        * include/gc.h (GC_register_my_thread, GC_unregister_my_thread):
        Update the comments.
        * pthread_support.c (GC_register_my_thread): Check the collector
        is in the multi-threaded mode.
        * win32_threads.c (GC_register_my_thread): Ditto.

12 years ago2009-07-10 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sat, 11 Jul 2009 00:59:57 +0000 (00:59 +0000)]
2009-07-10  Hans Boehm <Hans.Boehm@hp.com>

* finalize.c (GC_finalize_all): Always call GC_invoke_finalizers
instead, following Ivan's original patch.

12 years ago2009-06-20 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sat, 20 Jun 2009 20:24:43 +0000 (20:24 +0000)]
2009-06-20  Hans Boehm <Hans.Boehm@hp.com>

* allchblk.c (GC_allochblk_nth): Add assertion.
* checksums.c: Add GC_record_fault, GC_was_faulted,
CC_n_faulted_dirty_errors.
(GC_check_dirty): Remove register declarations, print
dirty bit errors on faulted pages.
* os_dep.c (GC_write_fault_handler): Call GC_record_fault().
* os_dep.c (GC_remove_protection): Compute index correctly.

12 years ago2009-06-12 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sat, 13 Jun 2009 01:06:54 +0000 (01:06 +0000)]
2009-06-12  Hans Boehm <Hans.Boehm@hp.com>

* include/gc_version.h, configure.ac, doc/README:
Change to version 7.2alpha3.
* configure: Regenerate.

12 years ago2009-06-12 Hans Boehm <Hans.Boehm@hp.com> gc7_2alpha2
hboehm [Sat, 13 Jun 2009 00:52:25 +0000 (00:52 +0000)]
2009-06-12  Hans Boehm <Hans.Boehm@hp.com>

* include/gc_version.h, configure.ac, doc/README:
Change to version 7.2alpha2.
* configure: Regenerate.

12 years ago2009-06-12 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
hboehm [Sat, 13 Jun 2009 00:00:06 +0000 (00:00 +0000)]
2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
diff98_cvs(resembling diff3, diff27, diff59, diff61, diff66,
diff73 partly)

        * dbg_mlc.c (GC_print_smashed_obj): Convert a group of printf()
        calls into a single one (for output atomicity).
        * typd_mlc.c (GC_calloc_explicitly_typed): Don't declare and use
        GC_finalization_failures variable; check the result of
        GC_general_register_disappearing_link() (for lack of memory)
        instead.
        * finalize.c (GC_finalization_failures): Remove unused global
        variable.
        * finalize.c (GC_general_register_disappearing_link,
        GC_general_register_disappearing_link): Don't update the value of
        GC_finalization_failures (since unused).
        * include/private/gc_pmark.h (PUSH_ONE_CHECKED_STACK,
        GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP): The first parameter is of
        word type now (as FIXUP_POINTER requires numeric argument).
        * finalize.c (GC_ignore_self_finalize_mark_proc): GC_PUSH_ONE_HEAP
        requires the first parameter of word type.
        * mark.c (PUSH_GRANULE): Ditto.
        * mark.c (GC_push_one, GC_push_all_eager): Ditto (for
        GC_PUSH_ONE_STACK).
        * finalize.c (GC_finalize_all): Call GC_invoke_finalizers() or
GC_finalizer_notifier directly, instead
        of GC_INVOKE_FINALIZERS() to prevent infinite looping.
* include/javaxfc.h: Clarify GC_finalize_all comment.
        * gcj_mlc.c: Include gc_pmark.h before "ifdef GC_GCJ_SUPPORT" (not
        after) for configuration information.
        * gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Add comment.
        * gcj_mlc.c (GC_gcj_malloc_ignore_off_page): Check "op" local
        variable for NULL before dereferencing it, return GC_oom_fn() in
        this case.
        * typd_mlc.c (GC_malloc_explicitly_typed,
        GC_malloc_explicitly_typed_ignore_off_page): Transform the code to
        suppress compiler warning (for uninitialized "lg" variable).

12 years ago2009-06-12 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Fri, 12 Jun 2009 22:54:39 +0000 (22:54 +0000)]
2009-06-12  Hans Boehm <Hans.Boehm@hp.com>

* win32_threads.c (GC_unregister_my_thread): add false assertion
in unreachable code.

12 years ago2009-06-12 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Fri, 12 Jun 2009 22:47:18 +0000 (22:47 +0000)]
2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)

diff97 (resembling diff43, diff51, diff67, diff76, diff83 partly)
        * pthread_support.c (GC_inner_start_routine): Don't release the
        GC lock between GC_register_my_thread_inner() and
        GC_init_thread_local() calls (post the "registered" even after
        calling GC_init_thread_local()).
        * win32_threads.c (GC_register_my_thread, GC_unregister_my_thread):
        Use GC_lookup_thread_inner() instead of GC_lookup_thread() and
        acquire the GC lock only once.
        * win32_threads.c (GC_thr_init): Call GC_register_my_thread_inner()
        directly instead of GC_register_my_thread() since I_HOLD_LOCK
        and our (main) thread is not registered yet (add assertion for it).
        * win32_threads.c (GC_init_parallel): Call GC_lookup_thread_inner()
        directly instead of GC_lookup_thread() (since I_HOLD_LOCK).
        * win32_threads.c (GC_lookup_thread): Remove unused function.
        * win32_threads.c: Remove "#error GC_DLL untested with Cygwin".
        * win32_threads.c (GC_win32_dll_threads): Define as FALSE macro
        also if THREAD_LOCAL_ALLOC or GC_PTHREADS.
        * win32_threads.c (GC_use_DllMain): Call ABORT also if GC_PTHREADS
        (for Cygwin).
        * win32_threads.c (GC_push_stack_for): Add parentheses around "&&"
        (inside GC_ASSERT) to prevent compiler warning.
        * win32_threads.c (GC_push_all_stacks): Remove FIXME for
        PARALLEL_MARK.
        * win32_threads.c (MAX_MARKERS, GC_markers): Move the definitions
        to a place before GC_get_next_stack().
        * win32_threads.c (marker_sp, marker_bsp): New static arrays (same
        as in pthread_support.c).
        * win32_threads.c (marker_last_stack_min): New static arrays (the
        same semantics as for last_stack_min of GC_Thread_Rep).
        * win32_threads.c (GC_get_next_stack): Handle marker threads.
        * win32_threads.c (GC_mark_thread): Save the current stack pointer
        to marker_[b]sp.
        * win32_threads.c (start_mark_threads): Initialize
        marker_last_stack_min elements (to "unset" value).

12 years ago2009-06-12 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Fri, 12 Jun 2009 22:06:47 +0000 (22:06 +0000)]
2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff96_cvs, partly from diff45 and diff75)

        * misc.c (GC_set_oom_fn, GC_set_all_interior_pointers,
        GC_set_finalize_on_demand, GC_set_java_finalization,
        GC_set_finalizer_notifier, GC_set_dont_expand, GC_set_full_freq,
        GC_set_no_dls, GC_set_free_space_divisor, GC_set_max_retries,
        GC_set_dont_precollect, GC_set_time_limit, GC_set_warn_proc):
        Change return type to void (these API functions no longer return
        the old value).
        * include/gc.h: Ditto (for prototypes).
        * tests/test.c (main, WinMain, test): Remove explicit cast to void
        for GC_set_warn_proc().
        * misc.c (GC_get_oom_fn, GC_get_all_interior_pointers,
        GC_get_finalize_on_demand, GC_get_java_finalization,
        GC_get_finalizer_notifier, GC_get_dont_expand, GC_get_full_freq,
        GC_get_no_dls, GC_get_free_space_divisor, GC_get_max_retries,
        GC_get_dont_precollect, GC_get_time_limit, GC_get_warn_proc): New
        API functions (to get the current value of the corresponding R/W
        public variables).
        * include/gc.h: Ditto (for prototypes).
        * include/gc.h (GC_set_warn_proc, GC_set_free_space_divisor):
        Update the comment.
        * misc.c (GC_ignore_warn_proc): New API call-back function.
        * include/gc.h (GC_ignore_warn_proc): Ditto (for the prototype).
        * misc.c (GC_set_find_leak, GC_get_find_leak, GC_set_non_gc_bytes,
        GC_get_non_gc_bytes): New API setter and getter functions (for the
        public GC_find_leak and GC_non_gc_bytes variables, respectively).
        * include/gc.h: Ditto (for prototypes).
        * include/gc.h (GC_memalign): Add proto to GC API.
        * mallocx.c (GC_memalign): Use GC_API, GC_CALL for the definition.
        * tests/test.c (run_one_test): Test GC_memalign() on Win32 too,
        remove GC_memalign() proto.
        * misc.c (GC_write): Use multi-byte (A) variants of Win32
        GetModuleFileName() and CreateFile().
  * tests/test.c (main): Replace K&R-style function definition with the
  ANSI C one.

12 years ago2009-06-12 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski and George Talbot)
hboehm [Fri, 12 Jun 2009 18:59:14 +0000 (18:59 +0000)]
2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski and George Talbot)
(diff95_cvs)
* include/private/gcconfig.h (PLATFORM_ANDROID): New macro
        recognized (for Linux on ARM32 without glibc).
        * include/private/gcconfig.h (STRTOULL): Define for all targets
        (define as "strtoul" for most targets except for LLP64/Win64).
        * misc.c (GC_init_inner): Use STRTOULL instead of atoi/atol()
        (cast the result to word type) to decode values of "GC_TRACE",
        "GC_INITIAL_HEAP_SIZE", "GC_MAXIMUM_HEAP_SIZE" environment vars.

12 years ago2009-06-12 Hans Boehm <Hans.Boehm@hp.com> (Really mostly George Talbot)
hboehm [Fri, 12 Jun 2009 18:28:03 +0000 (18:28 +0000)]
2009-06-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly George Talbot)
* include/gc_allocator.h: Add gc_allocator_ignore_off_page.
* tests/test_cpp.cc: Add call to gc_allocator_ignore_off_page.

12 years ago2009-06-11 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Fri, 12 Jun 2009 06:33:10 +0000 (06:33 +0000)]
2009-06-11  Hans Boehm <Hans.Boehm@hp.com>
* win32_threads.c (GC_release_mark_lock): Correct misspelling of
AO_load in assertion.

2009-06-11  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
(diff93_cvs: resembling diff27, diff30, diff43, diff44, diff66,
diff76, diff79, diff83 partly)

        * win32_threads.c (MAX_THREADS): Define as 1 if GC_win32_dll_threads
        is defined as FALSE (otherwise the size of dll_thread_table is near
        200 KiB for 32-bit).
        * win32_threads.c (GC_use_DllMain): Optimize for THREAD_LOCAL_ALLOC.
        * win32_threads.c (GC_Thread_Rep): Add backing_store_end and
        backing_store_ptr fields for IA64 support.
        * win32_threads.c (GC_register_my_thread_inner): Set
        backing_store_end field to reg_base value for IA64 (same as in
        pthread_support.c).
        * win32_threads.c (SET_PTHREAD_MAP_CACHE): Put parentheses in the
        "right" places, remove ';'.
        * win32_threads.c (GC_fault_handler_lock): Declare only
        if MPROTECT_VDB (and not WinCE).
        * win32_threads.c (GC_suspend): Acquire and release
        GC_fault_handler_lock only if MPROTECT_VDB (and not WinCE).
        * win32_threads.c (GC_suspend): Define as STATIC.
        * win32_threads.c (GC_push_stack_for): Fix WARN() format specifier
        (should be word-complient, "%p" is used w/o "0x"), don't cast sp.
        * win32_threads.c (GC_push_all_stacks): Convert a group of printf()
        calls into a single one (for output atomicity).
        * win32_threads.c (GC_get_next_stack): Unprotect thread descriptor
        before altering its last_stack_min ("thread" variable is added).
        * win32_threads.c (GC_get_next_stack): Remove unnecessary checks for
        "s" is non-NULL.
        * win32_threads.c (GC_get_next_stack): Don't call GC_may_be_in_stack
        if WinCE.
        * win32_threads.c (GC_get_next_stack): Pass current_min value to
        GC_get_stack_min as-is (without -1).
        * win32_threads.c (GC_wait_marker): Remove FIXME and use "release"
        version of AO_fetch_and_sub1().
        * win32_threads.c (GC_win32_start_inner, GC_win32_start): convert int
        to pointer (and vice verse) thru word type to suppress warnings.
* win32_threads.c (GC_mark_mutex_waitcnt): Fix comment, always
access atomically.
* misc.c: Change GC_THREADS tests back to THREADS.

2009-06-11  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff92_cvs: resembling diff20, diff27, diff34, diff38, diff43, diff45,
diff46, diff56, diff60, diff62, diff74, diff75, diff81 partly)

        * allchblk.c (GC_print_hblkfreelist, GC_dump_regions): Convert
        a group of printf() calls into a single one (for output atomicity).
        * include/gc.h (GC_set_all_interior_pointers, GC_set_full_freq,
        GC_set_time_limit): New prototypes.
        * misc.c (GC_set_all_interior_pointers, GC_set_full_freq,
        GC_set_time_limit): New public setter/getter functions.
        * include/gc.h: Fix (and remove outdated) comments for thread-local
        allocation.
        * include/gc.h: Fix typos in comments.
        * misc.c (GC_init_inner, GC_printf): Ditto.
        * include/gc.h (GC_unregister_disappearing_link): Refine comment.
        * include/gc.h (GC_stack_base): Recognize _M_IA64 macro.
        * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
        GC_bytes_allocd_at_reset, DEGRADE_RATE): Define only if THREADS.
        * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
        GC_bytes_allocd_at_reset): Define as STATIC.
        * misc.c (GC_get_heap_size, GC_get_free_bytes,
        GC_get_bytes_since_gc, GC_get_total_bytes): Acquire the GC lock to
        avoid data races.
        * misc.c (GC_write_cs): Define only if THREADS (Win32/WinCE only).
        * misc.c (GC_init_inner): Initialize GC_write_cs only if THREADS.
        * misc.c (GC_init_inner): Use GC_INITIAL_HEAP_SIZE (if available) to
        set the default initial value of initial_heap_sz.
        * misc.c (GC_deinit): Destroy GC_write_cs only if THREADS.
        * misc.c (GC_init_inner): Fix WARN() format specifier (should be
        word-complient, "%p" is used w/o "0x").
        * misc.c (GC_init_inner): Don't recognize "GC_PAUSE_TIME_TARGET"
        environment variable if SMALL_CONFIG.
        * misc.c (GC_init_inner): Recognize "GC_FULL_FREQUENCY" environment
        variable to set initial GC_full_freq value (if not SMALL_CONFIG).
        * doc/README.environment (GC_FULL_FREQUENCY): Add information.
        * doc/README.environment (GC_MARKERS): Refine information.
        * misc.c (GC_init_inner): Change GC_ASSERT to GC_STATIC_ASSERT where
        possible.
        * misc.c (IF_NEED_TO_LOCK): New macro (instead of GC_need_to_lock).
        * misc.c (GC_write): Use IF_NEED_TO_LOCK for handling GC_write_cs.
        * misc.c (GC_abort): Don't define if SMALL_CONFIG.
        * misc.c (GC_abort): Directly use WRITE() instead of GC_err_printf()
        (to prevent possible infinite recursion).

2009-06-09  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
diff90_cvs (resembling diff28, diff30, diff32, diff34, diff47,
diff49, diff60, diff62, diff66, diff67, diff68, diff72 partly)

        * finalize.c (finalization_mark_proc): Replace K&R-style declaration
        with ANSI C one.
        * finalize.c (GC_grow_table, GC_register_finalizer_inner,
        GC_enqueue_all_finalizers): Remove outdated comments about disabling
        signals.
        * finalize.c (GC_general_register_disappearing_link): Fix assertion
        to catch NULL "obj" value.
        * finalize.c (GC_unregister_disappearing_link): Check "link"
        alignment before gaining the lock.
        * finalize.c (GC_finalize): Refine comment.
        * finalize.c (GC_finalize): Fix WARN() format specifier (should be
        word-complient, "%p" is used w/o "0x").
        * finalize.c (GC_invoke_finalizers): Initialize "bytes_freed_before"
        variable (to 0) to suppress compiler warning.
        * include/gc_gcj.h (MARK_DESCR_OFFSET): Move to private/gc_pmark.h.
        * include/gc_gcj.h: add "extern C" header and tail.
        * include/private/gc_pmark.h: Remove GC_do_parallel_mark(),
        GC_help_wanted, GC_helper_count, GC_active_count declarations (move
        the comments to the place where these symbols are defined in mark.c).
        * mark.c: Add STATIC GC_do_parallel_mark() declaration (for use by
        GC_mark_some_inner, if PARALLEL_MARK only).
        * mark.c (GC_mark_some_inner, GC_help_wanted, GC_helper_count,
        GC_active_count, GC_do_parallel_mark): Define as STATIC.
        * pthread_support.c (GC_mark_thread): Ditto.
        * typd_mlc.c (GC_explicit_typing_initialized, GC_explicit_kind,
        GC_array_kind, GC_ext_descriptors, GC_ed_size, GC_avail_descr,
        GC_typed_mark_proc_index, GC_array_mark_proc_index, GC_eobjfreelist,
        GC_arobjfreelist): Ditto.
        * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Change GC_ASSERT
        for HBLKSIZE to GC_STATIC_ASSERT.
        * mark.c (GC_noop): Define for Borland C the same as for Watcom.
        * mark.c (GC_noop, GC_mark_and_push): Add ARGSUSED tag.
        * pthread_support.c (GC_do_blocking_inner): Ditto.
        * mark.c (GC_mark_from): Initialize "limit" (to 0) in the default
        switch branch to suppress compiler warning.
        * mark.c (GC_return_mark_stack): Append new-line to printf message.
        * mark.c: Remove unused GC_true_func(), GC_PUSH_ALL().
        * pthread_support.c (GC_mark_thread): Add dummy "return 0" to
        suppress compiler warning.
        * pthread_support.c (start_mark_threads): Move the code limiting
        "GC_markers" value (and printing a warning) to GC_thr_init().
        * pthread_support.c (GC_thr_init): Silently limit "GC_markers" value
        if based on the number of CPUs.
        * pthread_support.c (GC_thr_init): Treat incorrect "GC_markers"
        values as one.
* pthread_support.c (GC_register_my_thread_inner): Add a check for
"stack_end" is non-NULL (the same as in win32_threads.c).
* pthread_support.c (pthread_create): Call GC_oom_fn before giving up
with ENOMEM.
* thread_local_alloc.c (return_single_freelist): Convert "for" loop
to "while" one to suppress "possible extraneous ';'" warning.

2009-06-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski
and Zoltan Varga)
        * darwin_stop_world.c (GC_push_all_stacks): Recognize ARM32.
        * include/private/gc_priv.h (GC_THREAD_STATE_T): Define for ARM32
        (Darwin only).
        * include/private/gcconfig.h: Add machine-specific part for DARWIN.
        * include/private/gcconfig.h (ARM32): Define config parameters for
        DARWIN (iPhone).

2009-06-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff91_cvs: resembling diff3, diff27, diff33, diff45, diff47, diff49,
diff60, diff67, diff68 partly)
* alloc.c (GC_FULL_FREQ, GC_DONT_EXPAND, GC_FREE_SPACE_DIVISOR,
        GC_TIME_LIMIT): New macros (used to control the default initial
        values of GC_full_freq variable, GC_dont_expand,
        GC_free_space_divisor, GC_time_limit respectively).
        * include/private/gc_priv.h (TIME_LIMIT): Remove macro (replaced
        with GC_TIME_LIMIT in alloc.c).
        * alloc.c (GC_need_full_gc, GC_stopped_mark, GC_finish_collection):
        Define as STATIC.
        * mark_rts.c (GC_push_current_stack, GC_push_gc_structures): Ditto.
        * include/private/gc_priv.h (GC_stopped_mark, GC_finish_collection):
        Move the prototypes to alloc.c, make STATIC.
        * include/private/gc_priv.h (GC_push_current_stack,
        GC_push_gc_structures, GC_push_regs_and_stack): Remove prototypes
        (move the comments to the places where these functions are defined).
        * mach_dep.c (GC_push_regs_and_stack): Move to mark_rts.c and define
        as STATIC.
        * alloc.c (GC_timeout_stop_func, GC_stopped_mark,
        GC_print_heap_sects): Convert a group of printf() calls into
        a single one (for output atomicity).
        * mark_rts.c (GC_print_static_roots): Ditto.
        * alloc.c (GC_stopped_mark): Output blank line (when logging) for
        convenience to delimit collections.
        * alloc.c (GC_clear_a_few_frames): Rename NWORDS to CLEAR_NWORDS;
        make "frames" local variable volatile (to prevent optimization).
        * alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
        GC_finish_collection, GC_allocobj): Remove outdated comments about
        disabling signals.
        * include/private/gc_priv.h (GC_register_displacement_inner,
        GC_gcollect_inner): Ditto.
        * alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
        GC_finish_collection): Initialize "start_time" local variable (to 0)
        to suppress compiler warning.
        * mark_rts.c (GC_add_roots_inner): Ditto (for "old" variable).
        * alloc.c (GC_RATE, MAX_PRIOR_ATTEMPTS): Guard with "ifndef".
        * include/private/gc_priv.h (clock, GC_stop_world, GC_start_world,
        GC_acquire_mark_lock, GC_release_mark_lock, GC_notify_all_builder,
        GC_wait_for_reclaim, GC_notify_all_marker, GC_wait_marker): Replace
        K&R-style function prototypes with ANSI C one.
        * include/private/gc_priv.h (ABORT): Define as DebugBreak() for
        Win32/WinCE if SMALL_CONFIG (the same as in GC_abort()).
        * include/private/gc_priv.h (ROUNDED_UP_WORDS, abs): Remove unused
        macros.
        * include/private/gc_priv.h (GC_noop): Declare for Borland C the
        same as for Watcom.
        * mark_rts.c (GC_push_conditional_with_exclusions): Add ARGSUSED tag.

2009-06-04  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff89_cvs, resembling diff3, diff27, diff34, diff38, diff47, diff49,
diff59, diff60, diff66, diff67, diff68, diff69a, diff70, diff81
partly)
        * dbg_mlc.c (GC_store_debug_info, GC_store_debug_info_inner): Remove
        outdated comment about disabling signals.
        * mallocx.c (GC_malloc_uncollectable,
        GC_malloc_atomic_uncollectable): Ditto.
        * os_dep.c: Ditto.
        * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change):
        Add ARGSUSED tag.
        * pthread_stop_world.c (GC_suspend_handler,
        GC_suspend_handler_inner): Ditto.
        * dbg_mlc.c (GC_debug_free, GC_debug_realloc): Fix printf message.
        * dbg_mlc.c (GC_debug_realloc): Set "result" to NULL in the default
        switch branch to suppress compiler warning.
        * dyn_load.c (GC_init_dyld): Use ABORT() instead of GC_abort().
        * include/private/darwin_semaphore.h (sem_init): Ditto.
        * include/javaxfc.h: Replace "GC_H" with "_GC_H".
        * include/private/dbg_mlc.h (GC_has_other_debug_info,
        GC_store_debug_info): Replace K&R-style function prototypes with ANSI
        C one.
        * include/private/gcconfig.h (GC_FreeBSDGetDataStart, real_malloc,
        GC_win32_get_mem, GC_wince_get_mem, GC_unix_get_mem): Ditto.
        * include/private/pthread_support.h (GC_stop_init): Ditto.
        * include/private/gcconfig.h: Refine comment about setting
        GC_stackbottom.
        * include/private/gcconfig.h (FIXUP_POINTER): Put parentheses in the
        "right" places.
        * include/private/pthread_support.h (GC_Thread_Rep): Refine comment
        for "stack_end" field.
        * mallocx.c (GC_malloc_uncollectable,
        GC_malloc_atomic_uncollectable): Remove cast to undefined "hbklk".
        * os_dep.c (GC_USE_MEM_TOP_DOWN): New macro (for setting
        GC_mem_top_down to MEM_TOP_DOWN for debug purposes).
        * os_dep.c (GC_gww_read_dirty, catch_exception_raise): Fix WARN()
        format specifier (should be word-compliant, "%p" is used w/o "0x").
        * pthread_stop_world.c (GC_suspend_handler_inner): Ditto.
        * os_dep.c (GC_dirty_init): Append new-line to printf messages.
        * os_dep.c (GC_mprotect_thread): Fix GC_err_printf message.
        * os_dep.c (GC_save_callers): Change GC_ASSERT to GC_STATIC_ASSERT.
        * pthread_stop_world.c (GC_retry_signals, GC_suspend_ack_sem): Define
        as STATIC.
        * pthread_stop_world.c (GC_push_all_stacks): Add assertion for that
        "thread_blocked" is not set for the current thread.
        * real_malloc.c: Add "extern GC_quiet" to suppress compiler warning.
        * reclaim.c (GC_reclaim_all): Initialize "start_time" (to 0) to
        suppress compiler warning.

2009-06-02  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(adding last bit of diff86_cvs)
* tests/test.c (check_heap_stats): Avoid unbalanced brackets in ifdef.

2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff26)
* win32_threads.c: restructure parallel marking mutex intialization.
* win32_threads.c, alloc.c, darwin_stop_world.c, mallocx.c, mark.c,
pthread_stop_world.c, pthread_support.c: Add runtime conditions
on GC_parallel were appropriate.
* pthread_support.c: Condition marker_bsp on ia64.
(GC_segment_is_thread_stack): Fix loop upper bound.
* reclaim.c: Limit some assertions to PARALLEL_MARK.
* pthread_support.c: Don't acquire mark lock for thread-local
allocation.
* include/private/gc_priv.h: Don't define parallel mark sync
support just for THREAD_LOCAL_ALLOC.

2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff39)
* include/private/gcconfig.h: refine MINGW32 test.
* mark.c: Add win64/gcc tests.

2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff86_cvs, resembling diff28, diff32, diff33, diff38, diff68 partly)
* test.c (fork_a_thread, reverse_test, alloc8bytes, tree_test,
        typed_test, run_one_test, check_heap_stats, main, test): Replace
        all K&R-style function definitions with ANSI C ones.
        * trace_test.c (main): Ditto.
        * test.c (GC_COND_INIT): Define as GC_INIT() also in case of
        THREAD_LOCAL_ALLOC.
        * test.c (reverse_test): Call fork_a_thread() only if GC_PTHREADS
        or GC_WIN32_THREADS; remove fork_a_thread() macros definition.
        * test.c (reverse_test): Use "volatile" when clearing "b" and "c"
        local variables (to suppress "assigned value is never used"
        compiler warning).
        * test.c (tree_test): Use public GC_noop1() instead of private
        GC_noop().
        * test.c (typed_test): Ditto.
        * test.c (check_heap_stats): Define and assign value to
        "late_finalize_count" local variable only if its value is used
        (if FINALIZE_ON_DEMAND defined).
        * test.c (main): Remove DJGPP-specific initialization of
        GC_stackbottom (not needed anymore, handled in gcconfig.h).
        * trace_test.c: Guard #define GC_DEBUG with #ifndef.
        * trace_test.c: Include "gc_backptr.h".
        * trace_test.c (main): Call GC_INIT().
        * trace_test.c (main): Add "return 0" statement.

2009-05-25  Hans Boehm <Hans.Boehm@hp.com> (Really Petter Urkedal)
* dyn_load.c (GC_register_dynlib_callback): Use new index j
instead of i in the inner loop.

2009-05-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff85)
* tests/test.c: Increment n_tests with fetch_and_add when possible,
avoiding need to export lock.

2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff63,diff65)
* include/gc_pthread_redirects.h:
- dlfcn.h is included for dlopen() proto before undefining
"dlopen" (so, it's possible now to include dlfcn.h after
gc.h from user code);
- GC_dlopen() proto is added (except for Darwin as
it's missing there);
- "dlopen" is explicitly undefined (before its redefinition).
* include/gc.h:
- "process.h" is included besides "windows.h"
(for _beginthreadex/_endthreadex); win32 only.
- GC_NO_THREAD_DECLS is moved to the right place
(before closing "extern C").
* pthread_support.c: Fix out of memory handling for Thread_Reps.
* win32_threads.c: Don't include process.h on winCE,
improve out of memory handling for thread structures, dont
define GC_beginthreadex and GC_endthreadex for winCE.

2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff71)
* tests/test.c: Change gcj vtable decriptor type from size_t to
GC_word.

2009-05-22  Hans Boehm <Hans.Boehm@hp.com>
* gcj_mlc.c: Add comment.
* tests/test.c: Change NTEST to NTHREADS.  Fork 5 threads by default.
Run reverse_test a second time in each thread.Add comments.
Dont rely on AO_fetch_and_add.

2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Largely from Ludovic Cortes)
* dyn_load.c (GC_register_dynlib_callback,
GC_register_dynamic_libraries_dl_iterate_phdr): Add support
for GNU_PT_RELRO relocations.

2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff61)
* Makefile, Makefile.direct: GC_SOLARIS_PTHREADS was replaced
by GC_SOLARIS_THREADS.
* include/gc.h: Improve finalizer documentation.
* mips_sgi_mach_dep.s: Replace _MIPS_SIM_ABI32 with _ABIO32.
* pthread_stop_world.c, Makefile.dj: Fix typos.

2009-05-21  Hans Boehm <Hans.Boehm@hp.com>
* win32_threads.c (GC_new_thread): Make first_thread
visible to the whole file.
(UNPROTECT): New macro.
(GC_push_stack_for, GC_suspend, GC_start_world): unprotect
thread structures before writing.
(GC_suspend): Acquire GC_fault_handler_lock before suspending
thread.
* os_dep.c: export GC_fault_handler_lock.
(GC_remove_protection): Check if already unprotected.

2009-05-20  Hans Boehm <Hans.Boehm@hp.com> (really Ivan Maidanski)
* doc/README.win32: Add OpenWatcom warning.
* include/private/gcconfig.h: Really check it in.

2009-05-19  Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidanski, Dave Korn)
* os_dep.c (GC_get_stack_base, windows): Replace with Dave Korn's
code from gcc version.
* os_dep.c: make gc compilable (optionally) for Cygwin with
GetWriteWatch-based virtual dirty bit implementation ("os_dep.c" file).
* os_dep.c: Make non-win32 GC_write_fault_handler STATIC.
* mark.c (GC_noop): fix declaration definition mismatch for DMC.
* include/private/gcconfig.h: Enable MPROTECT_VDB and GWW_VDB for
Watcom (Win32 only).  It works.

and GWW_VDB.  It works.

2009-05-07  Hans Boehm <Hans.Boehm@hp.com> and Mark Sibly
* mach_dep.c: Don't use __builtin_unwind_init for register
state on PowerPC/Darwin.

2009-04-24  Hans Boehm <Hans.Boehm@hp.com>
* doc/gcdescr.html: Improve description of object freelist
structure.
* include/private/gc_priv.h: Fix comment for _size_map.

2009-03-16  Hans Boehm <Hans.Boehm@hp.com>
* os_dep.c (GC_linux_stack_base): Relax sanity test.

2009-03-11  Hans Boehm <Hans.Boehm@hp.com>  (Really Ivan Maidanski)
* include/private/gc_pmark.h (PUSH_CONTENTS_HDR for
MARK_BIT_PER_OBJ): Add missing backslash before eoln.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
* misc.c (GC_set_warn_proc): Implicitly intialize GC on
non-Cygwin win32.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Petr Krajca)
* configure.ac: Enable thread-local allocation for sparc-linux.
* configure: Regenerate.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* alloc.c (GC_try_to_collect): Remove duplicate initialization
check.
* malloc.c (GC_generic_malloc): Remove lw to eliminate single-
threaded warnings.
* mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidansky)
* allchblk.c, backgraph.c, dbg_mlc.c, dyn_load.c,
finalize.c, include/private/gc_pmark.h, malloc.c, mark.c,
os_dep.c, pthread_stop_world.c, pthread_support.c, reclaim.c,
thread_local_alloc.c.
* misc.c: Refine comment.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
* os_dep.c: Define GC_GWW_BUF_LEN more intelligently.  Add FIXME
comment.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (With input from Ivan Maidansky)
* win32_threads.c (GC_push_stack_for): Yet another attempt
at the stack_min finding logic.  Try to clean up the existing code
while minimizing VirtualQuery calls.
(GC_win32_start_inner): Register thread before GC_printf.
Produce more output with DEBUG_THREADS.
*include/gc.h: Update obsolete comments.

2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* tests/test.c:
(gcj_class_struct2): Use cast instead of l suffix.
Cast GetLastError to int in various places.
Avoid unused result warning from incr/decr macros.
Add cast for fake_gcj_mark_proc.
Cast GC_gc_no to unsigned in printf.

2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* include/gc.h: Fix two typos in comments.

2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* finalize.c: Fix typo in comment.

2008-12-03  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* blacklst.c (GC_print_source_pointer): Don't call GC_print_heap_obj
with lock.

2008-12-01  Hans Boehm <Hans.Boehm@hp.com>
* reclaim.c: (GC_reclaim_block): Scan even nearly full blocks
if we are checking for leaks.

2008-11-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
* win32_threads.c: Remove mark lock spinning.
* win32_threads.c, pthread_support.c: Update GC_unlocked_count,
GC_spin_count, and GC_block_count using atomic operations.
* tests/test.c: Declare n_tests as AO_t only if we have threads.

2008-11-11  Hans Boehm <Hans.Boehm@hp.com>
(Really almost entirely Ivan Maidansky)
* win32_threads.c: Support PARALLEL_MARK.  Make printf arg
types agree with format specifiers.  Add missing copyright header.
Add STATIC for GC_threads.
* include/private/gcconfig.h: Add FIXME comment.
* tests/test.c (run_ine_test): Replace LOCK/UNLOCK use with
AO_fetch_and_add1_full.  Declare n_tests as AO_t.
(WinMain): Dont call GC_use_DllMain.
with PARALLEL_MARK or THREAD_LOCAL_ALLOC.

2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* alloc.c (GC_try_to_collect_inner): Don't print redundant
GC_bytes_allocd and GC_gc_no.
(GC_stopped_mark): Print average world stop time.
* include/private/gc_priv.h (MS_TIME_DIFF): Add cast.

2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
* misc.c, doc/README.environment: Add support  for
GC_FREE_SPACE_DIVISOR and GC-disable-incremental.
* include/gc.h: Make GC_set_free_space_divisor correspond to
(somewhat unfortunate) reality.

2008-11-07  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
(Mostly improves LLP64 support.)
* backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c,
misc.c, reclaim.c: Changed some int and long type to word or size_t
(and vice versa where appropriate)
* gcj_mlc.c, include/private/dbg_mlc.h, include/private/gcconfig.h,
include/private/thread_local_alloc.h, mark.c,
misc.c, thread_local_alloc.c, win32_threads.c: Added intermediate
casts to word type when casting from int to pointer (or pointer
to int, or data pointer to code pointer) - just to remove the
corresponding compiler warning.
* ptr_chck.c (GC_is_visible): cast int const to word type to
prevent left shift overflow.
* os_dep.c: change the type of GC_mem_top_down global var
(containing a flag) to DWORD.
* include/gc_config_macros.h: define GC_SOLARIS_THREADS if GC_THREADS
is defined on SunOS x86_64.
* misc.c (GC_init_size_map): Ifdef out GC_ASSERT as a workaround
for VC++ 2008 amd64 (v15.00.21022.08 for x64) compiler bug
(the compiler gets hung if invoked with -Ox -D
ALL_INTERIOR_POINTERS -D GC_ASSERTIONS)
* backgraph.c: cast GC_gc_no value to unsigned short when
assigned/compared to height_gc_no field of back_edges.
* os_dep.c (GC_remove_protection): Add ARGSUSED.
* win32_threads.c (GC_thread_exit_proc): Remove unused local var.
* mark.c (GC_check_dirty): Move declaration out of func body.

2008-11-06  Hans Boehm <Hans.Boehm@hp.com>
* doc/gcinterface.html: Improve REDIRECT_MALLOC documentation.
* include/gc.h (GC_register_my_thread): Improve comment.

2008-11-04  Hans Boehm <Hans.Boehm@hp.com>
* Makefile.direct: Add comment for -DCHECKSUMS.

2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* thread_local_alloc.c, include/private/thread_local_alloc.h:
Fix typos in comments.
* finalize.c: Declare mark_procs and GC_register_finalizer_inner
STATIC.
* malloc.c (GC_free): Move size calculation below assertion.

2008-10-27  Hans Boehm <Hans.Boehm@hp.com>
* win32_threads.c (GC_get_stack_min, GC_may_be_in_stack):
Add one entry VirtualQuery cache, I_HOLD_LOCK assertions.
(GC_push_stack_for, GC_get_next_stack) : Hopefully fix WINCE support.

2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Thanks to Klaus Treichel.)
* finalize.c (GC_general_register_disappearing_link): Add
assertion.
* malloc.c (GC_generic_malloc): Round lb to granules, not words.
* mallocx.c (GC_generic_malloc_ignore_off_page): Round lb to
granules, not words.

2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Really Rex Dieter and
Petr Krajca)
* mach_dep.c (NO_GETCONTEXT): Define for sparc linux.
* configure.ac: Define mach_dep for sparc-linux.
* configure: Regenerate.

2008-10-25  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* mark_rts.c (GC_approx_sp): Use volatile to avoid common
warning.

2008-10-25  Hans Boehm <Hans.Boehm@hp.com>
* dyn_load.c (GC_cond_add_roots): Fix GC_get_next_stack argument
order.

2008-10-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* alloc.c, dbg_mlc.c, dyn_load.c, finalize.c, gcj_mlc.c,
include/gc.h, include/gc_config_macros.h, include/gc_cpp.h,
include/gc_gcj.h, include/gc_mark.h, include/gc_typed.h,
include/javaxfc.h, include/private/gc_locks.h,
include/private/gc_priv.h, malloc.c, mallocx.c, mark.c, mark_rts.c,
misc.c, obj_map.c, os_dep.c, pthread_support.c, ptr_chck.c,
stubborn.c, tests/test.c, thread_local_alloc.c, typd_mlc.c
win32_threads.c: Add GC_CALL and GC_CALLBACK macro invocations.
* test.c: Remove some old K&R code.

2008-10-24  Hans Boehm <Hans.Boehm@hp.com>
(Partially based loosely on patch from Ivan Maidanski)
* win32_threads.c (GC_may_be_in_stack): New.  (GC_Thread_Rep):
Add last_stack_min.  (GC_push_stack_for): Use last_stack_min.
(GC_get_next_stack): Add limit argument, use_last_stack_min.
(GC_suspend): make stack_base assignment conditional.
* dyn_load.c (win32 GC_cod_add_roots): Pass limit to
GC_get_next_stack.
* configure_atomic_ops.sh: Remove.
* build_atomic_ops.sh, build_atomic_ops.sh.cygwin, doc/README.win32,
Makefile.direct: Partially support build directories whose path
name contains blanks.
* Makefile.am: Support new files (build_atomic_ops.sh,
build_atomic_ops.sh.cygwin)
* Makefile.in: Regenerate.

2008-10-21  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* include/private/gc_locks.h, include/private/gc_pmark.h,
include/private/gc_priv.h, include/private/gcconfig.h,
mach_dep.c, mark_rts.c, misc.c, os_dep.c, pthread_stop_world.c,
pthread_support.c, thread_local_alloc.c, typd_mlc.c, win32_threads.c:
Fix comments.

2008-10-21  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* pthread_support.c: Comment out LOCK_STATS.
* include/gc.h: Fix comments.

2008-10-20  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* misc.c (GC_init_inner): Enable GC_LOG_FILE on Cygwin.
* include/private/gcconfig.h: Consider USE_MMAP for Cygwin.
* os_dep.c (GC_get_main_stack_base): Use alternate definition
with USE_MMAP.
* include/private/gc_priv.h: Sometimes define SETJMP on Cygwin.

2008-10-20  Hans Boehm <Hans.Boehm@hp.com>
* doc/README: Make it clearer when Makefile.direct is assumed.
* cord/cord.am: install include/cord.h.
* Makefile.in: Regenerate.

2008-09-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* win32_threads.c (GC_pthread_join, GC_pthread_start_inner):
Remove unused variables.
* darwin_stop_world.c: Always declare GC_thr_init().
* dbg_mlc.c (GC_debug_free_inner): Dont touch oh_sz if
SHORT_DBG_HDRS is defined.
* include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET, parallel
mark, USE_MARK_BITS version): Refer to correct parameter name.

2008-09-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* finalize.c (GC_general_register_disappearing_link): Remove
redundant code.
* gcj_mlc.c (GC_init_gcj_malloc): Add cast to signed.
* os_dep.c: (GC_write_fault_handler): Remove remaining
references to deleted variable "code".  Remove redundant
FREEBSD definitions.
* include/private/gcconfig.h (GWW_VDB): Define for X86_64 when
defined for X86. (STATIC): Define as "static" with NO_DEBUGGING.

2008-09-24  Hans Boehm <Hans.Boehm@hp.com>
* include/private/gc_priv.h: Update MAX_HEAP_SECTS.

2008-09-10  Hans Boehm <Hans.Boehm@hp.com>
* dbg_mlc.c (GC_print_smashed_obj): Increase robustness with
smashed string, (GC_debug_free_inner): Mark as free.
* mallocx.c (GC_malloc_many): Always clear new block if
GC_debugging_started.
* reclaim.c: Move GC_debugging_started from
GC_reclaim_small_nonempty_block() to GC_reclaim_generic(),
which is also called directly.
* doc/README: Fix spelling error.  Update license summary.
* include/gc.h (GC_PRE_INCR3, GC_POST_INCR3): add (void **) casts.
* tests/test.c: Don't define GC_DEBUG if already defined.

2008-08-27  Hans Boehm <Hans.Boehm@hp.com>
* doc/simple_example.html: update --enable-full-debug reference,
Make HTML formatting standards compliant.
* doc/debugging.html, doc/leak.html: Fix HTML formatting bugs.
* doc/gcinterface.html: specify encoding.

2008-08-27  Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
* doc/simple_example.html: Update thread-local allocation
description.

2008-08-26  Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
* configure.ac: Check for gc-debug earlier; replace remaining
full-debug tests.
* configure: Regenerate.
* include/gc.h, ptr_chck.c (GC_pre_incr, GC_post_incr):
Use signed offset type.  Use ptr_t internally.
* doc/gcinterface.html: Update LOCAL_MALLOC description.
* doc/README.autoconf, doc/leak.html, doc/README.DGUX386:
Fix full-debug reference.
* include/gc.h: Rewrite GC_..._INCR and friends.
* tests/test.c: Minimally test GC_..._INCR and friends.

2008-08-21  Hans Boehm <Hans.Boehm@hp.com>
* mark.c: (GC_push_next_marked, GC_push_next_marked_dirty,
GC_push_next_marked_uncollectable): Never invoke GC_push_marked
on free hblk.
* headers.c: Test COUNT_HDR_CACHE_HITS not USE_HDR_CACHE.
(GC_header_cache_miss): Always blacklist pointers for free
hblks.  Add assertion and comment.
* pthread_support.c (GC_register_my_thread): Fix #if indentation.
* include/private/gc_hdrs.h: USE_HDR_CACHE is no longer tested.
Delete it.
* include/private/gc_pmark.h: (PUSH_OBJ): Add assertion.

2008-08-21  Hans Boehm <Hans.Boehm@hp.com>
* alloc.c, include/gc_mark.h, Makefile.direct: Improve comments.

2008-08-01  Hans Boehm <Hans.Boehm@hp.com> (Really Klaus Treichel)
* configure.ac: Set win32_threads on MinGW.
* configure: Reg

12 years ago2009-06-11 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
hboehm [Fri, 12 Jun 2009 00:30:44 +0000 (00:30 +0000)]
2009-06-11  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
(diff93_cvs: resembling diff27, diff30, diff43, diff44, diff66,
diff76, diff79, diff83 partly)

        * win32_threads.c (MAX_THREADS): Define as 1 if GC_win32_dll_threads
        is defined as FALSE (otherwise the size of dll_thread_table is near
        200 KiB for 32-bit).
        * win32_threads.c (GC_use_DllMain): Optimize for THREAD_LOCAL_ALLOC.
        * win32_threads.c (GC_Thread_Rep): Add backing_store_end and
        backing_store_ptr fields for IA64 support.
        * win32_threads.c (GC_register_my_thread_inner): Set
        backing_store_end field to reg_base value for IA64 (same as in
        pthread_support.c).
        * win32_threads.c (SET_PTHREAD_MAP_CACHE): Put parentheses in the
        "right" places, remove ';'.
        * win32_threads.c (GC_fault_handler_lock): Declare only
        if MPROTECT_VDB (and not WinCE).
        * win32_threads.c (GC_suspend): Acquire and release
        GC_fault_handler_lock only if MPROTECT_VDB (and not WinCE).
        * win32_threads.c (GC_suspend): Define as STATIC.
        * win32_threads.c (GC_push_stack_for): Fix WARN() format specifier
        (should be word-complient, "%p" is used w/o "0x"), don't cast sp.
        * win32_threads.c (GC_push_all_stacks): Convert a group of printf()
        calls into a single one (for output atomicity).
        * win32_threads.c (GC_get_next_stack): Unprotect thread descriptor
        before altering its last_stack_min ("thread" variable is added).
        * win32_threads.c (GC_get_next_stack): Remove unnecessary checks for
        "s" is non-NULL.
        * win32_threads.c (GC_get_next_stack): Don't call GC_may_be_in_stack
        if WinCE.
        * win32_threads.c (GC_get_next_stack): Pass current_min value to
        GC_get_stack_min as-is (without -1).
        * win32_threads.c (GC_wait_marker): Remove FIXME and use "release"
        version of AO_fetch_and_sub1().
        * win32_threads.c (GC_win32_start_inner, GC_win32_start): convert int
        to pointer (and vice verse) thru word type to suppress warnings.
* win32_threads.c (GC_mark_mutex_waitcnt): Fix comment, always
access atomically.
* misc.c: Change GC_THREADS tests back to THREADS.

12 years ago2009-06-11 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Thu, 11 Jun 2009 23:07:43 +0000 (23:07 +0000)]
2009-06-11  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff92_cvs: resembling diff20, diff27, diff34, diff38, diff43, diff45,
diff46, diff56, diff60, diff62, diff74, diff75, diff81 partly)

        * allchblk.c (GC_print_hblkfreelist, GC_dump_regions): Convert
        a group of printf() calls into a single one (for output atomicity).
        * include/gc.h (GC_set_all_interior_pointers, GC_set_full_freq,
        GC_set_time_limit): New prototypes.
        * misc.c (GC_set_all_interior_pointers, GC_set_full_freq,
        GC_set_time_limit): New public setter/getter functions.
        * include/gc.h: Fix (and remove outdated) comments for thread-local
        allocation.
        * include/gc.h: Fix typos in comments.
        * misc.c (GC_init_inner, GC_printf): Ditto.
        * include/gc.h (GC_unregister_disappearing_link): Refine comment.
        * include/gc.h (GC_stack_base): Recognize _M_IA64 macro.
        * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
        GC_bytes_allocd_at_reset, DEGRADE_RATE): Define only if THREADS.
        * misc.c (GC_stack_last_cleared, GC_min_sp, GC_high_water,
        GC_bytes_allocd_at_reset): Define as STATIC.
        * misc.c (GC_get_heap_size, GC_get_free_bytes,
        GC_get_bytes_since_gc, GC_get_total_bytes): Acquire the GC lock to
        avoid data races.
        * misc.c (GC_write_cs): Define only if THREADS (Win32/WinCE only).
        * misc.c (GC_init_inner): Initialize GC_write_cs only if THREADS.
        * misc.c (GC_init_inner): Use GC_INITIAL_HEAP_SIZE (if available) to
        set the default initial value of initial_heap_sz.
        * misc.c (GC_deinit): Destroy GC_write_cs only if THREADS.
        * misc.c (GC_init_inner): Fix WARN() format specifier (should be
        word-complient, "%p" is used w/o "0x").
        * misc.c (GC_init_inner): Don't recognize "GC_PAUSE_TIME_TARGET"
        environment variable if SMALL_CONFIG.
        * misc.c (GC_init_inner): Recognize "GC_FULL_FREQUENCY" environment
        variable to set initial GC_full_freq value (if not SMALL_CONFIG).
        * doc/README.environment (GC_FULL_FREQUENCY): Add information.
        * doc/README.environment (GC_MARKERS): Refine information.
        * misc.c (GC_init_inner): Change GC_ASSERT to GC_STATIC_ASSERT where
        possible.
        * misc.c (IF_NEED_TO_LOCK): New macro (instead of GC_need_to_lock).
        * misc.c (GC_write): Use IF_NEED_TO_LOCK for handling GC_write_cs.
        * misc.c (GC_abort): Don't define if SMALL_CONFIG.
        * misc.c (GC_abort): Directly use WRITE() instead of GC_err_printf()
        (to prevent possible infinite recursion).

12 years ago2009-06-09 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Wed, 10 Jun 2009 00:28:41 +0000 (00:28 +0000)]
2009-06-09  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
diff90_cvs (resembling diff28, diff30, diff32, diff34, diff47,
diff49, diff60, diff62, diff66, diff67, diff68, diff72 partly)

        * finalize.c (finalization_mark_proc): Replace K&R-style declaration
        with ANSI C one.
        * finalize.c (GC_grow_table, GC_register_finalizer_inner,
        GC_enqueue_all_finalizers): Remove outdated comments about disabling
        signals.
        * finalize.c (GC_general_register_disappearing_link): Fix assertion
        to catch NULL "obj" value.
        * finalize.c (GC_unregister_disappearing_link): Check "link"
        alignment before gaining the lock.
        * finalize.c (GC_finalize): Refine comment.
        * finalize.c (GC_finalize): Fix WARN() format specifier (should be
        word-complient, "%p" is used w/o "0x").
        * finalize.c (GC_invoke_finalizers): Initialize "bytes_freed_before"
        variable (to 0) to suppress compiler warning.
        * include/gc_gcj.h (MARK_DESCR_OFFSET): Move to private/gc_pmark.h.
        * include/gc_gcj.h: add "extern C" header and tail.
        * include/private/gc_pmark.h: Remove GC_do_parallel_mark(),
        GC_help_wanted, GC_helper_count, GC_active_count declarations (move
        the comments to the place where these symbols are defined in mark.c).
        * mark.c: Add STATIC GC_do_parallel_mark() declaration (for use by
        GC_mark_some_inner, if PARALLEL_MARK only).
        * mark.c (GC_mark_some_inner, GC_help_wanted, GC_helper_count,
        GC_active_count, GC_do_parallel_mark): Define as STATIC.
        * pthread_support.c (GC_mark_thread): Ditto.
        * typd_mlc.c (GC_explicit_typing_initialized, GC_explicit_kind,
        GC_array_kind, GC_ext_descriptors, GC_ed_size, GC_avail_descr,
        GC_typed_mark_proc_index, GC_array_mark_proc_index, GC_eobjfreelist,
        GC_arobjfreelist): Ditto.
        * include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Change GC_ASSERT
        for HBLKSIZE to GC_STATIC_ASSERT.
        * mark.c (GC_noop): Define for Borland C the same as for Watcom.
        * mark.c (GC_noop, GC_mark_and_push): Add ARGSUSED tag.
        * pthread_support.c (GC_do_blocking_inner): Ditto.
        * mark.c (GC_mark_from): Initialize "limit" (to 0) in the default
        switch branch to suppress compiler warning.
        * mark.c (GC_return_mark_stack): Append new-line to printf message.
        * mark.c: Remove unused GC_true_func(), GC_PUSH_ALL().
        * pthread_support.c (GC_mark_thread): Add dummy "return 0" to
        suppress compiler warning.
        * pthread_support.c (start_mark_threads): Move the code limiting
        "GC_markers" value (and printing a warning) to GC_thr_init().
        * pthread_support.c (GC_thr_init): Silently limit "GC_markers" value
        if based on the number of CPUs.
        * pthread_support.c (GC_thr_init): Treat incorrect "GC_markers"
        values as one.
* pthread_support.c (GC_register_my_thread_inner): Add a check for
"stack_end" is non-NULL (the same as in win32_threads.c).
* pthread_support.c (pthread_create): Call GC_oom_fn before giving up
with ENOMEM.
* thread_local_alloc.c (return_single_freelist): Convert "for" loop
to "while" one to suppress "possible extraneous ';'" warning.

12 years ago2009-06-08 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski
hboehm [Tue, 9 Jun 2009 06:06:40 +0000 (06:06 +0000)]
2009-06-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski
and Zoltan Varga)
        * darwin_stop_world.c (GC_push_all_stacks): Recognize ARM32.
        * include/private/gc_priv.h (GC_THREAD_STATE_T): Define for ARM32
        (Darwin only).
        * include/private/gcconfig.h: Add machine-specific part for DARWIN.
        * include/private/gcconfig.h (ARM32): Define config parameters for
        DARWIN (iPhone).

12 years ago2009-06-08 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Tue, 9 Jun 2009 05:02:26 +0000 (05:02 +0000)]
2009-06-08  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff91_cvs: resembling diff3, diff27, diff33, diff45, diff47, diff49,
diff60, diff67, diff68 partly)
* alloc.c (GC_FULL_FREQ, GC_DONT_EXPAND, GC_FREE_SPACE_DIVISOR,
        GC_TIME_LIMIT): New macros (used to control the default initial
        values of GC_full_freq variable, GC_dont_expand,
        GC_free_space_divisor, GC_time_limit respectively).
        * include/private/gc_priv.h (TIME_LIMIT): Remove macro (replaced
        with GC_TIME_LIMIT in alloc.c).
        * alloc.c (GC_need_full_gc, GC_stopped_mark, GC_finish_collection):
        Define as STATIC.
        * mark_rts.c (GC_push_current_stack, GC_push_gc_structures): Ditto.
        * include/private/gc_priv.h (GC_stopped_mark, GC_finish_collection):
        Move the prototypes to alloc.c, make STATIC.
        * include/private/gc_priv.h (GC_push_current_stack,
        GC_push_gc_structures, GC_push_regs_and_stack): Remove prototypes
        (move the comments to the places where these functions are defined).
        * mach_dep.c (GC_push_regs_and_stack): Move to mark_rts.c and define
        as STATIC.
        * alloc.c (GC_timeout_stop_func, GC_stopped_mark,
        GC_print_heap_sects): Convert a group of printf() calls into
        a single one (for output atomicity).
        * mark_rts.c (GC_print_static_roots): Ditto.
        * alloc.c (GC_stopped_mark): Output blank line (when logging) for
        convenience to delimit collections.
        * alloc.c (GC_clear_a_few_frames): Rename NWORDS to CLEAR_NWORDS;
        make "frames" local variable volatile (to prevent optimization).
        * alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
        GC_finish_collection, GC_allocobj): Remove outdated comments about
        disabling signals.
        * include/private/gc_priv.h (GC_register_displacement_inner,
        GC_gcollect_inner): Ditto.
        * alloc.c (GC_try_to_collect_inner, GC_stopped_mark,
        GC_finish_collection): Initialize "start_time" local variable (to 0)
        to suppress compiler warning.
        * mark_rts.c (GC_add_roots_inner): Ditto (for "old" variable).
        * alloc.c (GC_RATE, MAX_PRIOR_ATTEMPTS): Guard with "ifndef".
        * include/private/gc_priv.h (clock, GC_stop_world, GC_start_world,
        GC_acquire_mark_lock, GC_release_mark_lock, GC_notify_all_builder,
        GC_wait_for_reclaim, GC_notify_all_marker, GC_wait_marker): Replace
        K&R-style function prototypes with ANSI C one.
        * include/private/gc_priv.h (ABORT): Define as DebugBreak() for
        Win32/WinCE if SMALL_CONFIG (the same as in GC_abort()).
        * include/private/gc_priv.h (ROUNDED_UP_WORDS, abs): Remove unused
        macros.
        * include/private/gc_priv.h (GC_noop): Declare for Borland C the
        same as for Watcom.
        * mark_rts.c (GC_push_conditional_with_exclusions): Add ARGSUSED tag.

12 years ago2009-06-04 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Fri, 5 Jun 2009 03:59:36 +0000 (03:59 +0000)]
2009-06-04  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff89_cvs, resembling diff3, diff27, diff34, diff38, diff47, diff49,
diff59, diff60, diff66, diff67, diff68, diff69a, diff70, diff81
partly)
        * dbg_mlc.c (GC_store_debug_info, GC_store_debug_info_inner): Remove
        outdated comment about disabling signals.
        * mallocx.c (GC_malloc_uncollectable,
        GC_malloc_atomic_uncollectable): Ditto.
        * os_dep.c: Ditto.
        * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change):
        Add ARGSUSED tag.
        * pthread_stop_world.c (GC_suspend_handler,
        GC_suspend_handler_inner): Ditto.
        * dbg_mlc.c (GC_debug_free, GC_debug_realloc): Fix printf message.
        * dbg_mlc.c (GC_debug_realloc): Set "result" to NULL in the default
        switch branch to suppress compiler warning.
        * dyn_load.c (GC_init_dyld): Use ABORT() instead of GC_abort().
        * include/private/darwin_semaphore.h (sem_init): Ditto.
        * include/javaxfc.h: Replace "GC_H" with "_GC_H".
        * include/private/dbg_mlc.h (GC_has_other_debug_info,
        GC_store_debug_info): Replace K&R-style function prototypes with ANSI
        C one.
        * include/private/gcconfig.h (GC_FreeBSDGetDataStart, real_malloc,
        GC_win32_get_mem, GC_wince_get_mem, GC_unix_get_mem): Ditto.
        * include/private/pthread_support.h (GC_stop_init): Ditto.
        * include/private/gcconfig.h: Refine comment about setting
        GC_stackbottom.
        * include/private/gcconfig.h (FIXUP_POINTER): Put parentheses in the
        "right" places.
        * include/private/pthread_support.h (GC_Thread_Rep): Refine comment
        for "stack_end" field.
        * mallocx.c (GC_malloc_uncollectable,
        GC_malloc_atomic_uncollectable): Remove cast to undefined "hbklk".
        * os_dep.c (GC_USE_MEM_TOP_DOWN): New macro (for setting
        GC_mem_top_down to MEM_TOP_DOWN for debug purposes).
        * os_dep.c (GC_gww_read_dirty, catch_exception_raise): Fix WARN()
        format specifier (should be word-compliant, "%p" is used w/o "0x").
        * pthread_stop_world.c (GC_suspend_handler_inner): Ditto.
        * os_dep.c (GC_dirty_init): Append new-line to printf messages.
        * os_dep.c (GC_mprotect_thread): Fix GC_err_printf message.
        * os_dep.c (GC_save_callers): Change GC_ASSERT to GC_STATIC_ASSERT.
        * pthread_stop_world.c (GC_retry_signals, GC_suspend_ack_sem): Define
        as STATIC.
        * pthread_stop_world.c (GC_push_all_stacks): Add assertion for that
        "thread_blocked" is not set for the current thread.
        * real_malloc.c: Add "extern GC_quiet" to suppress compiler warning.
        * reclaim.c (GC_reclaim_all): Initialize "start_time" (to 0) to
        suppress compiler warning.

12 years ago2009-06-02 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Wed, 3 Jun 2009 00:17:13 +0000 (00:17 +0000)]
2009-06-02  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(adding last bit of diff86_cvs)
* tests/test.c (check_heap_stats): Avoid unbalanced brackets in ifdef.

2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff26)
* win32_threads.c: restructure parallel marking mutex intialization.
* win32_threads.c, alloc.c, darwin_stop_world.c, mallocx.c, mark.c,
pthread_stop_world.c, pthread_support.c: Add runtime conditions
on GC_parallel were appropriate.
* pthread_support.c: Condition marker_bsp on ia64.
(GC_segment_is_thread_stack): Fix loop upper bound.
* reclaim.c: Limit some assertions to PARALLEL_MARK.
* pthread_support.c: Don't acquire mark lock for thread-local
allocation.
* include/private/gc_priv.h: Don't define parallel mark sync
support just for THREAD_LOCAL_ALLOC.

2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff39)
* include/private/gcconfig.h: refine MINGW32 test.
* mark.c: Add win64/gcc tests.

2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff86_cvs, resembling diff28, diff32, diff33, diff38, diff68 partly)
* test.c (fork_a_thread, reverse_test, alloc8bytes, tree_test,
        typed_test, run_one_test, check_heap_stats, main, test): Replace
        all K&R-style function definitions with ANSI C ones.
        * trace_test.c (main): Ditto.
        * test.c (GC_COND_INIT): Define as GC_INIT() also in case of
        THREAD_LOCAL_ALLOC.
        * test.c (reverse_test): Call fork_a_thread() only if GC_PTHREADS
        or GC_WIN32_THREADS; remove fork_a_thread() macros definition.
        * test.c (reverse_test): Use "volatile" when clearing "b" and "c"
        local variables (to suppress "assigned value is never used"
        compiler warning).
        * test.c (tree_test): Use public GC_noop1() instead of private
        GC_noop().
        * test.c (typed_test): Ditto.
        * test.c (check_heap_stats): Define and assign value to
        "late_finalize_count" local variable only if its value is used
        (if FINALIZE_ON_DEMAND defined).
        * test.c (main): Remove DJGPP-specific initialization of
        GC_stackbottom (not needed anymore, handled in gcconfig.h).
        * trace_test.c: Guard #define GC_DEBUG with #ifndef.
        * trace_test.c: Include "gc_backptr.h".
        * trace_test.c (main): Call GC_INIT().
        * trace_test.c (main): Add "return 0" statement.

2009-05-25  Hans Boehm <Hans.Boehm@hp.com> (Really Petter Urkedal)
* dyn_load.c (GC_register_dynlib_callback): Use new index j
instead of i in the inner loop.

2009-05-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff85)
* tests/test.c: Increment n_tests with fetch_and_add when possible,
avoiding need to export lock.

2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff63,diff65)
* include/gc_pthread_redirects.h:
- dlfcn.h is included for dlopen() proto before undefining
"dlopen" (so, it's possible now to include dlfcn.h after
gc.h from user code);
- GC_dlopen() proto is added (except for Darwin as
it's missing there);
- "dlopen" is explicitly undefined (before its redefinition).
* include/gc.h:
- "process.h" is included besides "windows.h"
(for _beginthreadex/_endthreadex); win32 only.
- GC_NO_THREAD_DECLS is moved to the right place
(before closing "extern C").
* pthread_support.c: Fix out of memory handling for Thread_Reps.
* win32_threads.c: Don't include process.h on winCE,
improve out of memory handling for thread structures, dont
define GC_beginthreadex and GC_endthreadex for winCE.

2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff71)
* tests/test.c: Change gcj vtable decriptor type from size_t to
GC_word.

2009-05-22  Hans Boehm <Hans.Boehm@hp.com>
* gcj_mlc.c: Add comment.
* tests/test.c: Change NTEST to NTHREADS.  Fork 5 threads by default.
Run reverse_test a second time in each thread.Add comments.
Dont rely on AO_fetch_and_add.

2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Largely from Ludovic Cortes)
* dyn_load.c (GC_register_dynlib_callback,
GC_register_dynamic_libraries_dl_iterate_phdr): Add support
for GNU_PT_RELRO relocations.

2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff61)
* Makefile, Makefile.direct: GC_SOLARIS_PTHREADS was replaced
by GC_SOLARIS_THREADS.
* include/gc.h: Improve finalizer documentation.
* mips_sgi_mach_dep.s: Replace _MIPS_SIM_ABI32 with _ABIO32.
* pthread_stop_world.c, Makefile.dj: Fix typos.

2009-05-21  Hans Boehm <Hans.Boehm@hp.com>
* win32_threads.c (GC_new_thread): Make first_thread
visible to the whole file.
(UNPROTECT): New macro.
(GC_push_stack_for, GC_suspend, GC_start_world): unprotect
thread structures before writing.
(GC_suspend): Acquire GC_fault_handler_lock before suspending
thread.
* os_dep.c: export GC_fault_handler_lock.
(GC_remove_protection): Check if already unprotected.

2009-05-20  Hans Boehm <Hans.Boehm@hp.com> (really Ivan Maidanski)
* doc/README.win32: Add OpenWatcom warning.
* include/private/gcconfig.h: Really check it in.

2009-05-19  Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidanski, Dave Korn)
* os_dep.c (GC_get_stack_base, windows): Replace with Dave Korn's
code from gcc version.
* os_dep.c: make gc compilable (optionally) for Cygwin with
GetWriteWatch-based virtual dirty bit implementation ("os_dep.c" file).
* os_dep.c: Make non-win32 GC_write_fault_handler STATIC.
* mark.c (GC_noop): fix declaration definition mismatch for DMC.
* include/private/gcconfig.h: Enable MPROTECT_VDB and GWW_VDB for
Watcom (Win32 only).  It works.

and GWW_VDB.  It works.

2009-05-07  Hans Boehm <Hans.Boehm@hp.com> and Mark Sibly
* mach_dep.c: Don't use __builtin_unwind_init for register
state on PowerPC/Darwin.

2009-04-24  Hans Boehm <Hans.Boehm@hp.com>
* doc/gcdescr.html: Improve description of object freelist
structure.
* include/private/gc_priv.h: Fix comment for _size_map.

2009-03-16  Hans Boehm <Hans.Boehm@hp.com>
* os_dep.c (GC_linux_stack_base): Relax sanity test.

2009-03-11  Hans Boehm <Hans.Boehm@hp.com>  (Really Ivan Maidanski)
* include/private/gc_pmark.h (PUSH_CONTENTS_HDR for
MARK_BIT_PER_OBJ): Add missing backslash before eoln.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
* misc.c (GC_set_warn_proc): Implicitly intialize GC on
non-Cygwin win32.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Petr Krajca)
* configure.ac: Enable thread-local allocation for sparc-linux.
* configure: Regenerate.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* alloc.c (GC_try_to_collect): Remove duplicate initialization
check.
* malloc.c (GC_generic_malloc): Remove lw to eliminate single-
threaded warnings.
* mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidansky)
* allchblk.c, backgraph.c, dbg_mlc.c, dyn_load.c,
finalize.c, include/private/gc_pmark.h, malloc.c, mark.c,
os_dep.c, pthread_stop_world.c, pthread_support.c, reclaim.c,
thread_local_alloc.c.
* misc.c: Refine comment.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
* os_dep.c: Define GC_GWW_BUF_LEN more intelligently.  Add FIXME
comment.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (With input from Ivan Maidansky)
* win32_threads.c (GC_push_stack_for): Yet another attempt
at the stack_min finding logic.  Try to clean up the existing code
while minimizing VirtualQuery calls.
(GC_win32_start_inner): Register thread before GC_printf.
Produce more output with DEBUG_THREADS.
*include/gc.h: Update obsolete comments.

2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* tests/test.c:
(gcj_class_struct2): Use cast instead of l suffix.
Cast GetLastError to int in various places.
Avoid unused result warning from incr/decr macros.
Add cast for fake_gcj_mark_proc.
Cast GC_gc_no to unsigned in printf.

2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* include/gc.h: Fix two typos in comments.

2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* finalize.c: Fix typo in comment.

2008-12-03  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* blacklst.c (GC_print_source_pointer): Don't call GC_print_heap_obj
with lock.

2008-12-01  Hans Boehm <Hans.Boehm@hp.com>
* reclaim.c: (GC_reclaim_block): Scan even nearly full blocks
if we are checking for leaks.

2008-11-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
* win32_threads.c: Remove mark lock spinning.
* win32_threads.c, pthread_support.c: Update GC_unlocked_count,
GC_spin_count, and GC_block_count using atomic operations.
* tests/test.c: Declare n_tests as AO_t only if we have threads.

2008-11-11  Hans Boehm <Hans.Boehm@hp.com>
(Really almost entirely Ivan Maidansky)
* win32_threads.c: Support PARALLEL_MARK.  Make printf arg
types agree with format specifiers.  Add missing copyright header.
Add STATIC for GC_threads.
* include/private/gcconfig.h: Add FIXME comment.
* tests/test.c (run_ine_test): Replace LOCK/UNLOCK use with
AO_fetch_and_add1_full.  Declare n_tests as AO_t.
(WinMain): Dont call GC_use_DllMain.
with PARALLEL_MARK or THREAD_LOCAL_ALLOC.

2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* alloc.c (GC_try_to_collect_inner): Don't print redundant
GC_bytes_allocd and GC_gc_no.
(GC_stopped_mark): Print average world stop time.
* include/private/gc_priv.h (MS_TIME_DIFF): Add cast.

2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
* misc.c, doc/README.environment: Add support  for
GC_FREE_SPACE_DIVISOR and GC-disable-incremental.
* include/gc.h: Make GC_set_free_space_divisor correspond to
(somewhat unfortunate) reality.

2008-11-07  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
(Mostly improves LLP64 support.)
* backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c,
misc.c, reclaim.c: Changed some int and long type to word or size_t
(and vice versa where appropriate)
* gcj_mlc.c, include/private/dbg_mlc.h, include/private/gcconfig.h,
include/private/thread_local_alloc.h, mark.c,
misc.c, thread_local_alloc.c, win32_threads.c: Added intermediate
casts to word type when casting from int to pointer (or pointer
to int, or data pointer to code pointer) - just to remove the
corresponding compiler warning.
* ptr_chck.c (GC_is_visible): cast int const to word type to
prevent left shift overflow.
* os_dep.c: change the type of GC_mem_top_down global var
(containing a flag) to DWORD.
* include/gc_config_macros.h: define GC_SOLARIS_THREADS if GC_THREADS
is defined on SunOS x86_64.
* misc.c (GC_init_size_map): Ifdef out GC_ASSERT as a workaround
for VC++ 2008 amd64 (v15.00.21022.08 for x64) compiler bug
(the compiler gets hung if invoked with -Ox -D
ALL_INTERIOR_POINTERS -D GC_ASSERTIONS)
* backgraph.c: cast GC_gc_no value to unsigned short when
assigned/compared to height_gc_no field of back_edges.
* os_dep.c (GC_remove_protection): Add ARGSUSED.
* win32_threads.c (GC_thread_exit_proc): Remove unused local var.
* mark.c (GC_check_dirty): Move declaration out of func body.

2008-11-06  Hans Boehm <Hans.Boehm@hp.com>
* doc/gcinterface.html: Improve REDIRECT_MALLOC documentation.
* include/gc.h (GC_register_my_thread): Improve comment.

2008-11-04  Hans Boehm <Hans.Boehm@hp.com>
* Makefile.direct: Add comment for -DCHECKSUMS.

2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* thread_local_alloc.c, include/private/thread_local_alloc.h:
Fix typos in comments.
* finalize.c: Declare mark_procs and GC_register_finalizer_inner
STATIC.
* malloc.c (GC_free): Move size calculation below assertion.

2008-10-27  Hans Boehm <Hans.Boehm@hp.com>
* win32_threads.c (GC_get_stack_min, GC_may_be_in_stack):
Add one entry VirtualQuery cache, I_HOLD_LOCK assertions.
(GC_push_stack_for, GC_get_next_stack) : Hopefully fix WINCE support.

2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Thanks to Klaus Treichel.)
* finalize.c (GC_general_register_disappearing_link): Add
assertion.
* malloc.c (GC_generic_malloc): Round lb to granules, not words.
* mallocx.c (GC_generic_malloc_ignore_off_page): Round lb to
granules, not words.

2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Really Rex Dieter and
Petr Krajca)
* mach_dep.c (NO_GETCONTEXT): Define for sparc linux.
* configure.ac: Define mach_dep for sparc-linux.
* configure: Regenerate.

2008-10-25  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* mark_rts.c (GC_approx_sp): Use volatile to avoid common
warning.

2008-10-25  Hans Boehm <Hans.Boehm@hp.com>
* dyn_load.c (GC_cond_add_roots): Fix GC_get_next_stack argument
order.

2008-10-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* alloc.c, dbg_mlc.c, dyn_load.c, finalize.c, gcj_mlc.c,
include/gc.h, include/gc_config_macros.h, include/gc_cpp.h,
include/gc_gcj.h, include/gc_mark.h, include/gc_typed.h,
include/javaxfc.h, include/private/gc_locks.h,
include/private/gc_priv.h, malloc.c, mallocx.c, mark.c, mark_rts.c,
misc.c, obj_map.c, os_dep.c, pthread_support.c, ptr_chck.c,
stubborn.c, tests/test.c, thread_local_alloc.c, typd_mlc.c
win32_threads.c: Add GC_CALL and GC_CALLBACK macro invocations.
* test.c: Remove some old K&R code.

2008-10-24  Hans Boehm <Hans.Boehm@hp.com>
(Partially based loosely on patch from Ivan Maidanski)
* win32_threads.c (GC_may_be_in_stack): New.  (GC_Thread_Rep):
Add last_stack_min.  (GC_push_stack_for): Use last_stack_min.
(GC_get_next_stack): Add limit argument, use_last_stack_min.
(GC_suspend): make stack_base assignment conditional.
* dyn_load.c (win32 GC_cod_add_roots): Pass limit to
GC_get_next_stack.
* configure_atomic_ops.sh: Remove.
* build_atomic_ops.sh, build_atomic_ops.sh.cygwin, doc/README.win32,
Makefile.direct: Partially support build directories whose path
name contains blanks.
* Makefile.am: Support new files (build_atomic_ops.sh,
build_atomic_ops.sh.cygwin)
* Makefile.in: Regenerate.

2008-10-21  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* include/private/gc_locks.h, include/private/gc_pmark.h,
include/private/gc_priv.h, include/private/gcconfig.h,
mach_dep.c, mark_rts.c, misc.c, os_dep.c, pthread_stop_world.c,
pthread_support.c, thread_local_alloc.c, typd_mlc.c, win32_threads.c:
Fix comments.

2008-10-21  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* pthread_support.c: Comment out LOCK_STATS.
* include/gc.h: Fix comments.

2008-10-20  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* misc.c (GC_init_inner): Enable GC_LOG_FILE on Cygwin.
* include/private/gcconfig.h: Consider USE_MMAP for Cygwin.
* os_dep.c (GC_get_main_stack_base): Use alternate definition
with USE_MMAP.
* include/private/gc_priv.h: Sometimes define SETJMP on Cygwin.

2008-10-20  Hans Boehm <Hans.Boehm@hp.com>
* doc/README: Make it clearer when Makefile.direct is assumed.
* cord/cord.am: install include/cord.h.
* Makefile.in: Regenerate.

2008-09-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* win32_threads.c (GC_pthread_join, GC_pthread_start_inner):
Remove unused variables.
* darwin_stop_world.c: Always declare GC_thr_init().
* dbg_mlc.c (GC_debug_free_inner): Dont touch oh_sz if
SHORT_DBG_HDRS is defined.
* include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET, parallel
mark, USE_MARK_BITS version): Refer to correct parameter name.

2008-09-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* finalize.c (GC_general_register_disappearing_link): Remove
redundant code.
* gcj_mlc.c (GC_init_gcj_malloc): Add cast to signed.
* os_dep.c: (GC_write_fault_handler): Remove remaining
references to deleted variable "code".  Remove redundant
FREEBSD definitions.
* include/private/gcconfig.h (GWW_VDB): Define for X86_64 when
defined for X86. (STATIC): Define as "static" with NO_DEBUGGING.

2008-09-24  Hans Boehm <Hans.Boehm@hp.com>
* include/private/gc_priv.h: Update MAX_HEAP_SECTS.

2008-09-10  Hans Boehm <Hans.Boehm@hp.com>
* dbg_mlc.c (GC_print_smashed_obj): Increase robustness with
smashed string, (GC_debug_free_inner): Mark as free.
* mallocx.c (GC_malloc_many): Always clear new block if
GC_debugging_started.
* reclaim.c: Move GC_debugging_started from
GC_reclaim_small_nonempty_block() to GC_reclaim_generic(),
which is also called directly.
* doc/README: Fix spelling error.  Update license summary.
* include/gc.h (GC_PRE_INCR3, GC_POST_INCR3): add (void **) casts.
* tests/test.c: Don't define GC_DEBUG if already defined.

2008-08-27  Hans Boehm <Hans.Boehm@hp.com>
* doc/simple_example.html: update --enable-full-debug reference,
Make HTML formatting standards compliant.
* doc/debugging.html, doc/leak.html: Fix HTML formatting bugs.
* doc/gcinterface.html: specify encoding.

2008-08-27  Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
* doc/simple_example.html: Update thread-local allocation
description.

2008-08-26  Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
* configure.ac: Check for gc-debug earlier; replace remaining
full-debug tests.
* configure: Regenerate.
* include/gc.h, ptr_chck.c (GC_pre_incr, GC_post_incr):
Use signed offset type.  Use ptr_t internally.
* doc/gcinterface.html: Update LOCAL_MALLOC description.
* doc/README.autoconf, doc/leak.html, doc/README.DGUX386:
Fix full-debug reference.
* include/gc.h: Rewrite GC_..._INCR and friends.
* tests/test.c: Minimally test GC_..._INCR and friends.

2008-08-21  Hans Boehm <Hans.Boehm@hp.com>
* mark.c: (GC_push_next_marked, GC_push_next_marked_dirty,
GC_push_next_marked_uncollectable): Never invoke GC_push_marked
on free hblk.
* headers.c: Test COUNT_HDR_CACHE_HITS not USE_HDR_CACHE.
(GC_header_cache_miss): Always blacklist pointers for free
hblks.  Add assertion and comment.
* pthread_support.c (GC_register_my_thread): Fix #if indentation.
* include/private/gc_hdrs.h: USE_HDR_CACHE is no longer tested.
Delete it.
* include/private/gc_pmark.h: (PUSH_OBJ): Add assertion.

2008-08-21  Hans Boehm <Hans.Boehm@hp.com>
* alloc.c, include/gc_mark.h, Makefile.direct: Improve comments.

2008-08-01  Hans Boehm <Hans.Boehm@hp.com> (Really Klaus Treichel)
* configure.ac: Set win32_threads on MinGW.
* configure: Regenerate.

2008-07-25  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
Ivan's description of the patch follows. Note that a few pieces like
the GC_malloc(0) patch, were not applied since an alternate had been
previously applied.  A few differed stylistically from the rest of
the code (mostly casts to void * instead of target type),
or were classified as too minor to bother.  Note that
all of Ivan's static declarations which did not correct outright
naming bugs (as a few did), where replaced by STATIC, which is
ignored by default.

        - minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for
  GC_malloc(0));
        - addition of missing getter/setter functions for public variables
  (may be useful if compiled as Win32 DLL);
        - addition of missing GC_API for some exported functions;
        - addition of missing "static" declarator for internal functions
   and variables (where possible);
        - replacement of all remaining K&R-style definitions with ANSI
  C ones (__STDC__ macro is not used anymore);
        - addition of some Win32 macro definitions (that may be missing in
  the standard headers supplied with a compiler) for GWW_VDB mode;
        - elimination of most compiler warnings (except for
  "uninitialized data" warning);
        - several typos correction;
        - missing parenthesis addition in macros in some header files of
  "libatomic_ops" module.

My highlights based on reading the patch:

* allchblk.c: Remove GC_freehblk_ptr decl.
Make free_list_index_of() static.
* include/gc.h: Use __int64 on win64, define GC_oom_func,
GC_finalizer_notifier_proc, GC_finalizer_notifier_proc,
add getter and setters: GC_get_gc_no, GC_get_parallel,
GC_set_oom_fn, GC_set_finalize_on_demand,
GC_set_java_finalization, GC_set_dont_expand,
GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect,
GC_set_finalizer_notifier.  Always define GC_win32_free_heap.
gc_config_macros.h: Define _REENTRANT after processing
GC_THREADS.
* include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test,
handling of operator new[] for old Windows compilers.
* include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses
around arguments.
* dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs.
* mark.c (GC_mark_and_push_stack): Fix source argument for
blacklist printing.
* misc.c: Fix log file naming based on environment variable
for Windows.  Make GC_set_warn_proc and GC_set_free_space_divisor
just return current value with 0 argument.  Add DONT_USER_USER32_DLL.
Add various getters and setters as in gc.h.
* os_dep.c: Remove no longer used GC_disable/enable_signals
implementations.  (GC_get_stack_base): Add pthread_attr_destroy
call.  No longer set GC_old_bus_handler in DARWIN workaround.
* pthread_support.c: GC_register_my_thread must also
call GC_init_thread_local.

2008-07-21  Hans Boehm <Hans.Boehm@hp.com>
* Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
* mach_dep.c: Include signal.h.
* gc_priv.h: Factor out INLINE declaration.

2008-07-03  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Thiemo Seufer)

* include/private/gcconfig.h: Update MIPS/LINUX config.
* doc/gcdescr.html: Fix typo.
* mach_dep.c (GC_with_callee_saves_pushed): Don't rely on getcontext
for MIPS/LINUX.

2008-05-30  Hans Boehm <Hans.Boehm@hp.com> (some really dmcmahill)

* configure.ac: SPARC fixes.
* configure: Regenerate.
* thread_local_alloc.c(GC_mark_thread_local_fls_for): Include
size 0, except for gcj.
* doc/gc.man: Expand C++ cautions.
* include/gc_inline.h: Fix comments.

2008-05-03  Hans Boehm <Hans.Boehm@hp.com>

* include/gc_version.h, configure.ac, doc/README:
Change to version 7.2alpha1.
* configure: Regenerate.

[7.1]

2008-05-03  Hans Boehm <Hans.Boehm@hp.com>

* include/gc_version.h, configure.ac, doc/README:
Change to version 7.1.
* configure: Regenerate.

2008-05-03  Hans Boehm <Hans.Boehm@hp.com>

* doc/gcinterface.html: Improve C++ interface documentation.

2008-03-10  Hans Boehm <Hans.Boehm@hp.com>

* allchblk.c (GC_allochblk): Check for overflow during size
rounding.
* tests/huge_test.c: New.
* Makefile.direct, tests/tests.am: Add huge_test.c
* Makefile.in: Regenerate.

2008-02-29  Hans Boehm <Hans.Boehm@hp.com>

* pthread_support.c: Fix typo in comment.
* os_dep.c (GC_win32_get_mem): Add heap section only if
allocation succeeded.

2008-02-28  Hans Boehm <Hans.Boehm@hp.com>

* malloc.c: (free replacement) Fix caller address space check.

2008-02-25  Hans Boehm <Hans.Boehm@hp.com>

* finalize.c (GC_grow_table): Dereference table in null-check.

2008-02-24  Hans Boehm <Hans.Boehm@hp.com>

* win32_threads.c (GC_delete_gc_thread, GC_delete_thread):
Consistently call CloseHandle. (GC_suspend): Call
GC_delete_gc_thread.
* tests/test.c: Don't reference GC_print_stats if not exported.

2008-02-20  Hans Boehm <Hans.Boehm@hp.com>

* tests/test.c (run_one_test): Don't mention pthread_self().
* misc.c: Declare GC_thr_init().

2008-02-20  Hans Boehm <Hans.Boehm@hp.com>

* allchblk.c (add_to_fl): disable assertions with USE_MUNMAP,
and refine assertions to handle huge unmergable blocks.
(GC_allochblk_nth): Add comment.

2008-02-20  Hans Boehm <Hans.Boehm@hp.com>

* include/private/gcconfig.h: Add misssing FREEBSD macro
consistency test.

2008-02-20  Hans Boehm <Hans.Boehm@hp.com>

* allchblk.c (GC_enough_large_bytes_left): No longer take
parameters; return free list index bound.
(GC_merge_unmapped): Don't access nexthdr until after null test.
(Fixes bug in 1/29/08 check-in.)  (GC_allochblk): Calculate
when splitting is allowable only once here, not when considering each
block. (GC_allchblk_nth): Accept new may_split parameter.
Avoid some redundant tests for exact size matches.
* alloc.c (GC_should_collect): Cache min_bytes_allocd.
(GC_maybe_gc): Make locking assertion testable.
* mark_rts.c: Fix indentation.
* pthread_stop_world.c: Replace old GC_err_printf1 reference.
* tests/test.c: Remove (void) casts.  Optionally print some
timing information.

2008-02-15  Hans Boehm <Hans.Boehm@hp.com>

* windows-untested/gc.def: Remove CreateThread line.
* windows-untested/README: New file.
* win32_threads.c (GC_use_DllMain): Force collector initialization.
(GC_init_parallel): Reformat comment.
* include/gc.h (GC_use_DllMain): Clarify usage rules in comment.
* mark.c (GC_mark_from): Slightly simplify GC_DS_PER_OBJECT code.
* include/gc_cpp.h: Add matching placement delete overloads
everywhere.
* include/private/gc_locks.h (NO_THREAD): Add cast.
* include/private/gcconfig.h: Add test for __HP_aCC.
* configure.ac, tests/tests.am:  Avoid libgccpp on HP/UX.
* Makefile.in, configure: Regenerate.

2008-02-11  Hans Boehm <Hans.Boehm@hp.com> (partly David Leonard)

* doc/README.win32: Fix typo.
* configure.ac: Fix printing of enable-shared result.
* configure: Regenerate.

2008-02-08  Hans Boehm <Hans.Boehm@hp.com>

* misc.c (GC_init_inner): Assert !GC_need_to_lock only when
defined.  (GC_call_with_stack_base): Add GC_API.
* os_dep.c (GC_get_stack_base): Add GC_API.
* win32_threads.c: (GC_register_my_thread, GC_unregister_my_thread):
Add GC_API.
* include/gc.h: Add GC_API annotations.
* include/private/gc_locks.h: Define UNCOND_LOCK etc. also for
PCR.
* include/private/gc_pmark.h: Fix comments.

2008-02-06  Hans Boehm <Hans.Boehm@hp.com> (mostly from Henning Makholm)

* include/private/gc_priv.h, mark_rts.c, typd_mlc.c:
Add GC_push_typed_structures() to push GC_ext_descriptors.

2008-01-31  Hans Boehm <Hans.Boehm@hp.com> (mostly from Andreas Tobler)

* tests/test.c: Call GC_INIT for DARWIN; test system type using
gcconfig.h-defined macros.

2008-01-29  Hans Boehm <Hans.Boehm@hp.com>

* allchblk.c (GC_merge_unmapped, GC_freehblk): Refuse to create
blocks large enough that their size, when interpreted as a signed
value, would be negative.
* include/private/gc_priv.h: Comment hb_sz range limit.

2008-01-29  Hans Boehm <Hans.Boehm@hp.com>  (with help from Manuel Serrano)

* mark.c (GC_push_next_marked): correct comment.
* Makefile.direct: document NO_PROC_STAT.
* include/private/gcconfig.h: Accomodate NO_PROC_STAT.

2008-01-10  Hans Boehm <Hans.Boehm@hp.com>

* include/gc_version.h, configure.ac, doc/README:
Change to version 7.1alpha3.
* configure: Regenerate.

[7.1alpha2]

2008-01-10  Hans Boehm <Hans.Boehm@hp.com>

* include/gc_version.h, configure.ac, doc/README:
Change to version 7.1alpha2.
* configure: Regenerate.

2008-01-10  Hans Boehm <Hans.Boehm@hp.com>

* Makefile.am: Mention atomic_ops.c and atomic_ops_sysdeps.S
again.  Refer to build directory as ".".
* Makefile.in: Regenerate.

2008-01-10  Hans Boehm <Hans.Boehm@hp.com>

* configure.ac: Ignore --enable-parallel-mark on Darwin for now.
* configure: Regenerate.
* darwin_stop_world.c: Add FIXME comment for parallel marker.

2008-01-09  Hans Boehm <Hans.Boehm@hp.com>

* include/private/gc_priv.h: Update MAX_ROOT_SETS
and LOG_PHT_ENTRIES to handle larger heaps.

2008-01-03  Hans Boehm <Hans.Boehm@hp.com>

* include/gc.h (GC_INIT,GC_init): Update comments.

2008-01-03  Hans Boehm <Hans.Boehm@hp.com> (based on a patch from
John Bowman, and an ancient patch from Fergus Henderson)

* allchblk.c, alloc.c, include/private/gc_priv.h:
Track GC_bytes_dropped and use in GC triggering decisions.
* alloc.c (min_bytes_allocd): Weight atomic blocks less.

2008-01-02  Hans Boehm <Hans.Boehm@hp.com>

* alloc.c (GC_add_to_heap): Call GC_install_header(p) AFTER
adjusting p.

2007-12-23  Hans Boehm <Hans.Boehm@hp.com>

* Makefile.am: Add NT_X64_THREADS_MAKEFILE.

2007-12-23  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Friedrich Dominicus)

* NT_X64_STATIC_THREADS_MAKEFILE: Clean up obsolete comment.
* alloc.c: Add declaration for GC_add_current_malloc_heap.
* win32_threads.c (GC_beginthreadex): Clean up error
return code.
* doc/README.win64, NT_X64_THREADS_MAKEFILE, Makefile.direct:
Add NT_X64_THREADS_MAKEFILE.

2007-12-21  Hans Boehm <Hans.Boehm@hp.com>

* alloc.c: Define GC_version instead of in version.h.
* version.h: Remove.
* include/gc_version.h: Move most of version.h here.
* include/gc.h: Include gc_version.h.
* gcname.c, add_gc_prefix.c: include gc.h instead of version.h.
* Makefile.direct, Makefile.dj, Makefile.am, include/include.am:
Adjust for version.h rename.
* Makefile.in: Regenerate.

2007-12-21  Hans Boehm <Hans.Boehm@hp.com> (Really mostly russ sludge dot net)

* configure.ac: Put libatomic_ops links in build directory.
* configure: Regenerate.
* Makefile.am: Dont mention atomic_ops.c and atomic_ops_sysdeps.S
as nodist sources.

2007-12-20  Hans Boehm <Hans.Boehm@hp.com>

* include/gc.h, doc/README.macros: Add GC_NO_THREAD_REDIRECTS,
GC_NO_THREAD_DECLS, don't test explicitly for GC_SOLARIS_THREADS.

2007-12-20  Hans Boehm <Hans.Boehm@hp.com>

* alloc.c: Deal correctly with address wrapping for
GC_greatest_plausible_heap_addr and GC_least_plausible_heap_addr.
* finalize.c, include/gc.h (GC_register_disappearing_link,
GC_register_finalizer_inner): Improve out-of-memory handling.
* include/private/gc_pmark.h: Fix comment spelling.

2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really mainly Peter Wang)

* include/gc_inline.h, include/gc_tiny_fl.h: cleanups to make usable
in other contexts.

2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really Radek Polak)

* include/gc.h: Don't define GC_HAVE_BUILTIN_BACKTRACE for uclibc.

2007-12-18  Hans Boehm <Hans.Boehm@hp.com>

* gc_cpp.cc: Don't include gc_cpp.h from local directory.

2007-12-18  Hans Boehm <Hans.Boehm@hp.com> (really Adam Megacz)

* allchblk.c, configure.ac (add --enable-munmap)
* configure: Regenerate.

2007-12-10  Andreas Tobler  <a.tobler@schweiz.org>

* dyn_load.c (GC_dyld_image_add): Remove ifdef clause and use the macro
GC_GETSECTBYNAME instead.
* include/private/gc_priv.h: Define GC_GETSECTBYNAME according to the
architecture (Darwin).

2007-10-24  Hans Boehm <Hans.Boehm@hp.com>

* reclaim.c (GC_bytes_found): Expand comment.
* thread_local_alloc.c (GC_malloc_atomic, GC_gcj_malloc): Pass
granules, not bytes, to GC_FAST_MALLOC_GRANS.
* include/gc.h: Never include gc_local_alloc.h.
* tests/test.c: Add size zero allocation tests.

2007-10-23  Hans Boehm <Hans.Boehm@hp.com>

* malloc.c: Update GC_large_allocd_bytes on explicit deallocation.
* allchblk.c: Sanity check GC_max_large_allocd_bytes.

2007-10-23  Hans Boehm <Hans.Boehm@hp.com> (Really Manuel Serrano)

* Makefile.direct: Invoke $(MAKE) instead of make.

2007-10-23  Hans Boehm <Hans.Boehm@hp.com>

* doc/scale.html: Reflect gc7 thread local allocation behavior.

2007-10-23  Hans Boehm <Hans.Boehm@hp.com> (really Petter Urkedal)

* include/extra/gc.h, include/extra/gc_cpp.h: New.
* include/include.am: Install gc.h and gc_cpp.h in $(prefix)/include
again.
* Makefile.in: Regenerate.

2007-08-15  Hans Boehm <Hans.Boehm@hp.com> (really Samuel Thibault)

* pthread_support.c (GC_thr_init): Use sysconf(_SC_NPROCESSORS_ONLN)
for HURD.

2007-08-14  Hans Boehm <Hans.Boehm@hp.com> (really David Daney)

* include/private/gcconfig.h: Add Linux/mips-64 support.

2007-08-14  Hans Boehm <Hans.Boehm@hp.com> (really mostly Samuel Thibault)

* dbg_mlc.c: Use random() on all glibc systems.
* mach_dep.c (GC_with_callee_saves_pushed): Don't use getcontext() on
HURD.  Add comment.
* pthread_stop_world.c (GC_suspend_handler, GC_stop_init): Accomodate
systems without SA_SIGINFO.

2007-08-14  Hans Boehm <Hans.Boehm@hp.com> (partly really Henrik Theiling)

* include/gc.h (GC_PTR_STORE): Fix non-DEBUG parentheses.
* tests/test.c (run_one_test): Add GC_PTR_STORE test.
No longer test for RS6000.

2007-08-03  Hans Boehm <Hans.Boehm@hp.com>

* alloc.c, backgraph.c, headers.c, include/private/gc_priv.h:
Maintain GC_our_memory and GC_n_memory.
* dbg_mlc.c (GC_print_smashed_obj): Improve message.
(GC_print_all_smashed_proc): Pass client object address instead of
base.
* dyn_load.c (sort_heap_sects): New.  (GC_register_map_entries):
Register sections that are contiguous and merged with our heap.
* malloc.c, os_dep.c (GC_text_mapping): Check for just base name
of libraries.
* malloc.c (calloc): Check for special callers even with
USE_PROC_FOR_LIBRARIES. Move assertion.  Add rudimentary
malloc/free tracing.
* misc.c: No longer call GC_init_lib_bounds explicitly.
* thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Always
initialize on demand.
* tests/test.c: Call GC_INIT only when required.

2007-08-03  Hans Boeh

12 years ago2009-05-27 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Thu, 28 May 2009 00:51:35 +0000 (00:51 +0000)]
2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff26)
* win32_threads.c: restructure parallel marking mutex intialization.
* win32_threads.c, alloc.c, darwin_stop_world.c, mallocx.c, mark.c,
pthread_stop_world.c, pthread_support.c: Add runtime conditions
on GC_parallel were appropriate.
* pthread_support.c: Condition marker_bsp on ia64.
(GC_segment_is_thread_stack): Fix loop upper bound.
* reclaim.c: Limit some assertions to PARALLEL_MARK.
* pthread_support.c: Don't acquire mark lock for thread-local
allocation.
* include/private/gc_priv.h: Don't define parallel mark sync
support just for THREAD_LOCAL_ALLOC.

12 years ago2009-05-27 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Thu, 28 May 2009 00:12:25 +0000 (00:12 +0000)]
2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff39)
* include/private/gcconfig.h: refine MINGW32 test.
* mark.c: Add win64/gcc tests.

12 years ago2009-05-27 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Wed, 27 May 2009 23:09:53 +0000 (23:09 +0000)]
2009-05-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff86_cvs, resembling diff28, diff32, diff33, diff38, diff68 partly)
* test.c (fork_a_thread, reverse_test, alloc8bytes, tree_test,
        typed_test, run_one_test, check_heap_stats, main, test): Replace
        all K&R-style function definitions with ANSI C ones.
        * trace_test.c (main): Ditto.
        * test.c (GC_COND_INIT): Define as GC_INIT() also in case of
        THREAD_LOCAL_ALLOC.
        * test.c (reverse_test): Call fork_a_thread() only if GC_PTHREADS
        or GC_WIN32_THREADS; remove fork_a_thread() macros definition.
        * test.c (reverse_test): Use "volatile" when clearing "b" and "c"
        local variables (to suppress "assigned value is never used"
        compiler warning).
        * test.c (tree_test): Use public GC_noop1() instead of private
        GC_noop().
        * test.c (typed_test): Ditto.
        * test.c (check_heap_stats): Define and assign value to
        "late_finalize_count" local variable only if its value is used
        (if FINALIZE_ON_DEMAND defined).
        * test.c (main): Remove DJGPP-specific initialization of
        GC_stackbottom (not needed anymore, handled in gcconfig.h).
        * trace_test.c: Guard #define GC_DEBUG with #ifndef.
        * trace_test.c: Include "gc_backptr.h".
        * trace_test.c (main): Call GC_INIT().
        * trace_test.c (main): Add "return 0" statement.

12 years ago2009-05-25 Hans Boehm <Hans.Boehm@hp.com> (Really Petter Urkedal)
hboehm [Mon, 25 May 2009 19:24:44 +0000 (19:24 +0000)]
2009-05-25  Hans Boehm <Hans.Boehm@hp.com> (Really Petter Urkedal)
* dyn_load.c (GC_register_dynlib_callback): Use new index j
instead of i in the inner loop.

12 years ago2009-05-24 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff85)
hboehm [Sun, 24 May 2009 23:13:47 +0000 (23:13 +0000)]
2009-05-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff85)
* tests/test.c: Increment n_tests with fetch_and_add when possible,
avoiding need to export lock.

12 years ago2009-05-22 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff63,diff65)
hboehm [Sat, 23 May 2009 00:57:49 +0000 (00:57 +0000)]
2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff63,diff65)
* include/gc_pthread_redirects.h:
- dlfcn.h is included for dlopen() proto before undefining
"dlopen" (so, it's possible now to include dlfcn.h after
gc.h from user code);
- GC_dlopen() proto is added (except for Darwin as
it's missing there);
- "dlopen" is explicitly undefined (before its redefinition).
* include/gc.h:
- "process.h" is included besides "windows.h"
(for _beginthreadex/_endthreadex); win32 only.
- GC_NO_THREAD_DECLS is moved to the right place
(before closing "extern C").
* pthread_support.c: Fix out of memory handling for Thread_Reps.
* win32_threads.c: Don't include process.h on winCE,
improve out of memory handling for thread structures, dont
define GC_beginthreadex and GC_endthreadex for winCE.

12 years ago2009-05-22 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff71)
hboehm [Sat, 23 May 2009 00:12:28 +0000 (00:12 +0000)]
2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff71)
* tests/test.c: Change gcj vtable decriptor type from size_t to
GC_word.

12 years ago2009-05-22 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sat, 23 May 2009 00:02:21 +0000 (00:02 +0000)]
2009-05-22  Hans Boehm <Hans.Boehm@hp.com>
* gcj_mlc.c: Add comment.
* tests/test.c: Change NTEST to NTHREADS.  Fork 5 threads by default.
Run reverse_test a second time in each thread.Add comments.
Dont rely on AO_fetch_and_add.

12 years ago2009-05-22 Hans Boehm <Hans.Boehm@hp.com> (Largely from Ludovic Cortes)
hboehm [Fri, 22 May 2009 23:55:44 +0000 (23:55 +0000)]
2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Largely from Ludovic Cortes)
* dyn_load.c (GC_register_dynlib_callback,
GC_register_dynamic_libraries_dl_iterate_phdr): Add support
for GNU_PT_RELRO relocations.

12 years ago2009-05-22 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff61)
hboehm [Fri, 22 May 2009 23:38:02 +0000 (23:38 +0000)]
2009-05-22  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski, diff61)
* Makefile, Makefile.direct: GC_SOLAIS_PTHREADS was replaced
by GC_SOLARIS_THREADS.
* include/gc.h: Improve finalizer documentation.
* mips_sgi_mach_dep.s: Replace _MIPS_SIM_ABI32 with _ABIO32.
* pthread_stop_world.c, Makefile.dj: Fix typos.

12 years agoCorrect ChangeLog entry for last check-in.
hboehm [Fri, 22 May 2009 17:59:43 +0000 (17:59 +0000)]
Correct ChangeLog entry for last check-in.

12 years ago2009-05-21 Hans Boehm <Hans.Boehm@hp.com> (really Ivan Maidanski)
hboehm [Fri, 22 May 2009 00:39:53 +0000 (00:39 +0000)]
2009-05-21  Hans Boehm <Hans.Boehm@hp.com> (really Ivan Maidanski)
* win32_threads.c (GC_new_thread): Make first_thread
visible to the whole file.
(UNPROTECT): New macro.
(GC_push_stack_for, GC_suspend, GC_start_world): unprotect
thread structures before writing.
(GC_suspend): Acquire GC_fault_handler_lock before suspending
thread.
* os_dep.c: export GC_fault_handler_lock.
(GC_remove_protection): Check if already unprotected.

12 years ago2009-05-20 Hans Boehm <Hans.Boehm@hp.com> (really Ivan Maidanski)
hboehm [Wed, 20 May 2009 19:00:01 +0000 (19:00 +0000)]
2009-05-20  Hans Boehm <Hans.Boehm@hp.com> (really Ivan Maidanski)
* doc/README.win32: Add OpenWatcom warning.
* include/private/gcconfig.h: Really check it in.

12 years ago2009-05-19 Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidanski, Dave Korn)
hboehm [Wed, 20 May 2009 01:22:39 +0000 (01:22 +0000)]
2009-05-19  Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidanski, Dave Korn)
* os_dep.c (GC_get_stack_base, windows): Replace with Dave Korn's
code from gcc version.
* os_dep.c: make gc compilable (optionally) for Cygwin with
GetWriteWatch-based virtual dirty bit implementation ("os_dep.c" file).
* os_dep.c: Make non-win32 GC_write_fault_handler STATIC.
* mark.c (GC_noop): fix declaration definition mismatch for DMC.
* include/private/gcconfig.h: Remove special handling for Watcom
and GWW_VDB.  It works.

12 years ago2009-05-07 Hans Boehm <Hans.Boehm@hp.com> and Mark Sibly
hboehm [Thu, 7 May 2009 22:30:57 +0000 (22:30 +0000)]
2009-05-07  Hans Boehm <Hans.Boehm@hp.com> and Mark Sibly
* mach_dep.c: Don't use __builtin_unwind_init for register
state on PowerPC/Darwin.

12 years ago2009-04-24 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sat, 25 Apr 2009 00:11:39 +0000 (00:11 +0000)]
2009-04-24  Hans Boehm <Hans.Boehm@hp.com>
* doc/gcdescr.html: Improve description of object freelist
structure.
* include/private/gc_priv.h: Fix comment for _size_map.

12 years ago2009-03-16 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Mon, 16 Mar 2009 23:53:10 +0000 (23:53 +0000)]
2009-03-16  Hans Boehm <Hans.Boehm@hp.com>
* os_dep.c (GC_linux_stack_base): Relax sanity test.

12 years ago2009-03-11 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Wed, 11 Mar 2009 23:46:43 +0000 (23:46 +0000)]
2009-03-11  Hans Boehm <Hans.Boehm@hp.com>  (Really Ivan Maidanski)
* include/private/gc_pmark.h (PUSH_CONTENTS_HDR for
MARK_BIT_PER_OBJ): Add missing backslash before eoln.

12 years ago2009-02-28 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sun, 1 Mar 2009 01:52:59 +0000 (01:52 +0000)]
2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
* misc.c (GC_set_warn_proc): Implicitly intialize GC on
non-Cygwin win32.

12 years ago2009-02-28 Hans Boehm <Hans.Boehm@hp.com> (Really Petr Krajca)
hboehm [Sun, 1 Mar 2009 01:17:36 +0000 (01:17 +0000)]
2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Petr Krajca)
* configure.ac: Enable thread-local allocation for sparc-linux.
* configure: Regenerate.

12 years ago2009-02-28 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
hboehm [Sun, 1 Mar 2009 00:43:01 +0000 (00:43 +0000)]
2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* alloc.c (GC_try_to_collect): Remove duplicate initialization
check.
* malloc.c (GC_generic_malloc): Remove lw to eliminate single-
threaded warnings.
* mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.

12 years ago2009-02-28 Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidansky)
hboehm [Sun, 1 Mar 2009 00:20:14 +0000 (00:20 +0000)]
2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (Mostly Ivan Maidansky)
* allchblk.c, backgraph.c, dbg_mlc.c, dyn_load.c,
finalize.c, include/private/gc_pmark.h, malloc.c, mark.c,
os_dep.c, pthread_stop_world.c, pthread_support.c, reclaim.c,
thread_local_alloc.c.
* misc.s: Refine comment.

2009-02-28  Hans Boehm <Hans.Boehm@hp.com>
* os_dep.c: Define GC_GWW_BUF_LEN more intelligently.  Add FIXME
comment.

12 years ago2009-02-28 Hans Boehm <Hans.Boehm@hp.com> (With input from Ivan Maidansky)
hboehm [Sat, 28 Feb 2009 23:29:44 +0000 (23:29 +0000)]
2009-02-28  Hans Boehm <Hans.Boehm@hp.com> (With input from Ivan Maidansky)
* win32_threads.c (GC_push_stack_for): Yet another attempt
at the stack_min finding logic.  Try to clean up the existing code
while minimizing VirtualQuery calls.
(GC_win32_start_inner): Register thread before GC_printf.
Produce more output with DEBUG_THREADS.
*include/gc.h: Update obsolete comments.

12 years ago2009-02-24 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
hboehm [Tue, 24 Feb 2009 22:44:52 +0000 (22:44 +0000)]
2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* tests/test.c:
(gcj_class_struct2): Use cast instead of l suffix.
Cast GetLastError to int in various places.
Avoid unused result warning from incr/decr macros.
Add cast for fake_gcj_mark_proc.
Cast GC_gc_no to unsigned in printf.

12 years ago2009-02-24 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
hboehm [Tue, 24 Feb 2009 21:54:25 +0000 (21:54 +0000)]
2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* include/gc.h: Fix two typos in comments.

12 years ago2009-02-24 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
hboehm [Tue, 24 Feb 2009 21:44:44 +0000 (21:44 +0000)]
2009-02-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
        * finalize.c: Fix typo in comment.

12 years ago2008-12-03 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
hboehm [Thu, 4 Dec 2008 01:45:52 +0000 (01:45 +0000)]
2008-12-03  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* blacklst.c (GC_print_source_pointer): Don't call GC_print_heap_obj
with lock.

12 years ago2008-12-01 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Tue, 2 Dec 2008 00:37:17 +0000 (00:37 +0000)]
2008-12-01  Hans Boehm <Hans.Boehm@hp.com>
* reclaim.c: (GC_reclaim_block): Scan even nearly full blocks
if we are checking for leaks.

12 years ago2008-11-12 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
hboehm [Thu, 13 Nov 2008 01:26:56 +0000 (01:26 +0000)]
2008-11-12  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
* win32_threads.c: Remove mark lock spinning.
* win32_threads.c, pthread_support.c: Update GC_unlocked_count,
GC_spin_count, and GC_block_count using atomic operations.
* tests/test.c: Declare n_tests as AO_t only if we have threads.

12 years ago2008-11-11 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Wed, 12 Nov 2008 01:08:51 +0000 (01:08 +0000)]
2008-11-11  Hans Boehm <Hans.Boehm@hp.com>
(Really almost entirely Ivan Maidansky)
* win32_threads.c: Support PARALLEL_MARK.  Make printf arg
types agree with format specifiers.  Add missing copyright header.
Add STATIC for GC_threads.
* include/private/gcconfig.h: Add FIXME comment.
* tests/test.c (run_ine_test): Replace LOCK/UNLOCK use with
AO_fetch_and_add1_full.  Declare n_tests as AO_t.
(WinMain): Dont call GC_use_DllMain.
with PARALLEL_MARK or THREAD_LOCAL_ALLOC.

12 years ago2008-11-10 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
hboehm [Tue, 11 Nov 2008 00:24:52 +0000 (00:24 +0000)]
2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* alloc.c (GC_try_to_collect_inner): Don't print redundant
GC_bytes_allocd and GC_gc_no.
(GC_stopped_mark): Print average world stop time.
* include/private/gc_priv.h (MS_TIME_DIFF): Add cast.

12 years ago2008-11-10 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
hboehm [Mon, 10 Nov 2008 23:15:32 +0000 (23:15 +0000)]
2008-11-10  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidansky)
* misc.c, doc/README.environment: Add support  for
GC_FREE_SPACE_DIVISOR and GC-disable-incremental.
* include/gc.h: Make GC_set_free_space_divisor correspond to
(somewhat unfortunate) reality.

12 years ago2008-11-07 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
hboehm [Sat, 8 Nov 2008 00:29:55 +0000 (00:29 +0000)]
2008-11-07  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
(Mostly improves LLP64 support.)
* backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c,
misc.c, reclaim.c: Changed some int and long type to word or size_t
(and vice versa where appropriate)
* gcj_mlc.c, include/private/dbg_mlc.h, include/private/gcconfig.h,
include/private/thread_local_alloc.h, mark.c,
misc.c, thread_local_alloc.c, win32_threads.c: Added intermediate
casts to word type when casting from int to pointer (or pointer
to int, or data pointer to code pointer) - just to remove the
corresponding compiler warning.
* ptr_chck.c (GC_is_visible): cast int const to word type to
prevent left shift overflow.
* os_dep.c: change the type of GC_mem_top_down global var
(containing a flag) to DWORD.
* include/gc_config_macros.h: define GC_SOLARIS_THREADS if GC_THREADS
is defined on SunOS x86_64.
* misc.c (GC_init_size_map): Ifdef out GC_ASSERT as a workaround
for VC++ 2008 amd64 (v15.00.21022.08 for x64) compiler bug
(the compiler gets hung if invoked with -Ox -D
ALL_INTERIOR_POINTERS -D GC_ASSERTIONS)
* backgraph.c: cast GC_gc_no value to unsigned short when
assigned/compared to height_gc_no field of back_edges.
* os_dep.c (GC_remove_protection): Add ARGSUSED.
* win32_threads.c (GC_thread_exit_proc): Remove unused local var.
* mark.c (GC_check_dirty): Move declaration out of func body.

12 years ago2008-11-06 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Fri, 7 Nov 2008 00:53:21 +0000 (00:53 +0000)]
2008-11-06  Hans Boehm <Hans.Boehm@hp.com>
* doc/gcinterface.html: Improve REDIRECT_MALLOC documentation.
* include/gc.h (GC_register_my_thread): Improve comment.

12 years ago2008-11-04 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Wed, 5 Nov 2008 01:11:08 +0000 (01:11 +0000)]
2008-11-04  Hans Boehm <Hans.Boehm@hp.com>
* Makefile.direct: Add comment for -DCHECKSUMS.

12 years ago2008-10-27 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
hboehm [Tue, 28 Oct 2008 00:58:57 +0000 (00:58 +0000)]
2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* thread_local_alloc.c, include/private/thread_local_alloc.h:
Fix typos in comments.
* finalize.c: Declare mark_procs and GC_register_finalizer_inner
STATIC.
* malloc.c (GC_free): Move size calculation below assertion.

12 years ago2008-10-27 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Tue, 28 Oct 2008 00:42:29 +0000 (00:42 +0000)]
2008-10-27  Hans Boehm <Hans.Boehm@hp.com>
* win32_threads.c (GC_get_stack_min, GC_may_be_in_stack):
Add one entry VirtualQuery cache, I_HOLD_LOCK assertions.
(GC_push_stack_for, GC_get_next_stack) : Hopefully fix WINCE support.

2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Thanks to Klaus Treichel.)
* finalize.c (GC_general_register_disappearing_link): Add
assertion.
* malloc.c (GC_generic_malloc): Round lb to granules, not words.
* mallocx.c (GC_generic_malloc_ignore_off_page): Round lb to
granules, not words.

12 years ago2008-10-27 Hans Boehm <Hans.Boehm@hp.com> (Really Rex Dieter and
hboehm [Mon, 27 Oct 2008 22:55:49 +0000 (22:55 +0000)]
2008-10-27  Hans Boehm <Hans.Boehm@hp.com> (Really Rex Dieter and
Petr Krajca)
* mach_dep.c (NO_GETCONTEXT): Define for sparc linux.
* configure.ac: Define mach_dep for sparc-linux.
* configure: Regenerate.

12 years ago2008-10-25 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
hboehm [Sun, 26 Oct 2008 05:22:45 +0000 (05:22 +0000)]
2008-10-25  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* mark_rts.c (GC_approx_sp): Use volatile to avoid common
warning.

12 years ago2008-10-25 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sun, 26 Oct 2008 05:16:36 +0000 (05:16 +0000)]
2008-10-25  Hans Boehm <Hans.Boehm@hp.com>
* dyn_load.c (GC_cond_add_roots): Fix GC_get_next_stack argument
order.

12 years ago2008-10-24 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Sat, 25 Oct 2008 05:03:02 +0000 (05:03 +0000)]
2008-10-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* alloc.c, dbg_mlc.c, dyn_load.c, finalize.c, gcj_mlc.c,
include/gc.h, include/gc_config_macros.h, include/gc_cpp.h,
include/gc_gcj.h, include/gc_mark.h, include/gc_typed.h,
include/javaxfc.h, include/private/gc_locks.h,
include/private/gc_priv.h, malloc.c, mallocx.c, mark.c, mark_rts.c,
misc.c, obj_map.c, os_dep.c, pthread_support.c, ptr_chck.c,
stubborn.c, tests/test.c, thread_local_alloc.c, typd_mlc.c
win32_threads.c: Add GC_CALL and GC_CALLBACK macro invocations.
* test.c: Remove some old K&R code.

12 years ago2008-10-24 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sat, 25 Oct 2008 00:13:19 +0000 (00:13 +0000)]
2008-10-24  Hans Boehm <Hans.Boehm@hp.com>
(Partially based loosely on patch from Ivan Maidanski)
* win32_threads.c (GC_may_be_in_stack): New.  (GC_Thread_Rep):
Add last_stack_min.  (GC_push_stack_for): Use last_stack_min.
(GC_get_next_stack): Add limit argument, use_last_stack_min.
(GC_suspend): make stack_base assignment conditional.
* dyn_load.c (win32 GC_cod_add_roots): Pass limit to
GC_get_next_stack.
* configure_atomic_ops.sh: Remove.
* build_atomic_ops.sh, build_atomic_ops.sh.cygwin, doc/README.win32,
Makefile.direct: Partially support build directories whose path
name contains blanks.
* Makefile.am: Support new files (build_atomic_ops.sh,
build_atomic_ops.sh.cygwin)
* Makefile.in: Regenerate.

12 years ago2008-10-21 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Wed, 22 Oct 2008 01:06:28 +0000 (01:06 +0000)]
2008-10-21  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* include/private/gc_locks.h, include/private/gc_pmark.h,
include/private/gc_priv.h, include/private/gcconfig.h,
mach_dep.c, mark_rts.c, misc.c, os_dep.c, pthread_stop_world.c,
pthread_support.c, thread_local_alloc.c, typd_mlc.c, win32_threads.c:
Fix comments.

12 years ago2008-10-21 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Wed, 22 Oct 2008 00:45:55 +0000 (00:45 +0000)]
2008-10-21  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* pthread_support.c: Comment out LOCK_STATS.
* include/gc.h: Fix comments.

12 years ago2008-10-20 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Mon, 20 Oct 2008 23:42:32 +0000 (23:42 +0000)]
2008-10-20  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* misc.c (GC_init_inner): Enable GC_LOG_FILE on Cygwin.
* include/private/gcconfig.h: Consider USE_MMAP for Cygwin.
* os_dep.c (GC_get_main_stack_base): Use alternate definition
with USE_MMAP.
* include/private/gc_priv.h: Sometimes define SETJMP on Cygwin.

12 years ago2008-10-20 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Mon, 20 Oct 2008 23:11:27 +0000 (23:11 +0000)]
2008-10-20  Hans Boehm <Hans.Boehm@hp.com>
* doc/README: Make it clearer when Makefile.direct is assumed.
* cord/cord.am: install include/cord.h.
* Makefile.in: Regenerate.

12 years ago2008-09-24 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Thu, 25 Sep 2008 00:51:23 +0000 (00:51 +0000)]
2008-09-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* win32_threads.c (GC_pthread_join, GC_pthread_start_inner):
Remove unused variables.
* darwin_stop_world.c: Always declare GC_thr_init().
* dbg_mlc.c (GC_debug_free_inner): Dont touch oh_sz if
SHORT_DBG_HDRS is defined.
* include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET, parallel
mark, USE_MARK_BITS version): Refer to correct parameter name.

12 years ago2008-09-24 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
hboehm [Thu, 25 Sep 2008 00:24:21 +0000 (00:24 +0000)]
2008-09-24  Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
* finalize.c (GC_general_register_disappearing_link): Remove
redundant code.
* gcj_mlc.c (GC_init_gcj_malloc): Add cast to signed.
* os_dep.c: (GC_write_fault_handler): Remove remaining
references to deleted variable "code".  Remove redundant
FREEBSD definitions.
* include/private/gcconfig.h (GWW_VDB): Define for X86_64 when
defined for X86. (STATIC): Define as "static" with NO_DEBUGGING.

12 years ago2008-09-24 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Wed, 24 Sep 2008 23:34:47 +0000 (23:34 +0000)]
2008-09-24  Hans Boehm <Hans.Boehm@hp.com>
* include/private/gc_priv.h: Update MAX_HEAP_SECTS.

12 years ago2008-09-10 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Thu, 11 Sep 2008 01:37:57 +0000 (01:37 +0000)]
2008-09-10  Hans Boehm <Hans.Boehm@hp.com>
* dbg_mlc.c (GC_print_smashed_obj): Increase robustness with
smashed string, (GC_debug_free_inner): Mark as free.
* mallocx.c (GC_malloc_many): Always clear new block if
GC_debugging_started.
* reclaim.c: Move GC_debugging_started from
GC_reclaim_small_nonempty_block() to GC_reclaim_generic(),
which is also called directly.
* doc/README: Fix spelling error.  Update license summary.
* include/gc.h (GC_PRE_INCR3, GC_POST_INCR3): add (void **) casts.
* tests/test.c: Don't define GC_DEBUG if already defined.

12 years ago2008-08-27 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Wed, 27 Aug 2008 22:14:51 +0000 (22:14 +0000)]
2008-08-27  Hans Boehm <Hans.Boehm@hp.com>
* doc/simple_example.html: update --enable-full-debug reference,
Make HTML formatting standards compliant.
* doc/debugging.html, doc/leak.html: Fix HTML formatting bugs.
* doc/gcinterface.html: specify encoding.

12 years ago2008-08-27 Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
hboehm [Wed, 27 Aug 2008 20:40:25 +0000 (20:40 +0000)]
2008-08-27  Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
* doc/simple_example.html: Update thread-local allocation
description.

12 years ago2008-08-26 Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
hboehm [Tue, 26 Aug 2008 23:11:47 +0000 (23:11 +0000)]
2008-08-26  Hans Boehm <Hans.Boehm@hp.com> (with help from Marco Maggi)
* configure.ac: Check for gc-debug earlier; replace remaining
full-debug tests.
* configure: Regenerate.
* include/gc.h, ptr_chck.c (GC_pre_incr, GC_post_incr):
Use signed offset type.  Use ptr_t internally.
* doc/gcinterface.html: Update LOCAL_MALLOC description.
* doc/README.autoconf, doc/leak.html, doc/README.DGUX386:
Fix full-debug reference.
* include/gc.h: Rewrite GC_..._INCR and friends.
* tests/test.c: Minimally test GC_..._INCR and friends.

12 years ago2008-08-21 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Thu, 21 Aug 2008 21:06:56 +0000 (21:06 +0000)]
2008-08-21  Hans Boehm <Hans.Boehm@hp.com>
* mark.c: (GC_push_next_marked, GC_push_next_marked_dirty,
GC_push_next_marked_uncollectable): Never invoke GC_push_marked
on free hblk.
* headers.c: Test COUNT_HDR_CACHE_HITS not USE_HDR_CACHE.
(GC_header_cache_miss): Always blacklist pointers for free
hblks.  Add assertion and comment.
* pthread_support.c (GC_register_my_thread): Fix #if indentation.
* include/private/gc_hdrs.h: USE_HDR_CACHE is no longer tested.
Delete it.
* include/private/gc_pmark.h: (PUSH_OBJ): Add assertion.

2008-08-21  Hans Boehm <Hans.Boehm@hp.com>
* alloc.c, include/gc_mark.h, Makefile.direct: Improve comments.

12 years ago2008-08-01 Hans Boehm <Hans.Boehm@hp.com> (Really Klaus Treichel)
hboehm [Fri, 1 Aug 2008 21:55:57 +0000 (21:55 +0000)]
2008-08-01  Hans Boehm <Hans.Boehm@hp.com> (Really Klaus Treichel)
* configure.ac: Set win32_threads on MinGW.
* configure: Regenerate.

12 years ago2008-07-25 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
hboehm [Sat, 26 Jul 2008 00:51:33 +0000 (00:51 +0000)]
2008-07-25  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Ivan Maidanski)
Ivan's description of the patch follows. Note that a few pieces like
the GC_malloc(0) patch, were not applied since an alternate had been
previously applied.  A few differed stylistically from the rest of
the code (mostly casts to void * instead of target type),
or were classified as too minor to bother.  Note that
all of Ivan's static declarations which did not correct outright
naming bugs (as a few did), where replaced by STATIC, which is
ignored by default.

        - minor bug fixing (for FreeBSD, for THREAD_LOCAL_ALLOC and for
  GC_malloc(0));
        - addition of missing getter/setter functions for public variables
  (may be useful if compiled as Win32 DLL);
        - addition of missing GC_API for some exported functions;
        - addition of missing "static" declarator for internal functions
   and variables (where possible);
        - replacement of all remaining K&R-style definitions with ANSI
  C ones (__STDC__ macro is not used anymore);
        - addition of some Win32 macro definitions (that may be missing in
  the standard headers supplied with a compiler) for GWW_VDB mode;
        - elimination of most compiler warnings (except for
  "uninitialized data" warning);
        - several typos correction;
        - missing parenthesis addition in macros in some header files of
  "libatomic_ops" module.

My highlights based on reading the patch:

* allchblk.c: Remove GC_freehblk_ptr decl.
Make free_list_index_of() static.
* include/gc.h: Use __int64 on win64, define GC_oom_func,
GC_finalizer_notifier_proc, GC_finalizer_notifier_proc,
add getter and setters: GC_get_gc_no, GC_get_parallel,
GC_set_oom_fn, GC_set_finalize_on_demand,
GC_set_java_finalization, GC_set_dont_expand,
GC_set_no_dls, GC_set_max_retries, GC_set_dont_precollect,
GC_set_finalizer_notifier.  Always define GC_win32_free_heap.
gc_config_macros.h: Define _REENTRANT after processing
GC_THREADS.
* include/gc_cpp.h: Improve GC_PLACEMENT_DELETE test,
handling of operator new[] for old Windows compilers.
* include/gc_inline.h (GC_MALLOC_FAST_GRANS): Add parentheses
around arguments.
* dbg_mlc.c, malloc.c, misc.c: Add many GC_API specs.
* mark.c (GC_mark_and_push_stack): Fix source argument for
blacklist printing.
* misc.c: Fix log file naming based on environment variable
for Windows.  Make GC_set_warn_proc and GC_set_free_space_divisor
just return current value with 0 argument.  Add DONT_USER_USER32_DLL.
Add various getters and setters as in gc.h.
* os_dep.c: Remove no longer used GC_disable/enable_signals
implementations.  (GC_get_stack_base): Add pthread_attr_destroy
call.  No longer set GC_old_bus_handler in DARWIN workaround.
* pthread_support.c: GC_register_my_thread must also
call GC_init_thread_local.

12 years ago2008-07-21 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Tue, 22 Jul 2008 00:29:00 +0000 (00:29 +0000)]
2008-07-21  Hans Boehm <Hans.Boehm@hp.com>
* Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
* mach_dep.c: Include signal.h.
* gc_priv.h: Factor out INLINE declaration.

12 years ago2008-07-03 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Thiemo Seufer)
hboehm [Thu, 3 Jul 2008 21:46:04 +0000 (21:46 +0000)]
2008-07-03  Hans Boehm <Hans.Boehm@hp.com> (Really mostly Thiemo Seufer)

* include/private/gcconfig.h: Update MIPS/LINUX config.
* doc/gcdescr.html: Fix typo.
* mach_dep.c (GC_with_callee_saves_pushed): Don't rely on getcontext
for MIPS/LINUX.

12 years ago2008-05-30 Hans Boehm <Hans.Boehm@hp.com> (some really dmcmahill)
hboehm [Sat, 31 May 2008 00:40:00 +0000 (00:40 +0000)]
2008-05-30  Hans Boehm <Hans.Boehm@hp.com> (some really dmcmahill)

* configure.ac: SPARC fixes.
* configure: Regenerate.
* thread_local_alloc.c(GC_mark_thread_local_fls_for): Include
size 0, except for gcj.
* doc/gc.man: Expand C++ cautions.
* include/gc_inline.h: Fix comments.

12 years ago2008-05-03 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sun, 4 May 2008 01:20:36 +0000 (01:20 +0000)]
2008-05-03  Hans Boehm <Hans.Boehm@hp.com>

* include/gc_version.h, configure.ac, doc/README:
Change to version 7.2alpha1.
* configure: Regenerate.

12 years ago2008-05-03 Hans Boehm <Hans.Boehm@hp.com> gc7_1
hboehm [Sun, 4 May 2008 01:07:59 +0000 (01:07 +0000)]
2008-05-03  Hans Boehm <Hans.Boehm@hp.com>

* include/gc_version.h, configure.ac, doc/README:
Change to version 7.1.
* configure: Regenerate.

12 years ago2008-05-03 Hans Boehm <Hans.Boehm@hp.com>
hboehm [Sun, 4 May 2008 00:48:31 +0000 (00:48 +0000)]
2008-05-03  Hans Boehm <Hans.Boehm@hp.com>

* doc/gcinterface.html: Improve C++ interface documentation.