aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vec_bootstrap.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/vec_bootstrap.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/vec_bootstrap.h')
-rw-r--r--src/vppinfra/vec_bootstrap.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vppinfra/vec_bootstrap.h b/src/vppinfra/vec_bootstrap.h
index 304ea2dee1a..d6451f3d172 100644
--- a/src/vppinfra/vec_bootstrap.h
+++ b/src/vppinfra/vec_bootstrap.h
@@ -56,7 +56,8 @@ typedef struct
{
u32 len; /**< Number of elements in vector (NOT its allocated length). */
u8 hdr_size; /**< header size divided by VEC_MIN_ALIGN */
- u8 log2_align; /**< data alignment */
+ u8 log2_align : 7; /**< data alignment */
+ u8 default_heap : 1; /**< vector uses default heap */
u8 vpad[2]; /**< pad to 8 bytes */
u8 vector_data[0]; /**< Vector data . */
} vec_header_t;
@@ -72,6 +73,7 @@ typedef struct
@return pointer to the vector's vector_header_t
*/
#define _vec_find(v) ((vec_header_t *) (v) - 1)
+#define _vec_heap(v) (((void **) (_vec_find (v)))[-1])
always_inline uword __vec_align (uword data_align, uword configuered_align);
always_inline uword __vec_elt_sz (uword elt_sz, int is_void);