]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/common/rte_malloc.c
ipc: handle unsupported IPC in init
[dpdk.git] / lib / librte_eal / common / rte_malloc.c
index eebd0674b3926cd8ab2de5c28e2de3428d165595..54792ea5b1781e1380578716e26a6f2ca09b9e3d 100644 (file)
@@ -74,7 +74,18 @@ rte_malloc(const char *type, size_t size, unsigned align)
 void *
 rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket)
 {
-       return rte_malloc_socket(type, size, align, socket);
+       void *ptr = rte_malloc_socket(type, size, align, socket);
+
+#ifdef RTE_MALLOC_DEBUG
+       /*
+        * If DEBUG is enabled, then freed memory is marked with poison
+        * value and set to zero on allocation.
+        * If DEBUG is not enabled then  memory is already zeroed.
+        */
+       if (ptr != NULL)
+               memset(ptr, 0, size);
+#endif
+       return ptr;
 }
 
 /*