]> granicus.if.org Git - gc/log
gc
13 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.

13 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".

13 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.

13 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.

13 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.

13 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.

13 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.

13 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.

13 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.

13 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.

13 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.

13 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.

13 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).

13 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.

13 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.

13 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.

13 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).

13 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.

13 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.

13 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).

13 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.

13 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().

13 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.

13 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.

13 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.

13 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.

13 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().

13 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.

13 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).

13 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.

13 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).

13 years ago2011-03-15 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 15 Mar 2011 16:06:57 +0000 (16:06 +0000)]
2011-03-15  Ivan Maidanski  <ivmai@mail.ru>

* doc/README.macros (SMALL_CONFIG, LARGE_CONFIG): Refine the
documentation.
* include/private/gc_hdrs.h (LOG_BOTTOM_SZ): Ignore SMALL_CONFIG
if LARGE_CONFIG is defined.
* include/private/gc_priv.h (CPP_LOG_HBLKSIZE): Ditto.

13 years ago2011-03-15 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 15 Mar 2011 13:09:15 +0000 (13:09 +0000)]
2011-03-15  Ivan Maidanski  <ivmai@mail.ru>

* alloc.c (GC_finish_collection): Replace "#else #ifdef" with
"#elif".
* include/private/gc_priv.h (CPP_LOG_HBLKSIZE, LOG_PHT_ENTRIES,
MAX_ROOT_SETS, MAX_HEAP_SECTS): Ditto.
* alloc.c (GC_expand_hp_inner): Check for GC_collect_at_heapsize
overflow even if not LARGE_CONFIG.
* dbg_mlc.c (GC_check_heap_proc): Check "oh" size even if
SMALL_CONFIG.
* finalize.c (GC_print_finalization_stats): Fix "#endif" comment.
* new_hblk.c (GC_build_fl_clear2, GC_build_fl_clear4, GC_build_fl2,
GC_build_fl4): Reformat the comment; adjust code indentation.
* new_hblk.c (GC_build_fl): Fix indentation.
* include/private/gc_hdrs.h: Ditto.
* doc/README.environment (GC_LOG_FILE, GC_PRINT_VERBOSE_STATS,
GC_FULL_FREQUENCY): Refine the documentation.

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

* extra/msvc_dbg.c: Test _MSC_VER macro; include "gc.h" (for
GC_word); reformat the code; expand all tabs to spaces.
* extra/msvc_dbg.c (ULONG_PTR): Replace with GC_ULONG_PTR; define
as word.

13 years ago2011-03-13 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 13 Mar 2011 19:37:24 +0000 (19:37 +0000)]
2011-03-13  Ivan Maidanski  <ivmai@mail.ru>

* dbg_mlc.c (GC_get_back_ptr_info, GC_print_obj,
GC_print_smashed_obj, GC_debug_free_inner): Add a code for a
LINT-like tool to instruct it that the function is invoked only
with valid parameters (otherwise a SEGV is ok); recognize LINT2
new macro.
* misc.c (GC_abort): Instruct a LINT-like tool that the function
never returns in fact.
* os_dep.c (GC_linux_stack_base): Check for read buffer overflow;
close the file immediately after read; use STRTOULL() instead of
decoding the address number manually.
* include/private/gc_priv.h (EXPECT): Don't specify outcome for a
LINT-like tool.
* include/private/gc_priv.h (GC_all_interior_pointers): Instruct a
LINT-like tool that the value is restricted to zero and one only
(required since the variable is global and its value is used as a
part of array index expression is some places).

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

* dbg_mlc.c (GC_make_closure): Fix SEGV in case GC_malloc returns
NULL.
* dbg_mlc.c (GC_debug_register_finalizer,
GC_debug_register_finalizer_no_order,
GC_debug_register_finalizer_unreachable,
GC_debug_register_finalizer_ignore_self): Handle out of memory
case properly (similar to GC_register_finalizer_inner).
* headers.c (GC_install_header): Handle the case when alloc_hdr()
returns NULL.
* os_dep.c (GC_get_maps_len): Defend against missing "maps" file.
* pthread_support.c (GC_mark_thread): Place a dummy return
statement (which uses "id" argument) before the actual use of "id"
as an array index (to suppress a warning produced by some static
code analysis tools).
* win32_threads.c (GC_mark_thread): Ditto.
* pthread_support.c (GC_thr_init): Abort (with the appropriate
message) if out of memory.

13 years ago2011-03-13 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 13 Mar 2011 12:28:29 +0000 (12:28 +0000)]
2011-03-13  Ivan Maidanski  <ivmai@mail.ru>

* finalize.c (GC_register_finalizer_inner): Fix a typo in a
comment.
*include/private/gcconfig.h (STACKBOTTOM): Ditto.
* gcj_mlc.c (GC_core_gcj_malloc): Replace 0/1 with TRUE/FALSE in
EXPECT (the 2nd argument).
* malloc.c (GC_core_malloc_atomic, GC_core_malloc, GC_free):
Ditto.
* mark.c (GC_mark_and_push, GC_mark_and_push_stack): Ditto.
* thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Ditto.
* include/private/gc_hdrs.h (HC_GET_HDR): Ditto.
* include/private/gc_priv.h (SMALL_OBJ): Ditto.
* include/private/specific.h (getspecific): Ditto.
* pthread_support.c (LOCK_STATS): Add a comment.

13 years ago2011-03-08 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 8 Mar 2011 08:45:31 +0000 (08:45 +0000)]
2011-03-08  Ivan Maidanski  <ivmai@mail.ru>

* include/gc_pthread_redirects.h (GC_NO_DLOPEN,
GC_NO_PTHREAD_SIGMASK, GC_PTHREAD_CREATE_CONST,
GC_PTHREAD_EXIT_ATTRIBUTE, GC_NO_PTHREAD_CANCEL): Move the
definition to gc_config_macros.

13 years ago2011-03-08 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 8 Mar 2011 08:13:24 +0000 (08:13 +0000)]
2011-03-08  Ivan Maidanski  <ivmai@mail.ru>

* pthread_support.c (pthread_cancel, GC_pthread_cancel_t,
GC_pthread_cancel): Test GC_NO_PTHREAD_CANCEL (instead of NACL and
GC_PTHREAD_EXIT_ATTRIBUTE).
* include/gc_pthread_redirects.h (GC_pthread_cancel,
pthread_cancel): Ditto.
* pthread_support.c (GC_pthread_create, GC_pthread_sigmask,
GC_pthread_join, GC_pthread_detach, GC_pthread_cancel): Realign
code.
* include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE):
Define as empty for NaCl.
* include/gc_pthread_redirects.h (GC_NO_PTHREAD_CANCEL): New macro
defined.

13 years ago2011-03-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 7 Mar 2011 21:43:02 +0000 (21:43 +0000)]
2011-03-07  Ivan Maidanski  <ivmai@mail.ru>

* dyn_load.c (GC_init_dyld): Do not invoke
_dyld_bind_fully_image_containing_address() if GC_no_dls (as it is
not required to register the main data segment in that case).
* include/gc.h (GC_no_dls): Adjust the comment.

13 years ago2011-03-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 7 Mar 2011 17:36:19 +0000 (17:36 +0000)]
2011-03-07  Ivan Maidanski  <ivmai@mail.ru>

