summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-03-12 14:48:34 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-03-12 14:48:34 +0300
commitb1bcc63ba060e737ddde49456445997635af8939 (patch)
treee07ad6204876f524a98a4cbfd2814f064a0710ff
parentd5e367452ef5f7086978dcec5f18756b081b7178 (diff)
downloadbdwgc-b1bcc63ba060e737ddde49456445997635af8939.tar.gz
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.
-rw-r--r--reclaim.c5
1 files changed, 3 insertions, 2 deletions
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