[project @ 2001-07-19 07:28:00 by andy]
[ghc-hetmet.git] / ghc / rts / Storage.c
index eb9e989..b2f9593 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Storage.c,v 1.35 2001/01/31 11:04:29 simonmar Exp $
+ * $Id: Storage.c,v 1.39 2001/07/19 07:28:00 andy Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -68,6 +68,10 @@ initStorage (void)
    * fixed-size allocation area so that we get roughly even-spaced
    * samples.
    */
+
+  /* As an experiment, try a 2 generation collector
+   */
+
 #if defined(PROFILING) || defined(DEBUG)
   if (RtsFlags.ProfFlags.doHeapProfile) {
     RtsFlags.GcFlags.generations = 1;
@@ -249,7 +253,6 @@ newCAF(StgClosure* caf)
    */
   ACQUIRE_LOCK(&sm_mutex);
 
-#ifdef GHCI
   if (is_dynamically_loaded_rwdata_ptr((StgPtr)caf)) {
       ((StgIndStatic *)caf)->saved_info  = (StgInfoTable *)caf->header.info;
       ((StgIndStatic *)caf)->static_link = caf_list;
@@ -259,13 +262,17 @@ newCAF(StgClosure* caf)
       ((StgMutClosure *)caf)->mut_link = oldest_gen->mut_once_list;
       oldest_gen->mut_once_list = (StgMutClosure *)caf;
   }
-#else
-  ASSERT( ((StgMutClosure*)caf)->mut_link == NULL );
-  ((StgMutClosure *)caf)->mut_link = oldest_gen->mut_once_list;
-  oldest_gen->mut_once_list = (StgMutClosure *)caf;
-#endif
 
   RELEASE_LOCK(&sm_mutex);
+
+#ifdef PAR
+  /* If we are PAR or DIST then  we never forget a CAF */
+  { globalAddr *newGA;
+    //belch("<##> Globalising CAF %08x %s",caf,info_type(caf));
+    newGA=makeGlobal(caf,rtsTrue); /*given full weight*/
+    ASSERT(newGA);
+  } 
+#endif /* PAR */
 }
 
 /* -----------------------------------------------------------------------------