* dyn_load.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Test
GC_NO_DLOPEN.
* gc_dlopen.c: Ditto.
* include/gc_pthread_redirects.h (GC_dlopen, dlopen): Ditto.
* gc_dlopen.c: Don't include dlfcn.h (as it is included in
gc_pthread_redirects.h).
* pthread_support.c (pthread_sigmask, GC_pthread_sigmask_t,
GC_pthread_sigmask): Test GC_NO_PTHREAD_SIGMASK (instead of
GC_DARWIN_THREADS, GC_OPENBSD_THREADS and NACL).
* include/gc_pthread_redirects.h (GC_pthread_sigmask,
pthread_sigmask): Ditto.
* win32_threads.c (pthread_sigmask, GC_pthread_sigmask): Test
GC_NO_PTHREAD_SIGMASK (instead of GC_WIN32_PTHREADS); reformat the
comment.
* pthread_support.c (pthread_create, GC_pthread_create_t,
GC_pthread_create): Rename GC_PTHREAD_CONST to
GC_PTHREAD_CREATE_CONST.
* win32_threads.c (GC_pthread_create): Ditto.
* include/gc_pthread_redirects.h: Ditto.
* include/gc_pthread_redirects.h (GC_NO_DLOPEN,
GC_NO_PTHREAD_SIGMASK): New macro defined.
* include/gc_pthread_redirects.h (GC_PTHREAD_CREATE_CONST): Set to
empty for NaCl.
* include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): Do
not define for Android (as CANCEL_SAFE is not defined).

13 years ago2011-03-07 Ivan Maidanski
ivmai [Mon, 7 Mar 2011 08:49:05 +0000 (08:49 +0000)]
2011-03-07  Ivan Maidanski

* include/gc.h (GC_ADD_CALLER, GC_RETURN_ADDR,
GC_HAVE_BUILTIN_BACKTRACE, GC_CAN_SAVE_CALL_STACKS): Move
definition to gc_config_macros.h file.
* include/gc_config_macros.h: Check the file is included from gc.h
file.
* include/gc_version.h: Ditto.
* include/gc_config_macros.h: Reformat comments.
* include/gc_version.h: Reformat code.

13 years ago2011-02-20 Ivan Maidanski <ivmai@mail.ru> (mostly really Elijah Taylor)
ivmai [Sun, 20 Feb 2011 10:54:32 +0000 (10:54 +0000)]
2011-02-20  Ivan Maidanski  <ivmai@mail.ru> (mostly really Elijah Taylor)

* gc_dlopen.c: Empty unit for NaCl.
* os_dep.c: Include fcntl.h for NaCl.
* os_dep.c (GC_get_main_stack_base): Ignore
USE_GET_STACKBASE_FOR_MAIN macro for NaCl.
* os_dep.c (GC_get_stack_base): Return GC_UNIMPLEMENTED for NaCl.
* os_dep.c (GC_remap): Use mmap (instead of mprotect) for NaCl.
* pthread_start.c (GC_inner_start_routine): Don't invoke
pthread_cleanup_push/pop for NaCl.
* pthread_stop_world.c (GC_nacl_num_gc_threads,
GC_nacl_thread_idx, GC_nacl_park_threads_now,
GC_nacl_thread_parker, GC_nacl_gc_thread_self,
GC_nacl_thread_parked, GC_nacl_thread_used,
GC_nacl_thread_parking_inited, GC_nacl_thread_alloc_lock): New
variable (fo NaCl only).
* pthread_stop_world.c (GC_suspend_handler): Reformat the code.
* pthread_stop_world.c (GC_remove_allowed_signals,
suspend_handler_mask, GC_stop_count, GC_world_is_stopped,
GC_retry_signals, SIG_THR_RESTART, GC_suspend_ack_sem,
GC_restart_ack_sem, GC_suspend_handler_inner, GC_suspend_handler,
GC_restart_handler): Don't define for NaCl.
* pthread_support.c (GC_get_nprocs): Ditto.
* include/private/gc_priv.h (SIG_SUSPEND): Ditto.
* include/private/gcconfig.h (LINUX): Ditto.
* pthread_stop_world.c (GC_push_all_stacks): Push register storage
for NaCl.
* pthread_stop_world.c (GC_suspend_all, GC_stop_world,
GC_start_world): Implement for NaCl.
* pthread_stop_world.c (GC_stop_world): Don't define unused "i"
local variable for OpenBSD (and NaCl).
* pthread_stop_world.c (NACL_STORE_REGS): New macro definition for
NaCl.
* pthread_stop_world.c (nacl_pre_syscall_hook,
__nacl_suspend_thread_if_needed, nacl_post_syscall_hook,
GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread): New
function (for NaCl only).
* pthread_stop_world.c (GC_stop_init): Empty for NaCl.
* pthread_support.c (pthread_cancel, pthread_sigmask): Don't
redirect for NaCl.
* include/gc_pthread_redirects.h (pthread_cancel,
pthread_sigmask): Ditto.
* pthread_support.c (GC_nacl_initialize_gc_thread,
GC_nacl_shutdown_gc_thread): New internal prototype (NaCl only).
* pthread_support.c (GC_new_thread, GC_delete_thread): Initialize
and shutdown thread for NaCl.
* pthread_support.c (GC_thr_init): Call sysconf for NaCl.
* pthread_support.c (GC_pthread_exit): Call GC_thread_exit_proc
for NaCl.
* include/gc.h: Don't include features.h for NaCl.
* include/gc_pthread_redirects.h (GC_PTHREAD_CONST): New macro.
* include/gc_pthread_redirects.h (GC_pthread_create): Use
GC_PTHREAD_CONST instead of const.
* win32_threads.c (GC_pthread_create): Ditto.
* pthread_support.c (GC_pthread_create_t, GC_pthread_create,
pthread_create): Ditto.
* include/private/gcconfig.h (NACL): Recognize NaCl.
* include/private/gcconfig.h (GC_LINUX_THREADS): Valid for NaCl.
* include/private/pthread_stop_world.h (thread_stop_info): Add
reg_storage member; define NACL_GC_REG_STORAGE_SIZE macro (for
NaCl only).
* include/private/pthread_support.h (GC_nacl_gc_thread_self):
Declare internal variable (for NaCl only).

13 years ago2011-02-19 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 19 Feb 2011 10:45:00 +0000 (10:45 +0000)]
2011-02-19  Ivan Maidanski  <ivmai@mail.ru>

* aclocal.m4: Regenerate (by autoreconf -vif using autoconf-2.68,
automake-1.11.1 and libtool-2.4).
* configure: Ditto.
* ltmain.sh: Ditto.
* makefile.in: Ditto.
* m4/libtool.m4: Ditto.
* m4/ltversion.m4: Ditto.
* mach_dep.c (GC_with_callee_saves_pushed): Fix FE_ALL_EXCEPT
macro.

13 years ago2011-02-13 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 13 Feb 2011 18:44:37 +0000 (18:44 +0000)]
2011-02-13  Ivan Maidanski  <ivmai@mail.ru>

* mark.c (GC_mark_some): Prefix and suffix "asm" and "volatile"
keywords with double underscore.
* os_dep.c (GC_unix_get_mem): Reformat the code.
* os_dep.c (catch_exception_raise, catch_exception_raise_state,
catch_exception_raise_state_identity): Add GC_API_OSCALL to
function definition.
* os_dep.c (catch_exception_raise_state,
catch_exception_raise_state_identity): Move definition to be
before GC_ports.
* os_dep.c (catch_exception_raise): Declare to have the symbol
defined before GC_ports.
* os_dep.c (GC_ports): Store references to catch_exception_raise,
catch_exception_raise_state, catch_exception_raise_state_identity
(to prevent stripping these symbols as dead).
* os_dep.c (catch_exception_raise, catch_exception_raise_state,
catch_exception_raise_state_identity): Mark these symbols as
"referenced dynamically" via an assembler directive (unless
NO_DESC_CATCH_EXCEPTION_RAISE).
* include/private/gc_priv.h (GC_API_OSCALL): New macro (defined
similar to GC_API but as if GC_DLL is always defined).

