[project @ 2000-11-13 14:40:36 by simonmar]
[ghc-hetmet.git] / ghc / rts / Storage.h
index c996edf..aae36f4 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Storage.h,v 1.13 1999/11/11 11:49:26 simonmar Exp $
+ * $Id: Storage.h,v 1.17 2000/11/13 14:40:37 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -78,7 +78,7 @@ extern void PleaseStopAllocating(void);
    MarkRoot(StgClosure *p)     Returns the new location of the root.
    -------------------------------------------------------------------------- */
 
-extern void   GarbageCollect(void (*get_roots)(void));
+extern void   GarbageCollect(void (*get_roots)(void),rtsBool force_major_gc);
 extern StgClosure *MarkRoot(StgClosure *p);
 
 /* -----------------------------------------------------------------------------
@@ -104,7 +104,7 @@ recordMutable(StgMutClosure *p)
   bdescr *bd;
 
 #ifdef SMP
-  ASSERT(p->header.info == &WHITEHOLE_info || closure_MUTABLE(p));
+  ASSERT(p->header.info == &stg_WHITEHOLE_info || closure_MUTABLE(p));
 #else
   ASSERT(closure_MUTABLE(p));
 #endif
@@ -135,15 +135,15 @@ recordOldToNewPtrs(StgMutClosure *p)
     bd = Bdescr((P_)p1);                                               \
     if (bd->gen->no == 0) {                                            \
       ((StgInd *)p1)->indirectee = p2;                                 \
-      SET_INFO(p1,&IND_info);                                          \
+      SET_INFO(p1,&stg_IND_info);                                              \
       TICK_UPD_NEW_IND();                                              \
     } else {                                                           \
       ((StgIndOldGen *)p1)->indirectee = p2;                           \
-      if (info != &BLACKHOLE_BQ_info) {                                        \
+      if (info != &stg_BLACKHOLE_BQ_info) {                                    \
         ((StgIndOldGen *)p1)->mut_link = bd->gen->mut_once_list;       \
         bd->gen->mut_once_list = (StgMutClosure *)p1;                  \
       }                                                                        \
-      SET_INFO(p1,&IND_OLDGEN_info);                                   \
+      SET_INFO(p1,&stg_IND_OLDGEN_info);                                       \
       TICK_UPD_OLD_IND();                                              \
     }                                                                  \
   }
@@ -157,26 +157,44 @@ updateWithPermIndirection(const StgInfoTable *info, StgClosure *p1, StgClosure *
   bd = Bdescr((P_)p1);
   if (bd->gen->no == 0) {
     ((StgInd *)p1)->indirectee = p2;
-    SET_INFO(p1,&IND_PERM_info);
+    SET_INFO(p1,&stg_IND_PERM_info);
     TICK_UPD_NEW_PERM_IND(p1);
   } else {
     ((StgIndOldGen *)p1)->indirectee = p2;
-    if (info != &BLACKHOLE_BQ_info) {
+    if (info != &stg_BLACKHOLE_BQ_info) {
       ((StgIndOldGen *)p1)->mut_link = bd->gen->mut_once_list;
       bd->gen->mut_once_list = (StgMutClosure *)p1;
     }
-    SET_INFO(p1,&IND_OLDGEN_PERM_info);
+    SET_INFO(p1,&stg_IND_OLDGEN_PERM_info);
     TICK_UPD_OLD_PERM_IND();
   }
 }
 #endif
 
 /* -----------------------------------------------------------------------------
-   The CAF list - used to let us revert CAFs
+   The CAF table - used to let us revert CAFs
 
    -------------------------------------------------------------------------- */
 
-extern StgCAF* enteredCAFs;
+#if defined(INTERPRETER)
+typedef struct StgCAFTabEntry_ {
+    StgClosure*   closure;
+    StgInfoTable* origItbl;
+} StgCAFTabEntry;
+
+extern void addToECafTable ( StgClosure* closure, StgInfoTable* origItbl );
+extern void clearECafTable ( void );
+
+extern StgCAF*         ecafList;
+extern StgCAFTabEntry* ecafTable;
+extern StgInt          usedECafTable;
+extern StgInt          sizeECafTable;
+#endif
+
+#if defined(DEBUG)
+void printMutOnceList(generation *gen);
+void printMutableList(generation *gen);
+#endif DEBUG
 
 #endif STORAGE_H