summaryrefslogtreecommitdiff
path: root/rts/sm/GC.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-03-02 18:13:52 -0500
committerBen Gamari <ben@smart-cactus.org>2020-03-04 12:56:40 -0500
commit92bc36885a8866714fce5cb44e298562ac29b5b8 (patch)
tree63771e09bb27a2bcf04f30ce21c93cb7df5b7d17 /rts/sm/GC.c
parent2bf7b5b54065a6aa6ab7e70a9b5ba87aed1c84cf (diff)
downloadhaskell-wip/gc-backports.tar.gz
nonmoving: Fix collection of sparkswip/gc-backports
Previously sparks living in the non-moving heap would be promptly GC'd by the minor collector since pruneSparkQueue uses the BF_EVACUATED flag, which non-moving heap blocks do not have set. Fix this by implementing proper support in pruneSparkQueue for determining reachability in the non-moving heap. The story is told in Note [Spark management in the nonmoving heap].
Diffstat (limited to 'rts/sm/GC.c')
-rw-r--r--rts/sm/GC.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 83e9c97bd9..62c0f3ed42 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -462,12 +462,12 @@ GarbageCollect (uint32_t collect_gen,
#if defined(THREADED_RTS)
if (n_gc_threads == 1) {
for (n = 0; n < n_capabilities; n++) {
- pruneSparkQueue(capabilities[n]);
+ pruneSparkQueue(false, capabilities[n]);
}
} else {
for (n = 0; n < n_capabilities; n++) {
if (n == cap->no || idle_cap[n]) {
- pruneSparkQueue(capabilities[n]);
+ pruneSparkQueue(false, capabilities[n]);
}
}
}
@@ -1239,7 +1239,7 @@ gcWorkerThread (Capability *cap)
// non-deterministic whether a spark will be retained if it is
// only reachable via weak pointers. To fix this problem would
// require another GC barrier, which is too high a price.
- pruneSparkQueue(cap);
+ pruneSparkQueue(false, cap);
#endif
// Wait until we're told to continue