Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
svm: add custom q implementation for mq
[vpp.git]
/
src
/
vppinfra
/
vec.c
diff --git
a/src/vppinfra/vec.c
b/src/vppinfra/vec.c
index
2ee7895
..
e98b582
100644
(file)
--- a/
src/vppinfra/vec.c
+++ b/
src/vppinfra/vec.c
@@
-40,7
+40,7
@@
/* Vector resize operator. Called as needed by various macros such as
vec_add1() when we need to allocate memory. */
/* Vector resize operator. Called as needed by various macros such as
vec_add1() when we need to allocate memory. */
-void *
+
__clib_export
void *
vec_resize_allocate_memory (void *v,
word length_increment,
uword data_bytes,
vec_resize_allocate_memory (void *v,
word length_increment,
uword data_bytes,
@@
-95,9
+95,13
@@
vec_resize_allocate_memory (void *v,
return 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;
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,
new =
clib_mem_alloc_aligned_at_offset (new_alloc_bytes, data_align,
@@
-130,12
+134,24
@@
vec_resize_allocate_memory (void *v,
return v + header_bytes;
}
return v + header_bytes;
}
-uword
+
__clib_export
uword
clib_mem_is_vec_h (void *v, uword header_bytes)
{
return clib_mem_is_heap_object (vec_header (v, header_bytes));
}
clib_mem_is_vec_h (void *v, uword header_bytes)
{
return clib_mem_is_heap_object (vec_header (v, header_bytes));
}
+__clib_export u32
+vec_len_not_inline (void *v)
+{
+ return vec_len (v);
+}
+
+__clib_export void
+vec_free_not_inline (void *v)
+{
+ vec_free (v);
+}
+
/** \cond */
#ifdef TEST
/** \cond */
#ifdef TEST