13 years ago2011-02-10 Ivan Maidanski <ivmai@mail.ru> (with input from Dimitry Andric)
ivmai [Sat, 12 Feb 2011 18:28:44 +0000 (18:28 +0000)]
2011-02-10  Ivan Maidanski  <ivmai@mail.ru> (with input from Dimitry Andric)

* os_dep.c: Don't include signal.h for GC_write_fault_handler on
Win32.
* os_dep.c (SIG_OK): Don't return true unless SIGSEGV or SIGBUS on
FreeBSD.
* os_dep.c (CODE_OK): Use SEGV_ACCERR on FreeBSD (define
SEGV_ACCERR for older FreeBSD releases).
* os_dep.c (SIG_OK, CODE_OK, GC_write_fault_handler): Reformat the
code.

13 years ago2011-02-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 12 Feb 2011 15:06:57 +0000 (15:06 +0000)]
2011-02-10  Ivan Maidanski  <ivmai@mail.ru>

* dyn_load.c (GC_register_map_entries,
GC_register_dynamic_libraries_dl_iterate_phdr): Calculate
DATASTART only once if DATASTART_IS_FUNC.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr):
Calculate DATAEND only once if DATAEND_IS_FUNC.
* dyn_load.c: Add comment to some endif; realign some code.
* dyn_load.c (GC_init_dyld): Don't use
_dyld_bind_fully_image_containing_address if
NO_DYLD_BIND_FULLY_IMAGE defined; add FIXME.
* include/private/gcconfig.h (GC_data_start, GC_find_limit):
Declare if used by DATASTART/DATAEND, respectively.
* include/private/gcconfig.h (DATASTART_IS_FUNC, DATAEND_IS_FUNC):
Define if DATASTART/DATAEND is a function, respectively.
* include/private/gcconfig.h (GETPAGESIZE, NO_PTHREAD_TRYLOCK,
NO_DYLD_BIND_FULLY_IMAGE): Define for Darwin/arm as well; include
unistd.h.

13 years ago2011-02-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 12 Feb 2011 15:04:24 +0000 (15:04 +0000)]
2011-02-10  Ivan Maidanski  <ivmai@mail.ru>

* os_dep.c (GC_setpagesize, GC_task_self, PROTECT, UNPROTECT):
Reorder to remove redundant ifdef for Win32.
* os_dep.c: Add comment to some endif.
* os_dep.c: Include pthread.h (for Linux even if single-threaded)
if USE_GET_STACKBASE_FOR_MAIN; also include it for Darwin.
* os_dep.c (STACKBOTTOM): Redefine for Darwin (unless prohibited
for some reason).
* os_dep.c (GC_get_main_stack_base): Allow
USE_GET_STACKBASE_FOR_MAIN for Linux even if single-threaded; add
assertion for the returned result.
* os_dep.c (GC_get_stack_base): Define for Darwin if
multi-threaded.
* os_dep.c (GC_page_was_dirty): Reformat the code.
* os_dep.c: Reformat some comments.
* os_dep.c (SIG_OK, CODE_OK): Add comment (for FreeBSD).
* os_dep.c (ID_STOP, ID_RESUME): Define only if threads.
* os_dep.c (catch_exception_raise): Remove redundant parentheses;
refine the documentation.

13 years ago2011-02-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 12 Feb 2011 15:02:35 +0000 (15:02 +0000)]
2011-02-10  Ivan Maidanski  <ivmai@mail.ru>

* NT_MAKEFILE: Define _CRT_SECURE_NO_DEPRECATE for C++ files as
well.
* NT_STATIC_THREADS_MAKEFILE: Ditto.
* doc/README.macros (USE_GET_STACKBASE_FOR_MAIN): Refine.
* include/gc.h (GC_INIT): Document.
* include/private/gc_priv.h (GC_MACH_HEADER, GC_MACH_SECTION,
GC_GETSECTBYNAME): Define depending only on the word size (i.e.,
define these macros also for ARM).
* tests/test.c (check_heap_stats): Print main thread stack bottom
as well (only if verbose mode is on).

13 years ago2011-02-09 Ivan Maidanski <ivmai@mail.ru> (mostly Jean-Claude Beaudoin)
ivmai [Sat, 12 Feb 2011 14:43:27 +0000 (14:43 +0000)]
2011-02-09  Ivan Maidanski  <ivmai@mail.ru> (mostly Jean-Claude Beaudoin)

* mach_dep.c (GC_with_callee_saves_pushed): Fix and improve code
introduced by the previous patch (if GETCONTEXT_FPU_EXCMASK_BUG
and X86_64).

13 years ago2011-01-22 Ivan Maidanski <ivmai@mail.ru> (mostly Jean-Claude Beaudoin)
ivmai [Mon, 24 Jan 2011 21:43:30 +0000 (21:43 +0000)]
2011-01-22  Ivan Maidanski  <ivmai@mail.ru> (mostly Jean-Claude Beaudoin)

* darwin_stop_world.c (GC_FindTopOfStack): Prefix and suffix
"volatile" keyword with double underscore.
* mach_dep.c (GETCONTEXT_FPU_EXCMASK_BUG): Recognize new macro and
include fenv.h if defined (unless NO_GETCONTEXT or HAVE_PUSH_REGS).
* mach_dep.c (GC_with_callee_saves_pushed): Restore FPU exception
mask corrupted by getcontext if GETCONTEXT_FPU_EXCMASK_BUG.
* include/private/gcconfig.h (GETCONTEXT_FPU_EXCMASK_BUG): Define
for Linux/amd64 (since its GLibc getcontext currently has the bug).

13 years ago2011-01-17 Ivan Maidanski <ivmai@mail.ru>
ivmai [Mon, 17 Jan 2011 20:34:11 +0000 (20:34 +0000)]
2011-01-17  Ivan Maidanski  <ivmai@mail.ru>

* allchblk.c (GC_use_entire_heap): Change type to int (as declared
in gc.h); set the default value depending on new GC_USE_ENTIRE_HEAP
macro.
* misc.c (GC_init): Test GC_USE_ENTIRE_HEAP environment variable to
alter the default value of GC_use_entire_heap.
* doc/README.environment (GC_USE_ENTIRE_HEAP): Document.
* doc/README.macros (GC_USE_ENTIRE_HEAP): Ditto.

13 years ago2011-01-12 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 12 Jan 2011 22:20:07 +0000 (22:20 +0000)]
2011-01-12  Ivan Maidanski  <ivmai@mail.ru>

* include/private/gcconfig.h (PARALLEL_MARK): Do not make it cause
MPROTECT_VDB undefining.

13 years ago2011-01-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 7 Jan 2011 17:15:12 +0000 (17:15 +0000)]
2011-01-07  Ivan Maidanski  <ivmai@mail.ru>

* gc_dlopen.c: Reformat the comments and adjust code indentation.
* include/private/gcconfig.h (DYNAMIC_LOADING): Fix filename in
the comment.

13 years ago2011-01-07 Ivan Maidanski <ivmai@mail.ru> gc7_2alpha5-20110107
ivmai [Fri, 7 Jan 2011 17:10:01 +0000 (17:10 +0000)]
2011-01-07  Ivan Maidanski  <ivmai@mail.ru>

* gc_dlopen.c: Reformat the comments and adjust code indentation.

13 years ago2011-01-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 7 Jan 2011 10:25:31 +0000 (10:25 +0000)]
2011-01-07  Ivan Maidanski  <ivmai@mail.ru>

* include/private/gc_priv.h (THREAD_FLD, MAX_HEAP_SECTS,
_GC_arrays, GC_push_all_stack_sections, PRINT_BLACK_LIST,
GC_add_to_black_list_stack, GC_ASSERT, SIG_SUSPEND,
NEED_FIND_LIMIT): Reformat the code and comments for.
* include/private/gc_priv.h (_GC_arrays): Move the conditional
macro definitions (shortcuts for GC_arrays members) into the
structure body.

