[Mesa-dev] [PATCH 08/21] anv/pipeline: Ralloc prog_data::param of the compile mem_ctx
Jason Ekstrand
jason at jlekstrand.net
Fri Sep 29 21:25:08 UTC 2017
This way we stop leaking it. This is completely safe because, when we
hand it off to anv_shader_bin_create or anv_pipeline_cache_upload_kernel,
they make a copy of the entire param array.
---
src/intel/vulkan/anv_pipeline.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 1be66f3..5ebe5eb 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -415,8 +415,7 @@ anv_pipeline_compile(struct anv_pipeline *pipeline,
pipeline->needs_data_cache = true;
if (prog_data->nr_params > 0) {
- /* XXX: I think we're leaking this */
- prog_data->param = malloc(prog_data->nr_params * sizeof(uint32_t));
+ prog_data->param = ralloc_array(mem_ctx, uint32_t, prog_data->nr_params);
/* We now set the param values to be offsets into a
* anv_push_constant_data structure. Since the compiler doesn't
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list