vppinfra: deprecate clib_mem_is_vec
Use of clib_mem_is_heap_object is not reliable enough for production use as it relies on just few bytes of memory allocator chunk header. Type: improvement Change-Id: I48c8adde8b6348b15477e3a015ba515eb7ee7ec2 Signed-off-by: Damjan Marion <damarion@cisco.com>
This commit is contained in:

committed by
Florin Coras

parent
f87acfaf73
commit
8d7cdc808f
@ -238,8 +238,6 @@ format_offload (u8 * s, va_list * va)
|
|||||||
uword i, l;
|
uword i, l;
|
||||||
|
|
||||||
l = ~0;
|
l = ~0;
|
||||||
if (clib_mem_is_vec (id))
|
|
||||||
l = vec_len (id);
|
|
||||||
|
|
||||||
if (id)
|
if (id)
|
||||||
for (i = 0; id[i] != 0 && i < l; i++)
|
for (i = 0; id[i] != 0 && i < l; i++)
|
||||||
|
@ -396,8 +396,6 @@ format_c_identifier (u8 * s, va_list * va)
|
|||||||
uword i, l;
|
uword i, l;
|
||||||
|
|
||||||
l = ~0;
|
l = ~0;
|
||||||
if (clib_mem_is_vec (id))
|
|
||||||
l = vec_len (id);
|
|
||||||
|
|
||||||
if (id)
|
if (id)
|
||||||
for (i = 0; i < l && id[i] != 0; i++)
|
for (i = 0; i < l && id[i] != 0; i++)
|
||||||
|
@ -187,18 +187,6 @@ _vec_resize_will_expand (void *v, uword n_elts, uword elt_size)
|
|||||||
#define vec_resize_will_expand(V, N) \
|
#define vec_resize_will_expand(V, N) \
|
||||||
_vec_resize_will_expand (V, N, sizeof ((V)[0]))
|
_vec_resize_will_expand (V, N, sizeof ((V)[0]))
|
||||||
|
|
||||||
/** \brief Predicate function, says whether the supplied vector is a clib heap
|
|
||||||
object
|
|
||||||
|
|
||||||
@param v pointer to a vector
|
|
||||||
@return 0 or 1
|
|
||||||
*/
|
|
||||||
always_inline uword
|
|
||||||
clib_mem_is_vec (void *v)
|
|
||||||
{
|
|
||||||
return clib_mem_is_heap_object (vec_header (v));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Local variable naming macro (prevents collisions with other macro naming). */
|
/* Local variable naming macro (prevents collisions with other macro naming). */
|
||||||
#define _v(var) _vec_##var
|
#define _v(var) _vec_##var
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user