cache bd->todo_bd->free and the limit in the workspace
[ghc-hetmet.git] / rts / sm / Scav.c
index 3f68efb..7ee97c9 100644 (file)
@@ -275,7 +275,7 @@ linear_scan:
        info = get_itbl((StgClosure *)p);
        
        q = p;
-       switch (info->type) {
+        switch (((volatile StgWord *)info)[1] & 0xffff) {
            
         case MVAR_CLEAN:
         case MVAR_DIRTY:
@@ -1469,6 +1469,11 @@ scavenge_find_local_work (void)
            }
            ws = &gct->steps[g][s];
 
+            if (ws->todo_bd != NULL)
+            {
+                ws->todo_bd->free = ws->todo_free;
+            }
+
            // If we have a todo block and no scan block, start
            // scanning the todo block.
            if (ws->scan_bd == NULL && ws->todo_bd != NULL)