platform/upstream/libgc.git
12 years ago2011-07-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 14 Jul 2011 17:20:58 +0000 (17:20 +0000)]
2011-07-14  Ivan Maidanski <ivmai@mail.ru>

* .cvsignore: Add more auto-generated files.

12 years ago2011-07-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 14 Jul 2011 13:43:13 +0000 (13:43 +0000)]
2011-07-14  Ivan Maidanski <ivmai@mail.ru>

* new_hblk.c (GC_build_fl): Adjust "h" local variable cast type
when setting obj_link (to prevent compiler warning); reformat the
comment.
* tests/test.c (reverse_test_inner): Use proper type when touching
"b" and "c" local variables (to prevent compiler warning).

12 years ago2011-07-05 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 5 Jul 2011 17:53:24 +0000 (17:53 +0000)]
2011-07-05  Ivan Maidanski <ivmai@mail.ru>

* misc.c (GC_init): Use HOTTER_THAN (instead of STACK_GROWS_DOWN)
for GC_stackbottom assertion.
* os_dep.c (GC_enclosing_mapping): Define only if IA64 or
INCLUDE_LINUX_THREAD_DESCR; make GC_INNER.
* pthread_support.c (GC_enclosing_mapping): Declare (only if
INCLUDE_LINUX_THREAD_DESCR).
* os_dep.c (GC_get_main_stack_base): Don't call pthread_getattr_np
if REDIRECT_MALLOC as the former is observed to call redirected
malloc (while GC is not initialized yet) on some Linux platforms.
* include/private/gc_priv.h (MAX_HEAP_SECTS): Don't use a smaller
value for SMALL_CONFIG if USE_PROC_FOR_LIBRARIES defined.

12 years ago2011-07-05 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 5 Jul 2011 16:35:22 +0000 (16:35 +0000)]
2011-07-05  Ivan Maidanski <ivmai@mail.ru>

* malloc.c (GC_init_lib_bounds): Call GC_init (to ensure GC is
initialized before doing GC_text_mapping).
* misc.c (GC_init): Add a check for GC_init recursion in case of
malloc is redirected (abort with the corresponding message).
* pthread.c (GC_thr_init): Place GC_add_roots_inner call into
"else" branch to prevent "local variable might be uninitialized"
compiler warning; add comment.

12 years ago2011-07-05 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 5 Jul 2011 13:50:08 +0000 (13:50 +0000)]
2011-07-05  Ivan Maidanski <ivmai@mail.ru>

* dyn_load.c (GC_register_dynamic_libraries): Remove duplicate
call of GC_FirstDLOpenedLinkMap (twice).
* dyn_load.c (GC_register_main_static_data): Add comment.
* cord/cordbscs.c (CORD_riter): Check for empty string passed (do
not call CORD_riter4 if CORD_len() returned zero).
* cord/cordbscs.c (CORD_init_min_len): Replace the K&R-style
function definition with the ANSI C one.
* cord/cordbscs.c: Expand all tabs to spaces; remove
trailing spaces at EOLn.
* tests/threadkey_test.c (on_thread_exit_inner): Check
GC_pthread_create() result.

12 years ago2011-07-04 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 4 Jul 2011 14:56:09 +0000 (14:56 +0000)]
2011-07-04  Ivan Maidanski <ivmai@mail.ru>

* include/private/gcconfig.h (etext): Don't define if unused
(NetBSD).
* include/private/gcconfig.h (GC_data_start, DATASTART): Define
for NetBSD/amd64 if ELF.
* include/private/gcconfig.h (SEARCH_FOR_DATA_START): Don't define
for NetBSD/amd64 if ELF.

12 years ago2011-07-04 Ivan Maidanski <ivmai@mail.ru> (mostly really Andy Wingo)
ivmai [Mon, 4 Jul 2011 13:29:55 +0000 (13:29 +0000)]
2011-07-04  Ivan Maidanski <ivmai@mail.ru> (mostly really Andy Wingo)

* configure.ac (GC_THREADS): Refine the comment.
* configure.ac (GC_WIN32_PTHREADS): Add template.
* configure.ac (cygwin, win32): Define GC_WIN32_THREADS instead of
GC_THREADS.
* configure.ac (pthreads): Add mingw target (GC_WIN32_PTHREADS).
* configure: Regenerate.
* include/private/config.h.in: Ditto.
* include/private/gc_locks.h (GC_WIN32_PTHREADS): Remove nested
test for the macro; add comment.

12 years ago2011-07-01 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 1 Jul 2011 09:53:44 +0000 (09:53 +0000)]
2011-07-01  Ivan Maidanski <ivmai@mail.ru>

* win32_threads.c (CHECK_LOOKUP_MY_THREAD): New macro definition.
* win32_threads.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested, GC_unregister_my_thread,
GC_do_blocking_inner, GC_call_with_gc_active, GC_init_parallel):
Insert CHECK_LOOKUP_MY_THREAD before dereferencing thread
descriptor pointer (to instruct a LINT-like tool that it is ok to
dereference the pointer).
* win32_threads.c (GC_get_next_stack): Assert plast_stack_min is
non-NULL if current_min is not ADDR_LIMIT (for a LINT-like tool).
* win32_threads.c (GC_init_parallel): Define and use "me" local
variable.
* cord/cordtest.c (test_basics): Test CORD_substr() result is
non-NULL.
* cord/cordtest.c (test_extras): Test fopen() result is non-NULL.
* cord/cordtest.c (test_basics, test_extras, test_printf, main):
Replace the K&R-style function definition with the ANSI C one.
* cord/cordtest.c: Expand all tabs to spaces; remove
trailing spaces at EOLn.
* include/private/gc_priv.h (ABORT): Define as abort() when
checking the code with a LINT-like tool (Win32 only).
* tests/test.c (FAIL): Ditto.
* tests/test.c (CHECH_GCLIB_VERSION): New macro (to check that the
version of libgc.so used at runtime matches that at compile time).
* tests/test.c (GC_COND_INIT): Use CHECH_GCLIB_VERSION.
* tests/test.c (CHECK_OUT_OF_MEMORY): New macro (to test malloc
result for out of memory).
* tests/test.c (cons, small_cons, small_cons_uncollectable,
gcj_cons, reverse_test_inner, mktree, alloc8bytes, typed_test,
run_one_test): Use CHECK_OUT_OF_MEMORY.

12 years ago2011-06-30 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 30 Jun 2011 15:43:44 +0000 (15:43 +0000)]
2011-06-30  Ivan Maidanski <ivmai@mail.ru>

* dyn_load.c (GC_register_map_entries): Remove "count" local
variable as unused.
* gc_dlopen.c (disable_gc_for_dlopen): Define only if not
USE_PROC_FOR_LIBRARIES.
* malloc.c (calloc): Add parentheses around '&&' operator.
* mark.c (GC_noop_sink): New global variable (instead of a static
local variable inside GC_noop1).
* mark.c (GC_noop1): Use GC_noop_sink variable (to prevent
"variable set but not used" compiler warning).
* include/private/gcconfig.h (USE_PROC_FOR_LIBRARIES): Define only
if undefined yet.
* tests/smash_test.c (main): Don't dereference "p" local variable
if it is NULL.
* tests/staticrootslib.c (main): Ditto.

12 years ago2011-06-30 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 30 Jun 2011 15:29:25 +0000 (15:29 +0000)]
2011-06-30  Ivan Maidanski <ivmai@mail.ru>

* pthread_support.c (GC_segment_is_thread_stack): Replace '&'
operator with '&&' one in conditional expressions.
* specific.c (remove_specific): Dereference "entry" local variable
only if it is non-NULL.
* include/gc.h (GC_NEW): Refine the comment (about the returned
value).

12 years ago2011-06-15 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 15 Jun 2011 11:41:29 +0000 (11:41 +0000)]
2011-06-15  Ivan Maidanski <ivmai@mail.ru>

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

12 years ago2011-06-14 Ivan Maidanski <ivmai@mail.ru> gc7_2alpha6
ivmai [Tue, 14 Jun 2011 13:28:26 +0000 (13:28 +0000)]
2011-06-14  Ivan Maidanski  <ivmai@mail.ru>

* configure_atomic_ops.sh: Remove.

12 years ago2011-06-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 14 Jun 2011 13:25:24 +0000 (13:25 +0000)]
2011-06-14  Ivan Maidanski  <ivmai@mail.ru>

* configure_atomic_ops.sh: Remove.
* Makefile.direct (dist gc.tar): Remove configure_atomic_ops.sh.
* Makefile.am (EXTRA_DIST): Add autogen.sh.
* Makefile.in: Regenerate.
* configure: Ditto.

12 years ago2011-06-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 14 Jun 2011 12:34:54 +0000 (12:34 +0000)]
2011-06-14  Ivan Maidanski  <ivmai@mail.ru>

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

12 years ago2011-05-31 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 31 May 2011 17:22:01 +0000 (17:22 +0000)]
2011-05-31  Ivan Maidanski  <ivmai@mail.ru>

