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.