diff options
Diffstat (limited to 'rts/Sparks.c')
-rw-r--r-- | rts/Sparks.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/rts/Sparks.c b/rts/Sparks.c index 3911ae9e0b..93f641757e 100644 --- a/rts/Sparks.c +++ b/rts/Sparks.c @@ -112,7 +112,7 @@ tryStealSpark (Capability *cap) * -------------------------------------------------------------------------- */ void -pruneSparkQueue (evac_fn evac, void *user, Capability *cap) +pruneSparkQueue (Capability *cap) { SparkPool *pool; StgClosurePtr spark, tmp, *elements; @@ -208,17 +208,21 @@ pruneSparkQueue (evac_fn evac, void *user, Capability *cap) pruned_sparks++; // discard spark cap->sparks_pruned++; } - } else { - if (!(closure_flags[INFO_PTR_TO_STRUCT(info)->type] & _NS)) { + } else if (HEAP_ALLOCED(spark) && + (Bdescr(spark)->flags & BF_EVACUATED)) { + if (closure_SHOULD_SPARK(spark)) { elements[botInd] = spark; // keep entry (new address) - evac (user, &elements[botInd]); botInd++; n++; } else { pruned_sparks++; // discard spark cap->sparks_pruned++; } + } else { + pruned_sparks++; // discard spark + cap->sparks_pruned++; } + currInd++; // in the loop, we may reach the bounds, and instantly wrap around |