diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-11-16 16:22:51 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-12-23 19:09:30 -0500 |
commit | 36c9f23c9dc52928b5d2971f38f6e0b15e38528e (patch) | |
tree | 703c029d7aeb873da92505d4e4af9031ddc7aa33 /rts | |
parent | ab6cf893037f073fd3daf619579c84e58362b499 (diff) | |
download | haskell-36c9f23c9dc52928b5d2971f38f6e0b15e38528e.tar.gz |
nonmoving: Make free list counter accesses atomic
Since these may race with the allocator(s).
Diffstat (limited to 'rts')
-rw-r--r-- | rts/sm/NonMoving.c | 2 |
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); |