Merge the smp and threaded RTS ways
[ghc-hetmet.git] / ghc / includes / Storage.h
index 8cfd511..a04a411 100644 (file)
@@ -140,7 +140,7 @@ extern void exitStorage(void);
                                 via allocate() since the last GC.
                                Used in the reporting of statistics.
 
-   SMP: allocate and doYouWantToGC can be used from STG code, they are
+   THREADED_RTS: allocate and doYouWantToGC can be used from STG code, they are
    surrounded by a mutex.
    -------------------------------------------------------------------------- */
 
@@ -198,11 +198,11 @@ extern void GarbageCollect(void (*get_roots)(evac_fn),rtsBool force_major_gc);
 /*
  * Storage manager mutex
  */
-#if defined(SMP)
+#if defined(THREADED_RTS)
 extern Mutex sm_mutex;
 #endif
 
-#if defined(SMP)
+#if defined(THREADED_RTS)
 #define ACQUIRE_SM_LOCK   ACQUIRE_LOCK(&sm_mutex);
 #define RELEASE_SM_LOCK   RELEASE_LOCK(&sm_mutex);
 #define ASSERT_SM_LOCK()  ASSERT_LOCK_HELD(&sm_mutex);
@@ -269,7 +269,7 @@ extern rtsBool keepCAFs;
    and is put on the mutable list.
    -------------------------------------------------------------------------- */
 
-void dirty_MUT_VAR(StgClosure *p);
+void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p);
 
 /* -----------------------------------------------------------------------------
    DEBUGGING predicates for pointers
@@ -375,6 +375,8 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info)
     case FUN_2_0:
     case CONSTR_2_0:
        return sizeofW(StgHeader) + 2;
+    case THUNK:
+       return thunk_sizeW_fromITBL(info);
     case THUNK_SELECTOR:
        return THUNK_SELECTOR_sizeW();
     case AP_STACK:
@@ -411,6 +413,7 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info)
     }
 }
 
+// The definitive way to find the size, in words, of a heap-allocated closure
 STATIC_INLINE nat
 closure_sizeW (StgClosure *p)
 {