platform/upstream/libgc.git
12 years agoResolve minor warnings (reported by GCC with '-pedantic') in checksums
Ivan Maidanski [Fri, 11 Nov 2011 12:51:45 +0000 (16:51 +0400)]
Resolve minor warnings (reported by GCC with '-pedantic') in checksums

* checksums.c (GC_update_check_page): Explicitly cast a pointer
argument of GC_printf to void* to match %p format specifier.

12 years agoFix extra/gc.c to include new finalized_mlc.c file
Ivan Maidanski [Fri, 11 Nov 2011 12:25:12 +0000 (16:25 +0400)]
Fix extra/gc.c to include new finalized_mlc.c file

* extra/gc.c: Include finalized_mlc.c file (after finalize.c).

12 years agoResolve minor warnings in tests (reported by GCC with '-pedantic' option)
Ivan Maidanski [Fri, 11 Nov 2011 12:18:13 +0000 (16:18 +0400)]
Resolve minor warnings in tests (reported by GCC with '-pedantic' option)

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

12 years agoAdd macro to optionally omit GC_move_disappearing_link
Ivan Maidanski [Wed, 9 Nov 2011 09:59:11 +0000 (13:59 +0400)]
Add macro to optionally omit GC_move_disappearing_link

* finalize.c (GC_move_disappearing_link): Do not define if
GC_MOVE_DISAPPEARING_LINK_NOT_NEEDED defined (new macro).

12 years agoSwap GC_unregister_disappearing_link and GC_move_disappearing_link
Ivan Maidanski [Mon, 7 Nov 2011 07:38:36 +0000 (11:38 +0400)]
Swap GC_unregister_disappearing_link and GC_move_disappearing_link
prototypes order in include/gc.h

12 years agoRefactor GC_move_disappearing_link() code;
Ivan Maidanski [Mon, 7 Nov 2011 07:30:44 +0000 (11:30 +0400)]
Refactor GC_move_disappearing_link() code;
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".

12 years agoadd GC_move_disappearing_link
Andy Wingo [Wed, 26 Oct 2011 16:15:39 +0000 (18:15 +0200)]
add GC_move_disappearing_link

* finalize.c (GC_move_disappearing_link): New function, moves a
  disappearing link.

* include/gc.h: Add declaration, and new return code GC_NOT_FOUND.

12 years agoMerge branch 'master' of github.com:ivmai/bdwgc
Ivan Maidanski [Mon, 17 Oct 2011 18:03:05 +0000 (22:03 +0400)]
Merge branch 'master' of github.com:ivmai/bdwgc

12 years agoMerge remote-tracking branch 'origin/paurkedal-disclaim-v2'
Ivan Maidanski [Mon, 17 Oct 2011 17:52:48 +0000 (21:52 +0400)]
Merge remote-tracking branch 'origin/paurkedal-disclaim-v2'

12 years agoUpdate AUTHORS (add one email)
Ivan Maidanski [Sat, 15 Oct 2011 09:47:24 +0000 (13:47 +0400)]
Update AUTHORS (add one email)

12 years agoUpdate AUTHORS
Ivan Maidanski [Mon, 10 Oct 2011 07:39:21 +0000 (11:39 +0400)]
Update AUTHORS

12 years agogcconfig.h: Add machine description for Hexagon
Linas Vepstas [Mon, 10 Oct 2011 07:33:39 +0000 (11:33 +0400)]
gcconfig.h: Add machine description for Hexagon

12 years agoDo not define internal GC_parse_map_entry() unless really used.
Ivan Maidanski [Fri, 7 Oct 2011 14:33:50 +0000 (18:33 +0400)]
Do not define internal GC_parse_map_entry() unless really used.

* include/private/gc_priv.h (GC_parse_map_entry): Do not declare
unless USE_PROC_FOR_LIBRARIES.
* os_dep.c (GC_parse_map_entry): Test USE_PROC_FOR_LIBRARIES macro
in addition to DYNAMIC_LOADING (in condition whether to define this
function).

