summaryrefslogtreecommitdiff
path: root/rts/Sparks.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-03-18 14:21:22 +0000
committerSimon Marlow <marlowsd@gmail.com>2011-03-18 14:21:22 +0000
commit17bfe098a9043f38d46c4fed1429d6bc20de299b (patch)
treebf13e983a39ef4fd5f1b0b330133da0669117a79 /rts/Sparks.c
parent4a2a508bb6adf33f9f3e99baa85f73f0fc18c832 (diff)
downloadhaskell-17bfe098a9043f38d46c4fed1429d6bc20de299b.tar.gz
pruneSparkQueue: handle CAFs
Diffstat (limited to 'rts/Sparks.c')
-rw-r--r--rts/Sparks.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/rts/Sparks.c b/rts/Sparks.c
index ad08f3b577..a826190941 100644
--- a/rts/Sparks.c
+++ b/rts/Sparks.c
@@ -219,19 +219,34 @@ pruneSparkQueue (Capability *cap)
pruned_sparks++; // discard spark
cap->sparks_fizzled++;
}
- } else if (HEAP_ALLOCED(spark) &&
- (Bdescr((P_)spark)->flags & BF_EVACUATED)) {
- if (closure_SHOULD_SPARK(spark)) {
- elements[botInd] = spark; // keep entry (new address)
- botInd++;
- n++;
+ } else if (HEAP_ALLOCED(spark)) {
+ if ((Bdescr((P_)spark)->flags & BF_EVACUATED)) {
+ if (closure_SHOULD_SPARK(spark)) {
+ elements[botInd] = spark; // keep entry (new address)
+ botInd++;
+ n++;
+ } else {
+ pruned_sparks++; // discard spark
+ cap->sparks_fizzled++;
+ }
} else {
pruned_sparks++; // discard spark
- cap->sparks_fizzled++;
+ cap->sparks_gcd++;
}
} else {
- pruned_sparks++; // discard spark
- cap->sparks_gcd++;
+ 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->sparks_gcd++;
+ }
+ } else {
+ pruned_sparks++; // discard spark
+ cap->sparks_fizzled++;
+ }
}
}