mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 20:20:09 +01:00
util: add _mesa_hash_table_u64_num_entries
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27925>
This commit is contained in:
parent
a6123a80da
commit
ec9b6b5cfa
1 changed files with 7 additions and 0 deletions
|
|
@ -200,6 +200,13 @@ struct hash_entry_u64
|
|||
_mesa_hash_table_u64_next_entry(struct hash_table_u64 *ht,
|
||||
struct hash_entry_u64 *ent);
|
||||
|
||||
static inline uint32_t
|
||||
_mesa_hash_table_u64_num_entries(struct hash_table_u64 *ht)
|
||||
{
|
||||
return (!!ht->freed_key_data) + (!!ht->deleted_key_data) +
|
||||
_mesa_hash_table_num_entries(ht->table);
|
||||
}
|
||||
|
||||
/**
|
||||
* This foreach function is safe against deletion (which just replaces
|
||||
* an entry's data with the deleted marker), but not against insertion
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue