[project @ 2005-02-11 14:01:30 by simonmar]
[ghc-hetmet.git] / ghc / rts / LdvProfile.c
index efced28..e46f4d7 100644 (file)
@@ -1,5 +1,4 @@
 /* -----------------------------------------------------------------------------
- * $Id: LdvProfile.c,v 1.3 2002/12/11 15:36:42 simonmar Exp $
  *
  * (c) The GHC Team, 2001
  * Author: Sungwoo Park
@@ -10,12 +9,9 @@
 
 #ifdef PROFILING
 
-#include "Stg.h"
 #include "Rts.h"
 #include "LdvProfile.h"
 #include "RtsFlags.h"
-#include "Itimer.h"
-#include "Proftimer.h"
 #include "Profiling.h"
 #include "Stats.h"
 #include "Storage.h"
@@ -43,6 +39,10 @@ LDV_recordDead_FILL_SLOP_DYNAMIC( StgClosure *p )
     StgInfoTable *info;
     nat nw, i;
 
+#if defined(__GNUC__) && __GNUC__ < 3 && defined(DEBUG)
+#error Please use gcc 3.0+ to compile this file with DEBUG; gcc < 3.0 miscompiles it
+#endif
+
     if (era > 0) {
        info = get_itbl((p));
        switch (info->type) {
@@ -92,7 +92,7 @@ LDV_recordDead_FILL_SLOP_DYNAMIC( StgClosure *p )
  * closure.  Returns the size of the closure, including the profiling
  * header portion, so that the caller can find the next closure.
  * ----------------------------------------------------------------------- */
-static inline nat
+STATIC_INLINE nat
 processHeapClosureForDead( StgClosure *c )
 {
     nat size;
@@ -134,7 +134,6 @@ processHeapClosureForDead( StgClosure *c )
 
     case WEAK:
     case MUT_VAR:
-    case MUT_CONS:
     case FOREIGN:
     case BCO:
     case STABLE_NAME:
@@ -190,11 +189,8 @@ processHeapClosureForDead( StgClosure *c )
        break;
 
     case IND_PERM:
-       size = sizeofW(StgInd);
-       break;
-
     case IND_OLDGEN_PERM:
-       size = sizeofW(StgIndOldGen);
+       size = sizeofW(StgInd);
        break;
 
        /*
@@ -207,11 +203,8 @@ processHeapClosureForDead( StgClosure *c )
        // because they will perish before the next census at any
        // rate.
     case IND:
-       size = sizeofW(StgInd);
-       return size;
-
     case IND_OLDGEN:
-       size = sizeofW(StgIndOldGen);
+       size = sizeofW(StgInd);
        return size;
 
     case EVACUATED: