diff options
author | GHC GitLab CI <ghc-ci@gitlab-haskell.org> | 2020-11-25 23:08:50 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-11-29 15:33:54 -0500 |
commit | e82cd140e510a792031247a8f414ade48382703b (patch) | |
tree | cd0d39a1cf73f1f508dcf94ae1509ff65238472b /rts | |
parent | e992ea84248e2ac9f9d439cd9b25745e8c41e32d (diff) | |
download | haskell-e82cd140e510a792031247a8f414ade48382703b.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.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/sm/GC.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c index 0edc5f72ca..78be848c3f 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -1701,13 +1701,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; @@ -1732,7 +1727,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); } } |