[Mesa-dev] [PATCH 1/2] intel/fs: Alloc pull constants off mem_ctx
Jason Ekstrand
jason at jlekstrand.net
Wed Nov 1 16:33:15 UTC 2017
Do either of you mind if I cc the first one to stable? It does fix a
potential memory leak in the case where compilation fails.
On Wed, Nov 1, 2017 at 9:26 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
> series
> Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
>
>
> On 11/01/2017 06:00 PM, Jason Ekstrand wrote:
>
>> It doesn't actually matter since the only user of push constants, i965,
>> ralloc_steals it back to NULL but it's more consistent and probably
>> fixes memory leaks in some error cases.
>> ---
>> src/intel/compiler/brw_fs.cpp | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cp
>> p
>> index e546792..21ff030 100644
>> --- a/src/intel/compiler/brw_fs.cpp
>> +++ b/src/intel/compiler/brw_fs.cpp
>> @@ -2095,7 +2095,7 @@ fs_visitor::assign_constant_locations()
>> stage_prog_data->param = ralloc_array(mem_ctx, uint32_t,
>> num_push_constants);
>> if (num_pull_constants > 0) {
>> stage_prog_data->nr_pull_params = num_pull_constants;
>> - stage_prog_data->pull_param = ralloc_array(NULL, uint32_t,
>> + stage_prog_data->pull_param = ralloc_array(mem_ctx, uint32_t,
>> num_pull_constants);
>> }
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171101/f4378ea7/attachment.html>
More information about the mesa-dev
mailing list