* NT_STATIC_THREADS_MAKEFILE (.cpp.obj): Remove duplicate .cpp
filename passed.
* NT_X64_THREADS_MAKEFILE (.cpp.obj): Use lowercase file
extension.
* NT_X64_STATIC_THREADS_MAKEFILE (.cpp.obj): Ditto.
* NT_MAKEFILE (.cpp.obj): Ditto.

12 years ago2011-05-31 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 31 May 2011 15:27:11 +0000 (15:27 +0000)]
2011-05-31  Ivan Maidanski  <ivmai@mail.ru>

* alloc.c (GC_add_current_malloc_heap, GC_build_back_graph,
GC_traverse_back_graph): Move prototype to gc_priv.h.
* checksums.c (GC_page_was_ever_dirty): Ditto.
* dbg_mlc.c (GC_default_print_heap_obj_proc): Ditto.
* dyn_load.c (GC_parse_map_entry, GC_get_maps,
GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base,
GC_get_next_stack): Ditto.
* finalize.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested): Ditto.
* gcj_mlc.c (GC_start_debugging, GC_store_debug_info): Ditto.
* malloc.c (GC_extend_size_map, GC_text_mapping): Ditto.
* mark_rts.c (GC_mark_thread_local_free_lists): Ditto.
* misc.c (GC_register_main_static_data, GC_init_win32,
GC_setpagesize, GC_init_linux_data_start,
GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf,
GC_initialize_offsets, GC_bl_init, GC_do_blocking_inner,
GC_bl_init_no_interiors): Ditto.
* os_dep.c (GC_greatest_stack_base_below, GC_push_all_stacks):
Ditto.
* reclaim.c (GC_check_leaked): Ditto.
* win32_threads.c (GC_gww_dirty_init): Ditto.
* darwin_stop_world.c (GC_is_mach_marker, GC_mprotect_stop,
GC_mprotect_resume): Move prototype to darwin_stop_world.h.
* pthread_support.c (GC_FindTopOfStack): Ditto.
* dyn_load.c (GC_cond_add_roots): Merge adjacent definitions.
* mark.c (GC_page_was_ever_dirty): Remove (as already declared).
* mark_rts.c (GC_roots_present): Change return type to void
pointer (to match the prototype); return NULL instead of FALSE.
* mark_rts.c (GC_add_roots_inner): Cast GC_roots_present() result.
* os_dep.c (NEED_PROC_MAPS): Move definition to gcconfig.h.
* os_dep.c (GC_write_fault_handler): Make STATIC.
* os_dep.c (GC_set_write_fault_handler): New function (only if
GC_WIN32_THREADS).
* pthread_start.c (GC_start_rtn_prepare_thread,
GC_thread_exit_proc): Move prototype to pthread_support.h.
* pthread_support.c (GC_nacl_initialize_gc_thread,
GC_nacl_shutdown_gc_thread, GC_unblock_gc_signals):
Ditto.
* pthread_support.c (GC_stop_init): Move prototype to
pthread_stop_world.h.
* thread_local_alloc.c (GC_check_tls_for): Reformat comment.
* win32_threads.c (GC_write_fault_handler): Remove prototype.
* win32_threads.c (GC_register_my_thread_inner): Call
GC_set_write_fault_handler instead of SetUnhandledExceptionFilter
(only if MPROTECT_VDB).
* doc/README.win32: Add information about DMC.
* include/private/gc_priv.h (GC_set_write_fault_handler): New
prototype (only if GC_WIN32_THREADS and MPROTECT_VDB).

12 years ago2011-05-31 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 31 May 2011 09:53:36 +0000 (09:53 +0000)]
2011-05-31  Ivan Maidanski  <ivmai@mail.ru>

* misc.c (vsnprintf): Redirect to vsprintf() if NO_VSNPRINTF.

12 years ago2011-05-31 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 31 May 2011 09:09:34 +0000 (09:09 +0000)]
2011-05-31  Ivan Maidanski  <ivmai@mail.ru>

* win32_threads.c (GC_unregister_my_thread): Use KNOWN_FINISHED()
instead of FINISHED macro.
* tests/test.c (check_heap_stats): Round up max_heap_sz value for
Win32 (same as for USE_MMAP).

12 years ago2011-05-31 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 31 May 2011 08:41:20 +0000 (08:41 +0000)]
2011-05-31  Ivan Maidanski  <ivmai@mail.ru>

* tests/test.c (check_heap_stats): Adjust printf format specifier
for max_heap_sz; cast max_heap_sz accordingly.

12 years ago2011-05-30 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 30 May 2011 17:26:59 +0000 (17:26 +0000)]
2011-05-30  Ivan Maidanski  <ivmai@mail.ru>

* doc/README.solaris2: Add note.

12 years ago2011-05-30 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 30 May 2011 13:37:49 +0000 (13:37 +0000)]
2011-05-30  Ivan Maidanski  <ivmai@mail.ru>

* configure.ac (SOLARIS25_PROC_VDB_BUG_FIXED): Don't define for
Solaris/x86 2.10+.
* configure: Regenerate.

12 years ago2011-05-23 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 23 May 2011 21:19:18 +0000 (21:19 +0000)]
2011-05-23  Ivan Maidanski  <ivmai@mail.ru>

* tests/threadkey_test.c (SKIP_THREADKEY_TEST): Skip the test if
defined; explicitly define for some targets.

12 years ago2011-05-23 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 23 May 2011 15:18:04 +0000 (15:18 +0000)]
2011-05-23  Ivan Maidanski  <ivmai@mail.ru>

* mark.c (GC_dirty): Add prototype (only if MANUAL_VDB).
* stubborn.c (GC_dirty): Ditto.
* include/private/gcconfig.h (GWW_VDB, MPROTECT_VDB, PCR_VDB,
        PROC_VDB): Undefine if MANUAL_VDB.
* include/private/gcconfig.h (DEFAULT_VDB): Don't define if
MANUAL_VDB.
* os_dep.c (async_set_pht_entry_from_index): Define for
MANUAL_VDB.
* os_dep.c (GC_read_dirty): Set GC_dirty_maintained only if
success; if ioctl() failed then just print warning instead of
aborting.

12 years ago2011-05-23 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 23 May 2011 13:42:56 +0000 (13:42 +0000)]
2011-05-23  Ivan Maidanski  <ivmai@mail.ru>

* include/private/gc_priv.h (GC_ASSERT): Use "%d" (instead of %ld)
for line number printing.

12 years ago2011-05-23 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 23 May 2011 09:51:11 +0000 (09:51 +0000)]
2011-05-23  Ivan Maidanski  <ivmai@mail.ru>

* os_dep.c (GC_read_dirty): Add debug logging if DEBUG_DIRTY_BITS
(for PROC_VDB only); print errors via GC_err_printf; rename "ps"
and "np" local variables to npages and pagesize, respectively;
remove "current_addr" local variable.
* os_dep.c: Refprmat comments.

12 years ago2011-05-22 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 22 May 2011 12:46:28 +0000 (12:46 +0000)]
2011-05-22  Ivan Maidanski  <ivmai@mail.ru>

* os_dep.c (GC_get_main_stack_base): Convert to GC_get_stack_base
for BeOS and OS/2; define HAVE_GET_STACK_BASE.
* os_dep.c (GET_MAIN_STACKBASE_SPECIAL): Define when a specific
GC_get_main_stack_base implementation is defined.
* os_dep.c (GC_get_main_stack_base): Define that based on
GC_get_stack_base() in a single place (only if
GET_MAIN_STACKBASE_SPECIAL is unset); check GC_get_stack_base()
result.

12 years ago2011-05-20 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 20 May 2011 15:09:18 +0000 (15:09 +0000)]
2011-05-20  Ivan Maidanski  <ivmai@mail.ru>

* mark.c (GC_push_selected): Remove "push_fn" argument (use
GC_push_all directly); update the documentation; reformat the
comment.
* mark.c (GC_push_conditional): Simplify the code (for better
readability).

12 years ago2011-05-20 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 20 May 2011 09:57:34 +0000 (09:57 +0000)]
2011-05-20  Ivan Maidanski  <ivmai@mail.ru>

* mark.c (alloc_mark_stack): Use FALSE/TRUE (instead of 0/1) for
boolean local variables.
* doc/README.macros (GC_PREFER_MPROTECT_VDB): Update.
* os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty,
GC_remove_protection): Define for GWW_VDB and PROC_VDB in a single
place.
* os_dep.c (GC_page_was_dirty, GC_page_was_ever_dirty): Compute
PHT_HASH(h) only once (store result to a local variable).

12 years ago2011-05-20 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 20 May 2011 07:53:38 +0000 (07:53 +0000)]
2011-05-20  Ivan Maidanski  <ivmai@mail.ru>

* doc/README.solaris2: Update.

12 years ago2011-05-19 Ivan Maidanski <ivmai@mail.ru> (really Jie Liu)
ivmai [Thu, 19 May 2011 07:50:49 +0000 (07:50 +0000)]
2011-05-19  Ivan Maidanski  <ivmai@mail.ru> (really Jie Liu)

* include/private/gcconfig.h (end, InitStackBottom): Declare
extern variable for RTEMS.
* include/private/gcconfig.h (DATASTART, DATAEND, STACKBOTTOM):
Update (for RTEMS).
* include/private/gcconfig.h (DATAEND): Fix a typo in the macro
name (for RTEMS).
* tests/test.c (CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER):
Replace with CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER (for RTEMS).

