summaryrefslogtreecommitdiff
path: root/ghc/runtime/hooks/OutOfHeap.lc
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/runtime/hooks/OutOfHeap.lc')
-rw-r--r--ghc/runtime/hooks/OutOfHeap.lc13
1 files changed, 13 insertions, 0 deletions
diff --git a/ghc/runtime/hooks/OutOfHeap.lc b/ghc/runtime/hooks/OutOfHeap.lc
new file mode 100644
index 0000000000..22d2b4a4e4
--- /dev/null
+++ b/ghc/runtime/hooks/OutOfHeap.lc
@@ -0,0 +1,13 @@
+\begin{code}
+#include "rtsdefs.h"
+
+void
+OutOfHeapHook (request_size, heap_size)
+ W_ request_size; /* in bytes */
+ W_ heap_size; /* 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",
+ request_size,
+ heap_size);
+}
+\end{code}