From: Alyssa Rosenzweig Date: Tue, 18 Aug 2020 12:26:40 +0000 (-0400) Subject: pan/mdg: Free previous liveness X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8dd38e5a3e68d67d6050f8bcba28cf3514ef1eef;p=mesa.git pan/mdg: Free previous liveness Before we drop the reference. 160 calls with 0B peak consumption from: 0xffffbd9d2fc3 in ?? pan_compute_liveness at ../src/panfrost/util/pan_liveness.c:127 in /home/alyssa/rockchip_dri.so mir_compute_liveness at ../src/panfrost/midgard/midgard_liveness.c:55 in /home/alyssa/rockchip_dri.so midgard_opt_dead_code_eliminate at ../src/panfrost/midgard/midgard_opt_dce.c:118 in /home/alyssa/rockchip_dri.so Signed-off-by: Alyssa Rosenzweig Cc: mesa-stable Reviewed-by: Tomeu Vizoso Part-of: --- diff --git a/src/panfrost/util/pan_liveness.c b/src/panfrost/util/pan_liveness.c index 9772feb1a9c..0ec9652b59d 100644 --- a/src/panfrost/util/pan_liveness.c +++ b/src/panfrost/util/pan_liveness.c @@ -120,11 +120,13 @@ pan_compute_liveness( _mesa_hash_pointer, _mesa_key_pointer_equal); - /* Allocate */ + /* Free any previous liveness, and allocate */ + + pan_free_liveness(blocks); list_for_each_entry(pan_block, block, blocks, link) { - block->live_in = rzalloc_array(NULL, uint16_t, temp_count); - block->live_out = rzalloc_array(NULL, uint16_t, temp_count); + block->live_in = rzalloc_array(block, uint16_t, temp_count); + block->live_out = rzalloc_array(block, uint16_t, temp_count); } /* Initialize the work list with the exit block */