diff options
| author | GHC GitLab CI <ghc-ci@gitlab-haskell.org> | 2020-12-07 21:48:32 +0000 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2020-12-31 15:52:14 -0500 |
| commit | 10dc5f49f0c7a043a4f21ddb1e68d40693002e8f (patch) | |
| tree | b76e9d97ad7672ab162c8ae4a0304463361c71c2 | |
| parent | 8c9061307355f020ec496a7852117ec260972b58 (diff) | |
| download | haskell-10dc5f49f0c7a043a4f21ddb1e68d40693002e8f.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.
(cherry picked from commit a5b2fded602ee8110dc75de2ec9910c36980ca24)
| -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 9fe2c6006e..cff3f4b44e 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. |
