Skip to content

util/hash_table: Fix a leak in _mesa_hash_table_u64_insert()

Boris Brezillon requested to merge bbrezillon/mesa:hashtab-memleak into main

What does this MR do and why?

Attach a ralloc destructor to the hash table object when building for 32-bit, so we can make sure all keys are freed when the hash table is freed.

We don't allocate 64-bit keys with ralloc() to avoid the overhead of a ralloc context for such small objects.

Fixes: ff494361 ("util: rzalloc and free hash_table_u64")

/cc @kusma @dbaker

Edited by Boris Brezillon

Merge request reports