[project @ 2003-11-17 14:28:49 by simonmar]
[ghc-hetmet.git] / ghc / rts / hooks / OutOfHeap.c
index b09dbd1..587587b 100644 (file)
@@ -1,11 +1,12 @@
 /* -----------------------------------------------------------------------------
- * $Id: OutOfHeap.c,v 1.3 1999/06/29 13:06:45 panne Exp $
+ * $Id: OutOfHeap.c,v 1.5 2003/10/31 16:22:11 sof Exp $
  *
  * User-overridable RTS hooks.
  *
  * ---------------------------------------------------------------------------*/
 
 #include "Rts.h"
+#include <stdio.h>
 
 void
 OutOfHeapHook (lnat request_size, lnat heap_size) /* both sizes in bytes */
@@ -13,7 +14,7 @@ OutOfHeapHook (lnat request_size, lnat heap_size) /* both sizes in bytes */
   /*    fprintf(stderr, "Heap exhausted;\nwhile trying to allocate %lu bytes in a %lu-byte heap;\nuse `+RTS -H<size>' to increase the total heap size.\n", */
 
   (void)request_size;   /* keep gcc -Wall happy */
-  fprintf(stderr, "Heap exhausted;\nCurrent maximum heap size is %lu bytes;\nuse `+RTS -M<size>' to increase it.\n",
-         heap_size);
+  fprintf(stderr, "Heap exhausted;\nCurrent maximum heap size is %lu bytes (%lu Mb);\nuse `+RTS -M<size>' to increase it.\n",
+         heap_size, heap_size / (1024*1024));
 }