[Mesa-dev] [PATCH 6/7] i965/fs: fill allocated memory with zeros where needed

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Tue Jun 14 14:59:05 UTC 2016


Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp    | 2 +-
 src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
index 438f681..11f8576 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -822,7 +822,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block,
             int regs_written = effective_width *
                type_sz(inst->src[i].type) / REG_SIZE;
             if (inst->src[i].file == VGRF) {
-               acp_entry *entry = ralloc(copy_prop_ctx, acp_entry);
+               acp_entry *entry = rzalloc(copy_prop_ctx, acp_entry);
                entry->dst = inst->dst;
                entry->dst.reg_offset += offset;
                entry->src = inst->src[i];
diff --git a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
index 45f5c5e..9fa259e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
@@ -42,8 +42,8 @@ fs_visitor::dead_code_eliminate()
    calculate_live_intervals();
 
    int num_vars = live_intervals->num_vars;
-   BITSET_WORD *live = ralloc_array(NULL, BITSET_WORD, BITSET_WORDS(num_vars));
-   BITSET_WORD *flag_live = ralloc_array(NULL, BITSET_WORD, 1);
+   BITSET_WORD *live = rzalloc_array(NULL, BITSET_WORD, BITSET_WORDS(num_vars));
+   BITSET_WORD *flag_live = rzalloc_array(NULL, BITSET_WORD, 1);
 
    foreach_block_reverse_safe(block, cfg) {
       memcpy(live, live_intervals->block_data[block->num].liveout,
-- 
1.9.1



More information about the mesa-dev mailing list