summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2020-11-25 23:08:50 +0000
committerGHC GitLab CI <ghc-ci@gitlab-haskell.org>2020-12-07 15:11:57 +0000
commitef241371de7c4546b3ad45d7d190965be735f998 (patch)
tree33a40de05b2feec312611f7271167cc766f5ceab
parentd7e4813cae8c4f37135ffb8f6b979eec8da8abf2 (diff)
downloadhaskell-ef241371de7c4546b3ad45d7d190965be735f998.tar.gz
nonmoving: Fix regression from TSAN work
The TSAN rework (specifically aad1f803) introduced a subtle regression in GC.c, swapping `g0` in place of `gen`. Whoops! Fixes #18997. (cherry picked from commit 21c807df67afe1aee7bf4a964a00cc78ef19e00f)
-rw-r--r--rts/sm/GC.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 6c947f06a9..7a6345f469 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -1689,13 +1689,8 @@ collect_gct_blocks (void)
static void
collect_pinned_object_blocks (void)
{
- generation *gen;
const bool use_nonmoving = RtsFlags.GcFlags.useNonmoving;
- if (use_nonmoving && major_gc) {
- gen = oldest_gen;
- } else {
- gen = g0;
- }
+ generation *const gen = (use_nonmoving && major_gc) ? oldest_gen : g0;
for (uint32_t n = 0; n < n_capabilities; n++) {
bdescr *last = NULL;
@@ -1720,7 +1715,7 @@ collect_pinned_object_blocks (void)
if (gen->large_objects != NULL) {
gen->large_objects->u.back = last;
}
- g0->large_objects = RELAXED_LOAD(&capabilities[n]->pinned_object_blocks);
+ gen->large_objects = RELAXED_LOAD(&capabilities[n]->pinned_object_blocks);
RELAXED_STORE(&capabilities[n]->pinned_object_blocks, NULL);
}
}