Lines Matching defs:key

8  * \note key=0 is illegal.
125 _mesa_HashLookup_unlocked(struct _mesa_HashTable *table, GLuint key)
130 assert(key);
132 if (key == DELETED_KEY_VALUE)
136 uint_hash(key),
137 uint_key(key));
149 * \param key the key.
151 * \return pointer to user's data or NULL if key not in table
154 _mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
158 res = _mesa_HashLookup_unlocked(table, key);
171 * \param key the key.
173 * \return pointer to user's data or NULL if key not in table
176 _mesa_HashLookupLocked(struct _mesa_HashTable *table, GLuint key)
178 return _mesa_HashLookup_unlocked(table, key);
183 _mesa_HashInsert_unlocked(struct _mesa_HashTable *table, GLuint key, void *data)
185 uint32_t hash = uint_hash(key);
189 assert(key);
191 if (key > table->MaxKey)
192 table->MaxKey = key;
194 if (key == DELETED_KEY_VALUE) {
197 entry = _mesa_hash_table_search_pre_hashed(table->ht, hash, uint_key(key));
201 _mesa_hash_table_insert_pre_hashed(table->ht, hash, uint_key(key), data);
208 * Insert a key/pointer pair into the hash table without locking the mutex.
209 * If an entry with this key already exists we'll replace the existing entry.
215 * \param key the key (not zero).
217 * \param isGenName true if the key has been generated by a HashFindFreeKey* function
220 _mesa_HashInsertLocked(struct _mesa_HashTable *table, GLuint key, void *data,
223 _mesa_HashInsert_unlocked(table, key, data);
225 util_idalloc_reserve(table->id_alloc, key);
230 * Insert a key/pointer pair into the hash table.
231 * If an entry with this key already exists we'll replace the existing entry.
234 * \param key the key (not zero).
236 * \param isGenName true if the key has been generated by a HashFindFreeKey* function
239 _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data,
243 _mesa_HashInsert_unlocked(table, key, data);
245 util_idalloc_reserve(table->id_alloc, key);
254 * \param key key of entry to remove.
257 * key and unlinks it.
260 _mesa_HashRemove_unlocked(struct _mesa_HashTable *table, GLuint key)
265 assert(key);
274 if (key == DELETED_KEY_VALUE) {
278 uint_hash(key),
279 uint_key(key));
284 util_idalloc_free(table->id_alloc, key);
289 _mesa_HashRemoveLocked(struct _mesa_HashTable *table, GLuint key)
291 _mesa_HashRemove_unlocked(table, key);
295 _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key)
298 _mesa_HashRemove_unlocked(table, key);
398 _mesa_debug(NULL, "%u %p\n", (unsigned)(uintptr_t) entry->key,
410 * \return Starting key of free block or 0 if failure.
412 * If there are enough free keys between the maximum key existing in the table
413 * (_mesa_HashTable::MaxKey) and the maximum key possible, then simply return
414 * the adjacent key. Otherwise do a full search for a free key block in the
415 * allowable key range.
431 GLuint key;
432 for (key = 1; key != maxKey; key++) {
433 if (_mesa_HashLookup_unlocked(table, key)) {
434 /* darn, this key is already in use */
436 freeStart = key+1;
439 /* this key not in use, check if we've found enough */