12 years ago2011-05-18 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 18 May 2011 09:46:36 +0000 (09:46 +0000)]
2011-05-18  Ivan Maidanski  <ivmai@mail.ru>

* include/private/gcconfig.h (MPROTECT_VDB): Enable for Solaris in
single-threaded environment.

12 years ago2011-05-18 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 18 May 2011 09:40:00 +0000 (09:40 +0000)]
2011-05-18  Ivan Maidanski  <ivmai@mail.ru>

* include/private/gcconfig.h (MPROTECT_VDB): Undefine if PROC_VDB.
* tests/test.c (NUMBER_ROUND_UP): New macro.
* tests/test.c (check_heap_stats): Round up total expected heap
size to the nearest 4 MiB bound.
* tests/test.c (check_heap_stats): Print the current and expected
heap sizes in case of failure.

12 years ago2011-05-18 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 18 May 2011 08:55:41 +0000 (08:55 +0000)]
2011-05-18  Ivan Maidanski  <ivmai@mail.ru>

* checksums.c (GC_check_blocks, GC_check_dirty): Do log printing
only if GC_print_stats; print errors using GC_err_printf.
* checksums.c (GC_check_blocks): Join adjacent printf() calls into
a single one.

12 years ago2011-05-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 17 May 2011 08:59:42 +0000 (08:59 +0000)]
2011-05-17  Ivan Maidanski  <ivmai@mail.ru>

* pthread_support.c (pthread_join): Add assertion (check thread is
finished).
* pthread_support.c (GC_register_my_thread): Don't detach the
thread if invoked from the thread destructor.
* win32_threads.c (GC_register_my_thread): Ditto.
* win32_threads.c (GC_unregister_my_thread): Don't delete the
thread (just set FINISHED) if the thread is not detached (only if
GC_PTHREADS); add assertion (check the thread is not finished).
* tests/threadkey_test.c (main): Join some created threads.

12 years ago2011-05-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 17 May 2011 06:45:30 +0000 (06:45 +0000)]
2011-05-17  Ivan Maidanski  <ivmai@mail.ru>

* pthread_support.c (GC_delete_gc_thread): Rename "gc_id" local
variable to "t".
* win32_threads.c (GC_delete_gc_thread): Ditto.
* pthread_support.c (pthread_join, pthread_detach,
pthread_cancel): Rename "thread_gc_id" local variable to "t".
* win32_threads.c (GC_pthread_detach): Ditto.
* win32_threads.c (GC_delete_gc_thread): Remove "gc_nvid" local
variable.
* win32_threads.c (GC_pthread_join): Rename "joinee" local
variable to "t".

12 years ago2011-05-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 16 May 2011 13:12:14 +0000 (13:12 +0000)]
2011-05-16  Ivan Maidanski  <ivmai@mail.ru>

* pthread_stop_world.c (pthread_sigmask): Undefine even if not
DEBUG_THREADS.
* pthread_stop_world.c (GC_unblock_gc_signals): New function (only
if GC_EXPLICIT_SIGNALS_UNBLOCK).
* pthread_support.c (GC_unblock_gc_signals): New prototype.
* pthread_support.c (GC_register_my_thread_inner,
GC_register_my_thread): Call GC_unblock_gc_signals (only if
GC_EXPLICIT_SIGNALS_UNBLOCK); add comment.
* include/private/gcconfig.h (GC_EXPLICIT_SIGNALS_UNBLOCK): New
macro.

12 years ago2011-05-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 16 May 2011 07:06:33 +0000 (07:06 +0000)]
2011-05-16  Ivan Maidanski  <ivmai@mail.ru>

* pthread_stop_world.c (GC_suspend_handler_inner): Remove "dummy",
"sig" local variables; rename my_thread local variable to "self".

12 years ago2011-05-13 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 13 May 2011 15:18:44 +0000 (15:18 +0000)]
2011-05-13  Ivan Maidanski  <ivmai@mail.ru>

* tests/threadkey_test.c (LIMIT): Use smaller value (don't create
more than 30 in parallel by default).

12 years ago2011-05-13 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 13 May 2011 15:05:20 +0000 (15:05 +0000)]
2011-05-13  Ivan Maidanski  <ivmai@mail.ru>

* tests/threadkey_test.c (key_once, main): Work around for Solaris
PTHREAD_ONCE_INIT.
* tests/threadkey_test.c (LIMIT): Use smaller value for Solaris.

12 years ago2011-05-13 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 13 May 2011 14:40:31 +0000 (14:40 +0000)]
2011-05-13  Ivan Maidanski  <ivmai@mail.ru>

* dyn_load.c (GC_FirstDLOpenedLinkMap): Remove unused "r" local
variable.
* pthread_support.c (GC_unregister_my_thread_inner): Revert back
GC_remove_specific invocation; add a comment.
* include/private/thread_local_alloc.h (GC_remove_specific):
Revert back.
* specific.c: Expand all tabs to spaces.
* specific.c (slow_getspecific): Cast qtid to AO_t.
* include/private/specific.h (quick_thread_id): Reformat comment.
* include/private/specific.h (key_create, setspecific,
remove_specific): Remove "extern" keyword.
* include/private/specific.h (getspecific): Change type of "qtid"
local variable to unsigned long.

12 years ago2011-05-11 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 11 May 2011 17:06:03 +0000 (17:06 +0000)]
2011-05-11  Ivan Maidanski  <ivmai@mail.ru>

* pthread_support.c (GC_check_tls): Fix "#endif" comment.
* include/gc.h (GC_REDIRECT_TO_LOCAL): Remove deprecated comment.
* include/private/thread_local_alloc.h (THREAD_LOCAL_ALLOC):
Remove redundant test of the macro.
* include/private/thread_local_alloc.h: Reformat the code.

12 years ago2011-05-11 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 11 May 2011 13:27:30 +0000 (13:27 +0000)]
2011-05-11  Ivan Maidanski  <ivmai@mail.ru>

* backgraph.c (add_edge): Recognize DEBUG_PRINT_BIG_N_EDGES macro.
* os_dep.c (GC_set_and_save_fault_handler): Recognize
SIGACTION_FLAGS_NODEFER_HACK macro.
* pthread_support.c (mark_mutex): Recognize GLIBC_2_1_MUTEX_HACK
macro.
* pthread_support.c (GC_acquire_mark_lock): Remove commented out
code.
* include/gc_inline.h (GC_MALLOC_WORDS, GC_MALLOC_ATOMIC_WORDS,
GC_CONS): Remove trailing space (before back-slash).
* include/private/gc_hdrs.h (GET_BI, GET_HDR_ADDR): Ditto.
* include/private/gc_pmark.h (PUSH_OBJ, PUSH_CONTENTS,
SET_MARK_BIT_EXIT_IF_SET, LONG_MULT, PUSH_CONTENTS_HDR,
GC_PUSH_ONE_STACK, GC_PUSH_ONE_HEAP): Ditto.
* include/private/thread_local_alloc.h (GC_key_create): Ditto.
* include/private/gc_priv.h (SUNOS5SIGS): Don't include
sys/siginfo.h on Linux.
* include/private/gcconfig.h: Reformat comments (and some code).
* include/private/gcconfig.h (FORCE_WRITE_PREFETCH): New macro
recognized, force PREFETCH_FOR_WRITE to be defined on x86.
* include/private/gcconfig.h (USE_HPUX_FIXED_STACKBOTTOM): New
macro recognized (for HP/UX).

12 years ago2011-05-11 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 11 May 2011 09:12:35 +0000 (09:12 +0000)]
2011-05-11  Ivan Maidanski  <ivmai@mail.ru>

* os_dep.c (GC_gww_page_was_ever_dirty): Fix comment (for
GWW_VDB).
* os_dep.c (GC_dirty_init): Use memset() for GC_written_pages
resetting (for PROC_VDB).

12 years ago2011-05-11 Ivan Maidanski <ivmai@mail.ru> (mostly really Ludovic Courtes)
ivmai [Wed, 11 May 2011 07:41:49 +0000 (07:41 +0000)]
2011-05-11  Ivan Maidanski  <ivmai@mail.ru> (mostly really Ludovic Courtes)

* tests/threadkey_test.c: New file.
* .cvsignore (threadkey_test): Add.
* tests/tests.am (TESTS, check_PROGRAMS): Add 'threadkey_test'.
* tests/tests.am (threadkey_test_SOURCES, threadkey_test_LDADD):
New variable.
* Makefile.in: Regenerate.

12 years ago2011-05-11 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 11 May 2011 07:19:46 +0000 (07:19 +0000)]
2011-05-11  Ivan Maidanski  <ivmai@mail.ru>

* pthread_support.c (GC_unregister_my_thread_inner): Don't call
GC_remove_specific.
* include/private/thread_local_alloc.h (GC_remove_specific):
Remove (since it is empty for all targets).
* pthread_support.c (GC_record_stack_base): New inline function.
* win32_threads.c (GC_record_stack_base): Ditto.
* pthread_support.c (GC_register_my_thread_inner): Invoke
GC_record_stack_base.
* win32_threads.c (GC_register_my_thread_inner): Ditto.
* pthread_support.c (GC_register_my_thread): If thread is FINISHED
then call GC_record_stack_base, clear FINISHED, initialize
thread-local list and return success.
* win32_threads.c (GC_register_my_thread): Ditto.
* include/gc.h (GC_register_my_thread): Update documentation.
* include/private/thread_local_alloc.h (GC_thread_key): Ditto.