13 years ago2011-01-07 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 7 Jan 2011 09:51:40 +0000 (09:51 +0000)]
2011-01-07  Ivan Maidanski  <ivmai@mail.ru>

* .cvsignore: Add more auto-generated files.
* include/private/.cvsignore: Ditto.
* darwin_stop_world.c (GC_mach_handler_thread,
GC_use_mach_handler_thread,
GC_darwin_register_mach_handler_thread): Define only if
MPROTECT_VDB.
* darwin_stop_world.c (GC_suspend_thread_list): Use
GC_mach_handler_thread and GC_use_mach_handler_thread only if
MPROTECT_VDB.
* darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count
only if defined (i.e. unless GC_NO_THREADS_DISCOVERY).
* misc.c (GC_init): Fix comment for GWW_VDB.
* os_dep.c (GC_mprotect_state_t): Reformat the code.
* os_dep.c (DARWIN_EXC_STATE, DARWIN_EXC_STATE_COUNT,
DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR): New macros.
* os_dep.c (catch_exception_raise): Use DARWIN_EXC_STATE,
DARWIN_EXC_STATE_COUNT, DARWIN_EXC_STATE_T, DARWIN_EXC_STATE_DAR;
reformat the comment.
* pthread_support.c (GC_thr_init): Define "dummy" local variable
only unless GC_DARWIN_THREADS; reformat the code.
* include/private/gcconfig.h (MPROTECT_VDB): Define for Darwin
even in the single-threaded mode; define for iPhone/iPad.
* include/private/gcconfig.h (IA64): Remove unnecessary "ifdef"
around "undef".
* include/private/gcconfig.h (HEURISTIC1): Remove unused for
Cygwin.
* include/private/gcconfig.h (STACKBOTTOM): Use fixed address for
Darwin/arm (instead of HEURISTIC1).
* include/private/gcconfig.h (GET_MEM): Reformat the code.

13 years ago2011-01-05 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 5 Jan 2011 10:03:44 +0000 (10:03 +0000)]
2011-01-05  Ivan Maidanski  <ivmai@mail.ru>

* misc.c (GC_write): Replace multiple "ifdef/endif" with "elif"
(for ECOS and NOSYS).
* os_dep.c (GC_get_main_stack_base): Ditto.
* os_dep.c (GC_get_main_stack_base): Check
USE_GET_STACKBASE_FOR_MAIN macro before checking STACKBOTTOM one;
remove "dummy" variable (use result one instead); reformat the
code.
* doc/README.macros (SN_TARGET_PS3): Document.
* extra/threadlibs.c (main): Don't output "-lpthread" (and "-ldl")
for Android.
* include/private/pthread_support.h: Fix comment for "endif".

13 years ago2010-12-26 Ivan Maidanski <ivmai@mail.ru> (mostly really Miguel de Icaza)
ivmai [Sun, 26 Dec 2010 17:12:55 +0000 (17:12 +0000)]
2010-12-26  Ivan Maidanski  <ivmai@mail.ru> (mostly really Miguel de Icaza)

* misc.c (GC_allocate_ml): Define global variable if SN_TARGET_PS3.
* misc.c (GC_init): Initialize GC_allocate_ml if SN_TARGET_PS3.
* os_dep.c (SIGSEGV): Define to dummy zero if SN_TARGET_PS3.
* os_dep.c (GC_unix_mmap_get_mem): Don't define if SN_TARGET_PS3.
* os_dep.c (GC_default_push_other_roots,
GC_push_thread_structures): Define for SN_TARGET_PS3.
* include/private/gc_locks.h (GC_allocate_ml, LOCK, UNLOCK): Define
for SN_TARGET_PS3.
* include/private/gcconfig.h (SN_TARGET_PS3): Recognize new macro
(Sony PS/3 target).
* include/private/gcconfig.h (THREADS): Define unconditionally if
SN_TARGET_PS3.
* include/private/gcconfig.h (GET_MEM): Define for SN_TARGET_PS3.

13 years ago2010-12-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 26 Dec 2010 15:50:53 +0000 (15:50 +0000)]
2010-12-26  Ivan Maidanski  <ivmai@mail.ru>

* alloc.c (GC_collect_or_expand): Replace NIL with NULL in message.
* 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_generic_malloc_inner_ignore_off_page, GC_debug_malloc_stubborn,
GC_debug_malloc_atomic, GC_debug_malloc_uncollectable,
GC_debug_malloc_atomic_uncollectable): Ditto.
* gcj_mlc.c (GC_debug_gcj_malloc): Ditto.
* dbg_mlc.c (GC_check_annotated_obj): Replace NIL with NULL in a
comment.
* dyn_load.c (GC_FirstDLOpenedLinkMap): Ditto.
* mark_rts.c (GC_roots_present): Ditto.
* doc/README: Ditto.
* include/private/gc_hdrs.h (IS_FORWARDING_ADDR_OR_NIL): Ditto.
* include/private/gc_priv.h (_GC_arrays): Ditto.

13 years ago2010-12-26 Ivan Maidanski <ivmai@mail.ru> (mostly really Geoff Norton
ivmai [Sun, 26 Dec 2010 14:20:38 +0000 (14:20 +0000)]
2010-12-26  Ivan Maidanski  <ivmai@mail.ru> (mostly really Geoff Norton
                                             and Jonathan Pryor)

* configure.ac: Use AC_CHECK_LIB() to check for pthread instead of
just blindly linking to -lpthread, as Android includes pthread
support within libc and does not provide a separate libpthread.
* dyn_load.c (GC_register_dynamic_libraries): Skip current link map
entry if l_addr is NULL (Android/bionic only).
* pthread_stop_world.c (android_thread_kill): New internal function
(Android only).
* pthread_stop_world.c (GC_suspend_all, GC_start_world): Call
android_thread_kill (based on tkill) instead of pthread_kill on
Android (since pthread_kill cannot be used safely on the platform).
* pthread_support.c (GC_new_thread): Store thread Id (obtained from
gettid) for use by android_thread_kill (Android only).
* include/private/pthread_support.h (GC_Thread_Rep): Add kernel_id
structure member (Android only).
* include/private/gcconfig.h: Recognize __x86_64 macro as a synonym
of __x86_64__ (Darwin); define __environ macro (Android on M68K).
* configure: Regenerate.

13 years ago2010-12-02 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 2 Dec 2010 07:44:04 +0000 (07:44 +0000)]
2010-12-02  Ivan Maidanski  <ivmai@mail.ru>

* allchblk.c (GC_freehblk): Print extended error message (done via
GC_printf() before aborting with a short message) only if
GC_print_stats.
* dyn_load.c (GC_register_dynamic_libraries): Ditto.
* os_dep.c (GC_get_maps, GC_register_data_segments, GC_remap,
PROTECT, GC_write_fault_handler, GC_mprotect_thread): Ditto.
* pthread_stop_world.c (GC_start_world): Ditto.
* win32_threads.c (GC_register_my_thread_inner): Ditto.
* os_dep.c (GC_get_main_stack_base, GC_register_data_segments,
GC_dirty_init): Remove redundant print of an error message before
aborting with the same message.
* os_dep.c (GC_register_data_segments): Remove format specifier
from the string passed to GC_err_puts(); use ABORT instead of EXIT
(if invalid executable type).
* os_dep.c (GC_remap): Adjust printf format specifier (for long
type).
* os_dep.c (GC_dirty_init): Print a message about SIG_IGN detected
(for SIGSEGV/BUS) only if GC_print_stats.
* os_dep.c (catch_exception_raise): Join 2 adjucent GC_err_printf
calls.

