fix a couple of bugs in markSparkQueue (#799)
authorSimon Marlow <simonmar@microsoft.com>
Fri, 23 Jun 2006 09:20:44 +0000 (09:20 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Fri, 23 Jun 2006 09:20:44 +0000 (09:20 +0000)
rts/Sparks.c

index 68ad19d..c7a1c9f 100644 (file)
@@ -129,13 +129,15 @@ markSparkQueue (evac_fn evac)
        sparkp = pool->hd;
        to_sparkp = pool->hd;
        while (sparkp != pool->tl) {
-           ASSERT(to_sparkp<=sparkp);
            ASSERT(*sparkp!=NULL);
            ASSERT(LOOKS_LIKE_CLOSURE_PTR(((StgClosure *)*sparkp)));
            // ToDo?: statistics gathering here (also for GUM!)
            if (closure_SHOULD_SPARK(*sparkp)) {
                evac(sparkp);
                *to_sparkp++ = *sparkp;
+               if (to_sparkp == pool->lim) {
+                   to_sparkp = pool->base;
+               }
                n++;
            } else {
                pruned_sparks++;