summaryrefslogtreecommitdiff
path: root/rts/sm/NonMoving.h
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-10-22 21:04:16 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-03-08 15:02:30 -0500
commit58e53bc4d33dad76b3250997f1a8300d0041f387 (patch)
tree9b1f97fef6fe6d16ff6fa8e3515e548b6a27d939 /rts/sm/NonMoving.h
parent81d6cc551c7a843002495d3ffd2373ad00a52766 (diff)
downloadhaskell-58e53bc4d33dad76b3250997f1a8300d0041f387.tar.gz
nonmoving: Assert state of swept segments
Diffstat (limited to 'rts/sm/NonMoving.h')
-rw-r--r--rts/sm/NonMoving.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/rts/sm/NonMoving.h b/rts/sm/NonMoving.h
index 45ece3aa6a..1f82a77a93 100644
--- a/rts/sm/NonMoving.h
+++ b/rts/sm/NonMoving.h
@@ -47,8 +47,10 @@ enum NonmovingSegmentState {
};
#define SET_SEGMENT_STATE(seg, st) RELAXED_STORE(&(seg)->state, (st))
+#define ASSERT_SEGMENT_STATE(seg, st) ASSERT(RELAXED_LOAD(&(seg)->state) == (st))
#else
#define SET_SEGMENT_STATE(_seg,_st)
+#define ASSERT_SEGMENT_STATE(_seg, _st)
#endif
// A non-moving heap segment