Lines Matching defs:key

96 key_pointer_is_reserved(const void *key)
98 return key == NULL || key == deleted_key;
104 return entry->key == NULL;
110 return entry->key == deleted_key;
116 return entry->key != NULL && entry->key != deleted_key;
121 uint32_t (*key_hash_function)(const void *key),
142 uint32_t (*key_hash_function)(const void *key),
161 key_u32_hash(const void *key)
163 uint32_t u = (uint32_t)(uintptr_t)key;
173 /* key == 0 and key == deleted_key are not allowed */
250 entry->key = NULL;
259 * Finds a set entry with the given key and hash of that key.
264 set_search(const struct set *ht, uint32_t hash, const void *key)
266 assert(!key_pointer_is_reserved(key));
279 if (ht->key_equals_function(key, entry->key)) {
293 _mesa_set_search(const struct set *set, const void *key)
296 return set_search(set, set->key_hash_function(key), key);
301 const void *key)
304 hash == set->key_hash_function(key));
305 return set_search(set, hash, key);
309 set_add_rehash(struct set *ht, uint32_t hash, const void *key)
318 if (likely(entry->key == NULL)) {
320 entry->key = key;
363 set_add_rehash(ht, entry->hash, entry->key);
386 * Find a matching entry for the given key, or insert it if it doesn't already
393 set_search_or_add(struct set *ht, uint32_t hash, const void *key, bool *found)
397 assert(!key_pointer_is_reserved(key));
423 ht->key_equals_function(key, entry->key)) {
439 available_entry->key = key;
453 * Inserts the key with the given hash into the table.
459 set_add(struct set *ht, uint32_t hash, const void *key)
461 struct set_entry *entry = set_search_or_add(ht, hash, key, NULL);
469 * the key is searched for".
475 entry->key = key;
480 _mesa_set_add(struct set *set, const void *key)
483 return set_add(set, set->key_hash_function(key), key);
487 _mesa_set_add_pre_hashed(struct set *set, uint32_t hash, const void *key)
490 hash == set->key_hash_function(key));
491 return set_add(set, hash, key);
495 _mesa_set_search_and_add(struct set *set, const void *key, bool *replaced)
499 set->key_hash_function(key),
500 key, replaced);
505 const void *key, bool *replaced)
508 hash == set->key_hash_function(key));
509 struct set_entry *entry = set_search_or_add(set, hash, key, replaced);
517 entry->key = key;
522 _mesa_set_search_or_add(struct set *set, const void *key, bool *found)
525 return set_search_or_add(set, set->key_hash_function(key), key, found);
530 const void *key, bool *found)
533 hash == set->key_hash_function(key));
534 return set_search_or_add(set, hash, key, found);
549 entry->key = deleted_key;
555 * Removes the entry with the corresponding key, if exists.
558 _mesa_set_remove_key(struct set *set, const void *key)
560 _mesa_set_remove(set, _mesa_set_search(set, key));
579 return entry->key ? entry : _mesa_set_next_entry_unsafe(ht, entry);
658 if (_mesa_set_search_pre_hashed(b, entry->hash, entry->key))