summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-11-16 16:22:51 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-12-23 19:09:30 -0500
commit36c9f23c9dc52928b5d2971f38f6e0b15e38528e (patch)
tree703c029d7aeb873da92505d4e4af9031ddc7aa33
parentab6cf893037f073fd3daf619579c84e58362b499 (diff)
downloadhaskell-36c9f23c9dc52928b5d2971f38f6e0b15e38528e.tar.gz
nonmoving: Make free list counter accesses atomic
Since these may race with the allocator(s).
-rw-r--r--rts/sm/NonMoving.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/sm/NonMoving.c b/rts/sm/NonMoving.c
index 72bfdbafa7..2697c5d2aa 100644
--- a/rts/sm/NonMoving.c
+++ b/rts/sm/NonMoving.c
@@ -522,7 +522,7 @@ static void nonmovingInitSegment(struct NonmovingSegment *seg, uint8_t log_block
void nonmovingPushFreeSegment(struct NonmovingSegment *seg)
{
// See Note [Live data accounting in nonmoving collector].
- if (nonmovingHeap.n_free > NONMOVING_MAX_FREE) {
+ if (RELAXED_LOAD(&nonmovingHeap.n_free) > NONMOVING_MAX_FREE) {
bdescr *bd = Bdescr((StgPtr) seg);
ACQUIRE_SM_LOCK;
ASSERT(oldest_gen->n_blocks >= bd->blocks);