13 years ago2010-11-25 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 25 Nov 2010 21:38:04 +0000 (21:38 +0000)]
2010-11-25  Ivan Maidanski  <ivmai@mail.ru>

* tests/test.c (main): Print the relevant message if GWW_VDB.
* include/private/gcconfig.h: Don't define MPROTECT_VDB for Win32
on x64 if compiled by GCC.

13 years ago2010-11-04 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 4 Nov 2010 17:27:33 +0000 (17:27 +0000)]
2010-11-04  Ivan Maidanski  <ivmai@mail.ru>

* tests/staticrootstest.c: Include string.h for memset() prototype.
* tests/thread_leak_test.c (main): Fix printf() format specifiers.

13 years ago2010-10-22 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 22 Oct 2010 05:47:47 +0000 (05:47 +0000)]
2010-10-22  Ivan Maidanski <ivmai@mail.ru>

* CMakeLists.txt: Check enable_parallel_mark on Darwin.
* configure.ac: Ditto.
* darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS,
DARWIN_QUERY_TASK_THREADS): Rename to GC_NO_THREADS_DISCOVERY and
GC_DISCOVER_TASK_THREADS, respectively.
* os_dep.c (DARWIN_SUSPEND_GC_THREADS): Ditto.
* pthread_support.c (DARWIN_SUSPEND_GC_THREADS): Ditto.
* darwin_stop_world.c (DARWIN_QUERY_TASK_THREADS): Don't define
(and remove FIXME).
* darwin_stop_world.c (GC_use_threads_discovery): Add GC_API;
comment; remove FIXME.
* win32_threads.c (GC_NO_DLLMAIN): Rename to
GC_NO_THREADS_DISCOVERY.
* tests/test.c (GC_NO_DLLMAIN): Ditto.
* doc/README.macros (GC_NO_DLLMAIN): Ditto.
* doc/README.win32 (GC_NO_DLLMAIN): Ditto.
* doc/README.macros (GC_NO_THREADS_DISCOVERY): Update the comment.
* win32_threads.c (GC_win32_dll_threads): Define as macro to true
if GC_DISCOVER_TASK_THREADS (and not GC_NO_THREADS_DISCOVERY);
update the comment.
* win32_threads.c (GC_use_DllMain): Rename to
GC_use_threads_discovery; do not set GC_win32_dll_threads if
GC_DISCOVER_TASK_THREADS.
* win32_threads.c (GC_started_thread_while_stopped,
GC_lookup_thread_inner, UNPROTECT_THREAD, GC_lookup_pthread,
GC_thr_init, GC_pthread_create, DllMain): Rewrite some expressions
which use GC_win32_dll_threads to minimize the possibility of
an "unreachable code" compiler warning when GC_win32_dll_threads
is defined as a macro.
* win32_threads.c (GC_unregister_my_thread): Don't call
GC_delete_thread() if GC_win32_dll_threads and THREAD_LOCAL_ALLOC
(since can't happen); use "t" local variable only if not
GC_win32_dll_threads.
* win32_threads.c (GC_register_my_thread_inner): Reformat the
comment.
* doc/README.macros (GC_DISCOVER_TASK_THREADS): Document.
* include/gc.h (GC_use_DllMain): Rename to
GC_use_threads_discovery but keep old name as a macro definition.
* include/gc.h (GC_use_threads_discovery): Declare also for
Darwin; update the comment.
* tests/test.c (main): Call GC_use_threads_discovery for Darwin
(to test the mode if possible).
* configure: Regenerate.

13 years ago2010-10-16 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 16 Oct 2010 08:44:59 +0000 (08:44 +0000)]
2010-10-16  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (DARWIN_SUSPEND_GC_THREADS,
DARWIN_QUERY_TASK_THREADS): New macro recognized.
* darwin_stop_world.c (GC_query_task_threads): add STATIC;
initialize to false; define as macro if DARWIN_SUSPEND_GC_THREADS
or DARWIN_QUERY_TASK_THREADS; remove FIXME.
* darwin_stop_world.c (GC_use_threads_discovery): New function
(for setting GC_query_task_threads value).
* darwin_stop_world.c (GC_mach_handler_thread,
GC_use_mach_handler_thread, GC_mach_thread, GC_MAX_MACH_THREADS,
GC_mach_threads, GC_mach_threads_count, GC_suspend_thread_list,
GC_darwin_register_mach_handler_thread): Define only if not
DARWIN_SUSPEND_GC_THREADS.
* darwin_stop_world.c (GC_stop_world, GC_start_world): Exclude
the code for GC_query_task_threads case from compilation unless
DARWIN_SUSPEND_GC_THREADS.
* os_dep.c (GC_darwin_register_mach_handler_thread): Declared only
if Darwin threads and not DARWIN_SUSPEND_GC_THREADS.
* os_dep.c (GC_mprotect_thread): Call
GC_darwin_register_mach_handler_thread only if THREADS and not
DARWIN_SUSPEND_GC_THREADS.
* pthread_support.c (marker_mach_threads): Don't define if
DARWIN_SUSPEND_GC_THREADS.
* pthread_support.c (GC_mark_thread): Don't fill in
marker_mach_threads if DARWIN_SUSPEND_GC_THREADS.
* include/private/gc_locks.h (GC_need_to_lock): Always declare for
THREADS case.

13 years ago2010-10-15 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 15 Oct 2010 20:14:15 +0000 (20:14 +0000)]
2010-10-15  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (GC_query_task_threads): Don't define to
false for DARWIN_DONT_PARSE_STACK case; unconditionally initialize
the variable to false (for now).
* darwin_stop_world.c (GC_push_all_stacks): Call task_threads()
only if not DARWIN_DONT_PARSE_STACK.
* darwin_stop_world.c (GC_stop_world, GC_start_world): Use the
approach based on task_threads() only if GC_query_task_threads
else use GC_threads table.

13 years ago2010-10-15 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 15 Oct 2010 05:09:05 +0000 (05:09 +0000)]
2010-10-15  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (GC_mach_threads): Remove static qualifier.
* darwin_stop_world.c (GC_stop_init): Remove (as we do not need to
really clear GC_mach_threads[]).
* darwin_stop_world.c (GC_stop_world): Reset GC_mach_threads_count
(instead of calling GC_stop_init).
* include/private/pthread_support.h (GC_stop_init): Remove proto.
* pthread_support.c (GC_stop_init): Add proto (unless Darwin).
* pthread_support.c (GC_thr_init): Don't call GC_stop_init() if
GC_DARWIN_THREADS.

13 years ago2010-10-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 15 Oct 2010 04:12:42 +0000 (04:12 +0000)]
2010-10-14  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (GC_stack_range_for): New static function
(move the code from GC_push_all_stacks).
* darwin_stop_world.c (GC_push_all_stacks): Call
GC_stack_range_for(); rename kern_return local variable to
kern_result.
* darwin_stop_world.c (GC_is_mach_marker): Change argument type
from mach_port_t to thread_act_t.
* pthread_support.c (GC_is_mach_marker): Ditto.

13 years ago2010-10-12 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 12 Oct 2010 05:46:27 +0000 (05:46 +0000)]
2010-10-12  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (GC_push_all_stacks): Fix "my_task" local
variable initialization (always call current_task()).
* pthread_support.c (GC_thr_init, GC_register_my_thread_inner):
Don't set thread's stop_info.stack_ptr value for Darwin.

13 years ago2010-10-10 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 10 Oct 2010 17:31:33 +0000 (17:31 +0000)]
2010-10-10  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (GC_push_all_stacks): Rename "r", "me" local
variables to "kern_return" and "my_thread" ones, respectively;
call mach_port_deallocate() unconditionally.
* darwin_stop_world.c (GC_stop_world): Don't call mach_thread_self
if DEBUG_THREADS.

