summaryrefslogtreecommitdiff
path: root/rts/sm/NonMovingMark.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/sm/NonMovingMark.c')
-rw-r--r--rts/sm/NonMovingMark.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c
index a42c3c46ce..98aef4ce47 100644
--- a/rts/sm/NonMovingMark.c
+++ b/rts/sm/NonMovingMark.c
@@ -1281,7 +1281,10 @@ mark_closure (MarkQueue *queue, const StgClosure *p0, StgClosure **origin)
bd = Bdescr((StgPtr) p);
- if (bd->gen != oldest_gen) {
+ // This must be a relaxed load since the object may be a large object,
+ // in which case evacuation by the moving collector will result in
+ // mutation.
+ if (RELAXED_LOAD(&bd->gen) != oldest_gen) {
// Here we have an object living outside of the non-moving heap. While
// we likely evacuated nearly everything to the nonmoving heap during
// preparation there are nevertheless a few ways in which we might trace