summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/fifo.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-04-04 16:49:16 +0200
committerDamjan Marion <damarion@cisco.com>2022-04-04 16:53:48 +0200
commit8b231fbe9ae6801c6ad3332207b2f8fba1693b86 (patch)
tree7cf3d5bf99cd8625e3990e024163a791249448e0 /src/vppinfra/fifo.c
parent5a7aa51f00d562814204aca7831777651a00869f (diff)
vppinfra: fix alloc and alignment in fifo
Type: fix Change-Id: Ia9f715f6074c72ff581fba1740273cfebe48c0f1 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/fifo.c')
-rw-r--r--src/vppinfra/fifo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vppinfra/fifo.c b/src/vppinfra/fifo.c
index 1ef1754bbbf..af68765f7da 100644
--- a/src/vppinfra/fifo.c
+++ b/src/vppinfra/fifo.c
@@ -77,7 +77,7 @@
*/
__clib_export void *
-_clib_fifo_resize (void *v_old, uword n_new_elts, uword elt_bytes)
+_clib_fifo_resize (void *v_old, uword n_new_elts, uword align, uword elt_bytes)
{
void *end, *head;
u8 *v_new = 0;
@@ -92,8 +92,8 @@ _clib_fifo_resize (void *v_old, uword n_new_elts, uword elt_bytes)
else
n_new_elts = max_pow2 (n_new_elts);
- vec_alloc_ha (v_new, n_new_elts * elt_bytes, sizeof (clib_fifo_header_t), 0);
- _vec_len (v_new) = n_new_elts;
+ v_new = _vec_realloc (0, n_new_elts, elt_bytes, sizeof (clib_fifo_header_t),
+ align, 0);
f_new = clib_fifo_header (v_new);
f_new->head_index = 0;