Lines Matching refs:key
8 * \note key=0 is illegal.
107 _mesa_HashLookup_unlocked(struct _mesa_HashTable *table, GLuint key)
112 assert(key);
114 if (key == DELETED_KEY_VALUE)
118 uint_hash(key),
119 uint_key(key));
131 * \param key the key.
133 * \return pointer to user's data or NULL if key not in table
136 _mesa_HashLookup(struct _mesa_HashTable *table, GLuint key)
140 res = _mesa_HashLookup_unlocked(table, key);
153 * \param key the key.
155 * \return pointer to user's data or NULL if key not in table
158 _mesa_HashLookupLocked(struct _mesa_HashTable *table, GLuint key)
160 return _mesa_HashLookup_unlocked(table, key);
165 _mesa_HashInsert_unlocked(struct _mesa_HashTable *table, GLuint key, void *data)
167 uint32_t hash = uint_hash(key);
171 assert(key);
173 if (key > table->MaxKey)
174 table->MaxKey = key;
176 if (key == DELETED_KEY_VALUE) {
179 entry = _mesa_hash_table_search_pre_hashed(table->ht, hash, uint_key(key));
183 _mesa_hash_table_insert_pre_hashed(table->ht, hash, uint_key(key), data);
190 * Insert a key/pointer pair into the hash table without locking the mutex.
191 * If an entry with this key already exists we'll replace the existing entry.
197 * \param key the key (not zero).
201 _mesa_HashInsertLocked(struct _mesa_HashTable *table, GLuint key, void *data)
203 _mesa_HashInsert_unlocked(table, key, data);
208 * Insert a key/pointer pair into the hash table.
209 * If an entry with this key already exists we'll replace the existing entry.
212 * \param key the key (not zero).
216 _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
219 _mesa_HashInsert_unlocked(table, key, data);
228 * \param key key of entry to remove.
231 * key and unlinks it.
234 _mesa_HashRemove_unlocked(struct _mesa_HashTable *table, GLuint key)
239 assert(key);
246 if (key == DELETED_KEY_VALUE) {
250 uint_hash(key),
251 uint_key(key));
258 _mesa_HashRemoveLocked(struct _mesa_HashTable *table, GLuint key)
260 _mesa_HashRemove_unlocked(table, key);
264 _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key)
267 _mesa_HashRemove_unlocked(table, key);
282 void (*callback)(GLuint key, void *data, void *userData),
291 callback((uintptr_t)entry->key, entry->data, userData);
312 void (*callback)(GLuint key, void *data, void *userData),
320 callback((uintptr_t)entry->key, entry->data, userData);
329 void (*callback)(GLuint key, void *data, void *userData),
342 void (*callback)(GLuint key, void *data, void *userData),
349 debug_print_entry(GLuint key, void *data, void *userData)
351 _mesa_debug(NULL, "%u %p\n", key, data);
374 * \return Starting key of free block or 0 if failure.
376 * If there are enough free keys between the maximum key existing in the table
377 * (_mesa_HashTable::MaxKey) and the maximum key possible, then simply return
378 * the adjacent key. Otherwise do a full search for a free key block in the
379 * allowable key range.
393 GLuint key;
394 for (key = 1; key != maxKey; key++) {
395 if (_mesa_HashLookup_unlocked(table, key)) {
396 /* darn, this key is already in use */
398 freeStart = key+1;
401 /* this key not in use, check if we've found enough */