docs: clarify vector element alignment description. 67/16467/3
authorDave Wallace <dwallacelf@gmail.com>
Thu, 13 Dec 2018 17:29:44 +0000 (12:29 -0500)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 17 Dec 2018 00:10:16 +0000 (00:10 +0000)
Change-Id: I6da153779010263e6fc4b51c64b01444aaadca17
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
docs/gettingstarted/developers/infrastructure.md
src/vppinfra/vec.h

index 0361a63..b994607 100644 (file)
@@ -48,13 +48,16 @@ macro! It's smart about NULL pointers.\]
 
 Typically, the user header is not present. User headers allow for other
 data structures to be built atop vppinfra vectors. Users may specify the
-alignment for data elements via the [vec]()\*\_aligned macros.
+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). This
+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.
 
 Inconsistent usage of header and/or alignment related macro variants
 will cause delayed, confusing failures.
index 470a4f1..6f0e7e9 100644 (file)
    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