aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/ring.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-04-11 18:41:49 +0200
committerFlorin Coras <florin.coras@gmail.com>2022-04-12 22:40:52 +0000
commite4fa1d2f6b8721318c0f104f2615588b5d4e0441 (patch)
tree70d33a24bae0b9aa993fe6e03960e2b135accb70 /src/vppinfra/ring.h
parent65e770d895b13a6e5c73d13f436872ea626e47e3 (diff)
vppinfra: vector perf improvements
Type: improvement Change-Id: I37c187af80c21b8fb1ab15af112527a837e0df9e Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/ring.h')
-rw-r--r--src/vppinfra/ring.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/vppinfra/ring.h b/src/vppinfra/ring.h
index d7e19156482..8527fdb5978 100644
--- a/src/vppinfra/ring.h
+++ b/src/vppinfra/ring.h
@@ -37,12 +37,11 @@ clib_ring_new_inline (void **p, u32 elt_bytes, u32 size, u32 align)
{
void *v;
clib_ring_header_t *h;
+ vec_attr_t va = { .elt_sz = elt_bytes,
+ .hdr_sz = sizeof (clib_ring_header_t),
+ .align = align };
- v = _vec_realloc (0,
- /* length increment */ size,
- /* data bytes */ elt_bytes,
- /* header bytes */ sizeof (h[0]),
- /* data align */ align, 0);
+ v = _vec_alloc_internal (size, &va);
h = clib_ring_header (v);
h->next = 0;