summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vec_bootstrap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/vec_bootstrap.h')
-rw-r--r--src/vppinfra/vec_bootstrap.h28
1 files changed, 4 insertions, 24 deletions
diff --git a/src/vppinfra/vec_bootstrap.h b/src/vppinfra/vec_bootstrap.h
index 34e50c9edb1..5dc1b6af540 100644
--- a/src/vppinfra/vec_bootstrap.h
+++ b/src/vppinfra/vec_bootstrap.h
@@ -89,7 +89,6 @@ always_inline uword
vec_get_header_size (void *v)
{
uword header_size = _vec_find (v)->hdr_size * VEC_HEADER_ROUND;
- ASSERT (header_size >= vec_header_bytes (0));
return header_size;
}
@@ -100,9 +99,9 @@ vec_get_header_size (void *v)
*/
always_inline void *
-vec_header (void *v, uword header_bytes)
+vec_header (void *v)
{
- return v - vec_header_bytes (header_bytes);
+ return v ? v - vec_get_header_size (v) : 0;
}
/** \brief Find the end of user vector header
@@ -112,30 +111,11 @@ vec_header (void *v, uword header_bytes)
*/
always_inline void *
-vec_header_end (void *v, uword header_bytes)
+vec_header_end (void *v)
{
- return v + vec_header_bytes (header_bytes);
+ return v + vec_get_header_size (v);
}
-always_inline uword
-vec_aligned_header_bytes (uword header_bytes, uword align)
-{
- return round_pow2 (header_bytes + sizeof (vec_header_t), align);
-}
-
-always_inline void *
-vec_aligned_header (void *v, uword header_bytes, uword align)
-{
- return v - vec_aligned_header_bytes (header_bytes, align);
-}
-
-always_inline void *
-vec_aligned_header_end (void *v, uword header_bytes, uword align)
-{
- return v + vec_aligned_header_bytes (header_bytes, align);
-}
-
-
/** \brief Number of elements in vector (lvalue-capable)
_vec_len (v) does not check for null, but can be used as an lvalue