summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/pool.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vppinfra/pool.h b/src/vppinfra/pool.h
index ef816096ff0..ea22af4a68b 100644
--- a/src/vppinfra/pool.h
+++ b/src/vppinfra/pool.h
@@ -295,8 +295,9 @@ _pool_put_index (void *p, uword index, uword elt_sz)
/* Preallocated pool? */
if (ph->max_elts)
{
- ph->free_indices[_vec_len (ph->free_indices)] = index;
- vec_inc_len (ph->free_indices, 1);
+ u32 len = _vec_len (ph->free_indices);
+ vec_set_len (ph->free_indices, len + 1);
+ ph->free_indices[len] = index;
}
else
vec_add1 (ph->free_indices, index);