Mesa (master): anv: call blob_finish when done with it
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Mar 7 05:41:12 UTC 2019
Module: Mesa
Branch: master
Commit: 4900c0cff4cc1a5966d70402a8ee01b7495d3a0e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4900c0cff4cc1a5966d70402a8ee01b7495d3a0e
Author: Tapani Pälli <tapani.palli at intel.com>
Date: Wed Mar 6 12:27:30 2019 +0200
anv: call blob_finish when done with it
Fixes leaks from anv_device_upload_nir:
==7345== 8,192 bytes in 2 blocks are definitely lost in loss record 24 of 24
==7345== at 0x4C2ED78: malloc (vg_replace_malloc.c:308)
==7345== by 0x4C31393: realloc (vg_replace_malloc.c:836)
==7345== by 0x54E0848: grow_to_fit (blob.c:67)
==7345== by 0x54E0BE5: blob_reserve_bytes (blob.c:166)
==7345== by 0x54E0C7C: blob_reserve_intptr (blob.c:186)
==7345== by 0x54704A7: nir_serialize (nir_serialize.c:1091)
==7345== by 0x512F97D: anv_device_upload_nir (anv_pipeline_cache.c:756)
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
---
src/intel/vulkan/anv_pipeline_cache.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c
index 056e2df6e9a..ecdd4da73ca 100644
--- a/src/intel/vulkan/anv_pipeline_cache.c
+++ b/src/intel/vulkan/anv_pipeline_cache.c
@@ -766,6 +766,7 @@ anv_device_upload_nir(struct anv_device *device,
*/
entry = _mesa_hash_table_search(cache->nir_cache, sha1_key);
if (entry) {
+ blob_finish(&blob);
pthread_mutex_unlock(&cache->mutex);
return;
}
@@ -776,6 +777,8 @@ anv_device_upload_nir(struct anv_device *device,
snir->size = blob.size;
memcpy(snir->data, blob.data, blob.size);
+ blob_finish(&blob);
+
_mesa_hash_table_insert(cache->nir_cache, snir->sha1_key, snir);
pthread_mutex_unlock(&cache->mutex);
More information about the mesa-commit
mailing list