summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2020-12-07 21:48:32 +0000
committerBen Gamari <ben@well-typed.com>2020-12-20 21:05:13 -0500
commita5b2fded602ee8110dc75de2ec9910c36980ca24 (patch)
tree5197bf7034b138370fc8830b5199e3cd92fb17f0
parent19823708258224266e75b0236719313b9022aba4 (diff)
downloadhaskell-a5b2fded602ee8110dc75de2ec9910c36980ca24.tar.gz
nonmoving: Assert deadlock-gc promotion invariant
When performing a deadlock-detection GC we must ensure that all objects end up in the non-moving generation. Assert this in scavenge.
-rw-r--r--rts/sm/Scav.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c
index c1f3faf998..fe6dc4be54 100644
--- a/rts/sm/Scav.c
+++ b/rts/sm/Scav.c
@@ -441,6 +441,14 @@ scavenge_block (bdescr *bd)
p = bd->u.scan;
+ // Sanity check: See Note [Deadlock detection under nonmoving collector].
+#if defined(DEBUG)
+ if (RtsFlags.GcFlags.useNonmoving && deadlock_detect_gc) {
+ ASSERT(bd->gen == oldest_gen);
+ }
+#endif
+
+
// we might be evacuating into the very object that we're
// scavenging, so we have to check the real bd->free pointer each
// time around the loop.