12 years ago2011-05-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 10 May 2011 15:39:29 +0000 (15:39 +0000)]
2011-05-10  Ivan Maidanski  <ivmai@mail.ru>

* thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Join
adjacent "#ifdef".
* thread_local_alloc.c (GC_malloc_atomic): Call
GC_core_malloc_atomic (instead of GC_core_malloc).

12 years ago2011-05-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 10 May 2011 14:15:57 +0000 (14:15 +0000)]
2011-05-10  Ivan Maidanski  <ivmai@mail.ru>

* pthread_start.c (GC_start_rtn_prepare_thread): Change return
type to GC_thread.
* pthread_start.c (GC_inner_start_routine): Pass the current
thread descriptor to pthread_cleanup_push (same as in
win32_threads.c).
* pthread_stop_world.c (GC_push_all_stacks): Rename "me" local
variable to "self".
* win32_threads.c (GC_push_all_stacks): Ditto.
* pthread_stop_world.c (GC_suspend_all, GC_start_world): Rename
"my_thread" local variable to "self".
* pthread_support.c (GC_unregister_my_thread_inner): New static
function.
* pthread_support.c (GC_unregister_my_thread,
GC_thread_exit_proc): Use GC_unregister_my_thread_inner.
* win32_threads.c (GC_register_my_thread, GC_unregister_my_thread,
GC_do_blocking_inner): Rename "t" local variable to "thread_id".
* win32_threads.c (GC_wait_marker, GC_notify_all_marker): Rename
"id" local variable to "thread_id".

12 years ago2011-05-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 10 May 2011 12:53:40 +0000 (12:53 +0000)]
2011-05-10  Ivan Maidanski  <ivmai@mail.ru>

* pthread_support.c (GC_unregister_my_thread): Call pthread_self
only once.
* win32_threads.c (GC_pthread_start_inner): Ditto.
* pthread_support.c (GC_unregister_my_thread): Add debug output.
* win32_threads.c (GC_unregister_my_thread): Ditto.
* pthread_support.c (GC_register_my_thread,
GC_start_rtn_prepare_thread): Rename "my_pthread" local variable
to "self".

12 years ago2011-05-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 10 May 2011 11:07:12 +0000 (11:07 +0000)]
2011-05-10  Ivan Maidanski  <ivmai@mail.ru>

* include/gc.h (GC_HIDE_POINTER, GC_REVEAL_POINTER): Define
unconditionally (do not test GC_I_HIDE_POINTERS); update the
comment.
* include/gc.h (HIDE_POINTER, REVEAL_POINTER): Define as alias to
GC_HIDE/REVEAL_POINTER, respectively.
* include/private/gc_pmark.h (GC_I_HIDE_POINTERS): Do not define.
* include/private/gc_priv.h (GC_I_HIDE_POINTERS): Ditto.

12 years ago2011-05-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 10 May 2011 09:58:23 +0000 (09:58 +0000)]
2011-05-10  Ivan Maidanski  <ivmai@mail.ru>

* include/gc.h (GC_register_my_thread): Refine the comment.

12 years ago2011-05-08 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 8 May 2011 21:21:44 +0000 (21:21 +0000)]
2011-05-08  Ivan Maidanski  <ivmai@mail.ru>

* include/gc_inline.h (GC_MALLOC_WORDS, GC_CONS): Add missing
parentheses.
* include/gc_typed.h (GC_get_bit, GC_set_bit,
GC_CALLOC_EXPLICITLY_TYPED): Ditto.

12 years ago2011-05-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 7 May 2011 19:15:21 +0000 (19:15 +0000)]
2011-05-07  Ivan Maidanski  <ivmai@mail.ru>

* include/private/gcconfig.h (NO_GETCONTEXT): Add missing ')'.

12 years ago2011-05-07 Ivan Maidanski <ivmai@mail.ru> (really Thorsten Glaser)
ivmai [Sat, 7 May 2011 19:10:05 +0000 (19:10 +0000)]
2011-05-07  Ivan Maidanski  <ivmai@mail.ru> (really Thorsten Glaser)

* include/private/gcconfig.h (NO_GETCONTEXT): Do not use
getcontext(2) on m68k because it is not implemented there.

12 years ago2011-05-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 7 May 2011 19:04:25 +0000 (19:04 +0000)]
2011-05-07  Ivan Maidanski  <ivmai@mail.ru>

* alloc.c (GC_clear_a_few_frames): Use BZERO().
* mark_rts.c (GC_clear_roots, GC_rebuild_root_index): Ditto.
* reclaim.c (GC_start_reclaim): Ditto.
* blacklst.c (total_stack_black_listed): Remove "len" local
variable.
* dbg_mlc.c (GC_generate_random_valid_address): Replace "for"
statement with "do-while" one.
* dyn_load.c (GC_register_dynamic_libraries,
GC_register_dynlib_callback): Remove redundant parentheses.

12 years ago2011-05-06 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 6 May 2011 07:46:34 +0000 (07:46 +0000)]
2011-05-06  Ivan Maidanski  <ivmai@mail.ru>

* cord/cordxtra.c (CORD_from_file_lazy_inner): Suppress
"unused result" compiler warning for fread().
* cord/cordxtra.c: Expand all tabs to spaces.

12 years ago2011-05-06 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 6 May 2011 05:35:44 +0000 (05:35 +0000)]
2011-05-06  Ivan Maidanski  <ivmai@mail.ru>

* os_dep.c (GC_write_fault_handler): Break when in_allocd_block
is set to true.

12 years ago2011-05-06 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 6 May 2011 04:43:49 +0000 (04:43 +0000)]
2011-05-06  Ivan Maidanski  <ivmai@mail.ru>

* dbg_mlc.c (GC_has_other_debug_info): Change return type to int;
return -1 if the object has (or had) debugging info but was
marked deallocated.
* include/private/dbg_mlc.h (GC_has_other_debug_info): Ditto.
* dbg_mlc.c (GC_has_other_debug_info): Update documentation;
remove "ohdr" local variable.
* dbg_mlc.c (GC_debug_free): Don't call GC_free if the object has
probably been deallocated.
* dbg_mlc.c (GC_debug_free): Don't actually free the object even
in the leak-finding mode if GC_findleak_delay_free.
* dbg_mlc.c (GC_print_all_smashed_proc): Print a trailing blank
line.
* dbg_mlc.c (GC_check_leaked): New function (only unless
SHORT_DBG_HDRS).
* doc/README.environment (GC_FINDLEAK_DELAY_FREE): Document.
* doc/README.macros (GC_FINDLEAK_DELAY_FREE): Ditto.
* include/private/dbg_mlc.h (START_FLAG, END_FLAG): Use GC_WORD_C
on 64-bit architectures.
* include/private/dbg_mlc.h (NOT_MARKED): Remove redundant
parentheses.
* include/private/dbg_mlc.h (GC_HAS_DEBUG_INFO): Update (due to
GC_has_other_debug_info change).
* include/private/gc_priv.h (GC_findleak_delay_free): New global
variable declaration (unless SHORT_DBG_HDRS).
* misc.c (GC_findleak_delay_free): New global variable; recognize
GC_FINDLEAK_DELAY_FREE.
* misc.c (GC_init): Recognize GC_FINDLEAK_DELAY_FREE environment
variable (unless SHORT_DBG_HDRS).
* reclaim.c (GC_check_leaked): Declare (unless SHORT_DBG_HDRS).
* reclaim.c (GC_add_leaked): Don't add the object to leaked list
if marked as deallocated.

12 years ago2011-05-05 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 5 May 2011 05:24:48 +0000 (05:24 +0000)]
2011-05-05  Ivan Maidanski  <ivmai@mail.ru>

* dbg_mlc.c (GC_has_other_debug_info): Fix punctuation in the
comment.
* dbg_mlc.c (GC_FREED_MEM_MARKER): New macro.
* dbg_mlc.c (GC_debug_free): Use GC_FREED_MEM_MARKER.
* dbg_mlc.c (GC_smashed): Refine documentation.
* mark.c (GC_push_selected): Change dirty_fn return type to
GC_bool.
* os_dep.c (GC_page_was_ever_dirty): Make GC_INNER.
* reclaim.c (GC_reclaim_small_nonempty_block): Remove "kind"
local  variable.
* reclaim.c (GC_reclaim_block): Pass true constant to
GC_reclaim_small_nonempty_block (instead of report_if_found).
* doc/README.autoconf: Update; fix a typo.
* include/private/gcconfig.h (GC_WORD_C): New macro.

12 years ago2011-05-03 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 3 May 2011 10:33:59 +0000 (10:33 +0000)]
2011-05-03  Ivan Maidanski  <ivmai@mail.ru>