13 years ago2010-10-09 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 9 Oct 2010 06:05:29 +0000 (06:05 +0000)]
2010-10-09  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (GC_mach_thread): Move from
darwin_stop_world.h.
* include/private/darwin_stop_world.h (GC_mach_thread): Remove.
* win32_threads.c (GC_start_world): Define "thread_id" local
variable only if GC_ASSERTIONS; decide whether to resume a thread
based on its "suspended" field value; assert that suspended thread
stack_base is non-zero and the thread is not our one.

13 years ago2010-10-08 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 8 Oct 2010 19:56:26 +0000 (19:56 +0000)]
2010-10-08  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (GC_thread_resume): New inline function
(move code from GC_thread_resume).
* darwin_stop_world.c (GC_start_world): Check result of
task_threads(); call GC_thread_resume().
* os_dep.c (GC_malloc_heap_l, GC_is_malloc_heap_base): Define
only if not CYGWIN32.
* os_dep.c (GC_is_heap_base): Call GC_is_malloc_heap_base() only
if not CYGWIN32.

13 years ago2010-10-06 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 6 Oct 2010 20:09:27 +0000 (20:09 +0000)]
2010-10-06  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (FindTopOfStack): Change return type to
ptr_t (from long); make GC_INNER; add GC_ prefix.
* darwin_stop_world.c (GC_push_all_stacks): Add thread_blocked
local variable (initialized from the corresponding GC_thread
field unless GC_query_task_threads); add assertion that our
thread is not blocked; prefix FindTopOfStack with GC_ and remove
no longer needed cast to ptr_t of the result; handle thread
blocked case (and remove FIXME); use GC_push_all_stack_sections
unless GC_query_task_threads (and remove FIXME).
* pthread_support.c (GC_FindTopOfStack): Declare (if needed).
* pthread_support.c (GC_do_blocking_inner): Call
GC_save_regs_in_stack (if needed) before acquiring the lock.
* win32_threads.c (GC_do_blocking_inner): Ditto.
* pthread_support.c (GC_do_blocking_inner): Set/clear topOfStack
field of GC_thread (Darwin only).
* include/private/pthread_support.h (GC_thread): Add topOfStack
field for Darwin (unless DARWIN_DONT_PARSE_STACK).

13 years ago2010-10-05 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 5 Oct 2010 07:07:06 +0000 (07:07 +0000)]
2010-10-05  Ivan Maidanski <ivmai@mail.ru>

* finalize.c (GC_check_finalizer_nested): Change return type to
char pointer (instead of int pointer); use explicit cast for
GC_finalizer_nested assignment.
* pthread_support.c (GC_check_finalizer_nested): Ditto.
* win32_threads.c (GC_check_finalizer_nested): Ditto.
* finalize.c (GC_finalizer_nested): Change type to unsigned char.
* finalize.c (GC_notify_or_invoke_finalizers): Change type of
"pnested" local variable to char pointer.
* pthread_support.c (GC_do_blocking_inner,
GC_call_with_gc_active): Use explicit cast for "thread_blocked"
field assignment.
* win32_threads.c (GC_lookup_pthread): Use explicit cast for
"suspended" field assignment.
* win32_threads.c (GC_Thread_Rep): Use short type for
finalizer_skipped; use char type for finalizer_nested and flags
fields and reorder some fields (to minimize GC_Thread_Rep
structure size).
* include/private/pthread_support.h (GC_Thread_Rep): Ditto.
* win32_threads.c (GC_Thread_Rep): Use char type for suspended
field (instead of GC_bool).
* include/private/pthread_support.h (GC_Thread_Rep): Use char type
for thread_blocked field (instead of short).

13 years ago2010-09-30 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 30 Sep 2010 06:05:44 +0000 (06:05 +0000)]
2010-09-30  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (GC_query_task_threads): New variable (or
macro).
* darwin_stop_world.c (GC_push_all_stacks): Use
GC_query_task_threads (to choose between algorithms based on
kernel task_threads and based on GC_threads table); update FIXME;
remove commented out GC_push_one statements.
* pthread_support.c (GC_thr_init, GC_do_blocking_inner,
GC_call_with_gc_active, GC_register_my_thread_inner): Initialize
stack_ptr field for all platforms.
* pthread_support.c (GC_call_with_gc_active): Initialize
saved_stack_ptr field for all platforms.
* include/private/darwin_stop_world.h (thread_stop_info): Add
stack_ptr field; change type of already_suspended from int to
GC_bool.

13 years ago2010-09-29 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 30 Sep 2010 05:31:16 +0000 (05:31 +0000)]
2010-09-29  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (GC_MAX_MACH_THREADS): New macro.
* darwin_stop_world.c (GC_mach_threads, GC_stop_init): Use
GC_MAX_MACH_THREADS instead of THREAD_TABLE_SZ.
* darwin_stop_world.c (GC_mach_threads): Add FIXME.
* darwin_stop_world.c (GC_stop_init, GC_suspend_thread_list,
GC_stop_world): Use FALSE and TRUE for already_suspended field and
"changed", "found" variables.
* darwin_stop_world.c (GC_is_mach_marker): New prototype (only if
PARALLEL_MARK).
* darwin_stop_world.c (GC_suspend_thread_list): Change return type
to GC_bool; change type of "changed", "found" to GC_bool; make
"my_thread" as an argument (instead of acquiring/deallocating it
locally); do not add my_thread, GC_mach_handler_thread and marker
threads to GC_mach_threads table; check for overflow of
GC_mach_threads table; increase GC_mach_threads_count if "found"
is true and info.suspend_count is non-zero.
* darwin_stop_world.c (GC_suspend_thread_list, GC_start_world):
Adjust "thread" format specifiers for GC_printf(); search thread
in "old_list" starting from the previous found one.
* darwin_stop_world.c (GC_stop_world): Rename "changes" to
"changed" local variable; remove "result" variable; adjust
GC_printf debugging message.
* darwin_stop_world.c (GC_start_world): Do not check for
my_thread and GC_use_mach_handler_thread (since they are not added
to GC_mach_threads table); call thread_info() only if
DEBUG_THREADS or GC_ASSERTIONS.
* pthread_support.c (marker_mach_threads): New static variable (if
Darwin).
* pthread_support.c (GC_is_mach_marker): New function (if Darwin).
* pthread_support.c (GC_mark_thread): Fill in marker_mach_threads
table (if Darwin).

13 years ago2010-09-26 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sun, 26 Sep 2010 05:22:23 +0000 (05:22 +0000)]
2010-09-26  Ivan Maidanski <ivmai@mail.ru>

* alloc.c (GC_parallel): Define only if THREADS.
* misc.c (GC_get_parallel): Ditto.
* include/gc.h (GC_parallel, GC_get_parallel,
GC_get_suspend_signal, GC_allow_register_threads,
GC_register_my_thread, GC_unregister_my_thread): Define only if
GC_THREADS.
* include/gc.h (GC_get_heap_size): Fix a typo in a comment.

13 years ago2010-09-11 Ivan Maidanski <ivmai@mail.ru> (really Ludovic Courtes)
ivmai [Sat, 11 Sep 2010 11:27:06 +0000 (11:27 +0000)]
2010-09-11  Ivan Maidanski <ivmai@mail.ru> (really Ludovic Courtes)

