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;
}
}
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
+}