* dbg_mlc.c (GC_store_debug_info_inner): Cast "linenum".
* dbg_mlc.c (GC_check_annotated_obj): Fix punctuation in the
comment.
* dbg_mlc.c (GC_print_smashed_obj): Add (and print) "msg"
argument.
* dbg_mlc.c (GC_debug_free, GC_print_all_smashed_proc): Pass
message to GC_print_smashed_obj.
* dbg_mlc.c (GC_debug_free): Call GC_size once.
* dbg_mlc.c (GC_debug_realloc): Calculate old_sz only if
allocation succeeded; remove unnecessary check for object is
smashed (since this is done in GC_debug_free); remove "clobbered"
local variable.

12 years ago2011-05-03 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 3 May 2011 07:21:16 +0000 (07:21 +0000)]
2011-05-03  Ivan Maidanski  <ivmai@mail.ru>

* dbg_mlc.c (GC_store_debug_info_inner, GC_store_debug_info):
Rename "integer" argument to "linenum"; change the type of the
argument to int.
* gcj_mlc.c (GC_store_debug_info): Ditto.
* dbg_mlc.c (GET_OH_LINENUM): New macro.
* dbg_mlc.c (GC_print_obj, GC_print_smashed_obj): Use
GET_OH_LINENUM; adjust print format specifier.
* dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page,
GC_debug_generic_malloc_inner,
GC_debug_generic_malloc_inner_ignore_off_page,
GC_debug_malloc_stubborn, GC_debug_malloc_atomic,
GC_debug_malloc_uncollectable,
GC_debug_malloc_atomic_uncollectable): Remove unnecessary cast of
"i".
* gcj_mlc.c (GC_debug_gcj_malloc): Ditto.

12 years ago2011-04-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 26 Apr 2011 21:09:41 +0000 (21:09 +0000)]
2011-04-26  Ivan Maidanski  <ivmai@mail.ru>

* .cvsignore (initsecondarythread, test_cpp): Add.
* os_dep.c (GC_linux_stack_base): Rename to
GC_linux_main_stack_base.
* os_dep.c (GC_freebsd_stack_base): Rename to
GC_freebsd_main_stack_base; adjust error message.
* pthread_stop_world.c (GC_stop_init): Use GC_SEM_INIT_PSHARED
as an argument for sem_init().
* pthread_support.c (pthread_create): Ditto.
* pthread_support.c (pthread_create): Abort in case sem_init()
fails.
* include/private/gc_priv.h (GC_SEM_INIT_PSHARED): Define.
* tests/initsecondarythread.c: Include gcconfig.h; call GC_INIT
from main() if it should be done from the primordial thread only.

12 years ago2011-04-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 26 Apr 2011 10:47:02 +0000 (10:47 +0000)]
2011-04-26  Ivan Maidanski  <ivmai@mail.ru>

* alloc.c: Don't include sys/types.h for ArmCC.
* dyn_load.c: Ditto.
* os_dep.c: Ditto.
* mach_dep.c (_setjmp, _longjmp): Redirect to setjmp/longjmp for
ArmCC.
* mark.c (GC_noop): Define specially for ArmCC.
* include/private/gc_priv.h (GC_noop): Ditto.
* misc.c (GC_init): Don't test pointers comparison for ArmCC.
* misc.c: Don't include unistd.h for ArmCC.
* os_dep.c (pages_executable): Rename to GC_pages_executable;
make STATIC.
* os_dep.c (GC_unix_mmap_get_mem): Don't define for ArmCC.
* ptr_chck.c (GC_is_visible): Explicitly cast
(GC_DS_PER_OBJECT-GC_INDIR_PER_OBJ_BIAS) to word (to suppress
a compiler warning).
* include/private/gcconfig.h: Recognize __arm.
* include/private/gcconfig.h (HBLKPTR): Define for ArmCC.
* include/private/gcconfig.h (HBLKPTR): Add parentheses for
"bytes" argument.

12 years ago2011-04-24 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 24 Apr 2011 13:09:21 +0000 (13:09 +0000)]
2011-04-24  Ivan Maidanski  <ivmai@mail.ru>

* pthread_support.c (GC_get_nprocs): Don't define for Android.
* pthread_support.c (GC_dummy_thread_local): Don't test
GC_LINUX_THREADS.
* include/gc_config_macros.h (GC_ADD_CALLER, GC_RETURN_ADDR):
Define for Android.

12 years ago2011-04-24 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 24 Apr 2011 06:37:23 +0000 (06:37 +0000)]
2011-04-24  Ivan Maidanski  <ivmai@mail.ru>

* mach_dep.c (NO_GETCONTEXT): Move to gcconfig.h.
* os_dep.c (GC_write_fault_handler): Don't include ucontext.h if
NO_GETCONTEXT.
* include/private/gcconfig.h (GETPAGESIZE): Define as a sysconf
call for Android.

12 years ago2011-04-23 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 23 Apr 2011 10:03:58 +0000 (10:03 +0000)]
2011-04-23  Ivan Maidanski  <ivmai@mail.ru>

* include/private/gc_locks.h (WIN32_LEAN_AND_MEAN, NOSERVICE):
Define before including windows.h.
* include/private/gc_priv.h (WIN32_LEAN_AND_MEAN, NOSERVICE):
Ditto.
* include/private/thread_local_alloc.h (WIN32_LEAN_AND_MEAN,
NOSERVICE): Ditto.
* include/private/gc_priv.h (CLOCKS_PER_SEC): Reformat the
comment.
* include/private/gc_priv.h (MS_TIME_DIFF): Avoid floating-point
arithmetics; add a comment.

12 years ago2011-04-23 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 23 Apr 2011 08:51:53 +0000 (08:51 +0000)]
2011-04-23  Ivan Maidanski  <ivmai@mail.ru>

* mark.c (GC_clear_hdr_marks): Don't test USE_MARK_BYTES.
* extra/setjmp_t.c (main): Don't test USE_MARK_BITS.
* include/private/gc_pmark.h (SET_MARK_BIT_EXIT_IF_SET): Ditto.
* include/private/gc_pmark.h (SET_MARK_BIT_EXIT_IF_SET): Remove
"mark_byte" local variable.
* include/private/gc_pmark.h (OR_WORD_EXIT_IF_SET): Add a comment
about that AO_or() is not used by GC unless USE_MARK_BITS
explicitly set.
* include/private/gc_priv.h (OR_WORD): Ditto.
* include/private/gc_pmark.h (INCR_MARKS): Remove trailing ';',
add parentheses.
* include/private/gc_priv.h (ONES): Define before use by
MAKE_COOLER.
* include/private/gc_priv.h (MARK_BITS_SZ): Define where used.
* include/private/gc_priv.h (OR_WORD): Don't define if
USE_MARK_BYTES.
* include/private/gcconfig.h (USE_MARK_BYTES); Remove duplicate
definition; simplify expression.

12 years ago2011-04-22 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 22 Apr 2011 21:40:15 +0000 (21:40 +0000)]
2011-04-22  Ivan Maidanski  <ivmai@mail.ru>

* os_dep.c (GC_get_maps): Always close the file.
* pthread_support.c (GC_get_nprocs): Ditto.
* os_dep.c (READ): Define similarly across the file (without
parameters).
* pthread_support.c (GC_get_nprocs): Use signed int type for "i"
and "len" local variables (since read() may return -1).
* include/private/gc_pmark.h (LONG_MULT): Add prefix/suffix
double underscore; add "volatile" for asm.
* include/private/gc_pmark.h (LONG_MULT): Add missing
parentheses.
* include/private/gc_priv.h (OR_WORD): Ditto.
* include/private/gc_priv.h (OR_WORD): Remove unnecessary brackets
and ';' symbol.

12 years ago2011-04-22 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 22 Apr 2011 11:54:12 +0000 (11:54 +0000)]
2011-04-22  Ivan Maidanski  <ivmai@mail.ru>

* os_dep.c (GC_get_stack_base): Implement for Android (same as
for Linux).
* pthread_support.c (GC_get_nprocs): Return 1 (instead of -1) if
failed to open "stat" file (not to issue a warning twice); update
the comment.
* pthread_support.c (GC_thr_init): Call sysconf() on Android to
get the number of CPUs.

12 years ago2011-04-21 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 21 Apr 2011 15:20:00 +0000 (15:20 +0000)]
2011-04-21  Ivan Maidanski  <ivmai@mail.ru>

* include/private/gc_priv.h (_GNU_SOURCE): Revert one of the
recent patches regarding this macro as the macro should be set
(to 1) before including any other system header.

12 years ago2011-04-21 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 21 Apr 2011 07:10:16 +0000 (07:10 +0000)]
2011-04-21  Ivan Maidanski  <ivmai@mail.ru>

* doc/README.environment (GC_INITIAL_HEAP_SIZE,
GC_MAXIMUM_HEAP_SIZE): Update.

12 years ago2011-04-20 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 20 Apr 2011 21:25:18 +0000 (21:25 +0000)]
2011-04-20  Ivan Maidanski  <ivmai@mail.ru>

* misc.c (GC_parse_mem_size_arg): Allow 'k', 'M', 'G' suffixes in
heap size specifier; return 0 if not a valid one.
* include/gc_cpp.h: Explicitly define inline one-argument delete
operator for Cygwin (as a workaround).
* include/gc_cpp.h: Reformat the code.
* tests/test_cpp.cc: Ditto.
* tests/test_cpp.cc (main): Suppress compiler warnings about
"assigned value is unused".

