DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] malloc: set pad to 0 on free
@ 2018-05-02 15:38 Anatoly Burakov
  2018-05-02 15:38 ` [dpdk-dev] [PATCH 2/2] malloc: avoid padding elements on page deallocation Anatoly Burakov
  0 siblings, 1 reply; 3+ messages in thread
From: Anatoly Burakov @ 2018-05-02 15:38 UTC (permalink / raw)
  To: dev; +Cc: shahafs, thomasm, olgas, rasland

The pad value is not used unless element is in pad state, but it
will show up in heap dumps and may be confusing.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/malloc_elem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c
index af81961..0a86d34 100644
--- a/lib/librte_eal/common/malloc_elem.c
+++ b/lib/librte_eal/common/malloc_elem.c
@@ -445,6 +445,8 @@ malloc_elem_free(struct malloc_elem *elem)
 
 	malloc_elem_free_list_insert(elem);
 
+	elem->pad = 0;
+
 	/* decrease heap's count of allocated elements */
 	elem->heap->alloc_count--;
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-02 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02 15:38 [dpdk-dev] [PATCH 1/2] malloc: set pad to 0 on free Anatoly Burakov
2018-05-02 15:38 ` [dpdk-dev] [PATCH 2/2] malloc: avoid padding elements on page deallocation Anatoly Burakov
2018-05-02 16:28   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).