mem-pool: add life cycle management functions
[gitweb.git] / mem-pool.h
index 829ad58ecfc48ce7ebbd707e833e933c87eb0d44..f75b3365d5c5d3e6f8b2b1601ef2abc4c54c1749 100644 (file)
@@ -21,6 +21,16 @@ struct mem_pool {
        size_t pool_alloc;
 };
 
+/*
+ * Initialize mem_pool with specified initial size.
+ */
+void mem_pool_init(struct mem_pool **mem_pool, size_t initial_size);
+
+/*
+ * Discard a memory pool and free all the memory it is responsible for.
+ */
+void mem_pool_discard(struct mem_pool *mem_pool);
+
 /*
  * Alloc memory from the mem_pool.
  */