diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-11-16 16:22:51 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2022-12-21 15:46:41 -0500 |
commit | 5a40353566516d7ba8b1db6877f8c3aba06e64aa (patch) | |
tree | d08a194ef3035da7ad1f1697c4694a27fd2bbd8c | |
parent | b6a3ab00712ca40acd1d91ba910e18c972a345a8 (diff) | |
download | haskell-wip/tsan/nonmoving.tar.gz |
nonmoving: Make free list counter accesses atomicwip/tsan/nonmoving
Since these may race with the allocator(s).
-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); |