summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* Add public GC_set_handle_fork to control forked child handling supportIvan Maidanski2012-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Apply commit 1e882b9 from 'master' branch) * include/gc.h (GC_set_handle_fork): New API function. * misc.c (GC_set_handle_fork): Likewise. * include/private/gc_priv.h (GC_handle_fork): New internal variable declaration (only if CAN_HANDLE_FORK). * misc.c (GC_handle_fork): New internal variable (defined only if CAN_HANDLE_FORK); initialize to TRUE if HANDLE_FORK. * include/private/gcconfig.h (HANDLE_FORK): Replace with CAN_HANDLE_FORK. * pthread_support.c (HANDLE_FORK): Likewise. * win32_threads.c (HANDLE_FORK): Likewise. * include/private/gcconfig.h (CAN_HANDLE_FORK): Always define macro if HANDLE_FORK. * pthread_support.c (GC_thr_init): Replace HANDLE_FORK with CAN_HANDLE_FORK; call pthread_atfork only if GC_handle_fork; update the comment. * win32_threads.c (GC_thr_init): Likewise. * tests/test.c (NO_TEST_HANDLE_FORK): Define new macro if fork handling is not supported (or is a no-op) on the target. * tests/test.c (INIT_FORK_SUPPORT): New macro (invoke GC_set_handle_fork unless NO_TEST_HANDLE_FORK). * tests/test.c (GC_OPT_INIT): New macro (defined to GC_INIT or empty). * tests/test.c (GC_COND_INIT): Use INIT_FORK_SUPPORT and GC_OPT_INIT. * tests/test.c (run_one_test): Test NO_TEST_HANDLE_FORK (instead of target-specific macros). * win32_threads.c (GC_remove_all_threads_but_me, GC_fork_prepare_proc, GC_fork_parent_proc, GC_fork_child_proc): Do not test GC_PTHREADS. * configure.ac (HANDLE_FORK, NO_HANDLE_FORK): Update message.
* Fix GC_ALPHA_VERSION comparison in gctest and tools filesIvan Maidanski2012-03-19
| | | | | | | | | (Apply commit 3b6bc1e from 'master' branch) * tests/test.c (GC_ALPHA_VERSION): Define to GC_TMP_ALPHA_VERSION if not defined by gc_version.h. * extra/add_gc_prefix.c (GC_ALPHA_VERSION): Likewise. * extra/gcname.c (GC_ALPHA_VERSION): Likewise.
* Fix gctest (for Win32) to avoid GC_print_stats internal variable usageIvan Maidanski2012-03-06
| | | | | | | | | | | | | | (Apply commit 9dc445d from 'master' branch) * include/private/gc_priv.h (GC_print_stats): Update the comment. * tests/test.c (GC_print_stats, run_one_test, check_heap_stats): Rename GC_print_stats to print_stats (since the former is used internally by GC and not exported). * tests/test.c (print_stats): Always define (either as a macro or a static int variable) regardless of GC_DLL and SMALL_CONFIG. * tests/test.c (INIT_PRINT_STATS): New macro (used to initialize print_stats if needed); GETENV is used if needed and available. * tests/test.c (GC_COND_INIT): Invoke INIT_PRINT_STATS.
* Fix fork() handling for Darwin partiallyIvan Maidanski2012-02-24
| | | | | | | | | | | | | | (still not handled well for Darwin if GC incremental mode is on) * os_dep.c (GC_dirty_init): Add FIXME regarding fork (Darwin). * pthread_support.c (GC_remove_all_threads_but_me): Update mach_thread for "me" (Darwin). * pthread_support.c (GC_fork_prepare_proc): Output warning if GC_dirty_maintained (if DARWIN and MPROTECT_VDB). * pthread_support.c (GC_fork_prepare_proc, GC_fork_child_proc): Add FIXME (for Darwin). * tests/test.c (run_one_test): Do not test fork() for Darwin with incremental mode on (if HANDLE_FORK); add FIXME.
* Fix gctest to include unistd.h if HANDLE_FORKIvan Maidanski2012-02-21
| | | | | * tests/test.c: Include unistd.h for fork() declaration if HANDLE_FORK (and THREADS).
* Fix realloc_test to check GC_malloc result for NULLIvan Maidanski2012-01-18
| | | | | * tests/realloc_test.c (main): Prevent NULL pointer dereference (exit with an error message in case of NULL returned by GC_malloc).
* Fix GC_printf import declarator in test_cpp.ccIvan Maidanski2011-12-30
| | | | | | * tests/test_cpp.cc (GC_API_PRIV): New macro (same definition as in gc_priv.h). * tests/test_cpp.cc (GC_printf): Use GC_API_PRIV instead of GC_API.
* tests: Add missing checks of GC_malloc result (for out-of-memory)Ivan Maidanski2011-09-30
| | | | | | | | * tests/test.c (mktree): Insert CHECK_OUT_OF_MEMORY to report mktree() out-of-memory failures. * tests/trace_test.c (mktree): Test whether GC_MALLOC_ATOMIC returns NULL (exit with an error code and the appropriate message printed in this case).
* tests: print a message in case a test is a no-op.Ivan Maidanski2011-09-20
| | | | | * tests/threadkey_test.c (main): Print a message if the test is skipped.
* Increase tests/test.c max heap size limit (required for Cygwin)Ivan Maidanski2011-09-13
| | | | | | * tests/test.c (check_heap_stats): Increase max_heap_sz value (for 32-bit targets) from 15M by 1M (as the former is hit sometimes on Cygwin).
* Resolve "comparison of signed and unsigned values" compiler warnings.Ivan Maidanski2011-09-12
| | | | | | | | | | | | | | | | | | | | | (Apply commit 96f7891) * cord/cordprnt.c (CORD_vsprintf): Cast "prec" and "width" local variables to size_t. * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Change type of "i" local variable to int. * pthread_support.c (start_mark_threads): Likewise. * os_dep.c (GC_repeat_read): Change type of "num_read" to size_t. * os_dep.c (GC_get_maps): Change type of "result" local variable from int to ssize_t; cast "result" to size_t in comparison. * pthread_support.c (GC_remove_all_threads_but_me): Cast "result" to int. * pthread_support.c (GC_wait_for_gc_completion): Change type of "old_gc_no" local variable to word. * pthread_support.c (GC_lock): Change type of "i" local variable to unsigned. * tests/staticrootstest.c (main): Cast sizeof() value to int in comparisons.
* FIX: MinGW/MingwCE: Use CreateThread in initsecondarythread test andIvan Maidanski2011-09-12
| | | | | | | | | | | | | | | thread_leak_test. * tests/initsecondarythread.c: Include windows.h instead of pthread.h unless GC_PTHREADS. * tests/thread_leak_test.c: Likewise. * tests/initsecondarythread.c (thread): Use WINAPI and set return type to DWORD unless GC_PTHREADS. * tests/thread_leak_test.c (test): Likewise. * tests/initsecondarythread.c (main): Use HANDLE, CreateThread and WaitForSingleObject instead of pthread_t, pthread_create and pthread_join, respectively, unless GC_PTHREADS. * tests/thread_leak_test.c (main): Likewise.
* Check pthread_create/join result in initsecondarythread test.Ivan Maidanski2011-09-12
| | | | | | | | | | | * tests/initsecondarythread.c (GC_NO_THREAD_REDIRECTS): Add comment. * tests/initsecondarythread.c: Include stdio.h. * tests/initsecondarythread.c (thread): Cast result of malloc to void; return arg parameter instead of NULL (to suppress compiler warnings). * tests/initsecondarythread.c (main): Define "code" local variable; store result of pthread_create and pthread_join to "code" variable; exit application with an error code (with the corresponding error message) if pthread_create or pthread_join fails.
* Remove references to old missing gc_alloc.h and gc_local_alloc.h files.Ivan Maidanski2011-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused HPUX GC_test_and_clear implementation. (Apply commit 6f07a01) * hpux_test_and_clear.s: Remove. * Makefile.am (EXTRA_DIST): Remove hpux_test_and_clear.s. * Makefile.direct (SRCS): Ditto. * Makefile.dj (SRCS): Ditto. * Makefile.dj (SRCS): Remove missing gcc_support.c, include/gc_alloc.h, include/gc_local_alloc.h. * doc/gcdescr.html: Remove information about gc_local_alloc.h. * doc/gcinterface.html: Ditto. * doc/scale.html: Ditto. * doc/gcinterface.html: Remove information about gc_alloc.h. * tests/test_cpp.cc: Don't include missing old gc_alloc.h (include new_gc_alloc.h instead); don't test __GNUC__. * tests/test_cpp.cc (main): Use gc_alloc class instead of alloc (don't test __GNUC__). * windows-untested/vc60/gc.dsp (SOURCE): Don't include missing gc_alloc.h, gc_local_alloc.h. * windows-untested/vc60/libgc.dsp (SOURCE): Ditto. * windows-untested/vc70/gc.vcproj (Header Files): Ditto. * windows-untested/vc70/libgc.vcproj (Header Files): Ditto. * windows-untested/vc71/gc.vcproj (Header Files): Ditto. * windows-untested/vc71/libgc.vcproj (Header Files): Ditto.
* Support multi-threading for RTEMS target.Jie Liu2011-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | (Apply commit e773036) * configure.ac: Add GC_RTEMS_PTHREADS AH_TEMPLATE and configure for rtems. * os_dep.c: Add GC_get_stack_base if GC_RTEMS_PTHREADS for rtems. * pthread_stop_world.c (GC_stop_init): Add ifdef SA_RESTART. * pthread_stop_world.c (GC_stop_init): Use sigprocmask for rtems when defined GC_RTEMS_PTHREADS. * pthread_support.c: Exclude sys/mman.h for rtems. * pthread_support.c (GC_thr_init): Set default GC_nprocs (1) for rtems. * include/gc_config_macros.h: Define GC_RTEMS_PTHREADS for rtems pthread and define GC_NO_DLOPEN for rtems. * include/private/gc_locks.h: Define USE_PTHREAD_LOCKS for rtems. * include/private/gcconfig.h: Use rtems_get_stack_bottom() for InitStackBottom; and use SIGUSR1 for SIG_SUSPEND, SIGUSR2 for SIG_THR_RESTART on rtems. * include/private/thread_local_alloc.h: Use USE_PTHREAD_SPECIFIC for rtems. * tests/test.c (Init): Use exit(0) for rtems instead of return. * configure: Regenerate. * include/private/config.h.in: Ditto.
* 2011-07-26 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | * tests/realloc_test.c: New file. * tests/tests.am (TESTS, check_PROGRAMS): Add realloc_test. * .cvsignore: Add realloc_test. * configure: Regenerate. * Makefile.in: Ditto.
* 2011-07-14 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | * 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).
* 2011-07-05 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | | | | | * 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.
* 2011-07-01 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2011-06-30 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | | | | | | | | * 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.
* 2011-05-31 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | * 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).
* 2011-05-31 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | * tests/test.c (check_heap_stats): Adjust printf format specifier for max_heap_sz; cast max_heap_sz accordingly.
* 2011-05-23 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | * tests/threadkey_test.c (SKIP_THREADKEY_TEST): Skip the test if defined; explicitly define for some targets.
* 2011-05-19 Ivan Maidanski <ivmai@mail.ru> (really Jie Liu)ivmai2011-07-26
| | | | | | | | | | | * 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).
* 2011-05-18 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | * 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.
* 2011-05-17 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | | | * 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.
* 2011-05-13 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | * tests/threadkey_test.c (LIMIT): Use smaller value (don't create more than 30 in parallel by default).
* 2011-05-13 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | * tests/threadkey_test.c (key_once, main): Work around for Solaris PTHREAD_ONCE_INIT. * tests/threadkey_test.c (LIMIT): Use smaller value for Solaris.
* 2011-05-11 Ivan Maidanski <ivmai@mail.ru> (mostly really Ludovic Courtes)ivmai2011-07-26
| | | | | | | | | * 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.
* 2011-04-26 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | | | | | | | * .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.
* 2011-04-20 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | | * 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".
* 2011-04-18 Ivan Maidanski <ivmai@mail.ru> (really Ludovic Courtes)ivmai2011-07-26
| | | | | | | | | * tests/tests.am (TESTS, check_PROGRAMS): Add 'initsecondarythread'. * tests/tests.am (initsecondarythread_SOURCES, initsecondarythread_LDADD): New variable. * Makefile.in: Regenerate. * configure: Ditto.
* 2011-04-11 Ivan Maidanski <ivmai@mail.ru> (really Jie Liu)ivmai2011-07-26
| | | | | | | | | * 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.
* 2011-04-11 Ivan Maidanski <ivmai@mail.ru> (mostly really Jim Meyering)ivmai2011-07-26
| | | | | | | | | | | | | * 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.
* 2011-04-10 Ivan Maidanski <ivmai@mail.ru> (mostly really Iain Sandoe)ivmai2011-07-26
| | | | | * tests/test.c (reverse_test): Modify count (BIG) for ppc64-darwin.
* 2011-04-04 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | * 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).
* 2011-04-03 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | * 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.
* 2011-04-02 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2011-04-02 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | * 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().
* 2011-03-20 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | | | | | | | | | | | | | * 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).
* 2011-02-10 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | | | | * 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).
* 2010-11-25 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | * 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.
* 2010-11-04 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | * tests/staticrootstest.c: Include string.h for memset() prototype. * tests/thread_leak_test.c (main): Fix printf() format specifiers.
* 2010-10-22 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2010-07-28 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | | * 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).
* 2010-07-14 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-26
| | | | | * tests/test.c (check_heap_stats): Increase max_heap_sz by 25% for 32-bit CPUs (to prevent "Unexpected heap growth" failure).
* 2010-05-13 Ivan Maidanski <ivmai@mail.ru> (mostly really Uros Bizjak)ivmai2011-07-26
| | | | | | | | | | | * tests/leak_test.c (main): Explicitly define as returning int (to prevent a spurious test failure on some Linux/alpha targets). * tests/thread_leak_test.c (main): Ditto. * tests/thread_leak_test.c: Initialize GC_find_leak in the main thread (before GC_INIT) only. * tests/leak_test.c (main): Use GC_set_find_leak() instead of accessing GC_find_leak directly. * tests/thread_leak_test.c (main): Ditto.
* 2010-03-23 Ivan Maidanski <ivmai@mail.ru> (really Dave Korn)ivmai2011-07-26
| | | | | | | | | | | | * Makefile.am (check_LTLIBRARIES): Initialise to empty. * tests/tests.am (TESTS, check_PROGRAMS): Add staticrootstest. * tests/tests.am (staticrootstest_SOURCES, staticrootstest_LDADD, libstaticrootslib_la_SOURCES, libstaticrootslib_la_LIBADD, libstaticrootslib_la_LDFLAGS, libstaticrootslib_la_DEPENDENCIES): Define. * tests/tests.am (check_LTLIBRARIES): Add libstaticrootslib.la. * .cvsignore: Ignore libstaticrootslib.la. * Makefile.in: Regenerate.
* 2010-03-20 Ivan Maidanski <ivmai@mail.ru> (really Dave Korn)ivmai2011-07-26
| | | | | * tests/staticrootstest.c: New file. * tests/staticrootslib.c: Ditto.
* 2010-02-24 Ivan Maidanski <ivmai@mail.ru> (really Jack Andrews)ivmai2011-07-26
| | | | | | * CMakeLists.txt: New file (adding CMake support). * tests/CMakeLists.txt: Ditto. * doc/README.cmake: Ditto.