12 years ago2011-04-19 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 19 Apr 2011 17:49:22 +0000 (17:49 +0000)]
2011-04-19  Ivan Maidanski  <ivmai@mail.ru>

* misc.c (GC_parse_mem_size_arg): New function.
* misc.c (GC_init): Use GC_parse_mem_size_arg().
* pthread_stop_world.c (tkill): Declare for Android.

12 years ago2011-04-19 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 19 Apr 2011 11:27:58 +0000 (11:27 +0000)]
2011-04-19  Ivan Maidanski  <ivmai@mail.ru>

* include/private/gc_priv.h (_GNU_SOURCE): Include features.h
first (except for NaCl) and then define the macro to 1 if not yet.

12 years ago2011-04-18 Ivan Maidanski <ivmai@mail.ru> (really Ludovic Courtes)
ivmai [Mon, 18 Apr 2011 22:11:59 +0000 (22:11 +0000)]
2011-04-18  Ivan Maidanski  <ivmai@mail.ru> (really Ludovic Courtes)

* tests/tests.am (TESTS, check_PROGRAMS): Add
'initsecondarythread'.
* tests/tests.am (initsecondarythread_SOURCES,
initsecondarythread_LDADD): New variable.
* Makefile.in: Regenerate.
* configure: Ditto.

12 years ago2011-04-18 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 18 Apr 2011 21:14:54 +0000 (21:14 +0000)]
2011-04-18  Ivan Maidanski  <ivmai@mail.ru>

* dbg_mlc.c (GC_store_debug_info_inner): Always define; add
"const" to its string argument.
* dbg_mlc.c (GC_store_debug_info): Call GC_store_debug_info_inner.
* dbg_mlc.c (GC_debug_free): Set GC_have_errors in case of
smashed or previously deallocated found.
* dbg_mlc.c (GC_check_heap_block): Replace while loop with a for
one.
* reclaim.c (GC_reclaim_check): Ditto.
* dbg_mlc.c (GC_check_heap_proc): Remove redundant cast to word.
* os_dep.c (GC_get_stack_base): Don't initialize
stackbase_main_self/ss_sp on Solaris if thr_main() is zero (thus
calling GC_INIT() from a non-primordial thread is possible now).
* reclaim.c (GC_add_leaked): Turn into an inline one.
* reclaim.c (GC_reclaim_small_nonempty_block):
Change report_if_found type from int/word to boolean.
* include/private/gc_priv.h (GC_start_reclaim): Ditto.
* include/private/gc_priv.h (set_mark_bit_from_hdr,
clear_mark_bit_from_hdr): Place closing parenthesis properly;
reformat the code.

12 years ago2011-04-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 16 Apr 2011 09:32:15 +0000 (09:32 +0000)]
2011-04-16  Ivan Maidanski  <ivmai@mail.ru>

* os_dep.c (GC_get_main_stack_base): Try to use
pthread_attr_getstack first for Linux if THREADS.
* doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Adjust text
alignment.

12 years ago2011-04-13 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 13 Apr 2011 20:27:47 +0000 (20:27 +0000)]
2011-04-13  Ivan Maidanski  <ivmai@mail.ru>

* dbg_mlc.c (GC_generate_random_backtrace_no_gc): Fix a message
typo.
* dbg_mlc.c (GC_debug_malloc): Add a comment (about zero size).
* dbg_mlc.c (GC_debug_generic_malloc_inner): Reformat the comment.
* dbg_mlc.c (GC_strdup): Call GC_err_printf instead of WARN (in
case of NULL argument).
* dbg_mlc.c (GC_free): In case of NULL argument, just return
(without any warning printed); eliminate "uncollectable" local
variable.

12 years ago2011-04-13 Ivan Maidanski <ivmai@mail.ru> (mostly really Rainer Orth)
ivmai [Wed, 13 Apr 2011 19:49:10 +0000 (19:49 +0000)]
2011-04-13  Ivan Maidanski  <ivmai@mail.ru> (mostly really Rainer Orth)

* configure.ac (THREADDLLIBS): Use alternate thread library on
Solaris 8.
* configure.ac (need_atomic_ops_asm): Set to true only for Sparc
Solaris.
* configure.ac: Don't use libdl on mips-sgi-irix6.
* configure: Regenerate.

12 years ago2011-04-11 Ivan Maidanski <ivmai@mail.ru> (really Jie Liu)
ivmai [Mon, 11 Apr 2011 20:20:05 +0000 (20:20 +0000)]
2011-04-11  Ivan Maidanski  <ivmai@mail.ru> (really Jie Liu)

* mach_dep.c (NO_GETCONTEXT); Define for RTEMS.
* mach_dep.c (GC_with_callee_saves_pushed): Don't call
__builtin_unwind_init() for RTEMS; use setjmp() without the
leading underscore (for RTEMS).
* tests/test.c (BIG): Use smaller value for RTEMS.
* tests/test.c (main): Customize for RTEMS.

12 years ago2011-04-11 Ivan Maidanski <ivmai@mail.ru> (mostly really Jim Meyering)
ivmai [Mon, 11 Apr 2011 19:51:54 +0000 (19:51 +0000)]
2011-04-11  Ivan Maidanski  <ivmai@mail.ru> (mostly really Jim Meyering)

* configure.host: Remove doubled words in comments.
* os_dep.c: Ditto.
* doc/README: Ditto.
* extra/setjmp_t.c: Ditto.
* tests/huge_test.c: Ditto.
* extra/setjmp_t.c (getpagesize, nested_sp, main, g): Replace the
K&R-style function definition with the ANSI C one.
* extra/setjmp_t.c: Expand all tabs to spaces.
* extra/setjmp_t.c (nested_sp): Implement in the same way as
GC_approx_sp.

12 years ago2011-04-10 Ivan Maidanski <ivmai@mail.ru> (really Iain Sandoe, Mike Stump)
ivmai [Sun, 10 Apr 2011 11:48:09 +0000 (11:48 +0000)]
2011-04-10  Ivan Maidanski  <ivmai@mail.ru> (really Iain Sandoe, Mike Stump)

* dyn_load.c (GC_dyld_sections): Add more sctions.
* dyn_load.c (GC_dyld_add_sect_fmts): New static varaible.
* dyn_load.c (L2_MAX_OFILE_ALIGNMENT): New macro.
* dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove): Improve
logging; add support for on-demand sections.
* dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove): Reformat
the code.

12 years ago2011-04-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 10 Apr 2011 09:46:46 +0000 (09:46 +0000)]
2011-04-10  Ivan Maidanski  <ivmai@mail.ru>

* gcj_mlc.c (GC_gcj_malloc_initialized): Use STATIC unless
GC_ASSERTIONS.
* include/private/gc_priv.h (GC_gcj_malloc_initialized): Don't
declare (as external) unless GC_ASSERTIONS.
* os_dep.c (GC_win32_free_heap): Clear GC_heap_bases[] also for
Cygwin; add FIXME.
* include/private/gcconfig.h: Include <sys/unistd.h> for RTEMS.
* include/private/gcconfig.h: Add "#error" for every "-->" mark.
* include/private/gcconfig.h (CLEAR_DOUBLE): Turn the code into
an expression.
* include/private/pthread_support.h (SUSPENDED_EXT): Add new flag
(which existed previously as SUSPENDED and still exists in GCJ).
* include/private/pthread_support.h (DISABLED_GC): Change the
value (as it is already used by SUSPENDED_EXT).

12 years ago2011-04-10 Ivan Maidanski <ivmai@mail.ru> (mostly really Iain Sandoe)
ivmai [Sun, 10 Apr 2011 09:13:47 +0000 (09:13 +0000)]
2011-04-10  Ivan Maidanski  <ivmai@mail.ru> (mostly really Iain Sandoe)

* tests/test.c (reverse_test):  Modify count (BIG) for
ppc64-darwin.

12 years ago2011-04-09 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 9 Apr 2011 13:42:08 +0000 (13:42 +0000)]
2011-04-09  Ivan Maidanski  <ivmai@mail.ru>

* reclaim.c (GC_print_all_errors): Recognize new GC_ABORT_ON_LEAK
macro and environment variable; abort if any error has been
printed provided the environment variable (or macro) is set.
* doc/README.environment (GC_ABORT_ON_LEAK): Document.
* doc/README.macros (GC_ABORT_ON_LEAK): Ditto.
* doc/README.macros (FIND_LEAK, SUNOS5SIGS, PCR,
USE_COMPILER_TLS): Reformat the text.

12 years ago2011-04-09 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 9 Apr 2011 11:47:01 +0000 (11:47 +0000)]
2011-04-09  Ivan Maidanski  <ivmai@mail.ru>

* os_dep.c (GC_unix_sbrk_get_mem, GC_unix_get_mem): Don't define
for RTEMS.
* include/private/gcconfig.h (RTEMS): Add support for.
* include/private/gcconfig.h (GET_MEM): Use calloc() for RTEMS.