12 years agoResolve minor merge conflict in gc_disclaim.h, disclaim_bench.c
Ivan Maidanski [Fri, 30 Sep 2011 13:40:43 +0000 (17:40 +0400)]
Resolve minor merge conflict in gc_disclaim.h, disclaim_bench.c

12 years agoFix compiler warnings in disclaim tests
Ivan Maidanski [Fri, 30 Sep 2011 09:48:34 +0000 (13:48 +0400)]
Fix compiler warnings in disclaim tests

12 years agofinalized_mlc.c: Add GC_ATTR_UNUSED tag to GC_finalized_disclaim
Ivan Maidanski [Fri, 30 Sep 2011 09:46:57 +0000 (13:46 +0400)]
finalized_mlc.c: Add GC_ATTR_UNUSED tag to GC_finalized_disclaim

12 years ago.gitignore: Ignore disclaim tests executables
Ivan Maidanski [Fri, 30 Sep 2011 09:44:36 +0000 (13:44 +0400)]
.gitignore: Ignore disclaim tests executables

12 years agoAdd comment on GC_init_finalized_malloc.
Petter Urkedal [Thu, 29 Sep 2011 22:28:14 +0000 (00:28 +0200)]
Add comment on GC_init_finalized_malloc.

12 years agoAdd gcj_mlc.o to the windows-untested project files (untested).
Petter Urkedal [Thu, 29 Sep 2011 18:12:01 +0000 (20:12 +0200)]
Add gcj_mlc.o to the windows-untested project files (untested).

12 years agoUse gc_priv.h API for timing in tests/disclaim_bench.c.
Petter Urkedal [Thu, 29 Sep 2011 18:05:45 +0000 (20:05 +0200)]
Use gc_priv.h API for timing in tests/disclaim_bench.c.

12 years agoMake disclaim_bench.c more portable.
Petter Urkedal [Wed, 28 Sep 2011 19:13:02 +0000 (21:13 +0200)]
Make disclaim_bench.c more portable.

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

12 years agoAdd finalized_mlc.* to various makefiles.
Petter Urkedal [Wed, 28 Sep 2011 18:12:51 +0000 (20:12 +0200)]
Add finalized_mlc.* to various makefiles.

12 years agoReview 'disclaim' add-on partially; fix code in some places again
Ivan Maidanski [Wed, 28 Sep 2011 09:48:17 +0000 (13:48 +0400)]
Review 'disclaim' add-on partially; fix code in some places again

12 years agoSkip disclaim_bench.c if AO_fetch_and_add1 is missing.
Petter Urkedal [Sat, 24 Sep 2011 08:20:58 +0000 (10:20 +0200)]
Skip disclaim_bench.c if AO_fetch_and_add1 is missing.

12 years agoAdjust tests code for 'disclaim' feature
Ivan Maidanski [Fri, 23 Sep 2011 15:17:20 +0000 (19:17 +0400)]
Adjust tests code for 'disclaim' feature

12 years agoReview 'disclaim' add-on partially; fix code in some places
Ivan Maidanski [Fri, 23 Sep 2011 11:28:00 +0000 (15:28 +0400)]
Review 'disclaim' add-on partially; fix code in some places

12 years agoFix issues proposed in Ivan's previous commit, etc.
Petter Urkedal [Tue, 13 Sep 2011 21:28:27 +0000 (23:28 +0200)]
Fix issues proposed in Ivan's previous commit, etc.

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

12 years agoENABLE_DISCLAIM: Make stylistic fixes in many places and add many FIXME.
Ivan Maidanski [Tue, 13 Sep 2011 06:58:36 +0000 (10:58 +0400)]
ENABLE_DISCLAIM: Make stylistic fixes in many places and add many FIXME.

12 years agoAdd and update some copyright and remove README.disclaim.
Petter Urkedal [Sat, 10 Sep 2011 13:09:41 +0000 (15:09 +0200)]
Add and update some copyright and remove README.disclaim.

