diff options
author | Simon Marlow <marlowsd@gmail.com> | 2008-07-23 12:52:05 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2008-07-23 12:52:05 +0000 |
commit | dc6008a61acedd3d0785111cf8955c479cb226a4 (patch) | |
tree | 2420459740a4fcdd1686f56882b4b80a158a544a /rts/Sparks.c | |
parent | 3eb8462836317d1c21bfd51969b2042fab6676cb (diff) | |
download | haskell-dc6008a61acedd3d0785111cf8955c479cb226a4.tar.gz |
Undo fix for #2185: sparks really should be treated as roots
Unless sparks are roots, strategies don't work at all: all the sparks
get GC'd. We need to think about this some more.
Diffstat (limited to 'rts/Sparks.c')
-rw-r--r-- | rts/Sparks.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/rts/Sparks.c b/rts/Sparks.c index 49f319c28b..1a839ab315 100644 --- a/rts/Sparks.c +++ b/rts/Sparks.c @@ -169,7 +169,7 @@ newSpark (StgRegTable *reg, StgClosure *p) * -------------------------------------------------------------------------- */ void -updateSparkQueue (Capability *cap) +markSparkQueue (evac_fn evac, void *user, Capability *cap) { StgClosure *spark, **sparkp, **to_sparkp; nat n, pruned_sparks; // stats only @@ -190,15 +190,16 @@ updateSparkQueue (Capability *cap) ASSERT(*sparkp!=NULL); ASSERT(LOOKS_LIKE_CLOSURE_PTR(((StgClosure *)*sparkp))); // ToDo?: statistics gathering here (also for GUM!) - spark = isAlive(*sparkp); - if (spark != NULL && closure_SHOULD_SPARK(spark)) { + evac(user,sparkp); + spark = *sparkp; + if (!closure_SHOULD_SPARK(spark)) { + pruned_sparks++; + } else{ *to_sparkp++ = spark; if (to_sparkp == pool->lim) { to_sparkp = pool->base; } n++; - } else { - pruned_sparks++; } sparkp++; if (sparkp == pool->lim) { @@ -210,7 +211,7 @@ updateSparkQueue (Capability *cap) PAR_TICKY_MARK_SPARK_QUEUE_END(n); debugTrace(DEBUG_sched, - "updated %d sparks and pruned %d sparks", + "marked %d sparks, pruned %d sparks", n, pruned_sparks); debugTrace(DEBUG_sched, |