summaryrefslogtreecommitdiff
path: root/reclaim.c
diff options
context:
space:
mode:
authorPetter A. Urkedal <paurkedal@gmail.com>2018-10-30 21:00:32 +0100
committerIvan Maidanski <ivmai@mail.ru>2018-11-02 10:23:40 +0300
commit3a5da5e6c7d336c616bf7e42fb4c56b24fc139ec (patch)
treeb45455381eb2f4a5bdcbe38e62695634468ef9bb /reclaim.c
parent95e0747277afa231cad42b9ce73c1385ba3a7f87 (diff)
downloadbdwgc-3a5da5e6c7d336c616bf7e42fb4c56b24fc139ec.tar.gz
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.
Diffstat (limited to 'reclaim.c')
-rw-r--r--reclaim.c1
1 files changed, 1 insertions, 0 deletions
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;
}