12 years ago2011-04-09 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 9 Apr 2011 11:22:22 +0000 (11:22 +0000)]
2011-04-09  Ivan Maidanski  <ivmai@mail.ru>

* mallocx.c (GC_malloc_uncollectable): Move to malloc.c (since
it is used internally in some places).

12 years ago2011-04-09 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 9 Apr 2011 10:50:54 +0000 (10:50 +0000)]
2011-04-09  Ivan Maidanski  <ivmai@mail.ru>

* dbg_mlc.c (GC_register_finalizer_no_order): Remove redundant
declaration.
* dbg_mlc.c (GC_debug_malloc_replacement,
GC_debug_realloc_replacement): Rename RA to GC_DBG_RA.
* malloc.c (GC_debug_malloc_replacement): Ditto.
* mallocx.c (GC_debug_realloc_replacement): Ditto.
* dbg_mlc.c (GC_store_debug_info): Move proto from dbg_mlc.h.
* malloc.c (GC_strdup, GC_strndup, GC_wcsdup): Move to mallocx.c.
* malloc.c: Include errno.h only REDIRECT_MALLOC; remove redundant
includes of string.h.
* mallocx.c: Include string.h (for GC_strdup).
* include/private/dbg_mlc.h (GC_store_debug_info): Move declaration
to dbg_mlc.c.
* include/private/gc_locks.h (UNCOND_LOCK, UNCOND_UNLOCK): Remove
redundant trailing ';'.
* include/private/gc_priv.h (START_WORLD, COND_DUMP): Ditto.
* include/private/gc_locks.h (LOCK, UNLOCK): Place opening '{'
properly.
* include/private/gc_priv.h (GC_DBG_RA): Move from dbg_mlc.c,
malloc.c, mallocx.c.

12 years ago2011-04-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 7 Apr 2011 20:35:46 +0000 (20:35 +0000)]
2011-04-07  Ivan Maidanski  <ivmai@mail.ru>

* alloc.c (GC_check_heap, GC_print_all_smashed): Move the
definition from misc.c.
* dbg_mlc.c (GC_debug_malloc_atomic_uncollectable): Define as
public.
* include/gc.h (GC_debug_malloc_atomic_uncollectable): Declare.
* include/gc.h (GC_MALLOC_ATOMIC_UNCOLLECTABLE): Define new public
macro.
* dbg_mlc.c (MAX_SMASHED): Don't define if already set.
* reclaim.c (MAX_LEAKED): Ditto.
* dbg_mlc.c (GC_add_smashed): Add FIXME about the concurrent
access to the global array.
* reclaim.c (GC_add_leaked): Ditto.
* misc.c (GC_print_back_height): Set on if GC_PRINT_BACK_HEIGHT
(new macro) is defined.
* doc/README.macros (GC_PRINT_BACK_HEIGHT): Document.
* misc.c (GC_dump_regularly, GC_init): Replace 0/1 for
GC_dump_regularly and GC_print_back_height variables with
FALSE/TRUE.
* reclaim.c (GC_print_all_errors): Refine the comment.

12 years ago2011-04-04 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 4 Apr 2011 19:45:06 +0000 (19:45 +0000)]
2011-04-04  Ivan Maidanski  <ivmai@mail.ru>

* tests/test.c (reverse_test_inner): Undo one of the previous
patches which shifts "c" and "d" pointers only if
ALL_INTERIOR_POINTERS (since interior pointers are always
recognized in stacks).

12 years ago2011-04-03 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 3 Apr 2011 19:29:08 +0000 (19:29 +0000)]
2011-04-03  Ivan Maidanski  <ivmai@mail.ru>

* misc.c (GC_stdout, GC_stderr): Move the definition to the place
where GC_log is defined (Unix only).
* misc.c (GC_init): Recognize "GC_ONLY_LOG_TO_FILE" environment
variable and the similar macro; redirect GC_stdout and GC_stderr
to GC_log if "GC_LOG_FILE" environment variable is set unless
prohibited by GC_ONLY_LOG_TO_FILE (Unix only).
* doc/README.environment (GC_ONLY_LOG_TO_FILE): Document.
* doc/README.macros (GC_ONLY_LOG_TO_FILE): Ditto.

12 years ago2011-04-03 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 3 Apr 2011 15:39:05 +0000 (15:39 +0000)]
2011-04-03  Ivan Maidanski  <ivmai@mail.ru>

* misc.c (GC_stdout, GC_write): Rename GC_stdout to GC_log (Win32
only).
* misc.c (GC_write): Add for MacOS (and OS/2); change WRITE()
accordingly.
* misc.c (GC_write): Reformat code (Unix only).
* misc.c (GC_printf): Check GC_quiet before va_start().

12 years ago2011-04-03 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 3 Apr 2011 15:29:32 +0000 (15:29 +0000)]
2011-04-03  Ivan Maidanski  <ivmai@mail.ru>

* allchblk.c (GC_freehblk): Use GC_log_printf instead of GC_printf
inside "if (GC_print_stats)" branch.
* alloc.c (GC_collect_or_expand): Ditto.
* dyn_load.c (GC_register_dynamic_libraries): Ditto.
* headers.c (GC_scratch_alloc): Ditto.
* os_dep.c (GC_get_maps, GC_remap, PROTECT,
GC_write_fault_handler, GC_dirty_init, GC_mprotect_thread): Ditto.
* alloc.c (min_bytes_allocd): Use GC_log_printf instead of
GC_printf for DEBUG_THREADS output.
* darwin_stop_world.c (GC_stack_range_for, GC_suspend_thread_list,
GC_stop_world, GC_thread_resume, GC_start_world): Ditto.
* pthread_start.c (GC_inner_start_routine): Ditto.
* pthread_stop_world.c (GC_suspend_handler, GC_restart_handler,
GC_push_all_stacks, GC_suspend_all, GC_stop_world,
GC_start_world): Ditto.
* pthread_support.c (GC_mark_thread, GC_get_nprocs,
GC_start_rtn_prepare_thread, pthread_create): Ditto.
* alloc.c (GC_adj_bytes_allocd, GC_maybe_gc, GC_stopped_mark,
GC_finish_collection): Reformat code.
* pthread_stop_world.c (GC_print_sig_mask): Ditto.
* pthread_support.c (GC_thr_init): Ditto.
* checksums.c (GC_update_check_page): Use GC_printf() instead of
GC_err_printf() for error printing.
* checksums.c (GC_check_blocks, GC_check_dirty): Use GC_log_printf
instead of GC_printf for logging purposes.
* dyn_load.c (sys_errlist, sys_nerr, errno): Move declaration of
external variable outside from GC_register_dynamic_libraries.
* dyn_load.c (GC_register_dynamic_libraries): Don't use
sys_errlist value if errno equals to sys_nerr.
* dyn_load.c (GC_register_dynamic_libraries): Use GC_log_printf
instead of GC_printf for DL_VERBOSE output.
* dyn_load.c (GC_dyld_image_add, GC_dyld_image_remove,
GC_init_dyld): Use GC_log_printf instead of GC_printf for
DARWIN_DEBUG output.
* os_dep.c (catch_exception_raise): Use GC_log_printf
instead of GC_printf for DEBUG_EXCEPTION_HANDLING output.
* reclaim.c (GC_print_free_list): Move "n" increment out of
GC_printf() call.

12 years ago2011-04-03 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 3 Apr 2011 14:32:12 +0000 (14:32 +0000)]
2011-04-03  Ivan Maidanski  <ivmai@mail.ru>

* win32_threads.c (DEBUG_CYGWIN_THREADS, DEBUG_WIN32_PTHREADS,
DEBUG_WIN32_THREADS): Remove.
* win32_threads.c (GC_register_my_thread_inner,
GC_win32_start_inner): Use GC_log_printf instead of GC_printf
inside "if (GC_print_stats)" branch.
* win32_threads.c (GC_PTHREAD_PTRVAL): New macro (defined only if
GC_PTHREADS).
* win32_threads.c (GC_delete_gc_thread, NUMERIC_THREAD_ID,
GC_pthread_join, GC_pthread_create): Use GC_PTHREAD_PTRVAL
macro.
* win32_threads.c (GC_push_stack_for, GC_mark_thread,
GC_CreateThread, GC_beginthreadex, GC_pthread_join,
GC_pthread_create, GC_pthread_start_inner, GC_thread_exit_proc,
GC_mark_thread_local_free_lists): Use GC_log_printf instead of
GC_printf for DEBUG_THREADS output.
* win32_threads.c (GC_win32_start_inner, GC_CreateThread,
GC_beginthreadex, GC_pthread_join, GC_pthread_create,
GC_pthread_start_inner, GC_thread_exit_proc): Cast
GetCurrentThreadId result to long; don't cast value of pthread_t
type to int; adjust printf format specifiers.
* doc/README.win32 (DEBUG_WIN32_PTHREADS): Remove obsolete
information.

12 years ago2011-04-03 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 3 Apr 2011 13:43:18 +0000 (13:43 +0000)]
2011-04-03  Ivan Maidanski  <ivmai@mail.ru>

