]> git.ozlabs.org Git - ccan/blobdiff - ccan/alloc/tiny.h
alloc: first cut of tiny allocator (down to 2 bytes!)
[ccan] / ccan / alloc / tiny.h
diff --git a/ccan/alloc/tiny.h b/ccan/alloc/tiny.h
new file mode 100644 (file)
index 0000000..37922d9
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef CCAN_TINY_H
+#define CCAN_TINY_H
+#include <stdbool.h>
+#include <stdio.h>
+
+void tiny_alloc_init(void *pool, unsigned long poolsize);
+void *tiny_alloc_get(void *pool, unsigned long poolsize,
+                    unsigned long size, unsigned long align);
+void tiny_alloc_free(void *pool, unsigned long poolsize, void *free);
+unsigned long tiny_alloc_size(void *pool, unsigned long poolsize, void *p);
+bool tiny_alloc_check(void *pool, unsigned long poolsize);
+void tiny_alloc_visualize(FILE *out, void *pool, unsigned long poolsize);
+
+#endif /* CCAN_TINY_H */