[Mesa-dev] [PATCH 2/2] anv: fix potential push constant buffer leaks

Jason Ekstrand jason at jlekstrand.net
Fri Oct 6 04:02:50 UTC 2017


Oh, hey, I should have read patch 2...  That said, I think I like just
calling anv_cmd_state_reset a little better.

On Thu, Sep 28, 2017 at 5:19 PM, Lionel Landwerlin <
lionel.g.landwerlin at intel.com> wrote:

> On 29/09/17 01:05, Lionel Landwerlin wrote:
>
>> Valgrind stats on
>> dEQP-VK.pipeline.push_constant.graphics_pipeline.range_size_128 :
>>
>
> I obviously inverted before & after...
>
>
> Before:
>> HEAP SUMMARY:
>>      in use at exit: 2,467,381 bytes in 1,304 blocks
>>    total heap usage: 697,853 allocs, 696,531 frees, 138,466,600 bytes
>> allocated
>>
>> LEAK SUMMARY:
>>     definitely lost: 936 bytes in 10 blocks
>>     indirectly lost: 24,669 bytes in 412 blocks
>>       possibly lost: 0 bytes in 0 blocks
>>     still reachable: 2,441,776 bytes in 882 blocks
>>          suppressed: 0 bytes in 0 blocks
>>
>> After:
>> HEAP SUMMARY:
>>      in use at exit: 2,467,513 bytes in 1,305 blocks
>>    total heap usage: 697,853 allocs, 696,530 frees, 138,466,600 bytes
>> allocated
>>
>> LEAK SUMMARY:
>>     definitely lost: 1,068 bytes in 11 blocks
>>     indirectly lost: 24,669 bytes in 412 blocks
>>       possibly lost: 0 bytes in 0 blocks
>>     still reachable: 2,441,776 bytes in 882 blocks
>>          suppressed: 0 bytes in 0 blocks
>>
>> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
>> Cc: "17.2 17.1" <mesa-stable at lists.freedesktop.org>
>> ---
>>   src/intel/vulkan/anv_cmd_buffer.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/src/intel/vulkan/anv_cmd_buffer.c
>> b/src/intel/vulkan/anv_cmd_buffer.c
>> index 2ef7f9bf260..3509acaec0a 100644
>> --- a/src/intel/vulkan/anv_cmd_buffer.c
>> +++ b/src/intel/vulkan/anv_cmd_buffer.c
>> @@ -289,6 +289,10 @@ anv_cmd_buffer_destroy(struct anv_cmd_buffer
>> *cmd_buffer)
>>            vk_free(&cmd_buffer->pool->alloc, state->push_descriptors[i]);
>>         }
>>      }
>> +   for (uint32_t i = 0; i < MESA_SHADER_STAGES; i++) {
>> +      if (state->push_constants[i] != NULL)
>> +         vk_free(&cmd_buffer->pool->alloc, state->push_constants[i]);
>> +   }
>>        vk_free(&cmd_buffer->pool->alloc, state->attachments);
>>      vk_free(&cmd_buffer->pool->alloc, cmd_buffer);
>>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171005/5b0e33c4/attachment-0001.html>


More information about the mesa-dev mailing list