aboutsummaryrefslogtreecommitdiffstats
path: root/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'mem.c')
-rw-r--r--mem.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mem.c b/mem.c
new file mode 100644
index 0000000..ff76b08
--- /dev/null
+++ b/mem.c
@@ -0,0 +1,16 @@
+#include "mem.h"
+
+#include <curses.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+#include "err.h"
+
+void *xmalloc(size_t size) {
+ void *rtn = malloc(size);
+ if (!rtn) {
+ endwin();
+ die("Out of memory");
+ }
+ return rtn;
+}