Typically, the header is not present. Headers allow for other
data structures to be built atop CLIB vectors.
- Users may specify the alignment for data elements via the
- vec_*_aligned macros.
+ Users may specify the alignment for first data element of a vector
+ via the vec_*_aligned macros.
- Vectors elements can be any C type e.g. (int, double, struct bar).
+ Vector elements can be any C type e.g. (int, double, struct bar).
This is also true for data types built atop vectors (e.g. heap,
pool, etc.).
- Many macros have _a variants supporting alignment of vector data
- and _h variants supporting non zero length vector headers.
- The _ha variants support both.
+ Many macros have \_a variants supporting alignment of vector elements
+ and \_h variants supporting non-zero-length vector headers. The \_ha
+ variants support both. Additionally cacheline alignment within a
+ vector element structure can be specified using the
+ CLIB_CACHE_LINE_ALIGN_MARK() macro.
Standard programming error: memorize a pointer to the ith element
of a vector then expand it. Vectors expand by 3/2, so such code
@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)
*/
/** \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
*/