we don't have a gcc-lib in LIB_DIR any more
[ghc-hetmet.git] / rts / sm / Storage.c
index 0234400..34cdab1 100644 (file)
@@ -177,8 +177,8 @@ initStorage( void )
   allocNurseries();
 
   weak_ptr_list = NULL;
-  caf_list = NULL;
-  revertible_caf_list = NULL;
+  caf_list = END_OF_STATIC_LIST;
+  revertible_caf_list = END_OF_STATIC_LIST;
    
   /* initialise the allocate() interface */
   alloc_blocks_lim = RtsFlags.GcFlags.minAllocAreaSize;
@@ -231,9 +231,8 @@ freeStorage (void)
      
       - builds a BLACKHOLE in the heap
       - pushes an update frame pointing to the BLACKHOLE
-      - invokes UPD_CAF(), which:
-          - calls newCaf, below
-         - updates the CAF with a static indirection to the BLACKHOLE
+      - calls newCaf, below
+      - updates the CAF with a static indirection to the BLACKHOLE
       
    Why do we build an BLACKHOLE in the heap rather than just updating
    the thunk directly?  It's so that we only need one kind of update
@@ -291,7 +290,9 @@ newCAF(StgRegTable *reg, StgClosure* caf)
   {
     // Put this CAF on the mutable list for the old generation.
     ((StgIndStatic *)caf)->saved_info = NULL;
-    recordMutableCap(caf, regTableToCapability(reg), oldest_gen->no);
+    if (oldest_gen->no != 0) {
+        recordMutableCap(caf, regTableToCapability(reg), oldest_gen->no);
+    }
   }
 }
 
@@ -722,6 +723,16 @@ setTSOLink (Capability *cap, StgTSO *tso, StgTSO *target)
 }
 
 void
+setTSOPrev (Capability *cap, StgTSO *tso, StgTSO *target)
+{
+    if (tso->dirty == 0 && (tso->flags & TSO_LINK_DIRTY) == 0) {
+        tso->flags |= TSO_LINK_DIRTY;
+        recordClosureMutated(cap,(StgClosure*)tso);
+    }
+    tso->block_info.prev = target;
+}
+
+void
 dirty_TSO (Capability *cap, StgTSO *tso)
 {
     if (tso->dirty == 0 && (tso->flags & TSO_LINK_DIRTY) == 0) {