summaryrefslogtreecommitdiff
path: root/mark.c
diff options
context:
space:
mode:
authorPetter A. Urkedal <paurkedal@gmail.com>2017-12-03 12:42:59 +0100
committerIvan Maidanski <ivmai@mail.ru>2017-12-04 09:18:53 +0300
commit74716728148f782c7c0b4ab83a59d59418731c55 (patch)
tree9b7cd7515b41d0e6bf5477fb034c4460a731070b /mark.c
parent0b2e3ea11f3d43cac6125ef1761a5264de39a6bd (diff)
downloadbdwgc-74716728148f782c7c0b4ab83a59d59418731c55.tar.gz
Fix marking of disclaim-reachable objects in the incremental mode
Issue #192 (bdwgc). Unconditional marking is done analogously to marking from uncollectible blocks, since they are meant to secure access to data for disclaim notifiers after the data is no longer marked. * mark.c [ENABLE_DISCLAIM] (GC_push_next_marked_dirty): Honor MARK_UNCONDITIONALLY when rescanning dirty blocks during incremental marking.
Diffstat (limited to 'mark.c')
-rw-r--r--mark.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/mark.c b/mark.c
index 2c468309..1da4a142 100644
--- a/mark.c
+++ b/mark.c
@@ -2015,7 +2015,21 @@ STATIC struct hblk * GC_push_next_marked(struct hblk *h)
h += OBJ_SZ_TO_BLOCKS(hhdr -> hb_sz);
hhdr = HDR(h);
}
- GC_push_marked(h, hhdr);
+# ifdef ENABLE_DISCLAIM
+ if ((hhdr -> hb_flags & MARK_UNCONDITIONALLY) != 0) {
+ GC_push_unconditionally(h, hhdr);
+
+ /* Then we may ask, why not also add the MARK_UNCONDITIONALLY */
+ /* case to GC_push_next_marked, which is also applied to */
+ /* uncollectible blocks? But it seems to me that the function */
+ /* does not need to scan uncollectible (and unconditionally */
+ /* marked) blocks since those are already handled in the */
+ /* MS_PUSH_UNCOLLECTABLE phase. */
+ } else
+# endif
+ /* else */ {
+ GC_push_marked(h, hhdr);
+ }
return(h + OBJ_SZ_TO_BLOCKS(hhdr -> hb_sz));
}
#endif /* !GC_DISABLE_INCREMENTAL */