summaryrefslogtreecommitdiff
path: root/src/util/hash_table.h
diff options
context:
space:
mode:
authorJuan A. Suarez Romero <jasuarez@igalia.com>2021-04-27 12:08:50 +0200
committerJuan A. Suarez Romero <jasuarez@igalia.com>2021-04-29 12:58:23 +0200
commite532a47f76cc8d763e2534c61b27dce0f5bc86a0 (patch)
tree2b3e036abad06f9f461dfc07d1b432ac30878685 /src/util/hash_table.h
parent33f9b06b0e91d8d22217106700210f3bfa723275 (diff)
util/hash_table: do not leak u64 struct key
For non 64bit devices the key stored in hash_table_u64 is wrapped in hash_key_u64 structure, which is never free. This commit fixes this issue by just removing the user-defined `delete_function` parameter in hash_table_u64_{destroy,clear} (which nobody is using) and using instead a delete function to free this structure. Fixes: 608257cf82f ("i965: Fix INTEL_DEBUG=bat") Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10480>
Diffstat (limited to 'src/util/hash_table.h')
-rw-r--r--src/util/hash_table.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/util/hash_table.h b/src/util/hash_table.h
index ff3b3bef576..b61721a5df8 100644
--- a/src/util/hash_table.h
+++ b/src/util/hash_table.h
@@ -172,8 +172,7 @@ struct hash_table_u64 *
_mesa_hash_table_u64_create(void *mem_ctx);
void
-_mesa_hash_table_u64_destroy(struct hash_table_u64 *ht,
- void (*delete_function)(struct hash_entry *entry));
+_mesa_hash_table_u64_destroy(struct hash_table_u64 *ht);
void
_mesa_hash_table_u64_insert(struct hash_table_u64 *ht, uint64_t key,
@@ -186,8 +185,7 @@ void
_mesa_hash_table_u64_remove(struct hash_table_u64 *ht, uint64_t key);
void
-_mesa_hash_table_u64_clear(struct hash_table_u64 *ht,
- void (*delete_function)(struct hash_entry *entry));
+_mesa_hash_table_u64_clear(struct hash_table_u64 *ht);
#ifdef __cplusplus
} /* extern C */