From: Petter A. Urkedal Date: Tue, 30 Oct 2018 20:00:32 +0000 (+0100) Subject: Fix marks and hb_n_marks consistency when disclaim returns true X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a5da5e6c7d336c616bf7e42fb4c56b24fc139ec;p=gc Fix marks and hb_n_marks consistency when disclaim returns true * reclaim.c [ENABLE_DISCLAIM] (GC_disclaim_and_reclaim): When a disclaim callback returns 1 to protect an object from being reclaimed, mark it to skip it on repeated scans within the cycle. In particular, this fixes sz*hhdr->hb_n_marks<=HBLKSIZE assertion failure due to excessive increments of hb_n_marks. --- diff --git a/reclaim.c b/reclaim.c index f729f5d5..ac92e058 100644 --- a/reclaim.c +++ b/reclaim.c @@ -238,6 +238,7 @@ STATIC ptr_t GC_reclaim_uninit(struct hblk *hbp, hdr *hhdr, word sz, while ((word)p <= (word)plim) { int marked = mark_bit_from_hdr(hhdr, bit_no); if (!marked && (*disclaim)(p)) { + set_mark_bit_from_hdr(hhdr, bit_no); hhdr -> hb_n_marks++; marked = 1; }