X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Futil%2Fset.h;h=55857aca7ab4a4f9ac899eb4114af12ae2bef7e8;hb=83667f7a61c9b540d1f649db67a4bcfdda096a6c;hp=307a2e46765a7ba92bbd29ac683881ca58b5aca3;hpb=ee23e8b17c77fa94320168427fb8a10a84b50e94;p=mesa.git diff --git a/src/util/set.h b/src/util/set.h index 307a2e46765..55857aca7ab 100644 --- a/src/util/set.h +++ b/src/util/set.h @@ -47,6 +47,8 @@ struct set { bool (*key_equals_function)(const void *a, const void *b); uint32_t size; uint32_t rehash; + uint64_t size_magic; + uint64_t rehash_magic; uint32_t max_entries; uint32_t size_index; uint32_t entries; @@ -65,6 +67,8 @@ void _mesa_set_destroy(struct set *set, void (*delete_function)(struct set_entry *entry)); void +_mesa_set_resize(struct set *set, uint32_t entries); +void _mesa_set_clear(struct set *set, void (*delete_function)(struct set_entry *entry)); @@ -73,12 +77,24 @@ _mesa_set_add(struct set *set, const void *key); struct set_entry * _mesa_set_add_pre_hashed(struct set *set, uint32_t hash, const void *key); +struct set_entry * +_mesa_set_search_or_add(struct set *set, const void *key); +struct set_entry * +_mesa_set_search_or_add_pre_hashed(struct set *set, uint32_t hash, + const void *key); + struct set_entry * _mesa_set_search(const struct set *set, const void *key); struct set_entry * _mesa_set_search_pre_hashed(const struct set *set, uint32_t hash, const void *key); +struct set_entry * +_mesa_set_search_and_add(struct set *set, const void *key, bool *replaced); +struct set_entry * +_mesa_set_search_and_add_pre_hashed(struct set *set, uint32_t hash, + const void *key, bool *replaced); + void _mesa_set_remove(struct set *set, struct set_entry *entry); void