summaryrefslogtreecommitdiffstats
path: root/malloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'malloc.h')
-rw-r--r--malloc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/malloc.h b/malloc.h
new file mode 100644
index 0000000..df459ed
--- /dev/null
+++ b/malloc.h
@@ -0,0 +1,16 @@
+#ifndef foomallochfoo
+#define foomallochfoo
+
+#include <stdlib.h>
+#include <string.h>
+
+#define sa_malloc malloc
+#define sa_free free
+#define sa_malloc0(size) calloc(1, (size))
+#define sa_strdup strdup
+
+void* sa_memdup(const void* p, size_t size);
+
+#define sa_new(t, n) ((t*) sa_malloc(sizeof(t)*n))
+
+#endif