summaryrefslogtreecommitdiff
path: root/ccc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ccc.c')
-rw-r--r--ccc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ccc.c b/ccc.c
new file mode 100644
index 0000000..ca4eba1
--- /dev/null
+++ b/ccc.c
@@ -0,0 +1,12 @@
+#include "ccc.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+void* ccc_alloc(integral_t sz) {
+ void* ptr = calloc(1, sz);
+ if (ptr == NULL) {
+ fprintf(stderr, "ccc: out of memory\n");
+ exit(1);
+ }
+ return ptr;
+}