FIX BUILD (non-profiling RTS was broken in previous patch)
[ghc-hetmet.git] / rts / ProfHeap.c
index dfa0067..e8966ec 100644 (file)
@@ -377,7 +377,7 @@ nextEra( void )
  * Heap profiling by info table
  * ------------------------------------------------------------------------- */
 
-#if !defined(PROFILNG)
+#if !defined(PROFILING)
 FILE *hp_file;
 static char *hp_filename;
 
@@ -523,12 +523,19 @@ endHeapProfiling(void)
     }
 #endif
 
-    {
+#ifdef PROFILING
+    if (doingLDVProfiling()) {
         nat t;
-        for (t = 0; t <= era; t++) {
+        for (t = 1; t <= era; t++) {
             freeEra( &censuses[t] );
         }
+    } else {
+        freeEra( &censuses[0] );
     }
+#else
+    freeEra( &censuses[0] );
+#endif
+
     stgFree(censuses);
 
     seconds = mut_user_time();