summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vec.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-02-10 10:16:40 -0500
committerNeale Ranns <nranns@cisco.com>2020-02-13 07:46:36 +0000
commit98bd75778736d4322db5ee7ecf5c548133e05d0f (patch)
tree12d17f6b56639041e6bae8248cca47ef0f710d58 /src/vppinfra/vec.c
parent104112f2d412a4576b5e0d3bbb20665d2b5bd615 (diff)
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
Diffstat (limited to 'src/vppinfra/vec.c')
-rw-r--r--src/vppinfra/vec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vppinfra/vec.c b/src/vppinfra/vec.c
index 2ee78952d19..05a557ebb54 100644
--- a/src/vppinfra/vec.c
+++ b/src/vppinfra/vec.c
@@ -95,9 +95,13 @@ vec_resize_allocate_memory (void *v,
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,