mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 19:20:12 +01:00
util/hash_table: add _mesa_string_hash_table_create() helper
This adds a string version of the _mesa_pointer_hash_table_create() helper allowing us to write tidy code. Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31137>
This commit is contained in:
parent
7c5b21c032
commit
6219275ffe
1 changed files with 7 additions and 0 deletions
|
|
@ -130,6 +130,13 @@ bool _mesa_key_pointer_equal(const void *a, const void *b);
|
|||
struct hash_table *
|
||||
_mesa_pointer_hash_table_create(void *mem_ctx);
|
||||
|
||||
static inline struct hash_table *
|
||||
_mesa_string_hash_table_create(void *mem_ctx)
|
||||
{
|
||||
return _mesa_hash_table_create(mem_ctx, _mesa_hash_string,
|
||||
_mesa_key_string_equal);
|
||||
}
|
||||
|
||||
bool
|
||||
_mesa_hash_table_reserve(struct hash_table *ht, unsigned size);
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue