summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Resolve minor warnings in tests (reported by GCC with '-pedantic' option)Ivan Maidanski2011-11-112-13/+16
| | | | | | | * tests/disclaim_test.c (pair_dct, pair_new): Explicitly cast a pointer argument of GC_printf to void* to match %p format specifier. * tests/test.c (cons, print_int_list, run_one_test, check_heap_stats): Likewise.
* Refactor GC_move_disappearing_link() code;Ivan Maidanski2011-11-071-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | make GC_move_disappearing_link(link,link) return GC_SUCCESS * finalize.c (GC_move_disappearing_link): Rename "from", "to" arguments to "link" and "new_link", respectively. * include/gc.h (GC_move_disappearing_link): Likewise. * finalize.c (GC_move_disappearing_link): Rename "to_curr_dl", "from_index", "to_index" local variables to "new_dl", "curr_index", "new_index", respectively. * finalize.c (GC_move_disappearing_link): Add curr_hidden_link, new_hidden_link local variables to evaluate GC_HIDE_POINTER(link) and GC_HIDE_POINTER(new_link) only once. * finalize.c (GC_move_disappearing_link): Reformat code. * finalize.c (GC_move_disappearing_link): Do not ABORT in case of unaligned "link", return GC_NOT_FOUND instead (similar to GC_unregister_disappearing_link behavior). * finalize.c (GC_move_disappearing_link): If new_link is equal to link then return GC_SUCCESS instead of GC_DUPLICATE. * include/gc.h (GC_move_disappearing_link, GC_NOT_FOUND): Refine and update documentation comment. * tests/test.c (mktree): Add "new_link" local variable; add GC_move_disappearing_link invocations; apply GC_unregister_disappearing_link to "new_link".
* Resolve minor merge conflict in gc_disclaim.h, disclaim_bench.cIvan Maidanski2011-09-301-2/+3
|\
| * Fix compiler warnings in disclaim testsIvan Maidanski2011-09-302-4/+4
| |
| * Merge branch 'remotes/paurkedal/t/disclaim-pullreq' plus some minor fixesIvan Maidanski2011-09-301-54/+43
| |\
| | * Use gc_priv.h API for timing in tests/disclaim_bench.c.Petter Urkedal2011-09-291-6/+11
| | |
| | * Make disclaim_bench.c more portable.Petter Urkedal2011-09-281-43/+32
| | | | | | | | | | | | | | | | | | | | | | | | * tests/disclaim_bench.c (main): Run all three sub-tests in the same process, rather than invoking them through a system-call. * tests/disclaim_bench.c (free_count, testobj_finalize): Drop the use of atomic ops, since the benchmark is single-threaded. We can now also run the test unconditionally.
| * | Review 'disclaim' add-on partially; fix code in some places againIvan Maidanski2011-09-281-7/+11
| |/
| * Skip disclaim_bench.c if AO_fetch_and_add1 is missing.Petter Urkedal2011-09-241-1/+10
| |
| * Adjust tests code for 'disclaim' featureIvan Maidanski2011-09-232-4/+6
| |
| * Merge remote-tracking branch 'remotes/paurkedal/t/disclaim-pullreq' into ↵Ivan Maidanski2011-09-233-0/+307
| |\ | | | | | | | | | paurkedal-disclaim-v2
| | * Fix issues proposed in Ivan's previous commit, etc.Petter Urkedal2011-09-192-20/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * disclaim.c -> {finalized_mlc.c, misc.c}: Move low-level code to misc.c and the finalized object-kind to finalized_mlc.c. * Makefile.am: Update accordingly. * reclaim.c: Condition #include "gc_disclaim.h" and remove "register". * include/gc_disclaim.h, include/private/gc_priv.h, finalized_mlc.c, misc.c: Add GC_API, GC_CALL, and GC_CALLBACK. Use typedefs for function pointers. * tests/disclaim_test.c, tests/disclaim_bench.c: Fix portability and other issues. * include/gc_disclaim.h: Forward declare ... * finalized_mlc.c: ... and export GC_finalized_objfreelist. * thread_local_alloc.c (GC_destroy_thread_local): Return finalized freelists though the same global. * include/private/thread_local_alloc.h: Tweak (move array above comment). * Makefile.dj, NT_MAKEFILE, NT_STATIC_THREADS_MAKEFILE, NT_X64_STATIC_THREADS_MAKEFILE, NT_X64_THREADS_MAKEFILE, gc.mak, windows-untested/vc60/gc.dsp, windows-untested/vc70/gc.vcproj, windows-untested/vc71/gc.vcproj: Add include/gc_disclaim.h to various build systems. (Untested.)
| | * ENABLE_DISCLAIM: Make stylistic fixes in many places and add many FIXME.Ivan Maidanski2011-09-193-100/+143
| | |
| | * Fix some issues and avoid warnings in disclaim-related code.Petter Urkedal2011-09-192-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * disclaim.c, include/gc_disclaim.h: Fix prototype. * include/private/gc_priv.h, mark.c: Avoid missing initializer warning. * mark.c: Fix type of a size_t variable in GC_reclaim_block. * misc.c: Initialize ok_mark_unconditionally. * reclaim.c: Tweak and avoid unused label warning. * tests/disclaim_bench.c, tests/disclaim_test.c: Remove or conditionalize unused variables.
| | * Fixed memory leak issue with unconditional marking.Petter Urkedal2011-09-191-7/+8
| | |
| | * Add disclaim callbacks for efficient finalization.Petter Urkedal2011-09-193-0/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Importing gc-20070403-disclaim-1.0.patch. * configure.ac: Add --disable-disclaim option and set ENABLE_DISCLAIM macro and conditional accordingly. * include/include.am, Makefile.am Add sources disclaim.c and include/gc_disclaim.h. * Makefile.direct: Ditto and define ENABLE_DISCLAIM. * include/private/gc_priv.h (obj_kind): Add ok_mark_unconditionally, ok_disclaim_proc and ok_disclaim_cd. * misc.c (GC_new_kind_inner): Initialize them. * include/private/gc_priv.h (hblkhdr): Add HAS_DISCLAIM and MARK_UNCONDITIONALLY flags. * allchblk.c (setup_header): Set HAS_DISCLAIM and MARK_UNCONDITIONALLY flags as indicated by the object kind. * reclaim.c: Main adjustments to support the disclaim callbacks. * mark.c (GC_push_unconditionally, GC_push_next_marked_uncollecable): Unconditionally mark from objects in blocks flagged MARK_UNCONDITIONALLY. This preserves links reachable from the finalizer when using the the finalized object kind. * disclaim.c: Add file with support functions for disclaim callbacks and implementation of the "finalized" object kind. * include/gc_disclaim.h: Add file providing the corresponding API. * include/private/thread_local_alloc.h (thread_local_freelists): Add finalized_freelists. * thread_local_alloc.c: Initialize them. * tests/tests.am, tests/disclaim_test.c, tests/disclaim_bench.c: Add disclaim-related tests.
* | | Fix compiler warnings in disclaim testsIvan Maidanski2011-09-302-3/+4
| | |
* | | Use gc_priv.h API for timing in tests/disclaim_bench.c.Petter Urkedal2011-09-301-6/+11
| | |
* | | Make disclaim_bench.c more portable.Petter Urkedal2011-09-301-51/+33
| | | | | | | | | | | | | | | | | | | | | | | | * tests/disclaim_bench.c (main): Run all three sub-tests in the same process, rather than invoking them through a system-call. * tests/disclaim_bench.c (free_count, testobj_finalize): Drop the use of atomic ops, since the benchmark is single-threaded. We can now also run the test unconditionally.
* | | Review 'disclaim' add-on partially; fix code in some places againIvan Maidanski2011-09-301-7/+11
| | |
* | | Skip disclaim_bench.c if AO_fetch_and_add1 is missing.Petter Urkedal2011-09-301-1/+10
| | |
* | | Adjust tests code for 'disclaim' featureIvan Maidanski2011-09-302-4/+6
| | |
* | | Fix issues proposed in Ivan's previous commit, etc.Petter Urkedal2011-09-302-20/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * disclaim.c -> {finalized_mlc.c, misc.c}: Move low-level code to misc.c and the finalized object-kind to finalized_mlc.c. * Makefile.am: Update accordingly. * reclaim.c: Condition #include "gc_disclaim.h" and remove "register". * include/gc_disclaim.h, include/private/gc_priv.h, finalized_mlc.c, misc.c: Add GC_API, GC_CALL, and GC_CALLBACK. Use typedefs for function pointers. * tests/disclaim_test.c, tests/disclaim_bench.c: Fix portability and other issues. * include/gc_disclaim.h: Forward declare ... * finalized_mlc.c: ... and export GC_finalized_objfreelist. * thread_local_alloc.c (GC_destroy_thread_local): Return finalized freelists though the same global. * include/private/thread_local_alloc.h: Tweak (move array above comment). * Makefile.dj, NT_MAKEFILE, NT_STATIC_THREADS_MAKEFILE, NT_X64_STATIC_THREADS_MAKEFILE, NT_X64_THREADS_MAKEFILE, gc.mak, windows-untested/vc60/gc.dsp, windows-untested/vc70/gc.vcproj, windows-untested/vc71/gc.vcproj: Add include/gc_disclaim.h to various build systems. (Untested.)
* | | ENABLE_DISCLAIM: Make stylistic fixes in many places and add many FIXME.Ivan Maidanski2011-09-303-100/+143
| | |
* | | Fix some issues and avoid warnings in disclaim-related code.Petter Urkedal2011-09-302-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * disclaim.c, include/gc_disclaim.h: Fix prototype. * include/private/gc_priv.h, mark.c: Avoid missing initializer warning. * mark.c: Fix type of a size_t variable in GC_reclaim_block. * misc.c: Initialize ok_mark_unconditionally. * reclaim.c: Tweak and avoid unused label warning. * tests/disclaim_bench.c, tests/disclaim_test.c: Remove or conditionalize unused variables.
* | | Fixed memory leak issue with unconditional marking.Petter Urkedal2011-09-301-7/+8
| | |
* | | Add disclaim callbacks for efficient finalization.Petter Urkedal2011-09-303-0/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Importing gc-20070403-disclaim-1.0.patch. * configure.ac: Add --disable-disclaim option and set ENABLE_DISCLAIM macro and conditional accordingly. * include/include.am, Makefile.am Add sources disclaim.c and include/gc_disclaim.h. * Makefile.direct: Ditto and define ENABLE_DISCLAIM. * include/private/gc_priv.h (obj_kind): Add ok_mark_unconditionally, ok_disclaim_proc and ok_disclaim_cd. * misc.c (GC_new_kind_inner): Initialize them. * include/private/gc_priv.h (hblkhdr): Add HAS_DISCLAIM and MARK_UNCONDITIONALLY flags. * allchblk.c (setup_header): Set HAS_DISCLAIM and MARK_UNCONDITIONALLY flags as indicated by the object kind. * reclaim.c: Main adjustments to support the disclaim callbacks. * mark.c (GC_push_unconditionally, GC_push_next_marked_uncollecable): Unconditionally mark from objects in blocks flagged MARK_UNCONDITIONALLY. This preserves links reachable from the finalizer when using the the finalized object kind. * disclaim.c: Add file with support functions for disclaim callbacks and implementation of the "finalized" object kind. * include/gc_disclaim.h: Add file providing the corresponding API. * include/private/thread_local_alloc.h (thread_local_freelists): Add finalized_freelists. * thread_local_alloc.c: Initialize them. * tests/tests.am, tests/disclaim_test.c, tests/disclaim_bench.c: Add disclaim-related tests.
* | | tests: Add missing checks of GC_malloc result (for out-of-memory)Ivan Maidanski2011-09-302-1/+9
|/ / | | | | | | | | | | | | | | * 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).
* | Add missing GC_ATTR_UNUSED annotation to some functions in gctestIvan Maidanski2011-09-221-8/+13
| | | | | | | | | | * tests/test.c (tiny_reverse_test, WinMain, thr_run_one_test, thr_window): Tag the arguments with GC_ATTR_UNUSED.
* | Adjust subthread_create test.Ivan Maidanski2011-09-201-26/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/subthread_create.c: Skip test if AO_fetch_and_add is missing. * tests/subthread_create.c: Implement for Win32 threads (include windows.h instead of pthread.h unless GC_PTHREADS). * tests/subthread_create.c (entry, main): Likewise. * tests/subthread_create.c (MAX_SUBTHREAD_DEPTH, MAX_SUBTHREAD_COUNT, INITIAL_THREAD_COUNT): Define only if INITIAL_THREAD_COUNT undefined. * tests/subthread_create.c (MAX_ALIVE_THREAD_COUNT): New macro. * tests/subthread_create.c (DECAY_NUMER, DECAY_DENOM): Define only if DECAY_NUMER is undefined. * tests/subthread_create.c (INITIAL_THREAD_COUNT, MAX_SUBTHREAD_DEPTH, MAX_SUBTHREAD_COUNT): Make the values smaller. * tests/subthread_create.c (thread_created_cnt): Move out of entry(); make volatile. * tests/subthread_create.c (thread_ended_cnt): New AO variable. * tests/subthread_create.c (entry): Use "arg" value (instead of address); adjust thread_ended_cnt on function exit; print thread number in case of failure; limit the number of concurrently running threads (by MAX_ALIVE_THREAD_COUNT). * tests/subthread_create.c (main): Print threads creation statistic on exit; exit with code 1 (instead of 69) in case of failure.
* | tests: print a message in case a test is a no-op.Ivan Maidanski2011-09-201-1/+4
| | | | | | | | | | * tests/threadkey_test.c (main): Print a message if the test is skipped.
* | Add test case to expose a bug with thread creation.Petter Urkedal2011-09-192-0/+60
|/
* Replace ARGSUSED comment-based annotation with GCC 'unused' attribute.Ivan Maidanski2011-09-142-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turn on unused-parameter checking for GCC. * alloc.c (GC_try_to_collect_general): Add GC_ATTR_UNUSED attribute to an argument. * tests/test.c (tiny_reverse_test, thr_run_one_test): Likewise. * backgraph.c (reset_back_edge, update_max_height): Replace ARGSUSED annotation with GC_ATTR_UNUSED attribute for some arguments. * checksums.c (GC_add_block): Likewise. * dbg_mlc.c (GC_debug_change_stubborn, GC_debug_end_stubborn_change, GC_check_heap_block): Likewise. * finalize.c (GC_null_finalize_mark_proc): Likewise. * gcj_mlc.c (GC_gcj_fake_mark_proc): Likewise. * mark.c (GC_noop, clear_marks_for_block, GC_mark_and_push): Likewise. * mark_rts.c (GC_push_conditional_with_exclusions, GC_push_current_stack): Likewise. * misc.c (GC_default_oom_fn, GC_do_blocking_inner): Likewise. * os_dep.c (GC_fault_handler_openbsd, GC_fault_handler, GC_remove_protection, GC_page_was_dirty, GC_page_was_ever_dirty): Likewise. * pthread_stop_world.c (GC_suspend_handler, GC_suspend_handler_inner): Likewise. * pthread_support.c (GC_do_blocking_inner): Likewise. * stubborn.c (GC_change_stubborn, GC_end_stubborn_change): Likewise. * tests/test.c (fail_proc1): Likewise. * typd_mlc.c (GC_array_mark_proc): Likewise. * win32_threads.c (GC_do_blocking_inner, DllMain): Likewise. * include/private/gc_priv.h (GC_ATTR_UNUSED): Define new macro. * cordxtra.c (CORD_ATTR_UNUSED): Likewise. * cordxtra.c (CORD_nul_func, CORD_lf_close_proc): Replace ARGSUSED annotation with CORD_ATTR_UNUSED attribute for an argument. * mach_dep.c (GC_clear_stack_inner): Remove ARGSUSED annotation and use "limit" argument in the function (to suppress compiler warning). * misc.c (GC_clear_stack_inner): Remove ARGSUSED. * tests/threadkey_test.c (on_thread_exit_inner, on_thread_exit): Use all function arguments (to suppress compiler warning). * configure.ac (CFLAGS): Remove "-Wno-unused-parameter" option.
* Increase tests/test.c max heap size limit (required for Cygwin)Ivan Maidanski2011-09-131-1/+1
| | | | | | * 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-081-2/+2
| | | | | | | | | | | | | | | | | | | * 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.
* Remove resolved FIXME in tests.am script.Ivan Maidanski2011-08-311-8/+0
| | | | | | | (The stated FIXME no longer in force.) * tests/tests.am: Remove ancient FIXME about trace_test that it does not work on MacOS X.
* FIX: MinGW/MingwCE: Use CreateThread in initsecondarythread test andIvan Maidanski2011-08-312-21/+90
| | | | | | | | | | | | | | | 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-08-311-5/+15
| | | | | | | | | | | * 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.
* Move information about the authors and their emails from the sourceIvan Maidanski2011-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | files to AUTHORS file. (This information could also be observed via "git log" or by looking into the original version of a file.) * doc/README.DGUX386: Remove original-author and modified-by information (as well as email and time-stamp) from the file. * doc/README.Mac: Ditto. * doc/README.amiga: Ditto. * doc/README.cords: Ditto. * doc/README.darwin: Ditto. * doc/README.dj: Ditto. * doc/README.ews4800: Ditto. * doc/README.win32: Ditto. * doc/barrett_diagram: Ditto. * include/private/gcconfig.h: Ditto. * tests/initsecondarythread.c: Ditto. * AUTHORS: Add authors information (with emails). * doc/README.Mac: Remove non Lattin-1 characters. * README: Update email to sending bugs information. * doc/README.Mac: Expand all tabs to spaces; remove trailing spaces at EOLn. * doc/README.amiga: Ditto. * doc/barrett_diagram: Ditto.
* Remove information about the authors from the source files.Ivan Maidanski2011-08-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (This information could be observed via "git log" or by looking into the original version of a file.) * Makefile.am: Remove original-author and modified-by information (as well as a time-stamp) from the file header. * configure.ac: Ditto. * cord/cordbscs.c: Ditto. * cord/cordprnt.c: Ditto. * cord/cordxtra.c: Ditto. * cord/de.c: Ditto. * cord/de_cmds.h: Ditto. * cord/de_win.h: Ditto. * doc/README.arm.cross: Ditto. * doc/doc.am: Ditto. * dyn_load.c: Ditto. * gc_cpp.cc: Ditto. * gc_dlopen.c: Ditto. * include/cord.h: Ditto. * include/include.am: Ditto. * include/private/cord_pos.h: Ditto. * include/private/gc_hdrs.h: Ditto. * include/weakpointer.h: Ditto. * m4/gc_set_version.m4: Ditto. * tests/test_cpp.cc: Ditto. * cord/cordprnt.c: Fix a typo in a comment. * AUTHORS: Add authors. * cord/cordprnt.c: Expand all tabs to spaces; remove trailing spaces at EOLn. * cord/de.c: Ditto. * cord/de_cmds.h: Ditto. * cord/de_win.c: Ditto. * cord/de_win.h: Ditto. * doc/README.arm.cross: Ditto. * include/private/cord_pos.h: Ditto. * include/weakpointer.h: Ditto. * m4/gc_set_version.m4: Ditto.
* Remove references to old missing gc_alloc.h and gc_local_alloc.h files.Ivan Maidanski2011-08-241-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused HPUX GC_test_and_clear implementation. * 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-08-091-1/+5
| | | | | | | | | | | | | | | | | | | | | * 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.
* 2011-07-26 Ivan Maidanski <ivmai@mail.ru>ivmai2011-07-262-0/+39
| | | | | | | | * 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-261-2/+2
| | | | | | | | * 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-261-2/+5
| | | | | | | | | | | | | | * 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-261-35/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-262-3/+5
| | | | | | | | | | | | | | | | | * 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-261-1/+1
| | | | | | | * 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-261-2/+2
| | | | | * 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-261-0/+19
| | | | | * tests/threadkey_test.c (SKIP_THREADKEY_TEST): Skip the test if defined; explicitly define for some targets.