* configure.ac: Use `AC_C_INLINE'.
* include/private/gc_priv.h (GC_INLINE): Use "inline" keyword
(determined by configure AC_C_INLINE) if HAVE_CONFIG_H is defined.
* configure.ac: Expand all tabs to spaces.
* configure: Regenerate.
* include/private/config.h.in: Ditto.

13 years ago2010-09-11 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 11 Sep 2010 10:38:25 +0000 (10:38 +0000)]
2010-09-11  Ivan Maidanski <ivmai@mail.ru>

* dyn_load.c (DL_ITERATE_PHDR_STRONG): New macro (define for
FreeBSD).
* dyn_load.c (GC_register_main_static_data): Move the definition
above GC_register_dynamic_libraries_dl_iterate_phdr one (FreeBSD
case); unconditionally return FALSE if DL_ITERATE_PHDR_STRONG.
* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Test
GC_register_main_static_data() result (instead of direct testing
of dl_iterate_phdr (to prevent a compiler warning).
* os_dep.c (CODE_OK): Test si_code also for the value of 2
(FreeBSD case; required for FreeBSD v7+).
* os_dep.c (CODE_OK): Properly use parentheses (HPUX case).
* include/private/gcconfig.h (DATASTART): Cast etext argument in
GC_FreeBSDGetDataStart() call; remove unnecessary "&" (FreeBSD
case).

13 years ago2010-09-09 Ivan Maidanski <ivmai@mail.ru> (with input from Ludovic Courtes)
ivmai [Wed, 8 Sep 2010 21:18:29 +0000 (21:18 +0000)]
2010-09-09  Ivan Maidanski <ivmai@mail.ru> (with input from Ludovic Courtes)

* include/private/specific.h (quick_thread_id): Define thru
GC_approx_sp(); define as a macro.
* include/private/specific.h (getspecific): Use GC_INLINE instead
of __inline__ (to work around Sun CC which does not recognize
inline keyword surrounded with underscores).
* include/private/specific.h: Expand all tabs to spaces; remove
trailing spaces at EOLn.

13 years ago2010-09-04 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 4 Sep 2010 11:41:02 +0000 (11:41 +0000)]
2010-09-04  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (FindTopOfStack): Simplify condition
expressions.
* darwin_stop_world.c (GC_push_all_stacks): Merge two variants
of this function (DARWIN_DONT_PARSE_STACK).
* darwin_stop_world.c (GC_push_all_stacks): Add a check for our
thread is found (same as in pthread_stop_world.c).
* darwin_stop_world.c (GC_push_all_stacks): Print the number of
scanned threads if verbose (same as in pthread_stop_world.c).

13 years ago2010-09-04 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 4 Sep 2010 10:22:10 +0000 (10:22 +0000)]
2010-09-04  Ivan Maidanski <ivmai@mail.ru>

* darwin_stop_world.c (GC_push_all_stacks): Reset
thread_state_count value before every thread_get_state call;
refine the comment for thread_state_count.
* darwin_stop_world.c (GC_push_all_stacks): Ignore rsp, rip/eip,
rflags, cs, fs, gs, ss, ds, es, __pc registers; uncomment ebp
register pushing.
* darwin_stop_world.c (GC_push_all_stacks): Set outCount to
GC_MACH_THREAD_STATE_COUNT (instead of THREAD_STATE_MAX).
* darwin_stop_world.c (GC_push_all_stacks): Remove FIXME and WARN
for i386.

13 years ago2010-09-03 Ivan Maidanski <ivmai@mail.ru>
ivmai [Fri, 3 Sep 2010 05:31:51 +0000 (05:31 +0000)]
2010-09-03  Ivan Maidanski <ivmai@mail.ru>

* doc/README.macros (DARWIN_DONT_PARSE_STACK): Fix a typo.
* darwin_stop_world.c (GC_use_mach_handler_thread): Change type
to GC_bool.
* darwin_stop_world.c (GC_suspend_thread_list, GC_start_world):
Simplify the expressions involving GC_use_mach_handler_thread.
* darwin_stop_world.c (GC_darwin_register_mach_handler_thread):
Initialize GC_use_mach_handler_thread to TRUE (instead of 1).

13 years ago2010-09-02 Ivan Maidanski <ivmai@mail.ru>
ivmai [Thu, 2 Sep 2010 06:05:05 +0000 (06:05 +0000)]
2010-09-02  Ivan Maidanski <ivmai@mail.ru>

* include/gc_pthread_redirects.h (GC_pthread_sigmask, GC_dlopen,
pthread_sigmask, dlopen): Don't define for Win32 pthreads (and
don't include signal.h and dlfcn.h).

13 years ago2010-08-25 Ivan Maidanski <ivmai@mail.ru> (with help from Hans Boehm)
ivmai [Wed, 25 Aug 2010 17:57:06 +0000 (17:57 +0000)]
2010-08-25  Ivan Maidanski <ivmai@mail.ru> (with help from Hans Boehm)

* dyn_load.c (GC_register_dynlib_callback): Add FIXME.

13 years ago2010-08-18 Ivan Maidanski <ivmai@mail.ru> (really Andreas Tobler)
ivmai [Wed, 18 Aug 2010 19:16:51 +0000 (19:16 +0000)]
2010-08-18  Ivan Maidanski <ivmai@mail.ru> (really Andreas Tobler)

* include/private/gcconfig.h: Add support for FreeBSD on ppc64.

13 years ago2010-08-18 Ivan Maidanski <ivmai@mail.ru> (with help from Andreas Tobler)
ivmai [Wed, 18 Aug 2010 18:40:23 +0000 (18:40 +0000)]
2010-08-18  Ivan Maidanski <ivmai@mail.ru> (with help from Andreas Tobler)

* os_dep.c (PROTECT, UNPROTECT): Correct VM_PROT_EXEC to
VM_PROT_EXECUTE.

13 years ago2010-08-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 14 Aug 2010 14:35:54 +0000 (14:35 +0000)]
2010-08-14  Ivan Maidanski <ivmai@mail.ru>

* aclocal.m4: Regenerate (by autoreconf -vif using autoconf-2.67,
automake-1.11.1 and libtool-2.2.8).
* configure: Ditto.
* ltmain.sh: Ditto.
* Makefile.in: Ditto.
* include/private/config.h.in: Ditto.
* m4/libtool.m4: Ditto.
* m4/ltoptions.m4: Ditto.
* m4/ltversion.m4: Ditto.
* m4/lt~obsolete.m4: Ditto.

13 years ago2010-08-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 14 Aug 2010 13:59:21 +0000 (13:59 +0000)]
2010-08-14  Ivan Maidanski <ivmai@mail.ru>

* os_dep.c (os2_alloc): Don't set PAG_EXECUTE unless
pages_executable is on.
* os_dep.c (os2_alloc): Add FIXME (for recursion).
* os_dep.c (UNPROTECT): Abort with a more informative message if
pages_executable is on ("mprotect" case).
* os_dep.c (PROTECT, UNPROTECT): Set VM_PROT_EXEC if
pages_executable is on (Darwin case).
* pthread_support.c (GC_init_real_syms): Abort with an informative
message if libgc is linked after libpthread.

13 years ago2010-08-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 14 Aug 2010 11:52:06 +0000 (11:52 +0000)]
2010-08-14  Ivan Maidanski <ivmai@mail.ru>

* dyn_load.c (GC_register_dynlib_callback): Adjust "start" pointer
for 64-bit targets.
* pthread_support.c (start_mark_threads): Expand PTHREAD_CREATE
macro.
* pthread_support.c (start_mark_threads): Call INIT_REAL_SYMS()
since REAL(pthread_create) is used.
* pthread_support.c (PTHREAD_CREATE): Remove unused.

13 years ago2010-08-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Sat, 14 Aug 2010 09:28:38 +0000 (09:28 +0000)]
2010-08-14  Ivan Maidanski <ivmai@mail.ru>
* extra/threadlibs.c (main): Remove --wrap for "read" (since not
wrapped anymore).
* doc/README.linux (GC_USE_LD_WRAP): Ditto.
* os_dep.c (__wrap_read): Ditto (in the comment).

13 years ago2010-08-14 Ivan Maidanski <ivmai@mail.ru> (with help from Hans Boehm)
ivmai [Sat, 14 Aug 2010 08:06:17 +0000 (08:06 +0000)]
2010-08-14  Ivan Maidanski <ivmai@mail.ru> (with help from Hans Boehm)

* include/gc_pthread_redirects.h: Test GC_PTHREADS and GC_H at the
beginning of the file.
* include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): New
macro (defined only for Linux and Solaris).
* include/gc_pthread_redirects.h (GC_pthread_cancel,
GC_pthread_exit): Declare new API function (only if
GC_PTHREAD_EXIT_ATTRIBUTE).
* include/gc_pthread_redirects.h (pthread_cancel, pthread_exit):
Redirect (if GC_PTHREAD_EXIT_ATTRIBUTE).
* include/private/pthread_support.h (DISABLED_GC): New macro.
* pthread_support.c (pthread_cancel, pthread_exit): Restore
original definition or declare "real" function (if needed and
GC_PTHREAD_EXIT_ATTRIBUTE).
* pthread_support.c (GC_pthread_cancel_t, GC_pthread_exit_t):
Declare new types if needed.
* pthread_support.c (GC_pthread_cancel, GC_pthread_exit): New
function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE).
* pthread_support.c (GC_init_real_syms): Initialise pointers to
the "real" pthread_cancel and pthread_exit (only if
GC_PTHREAD_EXIT_ATTRIBUTE).
* pthread_support.c (GC_unregister_my_thread): Enable collections
if DISABLED_GC was set (only if GC_PTHREAD_EXIT_ATTRIBUTE).
* pthread_support.c (pthread_cancel, pthread_exit): New wrapped
function definition (only if GC_PTHREAD_EXIT_ATTRIBUTE defined).
* pthread_support.c (GC_start_routine): Refine the comment.
* extra/threadlibs.c (main): Adjust --wrap (add "read",
"pthread_exit", "pthread_cancel" but remove "sleep").
* doc/README.linux (GC_USE_LD_WRAP): Ditto.
* doc/README.linux: Expand all tabs to spaces; remove trailing
spaces at EOLn.

13 years ago2010-08-12 Ivan Maidanski <ivmai@mail.ru> (mostly really Mike Gran)
ivmai [Thu, 12 Aug 2010 19:11:52 +0000 (19:11 +0000)]
2010-08-12  Ivan Maidanski <ivmai@mail.ru> (mostly really Mike Gran)

* include/gc.h (GC_MALLOC_STUBBORN): Remove trailing ';' in the
macro definition.
* include/gc.h (GC_reachable_here): Ditto.
* include/gc.h (GC_reachable_here): Prefix and postfix "volatile"
with double '_'.

13 years ago2010-07-29 Ivan Maidanski <ivmai@mail.ru> (with input from NIIBE Yutaka)
ivmai [Wed, 28 Jul 2010 20:49:53 +0000 (20:49 +0000)]
2010-07-29  Ivan Maidanski <ivmai@mail.ru> (with input from NIIBE Yutaka)

* pthread_start.c: New file.
* CMakeLists.txt (SRC): Add pthread_start.c.
* Makefile.am (libgc_la_SOURCES): Ditto.
* Makefile.direct (CSRCS): Ditto.
* Makefile.direct (OBJS): Add pthread_start.obj.
* extra/gc.c: Add a comment; include pthread_start.c.
* pthread_support.c (start_info): Move the struct definition down
closer to its usage.
* pthread_support.c (GC_thread_exit_proc): Replace STATIC with
GC_INNER.
* pthread_support.c (GC_inner_start_routine): Move to the
definition to pthread_start.c; leave only the prototype; remove
STATIC.
* pthread_support.c (GC_start_rtn_prepare_thread): New function
(contains parts of the original GC_inner_start_routine).
* Makefile.in: Regenerate.
* configure: Ditto.

13 years ago2010-07-28 Ivan Maidanski <ivmai@mail.ru> (mostly really Noah Lavine)
ivmai [Tue, 27 Jul 2010 21:30:18 +0000 (21:30 +0000)]
2010-07-28  Ivan Maidanski <ivmai@mail.ru> (mostly really Noah Lavine)

* configure.ac (NO_EXECUTE_PERMISSION): Add comment.
* doc/README.macros (NO_EXECUTE_PERMISSION): Update the
documentation.
* include/gc.h (GC_set_pages_executable, GC_get_pages_executable):
New API function declaration.
* include/gc.h (GC_ignore_warn_proc): Reformat the comment.
* os_dep.c (OPT_PROT_EXEC): Remove (superseded by
pages_executable).
* os_dep.c (pages_executable): New static variable.
* os_dep.c (IGNORE_PAGES_EXECUTABLE): New macro (used by
GC_get_pages_executable only).
* os_dep.c (GC_unix_mmap_get_mem, GC_remap, PROTECT, UNPROTECT):
Replace OPT_PROT_EXEC with pages_executable.
* os_dep.c (GC_unix_mmap_get_mem, GC_remap, GC_win32_get_mem,
GC_wince_get_mem, UNPROTECT): Undefine IGNORE_PAGES_EXECUTABLE.
* os_dep.c (GC_win32_get_mem, GC_wince_get_mem, GC_remap, PROTECT,
UNPROTECT): Use PAGE_EXECUTE_... only if pages_executable is on.
* os_dep.c (GC_set_pages_executable, GC_get_pages_executable): New
API function definition.

13 years ago2010-07-28 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 27 Jul 2010 20:57:47 +0000 (20:57 +0000)]
2010-07-28  Ivan Maidanski <ivmai@mail.ru>

* tests/test.c (check_heap_stats): Increase max_heap_sz by 20% for
64-bit CPUs (to prevent "Unexpected heap growth" failure on Win64,
at least).

13 years ago2010-07-14 Ivan Maidanski <ivmai@mail.ru>
ivmai [Wed, 14 Jul 2010 05:38:40 +0000 (05:38 +0000)]
2010-07-14  Ivan Maidanski <ivmai@mail.ru>

* tests/test.c (check_heap_stats): Increase max_heap_sz by 25% for
32-bit CPUs (to prevent "Unexpected heap growth" failure).

13 years ago2010-07-13 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 13 Jul 2010 11:01:46 +0000 (11:01 +0000)]
2010-07-13  Ivan Maidanski <ivmai@mail.ru>

* gc_dlopen.c (dlopen): Prototype REAL_DLFUNC if GC_USE_LD_WRAP.
* pthread_support.c (pthread_create, pthread_join, pthread_detach,
pthread_sigmask): Ditto.
* gc_dlopen.c (dlopen): Remove cast (redundant since the prototype
is added).
* gc_dlopen.c (GC_dlopen): Fix return type.
* pthread_support.c (GC_init_real_syms): Don't define
LIBPTHREAD_NAME, LIBPTHREAD_NAME_LEN, len, namebuf and
libpthread_name if RTLD_NEXT.

13 years ago2010-07-13 Ivan Maidanski <ivmai@mail.ru>
ivmai [Tue, 13 Jul 2010 09:44:01 +0000 (09:44 +0000)]
2010-07-13  Ivan Maidanski <ivmai@mail.ru>

* gc_dlopen.c (disable_gc_for_dlopen): Update the comment.
* gc_dlopen.c (dlopen): Ditto.
* include/gc.h: Update copyright header.
* include/gc.h (GC_enable_incremental): Refine the comment.
* include/gc.h (DECLSPEC_NORETURN): Define macro as empty if
missing (only for Win32).
* include/gc.h (GC_ExitThread): Use DECLSPEC_NORETURN.
* win32_threads.c (GC_ExitThread): Ditto.
* include/gc.h (GC_endthreadex): Add a comment.