* README.disclaim: Remove as it only contained patching instructions.
* disclaim.c: Add copyright notice.
* include/gc_disclaim.h: Update year on copyright notice.

12 years agoFix some issues and avoid warnings in disclaim-related code.
Petter Urkedal [Sat, 10 Sep 2011 12:03:16 +0000 (14:03 +0200)]
Fix some issues and avoid warnings in disclaim-related code.

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

12 years agoImplement freeing of blocks with disclaim callbacks.
Petter Urkedal [Mon, 15 Aug 2011 21:21:56 +0000 (23:21 +0200)]
Implement freeing of blocks with disclaim callbacks.

12 years agoAdjust comments and whitespace.
Petter Urkedal [Thu, 27 May 2010 22:10:57 +0000 (00:10 +0200)]
Adjust comments and whitespace.

12 years agoAdjustment to disclaim.c after config.h and a prototype change.
Petter Urkedal [Wed, 30 Sep 2009 21:19:52 +0000 (23:19 +0200)]
Adjustment to disclaim.c after config.h and a prototype change.

12 years agoFixed compilation errors, also tests passes.
Petter Urkedal [Wed, 22 Oct 2008 17:29:48 +0000 (19:29 +0200)]
Fixed compilation errors, also tests passes.

reclaim.c: Removed obsolete argument to GC_reclaim_small_nonempty_block.

12 years agoFixed memory leak issue with unconditional marking.
Petter Urkedal [Sun, 4 May 2008 16:12:52 +0000 (18:12 +0200)]
Fixed memory leak issue with unconditional marking.

12 years agodisclaim.c: Renamed RAW_BYTES_FROM_INDEX to GC_RAW_BYTES_FROM_INDEX according to...
Petter Urkedal [Sat, 12 Jan 2008 12:34:11 +0000 (13:34 +0100)]
disclaim.c: Renamed RAW_BYTES_FROM_INDEX to GC_RAW_BYTES_FROM_INDEX according to change in original branch.

README.disclaim: Patching instruction.

12 years agoAdd disclaim callbacks for efficient finalization.
Petter Urkedal [Sun, 1 Jul 2007 11:48:00 +0000 (13:48 +0200)]
Add disclaim callbacks for efficient finalization.

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.

12 years agoUpdate TODO file
Ivan Maidanski [Fri, 30 Sep 2011 13:33:45 +0000 (17:33 +0400)]
Update TODO file

12 years agoResolve some minor warnings reported by GCC with '-pedantic' option
Ivan Maidanski [Fri, 30 Sep 2011 13:32:47 +0000 (17:32 +0400)]
Resolve some minor warnings reported by GCC with '-pedantic' option

* allchblk.c (GC_print_hblkfreelist, GC_dump_regions, GC_freehblk):
Explicitly cast a pointer argument of GC_printf to void* to match %p
format specifier.
* reclaim.c (GC_print_free_list): Likewise.

12 years agomach_dep.c: Replace C++ style comments with C ones
Ivan Maidanski [Fri, 30 Sep 2011 13:27:35 +0000 (17:27 +0400)]
mach_dep.c: Replace C++ style comments with C ones

12 years agotests: Add missing checks of GC_malloc result (for out-of-memory)
Ivan Maidanski [Fri, 30 Sep 2011 12:17:31 +0000 (16:17 +0400)]
tests: Add missing checks of GC_malloc result (for out-of-memory)

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

12 years agoAdd missing GC_ATTR_UNUSED annotation to a function in backgraph
Ivan Maidanski [Fri, 30 Sep 2011 12:01:28 +0000 (16:01 +0400)]
Add missing GC_ATTR_UNUSED annotation to a function in backgraph

* backgraph.c (pop_in_progress): Tag the argument with GC_ATTR_UNUSED.

12 years agoFix compiler warnings in disclaim tests
Ivan Maidanski [Fri, 30 Sep 2011 09:48:34 +0000 (13:48 +0400)]
Fix compiler warnings in disclaim tests

