aboutsummaryrefslogtreecommitdiff
path: root/include/util/mempool.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-06-26 16:45:52 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-07-08 19:17:35 +0200
commit2087cc237cd0fe1ed29ebf891648bacb46f4833b (patch)
treeede4ba232bea36d8fc670ce360514927a2400bc7 /include/util/mempool.h
parentaed35c78c6a51a4b4c37ebda5643d2246842fb74 (diff)
Cleanup: move libutil headers to sub directory
Move all the libutil stuff from the toplevel include/ to a util/ sub directory and fix up the includes that make use of them. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/util/mempool.h')
-rw-r--r--include/util/mempool.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/util/mempool.h b/include/util/mempool.h
new file mode 100644
index 0000000..c946c31
--- /dev/null
+++ b/include/util/mempool.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: LGPL-3.0-or-later */
+/*
+ * mempool.h
+ *
+ * Copyright (C) 2021 David Oberhollenzer <goliath@infraroot.at>
+ */
+#ifndef MEMPOOL_H
+#define MEMPOOL_H
+
+#include "compat.h"
+#include "sqfs/predef.h"
+
+typedef struct mem_pool_t mem_pool_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SQFS_INTERNAL mem_pool_t *mem_pool_create(size_t obj_size);
+
+SQFS_INTERNAL void mem_pool_destroy(mem_pool_t *mem);
+
+SQFS_INTERNAL void *mem_pool_allocate(mem_pool_t *mem);
+
+SQFS_INTERNAL void mem_pool_free(mem_pool_t *mem, void *ptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MEMPOOL_H */