summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/mem.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-03-31 15:12:20 +0200
committerFlorin Coras <florin.coras@gmail.com>2022-03-31 20:50:21 +0000
commit2473858233ef1c62f8c3a10395449c3ea975fe33 (patch)
tree6a167b471c00e9c07694af691a3f31fc711b11a1 /src/vppinfra/mem.h
parent4b20830b496ade3f1e77cd5fcbdf6d6c7bb5336d (diff)
vppinfra: vectors with non-default heap
Type: improvement Change-Id: Ic675ad4edbf27b7230fc2a77f00c90c46d6350c3 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/mem.h')
-rw-r--r--src/vppinfra/mem.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/vppinfra/mem.h b/src/vppinfra/mem.h
index 1a813be68b6..e33ab37e877 100644
--- a/src/vppinfra/mem.h
+++ b/src/vppinfra/mem.h
@@ -223,6 +223,22 @@ void *clib_mem_alloc_or_null (uword size);
void *clib_mem_alloc_aligned_or_null (uword size, uword align);
void *clib_mem_realloc (void *p, uword new_size);
void *clib_mem_realloc_aligned (void *p, uword new_size, uword align);
+uword clib_mem_is_heap_object (void *p);
+void clib_mem_free (void *p);
+
+void *clib_mem_heap_alloc (void *heap, uword size);
+void *clib_mem_heap_alloc_aligned (void *heap, uword size, uword align);
+void *clib_mem_heap_alloc_or_null (void *heap, uword size);
+void *clib_mem_heap_alloc_aligned_or_null (void *heap, uword size,
+ uword align);
+void *clib_mem_heap_realloc (void *heap, void *p, uword new_size);
+void *clib_mem_heap_realloc_aligned (void *heap, void *p, uword new_size,
+ uword align);
+uword clib_mem_heap_is_heap_object (void *heap, void *p);
+void clib_mem_heap_free (void *heap, void *p);
+
+uword clib_mem_size (void *p);
+void clib_mem_free_s (void *p);
/* Memory allocator which panics when it fails.
Use macro so that clib_panic macro can expand __FUNCTION__ and __LINE__. */
@@ -241,11 +257,6 @@ void *clib_mem_realloc_aligned (void *p, uword new_size, uword align);
/* Alias to stack allocator for naming consistency. */
#define clib_mem_alloc_stack(bytes) __builtin_alloca(bytes)
-uword clib_mem_is_heap_object (void *p);
-void clib_mem_free (void *p);
-uword clib_mem_size (void *p);
-void clib_mem_free_s (void *p);
-
always_inline clib_mem_heap_t *
clib_mem_get_heap (void)
{