[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git] / ghc / rts / hooks / MallocFail.c
diff --git a/ghc/rts/hooks/MallocFail.c b/ghc/rts/hooks/MallocFail.c
new file mode 100644 (file)
index 0000000..01f534e
--- /dev/null
@@ -0,0 +1,15 @@
+/* -----------------------------------------------------------------------------
+ * $Id: MallocFail.c,v 1.2 1998/12/02 13:29:12 simonm Exp $
+ *
+ * User-overridable RTS hooks.
+ *
+ * ---------------------------------------------------------------------------*/
+
+#include "Rts.h"
+
+void
+MallocFailHook (lnat request_size /* in bytes */, char *msg)
+{
+    fprintf(stderr, "malloc: failed on request for %lu bytes; message: %s\n", request_size, msg);
+}
+