]> granicus.if.org Git - gc/commit
Add disclaim callbacks for efficient finalization.
authorPetter Urkedal <urkedal@nbi.dk>
Sun, 1 Jul 2007 11:48:00 +0000 (13:48 +0200)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 30 Sep 2011 13:34:38 +0000 (17:34 +0400)
commit6c1a9244581cdceaf39c7321e524b1ef5a099980
tree69789d0b45c46224f4675f0d37b6386251193d3e
parentafbc74ab7f0fb3f19d18294083cbcf68a6200e58
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.
16 files changed:
Makefile.am
Makefile.direct
allchblk.c
configure.ac
disclaim.c [new file with mode: 0644]
include/gc_disclaim.h [new file with mode: 0644]
include/include.am
include/private/gc_priv.h
include/private/thread_local_alloc.h
mark.c
misc.c
reclaim.c
tests/disclaim_bench.c [new file with mode: 0644]
tests/disclaim_test.c [new file with mode: 0644]
tests/tests.am
thread_local_alloc.c