summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/pool.c
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/pool.c
parent65e770d895b13a6e5c73d13f436872ea626e47e3 (diff)
vppinfra: vector perf improvements
Type: improvement Change-Id: I37c187af80c21b8fb1ab15af112527a837e0df9e Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/pool.c')
-rw-r--r--src/vppinfra/pool.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vppinfra/pool.c b/src/vppinfra/pool.c
index 2bbfe60d320..1f3b96f0f0a 100644
--- a/src/vppinfra/pool.c
+++ b/src/vppinfra/pool.c
@@ -44,11 +44,14 @@ _pool_init_fixed (void **pool_ptr, uword elt_size, uword max_elts, uword align)
pool_header_t *ph;
u8 *v;
u32 i;
+ vec_attr_t va = { .elt_sz = elt_size,
+ .align = align,
+ .hdr_sz = sizeof (pool_header_t) };
ASSERT (elt_size);
ASSERT (max_elts);
- v = _vec_realloc (0, max_elts, elt_size, sizeof (pool_header_t), align, 0);
+ v = _vec_alloc_internal (max_elts, &va);
ph = pool_header (v);
ph->max_elts = max_elts;