12 years agofinalized_mlc.c: Add GC_ATTR_UNUSED tag to GC_finalized_disclaim
Ivan Maidanski [Fri, 30 Sep 2011 09:46:57 +0000 (13:46 +0400)]
finalized_mlc.c: Add GC_ATTR_UNUSED tag to GC_finalized_disclaim

12 years ago.gitignore: Ignore disclaim tests executables
Ivan Maidanski [Fri, 30 Sep 2011 09:44:36 +0000 (13:44 +0400)]
.gitignore: Ignore disclaim tests executables

12 years agoMerge branch 'remotes/paurkedal/t/disclaim-pullreq' plus some minor fixes
Ivan Maidanski [Fri, 30 Sep 2011 09:30:16 +0000 (13:30 +0400)]
Merge branch 'remotes/paurkedal/t/disclaim-pullreq' plus some minor fixes

12 years agoAdd comment on GC_init_finalized_malloc.
Petter Urkedal [Thu, 29 Sep 2011 22:28:14 +0000 (00:28 +0200)]
Add comment on GC_init_finalized_malloc.

12 years agoAdd gcj_mlc.o to the windows-untested project files (untested).
Petter Urkedal [Thu, 29 Sep 2011 18:12:01 +0000 (20:12 +0200)]
Add gcj_mlc.o to the windows-untested project files (untested).

12 years agoUse gc_priv.h API for timing in tests/disclaim_bench.c.
Petter Urkedal [Thu, 29 Sep 2011 18:05:45 +0000 (20:05 +0200)]
Use gc_priv.h API for timing in tests/disclaim_bench.c.

12 years agoMake disclaim_bench.c more portable.
Petter Urkedal [Wed, 28 Sep 2011 19:13:02 +0000 (21:13 +0200)]
Make disclaim_bench.c more portable.

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

12 years agoAdd finalized_mlc.* to various makefiles.
Petter Urkedal [Wed, 28 Sep 2011 18:12:51 +0000 (20:12 +0200)]
Add finalized_mlc.* to various makefiles.

12 years agoReview 'disclaim' add-on partially; fix code in some places again
Ivan Maidanski [Wed, 28 Sep 2011 09:48:17 +0000 (13:48 +0400)]
Review 'disclaim' add-on partially; fix code in some places again

12 years agoSkip disclaim_bench.c if AO_fetch_and_add1 is missing.
Petter Urkedal [Sat, 24 Sep 2011 08:20:58 +0000 (10:20 +0200)]
Skip disclaim_bench.c if AO_fetch_and_add1 is missing.

12 years agoAdjust tests code for 'disclaim' feature
Ivan Maidanski [Fri, 23 Sep 2011 15:17:20 +0000 (19:17 +0400)]
Adjust tests code for 'disclaim' feature

12 years agoReview 'disclaim' add-on partially; fix code in some places
Ivan Maidanski [Fri, 23 Sep 2011 11:28:00 +0000 (15:28 +0400)]
Review 'disclaim' add-on partially; fix code in some places

12 years agoMerge remote-tracking branch 'remotes/paurkedal/t/disclaim-pullreq' into paurkedal...
Ivan Maidanski [Fri, 23 Sep 2011 10:47:59 +0000 (14:47 +0400)]
Merge remote-tracking branch 'remotes/paurkedal/t/disclaim-pullreq' into paurkedal-disclaim-v2

12 years agoChange configure to define NO_DEBUGGING if "--disable-gc-debug"
Ivan Maidanski [Fri, 23 Sep 2011 07:59:19 +0000 (11:59 +0400)]
Change configure to define NO_DEBUGGING if "--disable-gc-debug"

* configure.ac (NO_DEBUGGING): Define based on testing enable_gc_debug
value (instead of based on with_cross_host value).

12 years agoFix commit 505b041 regarding configure THREAD_LOCAL_ALLOC (Win32)
Ivan Maidanski [Fri, 23 Sep 2011 07:45:54 +0000 (11:45 +0400)]
Fix commit 505b041 regarding configure THREAD_LOCAL_ALLOC (Win32)

