summaryrefslogtreecommitdiffstats
path: root/lib/librte_mempool
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo.salveti@linaro.org>2016-07-18 15:30:53 -0300
committerRicardo Salveti <ricardo.salveti@linaro.org>2016-07-18 15:31:22 -0300
commit5d4e5dcd8a186778b3d78e27c81550d07a288fd2 (patch)
treeb84800fce31e7233445a7997c19df409c2a364ea /lib/librte_mempool
parenta41e6ff15809d40e0f9bbc9576bf8f7f80fbec1d (diff)
Imported Upstream version 16.07-rc3
Change-Id: I321148bfa234858ba1986d109470b7aa280cd429 Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Diffstat (limited to 'lib/librte_mempool')
-rw-r--r--lib/librte_mempool/rte_mempool.c4
-rw-r--r--lib/librte_mempool/rte_mempool.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 6ec09063..8806633b 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -199,7 +199,11 @@ rte_mempool_calc_obj_size(uint32_t elt_size, uint32_t flags,
sz->header_size = RTE_ALIGN_CEIL(sz->header_size,
RTE_MEMPOOL_ALIGN);
+#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
sz->trailer_size = sizeof(struct rte_mempool_objtlr);
+#else
+ sz->trailer_size = 0;
+#endif
/* element size is 8 bytes-aligned at least */
sz->elt_size = RTE_ALIGN_CEIL(elt_size, sizeof(uint64_t));
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index fb7052e1..4a8fbb1e 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -163,6 +163,8 @@ struct rte_mempool_objhdr {
*/
STAILQ_HEAD(rte_mempool_objhdr_list, rte_mempool_objhdr);
+#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
+
/**
* Mempool object trailer structure
*
@@ -170,11 +172,11 @@ STAILQ_HEAD(rte_mempool_objhdr_list, rte_mempool_objhdr);
* trailer structure containing a cookie preventing memory corruptions.
*/
struct rte_mempool_objtlr {
-#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
uint64_t cookie; /**< Debug cookie. */
-#endif
};
+#endif
+
/**
* A list of memory where objects are stored
*/