summaryrefslogtreecommitdiffstats
path: root/lib/liballoc/include
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2024-10-02 03:59:21 +0200
committerLouis Burda <quent.burda@gmail.com>2024-10-02 03:59:21 +0200
commit36c8d24c07ef3c6658f397fd156396f83b35ac27 (patch)
tree1b3293264dca677a8d8e1ca44061aa7af191f839 /lib/liballoc/include
parenteff49100e4fca394a23973abd5001a4fde15d6e8 (diff)
downloadtabular-master.tar.gz
tabular-master.zip
Vendor subgit modulesHEADmaster
Diffstat (limited to 'lib/liballoc/include')
-rw-r--r--lib/liballoc/include/allocator.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/liballoc/include/allocator.h b/lib/liballoc/include/allocator.h
new file mode 100644
index 0000000..fc9a13d
--- /dev/null
+++ b/lib/liballoc/include/allocator.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <stddef.h>
+
+struct allocator {
+ void *(*alloc)(const struct allocator *allocator,
+ size_t size, int *rc);
+ void *(*realloc)(const struct allocator *allocator,
+ void *p, size_t size, int *rc);
+ int (*free)(const struct allocator *allocator, void *p);
+};
+
+struct strict_allocator {
+ const struct allocator *allocator_ul;
+ struct allocator allocator;
+};
+
+void strict_allocator_init(struct strict_allocator *strict_allocator_init,
+ const struct allocator *allocator_ul);
+
+extern const struct allocator stdlib_heap_allocator;
+extern const struct allocator stdlib_strict_heap_allocator;