* configure.ac (THREAD_LOCAL_ALLOC): Test enable_shared and
enable_static values properly when setting THREAD_LOCAL_ALLOC
in case PARALLEL_MARK is off (Win32 only).

12 years agoUpdate TODO file
Ivan Maidanski [Thu, 22 Sep 2011 11:48:21 +0000 (15:48 +0400)]
Update TODO file

12 years agoDefine GC_DLL if building only dynamic libraries.
Ivan Maidanski [Thu, 22 Sep 2011 11:46:54 +0000 (15:46 +0400)]
Define GC_DLL if building only dynamic libraries.
Update README for Cygwin/MinGW.

* configure.ac (GC_DLL): New AC template; define if only the dynamic
libraries are being built.
* configure.ac (THREAD_LOCAL_ALLOC): Define for Win32 implicitly
if static libraries are being built (i.e. GC_DLL is not defined).
* doc/README.win32: Update "GNU Tools" section.

12 years agoFix thread model in configure for MinGW.
Ivan Maidanski [Thu, 22 Sep 2011 11:40:31 +0000 (15:40 +0400)]
Fix thread model in configure for MinGW.

* configure.ac (THREADS): Change "posix" to "win32" in case of
cross-compiling to MinGW.

12 years agoEnable parallel marker in configure for Solaris.
Ivan Maidanski [Thu, 22 Sep 2011 11:30:02 +0000 (15:30 +0400)]
Enable parallel marker in configure for Solaris.

* configure.ac (PARALLEL_MARK): Check --enable-parallel-mark also for
Solaris.

12 years agoAdd missing GC_ATTR_UNUSED annotation to some functions in gctest
Ivan Maidanski [Thu, 22 Sep 2011 11:23:58 +0000 (15:23 +0400)]
Add missing GC_ATTR_UNUSED annotation to some functions in gctest

* tests/test.c (tiny_reverse_test, WinMain, thr_run_one_test,
thr_window): Tag the arguments with GC_ATTR_UNUSED.

12 years agoRemove obsolete Makefile.DLL (superseded by cygwin/mingw configure)
Ivan Maidanski [Thu, 22 Sep 2011 08:58:56 +0000 (12:58 +0400)]
Remove obsolete Makefile.DLL (superseded by cygwin/mingw configure)

* Makefile.DLL: Remove.
* Makefile.am (EXTRA_DIST): Remove Makefile.DLL entry.
* Makefile.direct (OTHER_MAKEFILES): Likewise.
* Makefile.dj (OTHER_FILES): Likewise.
* Makefile.direct: Remove comment about Makefile.DLL.

12 years agoAdd TODO item
Ivan Maidanski [Wed, 21 Sep 2011 13:05:34 +0000 (17:05 +0400)]
Add TODO item

12 years ago.gitignore: Add subthread_create
Ivan Maidanski [Tue, 20 Sep 2011 15:44:53 +0000 (19:44 +0400)]
.gitignore: Add subthread_create

12 years agoFix GC_inner_start_routine() to prevent local variable clobbering.
Ivan Maidanski [Tue, 20 Sep 2011 08:15:17 +0000 (12:15 +0400)]
Fix GC_inner_start_routine() to prevent local variable clobbering.

* pthread_start.c (GC_inner_start_routine): Add volatile to "me" local
variable to prevent its clobbering.

12 years agoAdd missing GC_ATTR_UNUSED annotation to mark_ex_handler().
Ivan Maidanski [Tue, 20 Sep 2011 08:02:16 +0000 (12:02 +0400)]
Add missing GC_ATTR_UNUSED annotation to mark_ex_handler().

* mark.c (mark_ex_handler): Tag "disp_ctxt" argument with
GC_ATTR_UNUSED.

12 years agoAdjust subthread_create test.
Ivan Maidanski [Tue, 20 Sep 2011 07:58:56 +0000 (11:58 +0400)]
Adjust subthread_create test.

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