* tests/test.c (cons, small_cons, gcj_cons, check_ints,
check_uncollectable_ints, print_int_list, check_marks_int_list,
fork_a_thread, finalizer, mktree, chktree, alloc8bytes,
alloc_small, tree_test, typed_test, check_heap_stats, WinMain,
test, main): Remove unnecessary casts of GC_printf calls to void.

12 years ago2011-04-02 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 2 Apr 2011 15:57:23 +0000 (15:57 +0000)]
2011-04-02  Ivan Maidanski  <ivmai@mail.ru>

* allchblk.c (GC_print_hblkfreelist): Adjust (make uniform across
BDWGC) printed message (adjust letters case, terminating dot and
new line symbols).
* alloc.c (GC_check_fl_marks): Ditto.
* backgraph.c (new_back_edges): Ditto.
* checksums.c (GC_check_dirty): Ditto.
* darwin_stop_world.c (GC_push_all_stacks,
GC_suspend_thread_list): Ditto.
* dbg_mlc.c (GC_print_type, GC_debug_free, GC_debug_realloc,
store_old): Ditto.
* dyn_load.c (GC_register_dynamic_libraries): Ditto.
* mark.c (GC_initiate_gc, GC_mark_some, GC_mark_from, GC_push_all,
GC_push_selected, GC_push_next_marked_dirty): Ditto.
* mark_rts.c (GC_exclude_static_roots_inner): Ditto.
* os_dep.c (GC_remap, GC_default_push_other_roots,
GC_push_thread_structures, GC_dirty_init, GC_read_dirty,
catch_exception_raise_state, catch_exception_raise_state_identity,
GC_mprotect_thread_notify, GC_mprotect_thread,
catch_exception_raise): Ditto.
* pthread_stop_world.c (GC_print_sig_mask, GC_push_all_stacks,
GC_stop_world, GC_stop_init): Ditto.
* pthread_support.c (GC_thr_init, GC_register_my_thread_inner,
GC_start_routine): Ditto.
* win32_threads.c (GC_register_my_thread_inner,
GC_push_all_stacks, GC_win32_start_inner, GC_pthread_join,
GC_pthread_start_inner): Ditto.
* alloc.c (GC_expand_hp_inner): Realign the code.
* mark.c (GC_mark_from, GC_mark_local, GC_do_parallel_mark):
Ditto.
* misc.c (GC_init): Ditto.
* os_dep.c (GC_dirty_init, GC_read_dirty): Ditto.
* include/private/gc_pmark.h (PUSH_CONTENTS_HDR): Ditto.
* tests/test.c (run_one_test): Ditto.
* misc.c (GC_err_puts): Document.
* misc.c (GC_err_write): Remove.
* os_dep.c (dump_maps): Ditto.
* include/private/gc_priv.h (GC_err_write): Ditto.
* os_dep.c (GC_print_address_map): Call GC_err_puts() instead of
dump_maps() and GC_err_write().
* os_dep.c (GC_read_dirty): Remove redundant brackets.

12 years ago2011-04-02 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 2 Apr 2011 08:15:06 +0000 (08:15 +0000)]
2011-04-02  Ivan Maidanski  <ivmai@mail.ru>

* tests/test.c (reverse_test_inner): Test interior pointer
recognition only if ALL_INTERIOR_POINTERS.
* tests/test.c (run_one_test): Replace GC_all_interior_pointers
with GC_get_all_interior_pointers(); simplify the expression.
* tests/test.c (check_heap_stats): Replace GC_bytes_allocd and
GC_bytes_allocd_before_gc with GC_get_total_bytes().
* tests/test.c (main): Replace GC_gc_no with GC_get_gc_no().

12 years ago2011-03-27 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 27 Mar 2011 20:19:47 +0000 (20:19 +0000)]
2011-03-27  Ivan Maidanski  <ivmai@mail.ru>

* dbg_mlc.c (GC_debug_strdup, GC_debug_free): Output a portability
warning if the argument is NULL and GC is in leaks detection mode.
* dbg_mlc.c (GC_debug_strndup, GC_debug_wcsdup): New public
function definition.
* malloc.c (GC_strndup, GC_wcsdup, strndup): Ditto.
* mallocx.c (GC_posix_memalign): Ditto.
* malloc.c (strdup): Fix string size value; rename "len" to "lb".
* mallocx.c: Include errno.h unless WinCE (otherwise include
windows.h for Win32 error constants).
* win32_threads.c: Define WIN32_LEAN_AND_MEAN and NOSERVICE before
windows.h inclusion.
* misc.c (GC_init): Register at-exit callback if GC_find_leak
(even if GC_FIND_LEAK macro is unset).
* pthread_stop_world.c (NACL_STORE_REGS,
__nacl_suspend_thread_if_needed, GC_nacl_initialize_gc_thread):
Use BCOPY() instead of memcpy().
* pthread_support.c (GC_init_real_syms): Ditto.
* doc/README: Update year in copyright.
* include/gc.h: Ditto.
* doc/README.macros (GC_DEBUG_REPLACEMENT, GC_REQUIRE_WCSDUP):
Document new macro.
* doc/README.macros (REDIRECT_MALLOC): Update documentation.
* include/gc.h (GC_strndup, GC_posix_memalign, GC_debug_strndup):
New API function prototype.
* include/gc.h (GC_MALLOC, GC_REALLOC): Redirect to
GC_debug_malloc/realloc_replacement() if GC_DEBUG_REPLACEMENT.
* include/gc.h (GC_STRDUP): Remove redundant parentheses.
* include/leak_detector.h (realloc, strdup): Ditto.
* include/gc.h (GC_STRNDUP): New API macro.
* include/gc.h (GC_NEW, GC_NEW_ATOMIC, GC_NEW_STUBBORN,
GC_NEW_UNCOLLECTABLE): Add missing parentheses.
* include/gc.h (GC_wcsdup, GC_debug_wcsdup): New API function
prototype (only if GC_REQUIRE_WCSDUP).
* include/gc.h (GC_WCSDUP): New API macro (only if
GC_REQUIRE_WCSDUP).
* include/leak_detector.h: Add copyright header; add usage
comment; include stdlib.h and string.h after gc.h (unless
GC_DONT_INCLUDE_STDLIB).
* include/leak_detector.h (malloc, calloc, free, realloc):
Undefine symbol before its redefinition.
* include/leak_detector.h (strndup, memalign, posix_memalign):
Redefine to the corresponding GC function.
* include/leak_detector.h (wcsdup): Redefine to GC_WCSDUP (only
if GC_REQUIRE_WCSDUP).
* include/leak_detector.h (CHECK_LEAKS): Add comment; don't define
the macro if already defined.

12 years ago2011-03-22 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 22 Mar 2011 17:50:16 +0000 (17:50 +0000)]
2011-03-22  Ivan Maidanski  <ivmai@mail.ru>

* misc.c (GC_abort): Use _exit() (instead of DebugBreak) on Win32 when
doing code static analysis (to inform the tool that the function is
a no-return one).
* os_dep.c (GC_linux_stack_base): Remove a duplicate validation of the
length of "stat" file; use signed int type for "i", "buf_offset" and
"len" local variables (since read() may return -1).

12 years ago2011-03-20 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 20 Mar 2011 10:31:14 +0000 (10:31 +0000)]
2011-03-20  Ivan Maidanski  <ivmai@mail.ru>

* blacklst.c (GC_bl_init_no_interiors): New function (the code
moved from GC_bl_init).
* blacklst.c (GC_bl_init): Invoke GC_bl_init_no_interiors unless
GC_all_interior_pointers mode; remove unnecessarily parameter cast
for GC_scratch_alloc call.
* include/private/gc_priv.h (GC_bl_init): Move the function
declaration to misc.c file.
* misc.c (GC_bl_init_no_interiors): Add a prototype.
* misc.c (GC_set_all_interior_pointers): Allow values other than 0
and 1; allow altering GC_set_all_interior_pointers value even
after GC initialization.
* obj_map.c (GC_initialize_offsets): Clear GC_valid_offsets and
GC_modws_valid_offsets if GC_all_interior_pointers is off.
* misc.c (GC_init): Don't call GC_initialize_offsets() unless
GC_all_interior_pointers mode.

12 years ago2011-03-20 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 20 Mar 2011 09:08:55 +0000 (09:08 +0000)]
2011-03-20  Ivan Maidanski  <ivmai@mail.ru>

* alloc.c (GC_finish_collection): Remove redundant brackets;
adjust code indentation.
* blacklst.c (GC_add_to_black_list_normal): Simplify expression
(to improve code readability).
* blacklst.c (GC_is_black_listed): Join nested "if" (into a single
conditional expression); initialize "nblocks" just before the loop
beginning.
* misc.c (GC_init): Don't compute initial_heap_sz if GC is already
initialized.
* include/private/gc_priv.h (GC_initialize_offsets): Move the
function declaration to misc.c file.
* obj_map.c (GC_initialize_offsets): Remove offsets_initialized
static variable since the function is called only once.
* tests/middle.c: Include "gc.h" instead of <gc.h>; expand all
tabs to spaces; adjust code indentation; replace the K&R-style
function definition with the ANSI C one.
* tests/smash_test.c: Ditto.
* tests/middle.c (main): Use setter for GC_all_interior_pointers;
adjust printf format specifier (and cast the value passed to).