diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-03-18 14:21:22 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-03-18 14:21:22 +0000 |
commit | 17bfe098a9043f38d46c4fed1429d6bc20de299b (patch) | |
tree | bf13e983a39ef4fd5f1b0b330133da0669117a79 /rts/Sparks.c | |
parent | 4a2a508bb6adf33f9f3e99baa85f73f0fc18c832 (diff) | |
download | haskell-17bfe098a9043f38d46c4fed1429d6bc20de299b.tar.gz |
pruneSparkQueue: handle CAFs
Diffstat (limited to 'rts/Sparks.c')
-rw-r--r-- | rts/Sparks.c | 33 |
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++; + } } } |