aboutsummaryrefslogtreecommitdiff
path: root/src/alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.h')
-rw-r--r--src/alloc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/alloc.h b/src/alloc.h
new file mode 100644
index 0000000..8e8b365
--- /dev/null
+++ b/src/alloc.h
@@ -0,0 +1,11 @@
+#ifndef ORYX_ALLOC_H
+#define ORYX_ALLOC_H
+
+#include <stddef.h>
+
+/* Allocate a buffer of NMEMB elements of size SIZE. If PTR is non-null then
+ reallocate the buffer it points to. Aborts on out-of-memory or overflow. */
+void *bufalloc(void *ptr, size_t nmemb, size_t size)
+ __attribute__((returns_nonnull));
+
+#endif /* !ORYX_ALLOC_H */