Fix space problems in ghci
[ghc-hetmet.git] / rts / RtsUtils.c
index dda9660..ed082a3 100644 (file)
@@ -110,8 +110,8 @@ shutdownAllocator(void)
         free(prev);
         if (a == NULL) return;
         IF_DEBUG(sanity,
-                 debugBelch("Warning: %p still allocated at shutdown\n",
-                            a->addr);)
+                 debugBelch("Warning: %ld bytes at %p still allocated at shutdown\n",
+                            (long)a->len, a->addr);)
         prev = a;
     }
 }
@@ -465,3 +465,13 @@ void printRtsInfo(void) {
     printf(" ]\n");
 }
 
+// Provides a way for Haskell programs to tell whether they're being
+// profiled or not.  GHCi uses it (see #2197).
+int rts_isProfiled(void)
+{
+#ifdef PROFILING
+    return 1;
+#else
+    return 0;
+#endif
+}