Don't GC sparks for CAFs
authorSimon Marlow <marlowsd@gmail.com>
Fri, 10 Jun 2016 16:07:13 +0000 (17:07 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 14 Jun 2016 15:24:56 +0000 (16:24 +0100)
We can't tell whether the CAF is actually garbage or not.

rts/Sparks.c

index e0b2e66..ecd3c38 100644 (file)
@@ -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++;