aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/mem.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-12-22 14:58:56 +0100
committerDamjan Marion <damarion@cisco.com>2020-12-22 21:58:30 +0100
commit0da8168423349dfb1852d4708d67014de36748b8 (patch)
tree92a216775f99f26442afcd83f3baf73d928e753f /src/vppinfra/mem.h
parent9d7d599ca160bbd31b77e1f77b9d0b2c2db5afb2 (diff)
vppinfra: add bulk memory allocator
Small fixed size object memory allocator. Type: improvement Change-Id: I727705d9d4292b6b38d41e239871103b15aa9038 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/mem.h')
-rw-r--r--src/vppinfra/mem.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vppinfra/mem.h b/src/vppinfra/mem.h
index aba29bc0071..1cab0ae7252 100644
--- a/src/vppinfra/mem.h
+++ b/src/vppinfra/mem.h
@@ -555,6 +555,15 @@ clib_mem_get_last_error (void)
return clib_mem_main.error;
}
+/* bulk allocator */
+
+typedef void *clib_mem_bulk_handle_t;
+clib_mem_bulk_handle_t clib_mem_bulk_init (u32 elt_sz, u32 align,
+ u32 min_elts_per_chunk);
+void clib_mem_bulk_destroy (clib_mem_bulk_handle_t h);
+void *clib_mem_bulk_alloc (clib_mem_bulk_handle_t h);
+void clib_mem_bulk_free (clib_mem_bulk_handle_t h, void *p);
+u8 *format_clib_mem_bulk (u8 *s, va_list *args);
#include <vppinfra/error.h> /* clib_panic */