[Mesa-dev] [PATCH 3/7] [RFC] util: use rzalloc instead on ralloc in _mesa_hash_table_create()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Tue Jun 7 14:26:38 UTC 2016


rzalloc guarantee we get zeroed memory which is needed here.

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

diff --git a/src/util/hash_table.c b/src/util/hash_table.c
index 4cfe3d9..9097e85 100644
--- a/src/util/hash_table.c
+++ b/src/util/hash_table.c
@@ -117,7 +117,7 @@ _mesa_hash_table_create(void *mem_ctx,
 {
    struct hash_table *ht;
 
-   ht = ralloc(mem_ctx, struct hash_table);
+   ht = rzalloc(mem_ctx, struct hash_table);
    if (ht == NULL)
       return NULL;
 
-- 
1.9.1



More information about the mesa-dev mailing list