12 years agotests: print a message in case a test is a no-op.
Ivan Maidanski [Tue, 20 Sep 2011 07:45:02 +0000 (11:45 +0400)]
tests: print a message in case a test is a no-op.

* tests/threadkey_test.c (main): Print a message if the test is
skipped.

12 years agoMerge remote-tracking branch 'paurkedal/pullreq/subthread_create_test'
Ivan Maidanski [Tue, 20 Sep 2011 06:33:11 +0000 (10:33 +0400)]
Merge remote-tracking branch 'paurkedal/pullreq/subthread_create_test'

12 years agoFix issues proposed in Ivan's previous commit, etc.
Petter Urkedal [Tue, 13 Sep 2011 21:28:27 +0000 (23:28 +0200)]
Fix issues proposed in Ivan's previous commit, etc.

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

12 years agoENABLE_DISCLAIM: Make stylistic fixes in many places and add many FIXME.
Ivan Maidanski [Tue, 13 Sep 2011 06:58:36 +0000 (10:58 +0400)]
ENABLE_DISCLAIM: Make stylistic fixes in many places and add many FIXME.

12 years agoAdd and update some copyright and remove README.disclaim.
Petter Urkedal [Sat, 10 Sep 2011 13:09:41 +0000 (15:09 +0200)]
Add and update some copyright and remove README.disclaim.

* README.disclaim: Remove as it only contained patching instructions.
* disclaim.c: Add copyright notice.
* include/gc_disclaim.h: Update year on copyright notice.

12 years agoFix some issues and avoid warnings in disclaim-related code.
Petter Urkedal [Sat, 10 Sep 2011 12:03:16 +0000 (14:03 +0200)]
Fix some issues and avoid warnings in disclaim-related code.

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

12 years agoImplement freeing of blocks with disclaim callbacks.
Petter Urkedal [Mon, 15 Aug 2011 21:21:56 +0000 (23:21 +0200)]
Implement freeing of blocks with disclaim callbacks.

12 years agoAdjust comments and whitespace.
Petter Urkedal [Thu, 27 May 2010 22:10:57 +0000 (00:10 +0200)]
Adjust comments and whitespace.

12 years agoAdjustment to disclaim.c after config.h and a prototype change.
Petter Urkedal [Wed, 30 Sep 2009 21:19:52 +0000 (23:19 +0200)]
Adjustment to disclaim.c after config.h and a prototype change.

12 years agoFixed compilation errors, also tests passes.
Petter Urkedal [Wed, 22 Oct 2008 17:29:48 +0000 (19:29 +0200)]
Fixed compilation errors, also tests passes.

reclaim.c: Removed obsolete argument to GC_reclaim_small_nonempty_block.

12 years agoFixed memory leak issue with unconditional marking.
Petter Urkedal [Sun, 4 May 2008 16:12:52 +0000 (18:12 +0200)]
Fixed memory leak issue with unconditional marking.

12 years agodisclaim.c: Renamed RAW_BYTES_FROM_INDEX to GC_RAW_BYTES_FROM_INDEX according to...
Petter Urkedal [Sat, 12 Jan 2008 12:34:11 +0000 (13:34 +0100)]
disclaim.c: Renamed RAW_BYTES_FROM_INDEX to GC_RAW_BYTES_FROM_INDEX according to change in original branch.

README.disclaim: Patching instruction.

12 years agoAdd disclaim callbacks for efficient finalization.
Petter Urkedal [Sun, 1 Jul 2007 11:48:00 +0000 (13:48 +0200)]
Add disclaim callbacks for efficient finalization.

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.

12 years agoAdd test case to expose a bug with thread creation.
Petter Urkedal [Mon, 19 Sep 2011 06:35:13 +0000 (08:35 +0200)]
Add test case to expose a bug with thread creation.

12 years agoRewrite ChangeLog to contain only major per-release changes description
Ivan Maidanski [Sun, 18 Sep 2011 09:55:04 +0000 (13:55 +0400)]
Rewrite ChangeLog to contain only major per-release changes description
(only starting from 7.2alpha7, the rest remains in the form of commit
log except for versions prior to 7.0alpha9)

