/* Typically we'll not need to resize. */
if (new_data_bytes <= clib_mem_size (p))
{
+ CLIB_MEM_UNPOISON (v, data_bytes);
vh->len += length_increment;
return v;
}
@param V (possibly NULL) pointer to a vector.
@param I vector index which will be valid upon return
@param INIT initial value (can be a complex expression!)
- @param H header size in bytes (may be zero)
- @param A alignment (may be zero)
@return V (value-result macro parameter)
*/
@param V (possibly NULL) pointer to a vector.
@param I vector index which will be valid upon return
@param INIT initial value (can be a complex expression!)
- @param H header size in bytes (may be zero)
@param A alignment (may be zero)
@return V (value-result macro parameter)
*/
@param V pointer to a vector
@param E element to add
- @param H header size in bytes (may be zero)
@param A alignment (may be zero)
@return V (value-result macro parameter)
*/
if (_v(n) > 0) \
clib_memset ((V) + _v(l) - _v(n), 0, _v(n) * sizeof ((V)[0])); \
_vec_len (V) -= _v(n); \
+ CLIB_MEM_POISON(vec_end(V), _v(n) * sizeof ((V)[0])); \
} while (0)
/** \brief Delete the element at index I
if (_vec_del_i < _vec_del_l) \
(v)[_vec_del_i] = (v)[_vec_del_l]; \
_vec_len (v) = _vec_del_l; \
+ CLIB_MEM_POISON(vec_end(v), sizeof ((v)[0])); \
} while (0)
/** \brief Append v2 after v1. Result in v1.
/** \brief Search a vector for the index of the entry that matches.
- @param v1 Pointer to a vector
- @param v2 Entry to match
+ @param v Pointer to a vector
+ @param E Entry to match
@return index of match or ~0
*/
#define vec_search(v,E) \
/** \brief Search a vector for the index of the entry that matches.
- @param v1 Pointer to a vector
- @param v2 Pointer to entry to match
+ @param v Pointer to a vector
+ @param E Pointer to entry to match
@param fn Comparison function !0 => match
@return index of match or ~0
*/