[dpdk-dev,2/2] malloc: no need to zero out memory on zmalloc

Message ID 1467716476-130270-2-git-send-email-sergio.gonzalez.monroy@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

Sergio Gonzalez Monroy July 5, 2016, 11:01 a.m. UTC
  Zeroing out memory on rte_zmalloc_socket is not required anymore since all
allocated memory is already zeroed.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 lib/librte_eal/common/rte_malloc.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
  

Comments

Thomas Monjalon July 10, 2016, 1:43 p.m. UTC | #1
2016-07-05 12:01, Sergio Gonzalez Monroy:
> Zeroing out memory on rte_zmalloc_socket is not required anymore since all
> allocated memory is already zeroed.
> 
> Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>

Series applied, thanks

This patch will need special attention when validating this release.
  

Patch

diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 47deb00..f4a8835 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -123,11 +123,7 @@  rte_malloc(const char *type, size_t size, unsigned align)
 void *
 rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket)
 {
-	void *ptr = rte_malloc_socket(type, size, align, socket);
-
-	if (ptr != NULL)
-		memset(ptr, 0, size);
-	return ptr;
+	return rte_malloc_socket(type, size, align, socket);
 }
 
 /*