12 years agoFix mach_dep.c to include sys/ucontext.h on Mac OS X 10.6.
Ivan Maidanski [Thu, 15 Sep 2011 15:38:30 +0000 (19:38 +0400)]
Fix mach_dep.c to include sys/ucontext.h on Mac OS X 10.6.

* include/private/gc_priv.h (DARWIN): Include AvailabilityMacros.h
(unless MAC_OS_X_VERSION_MAX_ALLOWED already defined).
* mach_dep.c (GC_with_callee_saves_pushed): Include sys/ucontext.h
(instead of ucontext.h) if Mac OS X 10.6 or higher.

12 years agoResolve "comparison of signed and unsigned values" compiler warning.
Ivan Maidanski [Wed, 14 Sep 2011 18:02:00 +0000 (22:02 +0400)]
Resolve "comparison of signed and unsigned values" compiler warning.

* backgraph.c (per_object_helper): Cast "i" local variable to word
(instead of "sz") in a comparison.

12 years ago.gitignore: Ignore tracetest executable.
Ivan Maidanski [Wed, 14 Sep 2011 17:56:25 +0000 (21:56 +0400)]
.gitignore: Ignore tracetest executable.

12 years agoAdd TODO item.
Ivan Maidanski [Wed, 14 Sep 2011 17:55:22 +0000 (21:55 +0400)]
Add TODO item.

12 years agoReplace ARGSUSED comment-based annotation with GCC 'unused' attribute.
Ivan Maidanski [Wed, 14 Sep 2011 17:52:49 +0000 (21:52 +0400)]
Replace ARGSUSED comment-based annotation with GCC 'unused' attribute.
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.

12 years agoAdd TODO item.
Ivan Maidanski [Wed, 14 Sep 2011 15:20:07 +0000 (19:20 +0400)]
Add TODO item.

12 years agoMove "cord" library tests to "cord/tests" folder.
Ivan Maidanski [Wed, 14 Sep 2011 14:51:08 +0000 (18:51 +0400)]
Move "cord" library tests to "cord/tests" folder.

* cord/cordtest.c, cord/de.c, cord/de_win.c, cord/de_cmds.h,
cord/de_win.h: Move to cord/tests folder.
* cord/de_win.RC: Move ad rename to cord/tests/de_win.rc.
* .gitignore: Add cord/tests/de_win.res file.
* BCC_MAKEFILE (cord/de.obj, cord/de_win.obj, cord/de_win.res):
Rename (targets and source moved to cord/tests).
* NT_MAKEFILE (cord/de.obj, cord/de_win.obj): Likewise.
* CMakeLists.txt (cord): Rename cord/de.c, cord/de_win.c (source moved
to cord/tests).
* EMX_MAKEFILE (cord/cordtest.exe, cord/de.exe): Rename
cord/cordtest.c, cord/de.c to cord/tests (source moved to cord/tests).
* Makefile.direct, Makefile.dj (cord/cordtest, cord/de): Likewise.
* OS2_MAKEFILE (cord/cordtest.exe): Likewise.
* SMakefile.amiga (cord/cordtest.o): Likewise.
* Makefile.direct, Makefile.dj (CORD_SRCS): Rename cord/cordtest.c,
cord/de.c, cord/de_cmds.h, cord/de_win.c, cord/de_win.h,
cord/de_win.rc (moved to cord/tests).
* NT_MAKEFILE, NT_STATIC_THREADS_MAKEFILE,
NT_X64_STATIC_THREADS_MAKEFILE, NT_X64_THREADS_MAKEFILE
(cord/de_win.res, cord/de.exe): Move cord/de.obj, cord/de_win.obj to
cord/tests.
* cord/cord.am (EXTRA_DIST): Move cordtest.c, de.c, de_cmds.h,
de_win.h, de_win.c, de_win.rc to cord/tests.
* doc/README.cords: Update (regarding de.c file move).
* gc.mak (SOURCE): Move de_win.c, de.c, de_win.rc to cord/tests.

