[Mesa-dev] [PATCH] util: Take memset out of rzalloc_size()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Wed May 6 05:35:27 PDT 2015


rzalloc_size() call ralloc_size() to allocate memory. ralloc_size()
use calloc to get memory thus zeroing in rzalloc_size is not
necessary.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/util/ralloc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/util/ralloc.c b/src/util/ralloc.c
index 01719c8..09f5fcd 100644
--- a/src/util/ralloc.c
+++ b/src/util/ralloc.c
@@ -132,8 +132,6 @@ void *
 rzalloc_size(const void *ctx, size_t size)
 {
    void *ptr = ralloc_size(ctx, size);
-   if (likely(ptr != NULL))
-      memset(ptr, 0, size);
    return ptr;
 }
 
-- 
1.8.5.1



More information about the mesa-dev mailing list