[project @ 2005-11-04 12:02:04 by simonmar]
[ghc-hetmet.git] / ghc / rts / Storage.c
index 7b46021..e44348f 100644 (file)
@@ -56,7 +56,7 @@ step *nurseries         = NULL; /* array of nurseries, >1 only if SMP */
  * simultaneous access by two STG threads.
  */
 #ifdef SMP
-Mutex sm_mutex = INIT_MUTEX_VAR;
+Mutex sm_mutex;
 #endif
 
 /*
@@ -672,7 +672,7 @@ allocateLocal (Capability *cap, nat n)
                cap->r.rNursery->n_blocks++;
                RELEASE_SM_LOCK;
                bd->gen_no = 0;
-               bd->step = g0s0;
+               bd->step = cap->r.rNursery;
                bd->flags = 0;
            } else {
                // we have a block in the nursery: take it and put
@@ -980,6 +980,11 @@ memInventory(void)
   /* count the blocks we current have */
 
   for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
+      for (i = 0; i < n_capabilities; i++) {
+         for (bd = capabilities[i].mut_lists[g]; bd != NULL; bd = bd->link) {
+             total_blocks += bd->blocks;
+         }
+      }          
       for (bd = generations[g].mut_list; bd != NULL; bd = bd->link) {
          total_blocks += bd->blocks;
       }