12 years agoRemove cordtest from "cord" library.
Ivan Maidanski [Wed, 14 Sep 2011 14:27:30 +0000 (18:27 +0400)]
Remove cordtest from "cord" library.

* cord/cord.am (libcord_la_SOURCES): Remove cordtest.c from libcord.

12 years agoFix Makefile.direct after Makefile removal from package.
Ivan Maidanski [Wed, 14 Sep 2011 14:14:59 +0000 (18:14 +0400)]
Fix Makefile.direct after Makefile removal from package.

* .gitignore: Add "base_lib", "c++", "gc.a" files.
* Makefile.direct (Makefile): Add rule to create (or overwrite)
Makefile from Makefile.direct file.
* Makefile.direct (clean): Remove "base_lib", "c++" files as well.

12 years ago.gitignore: Ignore object, exe files in subfolders; ignore de_win.res.
Ivan Maidanski [Wed, 14 Sep 2011 12:35:24 +0000 (16:35 +0400)]
.gitignore: Ignore object, exe files in subfolders; ignore de_win.res.

12 years agoAdjust scripts after Makefile removal from package.
Ivan Maidanski [Wed, 14 Sep 2011 11:06:29 +0000 (15:06 +0400)]
Adjust scripts after Makefile removal from package.

* Makefile.direct (OTHER_FILES): Remove Makefile.
* Makefile.dj (OTHER_FILES): Likewise.
* Makefile.direct (dist gc.tar): Do not backup old auto-generated
Makefile.
* Makefile.dj: Remove comment about Makefile.DLLs.
* README: Update (about Makefile.direct).
* doc/README.autoconf: Likewise.
* doc/simple_example.html: Likewise.
* doc/simple_example.html (sample): Remove outdated comment for
GC_INIT.

12 years agoAdd TODO item.
Ivan Maidanski [Wed, 14 Sep 2011 07:34:18 +0000 (11:34 +0400)]
Add TODO item.

12 years agoMove and rename "callprocs" utility to tools/callprocs.sh.
Ivan Maidanski [Wed, 14 Sep 2011 07:32:59 +0000 (11:32 +0400)]
Move and rename "callprocs" utility to tools/callprocs.sh.

* callprocs: Move/rename to tools/callprocs.sh.
* Makefile.am (dist_noinst_SCRIPTS): Remove.
* Makefile.am (EXTRA_DIST): Add tools/callprocs.sh (move from
dist_noinst_SCRIPTS).
* Makefile.direct (OTHER_FILES): Rename callprocs to
tools/callprocs.sh.
* Makefile.dj (OTHER_FILES): Likewise.
* README: Likewise.
* doc/leak.html: Likewise.
* README: Fix a typo.

12 years agoDelete configure.host (move its content to configure.ac).
Ivan Maidanski [Wed, 14 Sep 2011 07:00:23 +0000 (11:00 +0400)]
Delete configure.host (move its content to configure.ac).

* Makefile.am (dist_noinst_SCRIPTS): Remove configure.host.
* Makefile.direct (GNU_BUILD_FILES): Likewise.
* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove.
* configure.ac: Put the content of configure.host instead of
including it.
* configure.host: Remove file.

12 years agoAdjust CMakeLists.txt for Cygwin (set CMAKE_LEGACY_CYGWIN_WIN32).
Ivan Maidanski [Tue, 13 Sep 2011 17:13:25 +0000 (21:13 +0400)]
Adjust CMakeLists.txt for Cygwin (set CMAKE_LEGACY_CYGWIN_WIN32).

* CMakeLists.txt (CMAKE_LEGACY_CYGWIN_WIN32): Set to 0 (required for
Cygwin).

12 years agoIncrease tests/test.c max heap size limit (required for Cygwin)
Ivan Maidanski [Tue, 13 Sep 2011 17:09:46 +0000 (21:09 +0400)]
Increase tests/test.c max heap size limit (required for Cygwin)

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