summaryrefslogtreecommitdiff
path: root/runtime/calloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/calloc.c')
-rw-r--r--runtime/calloc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/runtime/calloc.c b/runtime/calloc.c
new file mode 100644
index 0000000..2526ceb
--- /dev/null
+++ b/runtime/calloc.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+void * compcert_alloc(int sz)
+{
+ void * res = malloc(sz);
+ if (res == NULL) {
+ fprintf(stderr, "Out of memory in compcert_alloc().\n");
+ abort();
+ }
+ return res;
+}