aboutsummaryrefslogtreecommitdiffstats
path: root/common/almalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/almalloc.h')
-rw-r--r--common/almalloc.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/almalloc.h b/common/almalloc.h
new file mode 100644
index 00000000..8eadb5b3
--- /dev/null
+++ b/common/almalloc.h
@@ -0,0 +1,21 @@
+#ifndef AL_MALLOC_H
+#define AL_MALLOC_H
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Minimum alignment required by posix_memalign. */
+#define DEF_ALIGN sizeof(void*)
+
+void *al_malloc(size_t alignment, size_t size);
+void *al_calloc(size_t alignment, size_t size);
+void al_free(void *ptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AL_MALLOC_H */