From b1bcc63ba060e737ddde49456445997635af8939 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 12 Mar 2022 14:48:34 +0300 Subject: Relax assertion of hb_n_marks in reclaim_block if more than two markers (fix of commit c9be25027) Issue #412 (bdwgc). * reclaim.c [PARALLEL_MARK] (GC_reclaim_block): Use min(3,GC_markers_m1+1) (instead of hard-coded 2) multiplier in the assertion about hb_n_marks maximum value; update the relevant comment. --- reclaim.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'reclaim.c') diff --git a/reclaim.c b/reclaim.c index cca47310..d3b54a68 100644 --- a/reclaim.c +++ b/reclaim.c @@ -435,10 +435,11 @@ STATIC void GC_reclaim_block(struct hblk *hbp, word report_if_found) /* Count can be low or one too high because we sometimes */ /* have to ignore decrements. Objects can also potentially */ /* be repeatedly marked by each marker. */ - /* Here we assume two markers, but this is extremely */ + /* Here we assume 3 markers at most, but this is extremely */ /* unlikely to fail spuriously with more. And if it does, it */ /* should be looked at. */ - GC_ASSERT(sz != 0 && hhdr->hb_n_marks <= 2 * (HBLKSIZE/sz + 1) + 16); + GC_ASSERT(sz != 0 && (GC_markers_m1 > 1 ? 3 : GC_markers_m1 + 1) + * (HBLKSIZE/sz + 1) + 16 >= hhdr->hb_n_marks); # else GC_ASSERT(sz * hhdr -> hb_n_marks <= HBLKSIZE); # endif -- cgit v1.2.1