vppinfra: add cmake option to grow vectors by 1
For debugging. Do not set this option in production.
Type: feature
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I5e59671c4932e064bc087b85bf9c62c6f3bf48cf
diff --git a/src/vppinfra/vec.c b/src/vppinfra/vec.c
index 2ee7895..05a557e 100644
--- a/src/vppinfra/vec.c
+++ b/src/vppinfra/vec.c
@@ -95,9 +95,13 @@
return v;
}
+#if CLIB_VECTOR_GROW_BY_ONE > 0
+ new_alloc_bytes = data_bytes;
+#else
new_alloc_bytes = (old_alloc_bytes * 3) / 2;
if (new_alloc_bytes < data_bytes)
new_alloc_bytes = data_bytes;
+#endif
new =
clib_mem_alloc_aligned_at_offset (new_alloc_bytes, data_align,