diff options
author | GHC GitLab CI <ghc-ci@gitlab-haskell.org> | 2020-12-07 21:48:32 +0000 |
---|---|---|
committer | GHC GitLab CI <ghc-ci@gitlab-haskell.org> | 2020-12-10 04:29:25 +0000 |
commit | 4123b929e477d333290c958628d70240c4bd7521 (patch) | |
tree | ab0476b5a1b65a81572cff08434ab8a4339f81c1 | |
parent | 1abaf38a174e07cc9c3f22fb5e05490219219b84 (diff) | |
download | haskell-4123b929e477d333290c958628d70240c4bd7521.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.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index 941e3b399f..3892b04ca0 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -440,6 +440,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. |