[commit: ghc] ghc-8.0: Don't GC sparks for CAFs (381d451)

git at git.haskell.org git at git.haskell.org
Wed Aug 24 23:14:50 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/381d451f67e8aecb39bd08db2182ee93138f7ea7/ghc

>---------------------------------------------------------------

commit 381d451f67e8aecb39bd08db2182ee93138f7ea7
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Fri Jun 10 17:07:13 2016 +0100

    Don't GC sparks for CAFs
    
    We can't tell whether the CAF is actually garbage or not.
    
    (cherry picked from commit 23b73c97312e4d812812ed25a6396fff44d1da28)


>---------------------------------------------------------------

381d451f67e8aecb39bd08db2182ee93138f7ea7
 rts/Sparks.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/rts/Sparks.c b/rts/Sparks.c
index ec07580..85b59d0 100644
--- a/rts/Sparks.c
+++ b/rts/Sparks.c
@@ -211,15 +211,12 @@ pruneSparkQueue (Capability *cap)
               }
           } else {
               if (INFO_PTR_TO_STRUCT(info)->type == THUNK_STATIC) {
-                  if (*THUNK_STATIC_LINK(spark) != NULL) {
-                      elements[botInd] = spark; // keep entry (new address)
-                      botInd++;
-                      n++;
-                  } else {
-                      pruned_sparks++; // discard spark
-                      cap->spark_stats.gcd++;
-                      traceEventSparkGC(cap);
-                  }
+                  // We can't tell whether a THUNK_STATIC is garbage or not.
+                  // See also Note [STATIC_LINK fields]
+                  // isAlive() also ignores static closures (see GCAux.c)
+                  elements[botInd] = spark; // keep entry (new address)
+                  botInd++;
+                  n++;
               } else {
                   pruned_sparks++; // discard spark
                   cap->spark_stats.fizzled++;



More information about the ghc-commits mailing list