assert(table);
assert(key);
+ #ifndef NDEBUG
/* assert if _mesa_HashRemove illegally called from _mesa_HashDeleteAll
* callback function. Have to check this outside of mutex lock.
*/
assert(!table->InDeleteAll);
+ #endif
if (key == DELETED_KEY_VALUE) {
table->deleted_key_data = NULL;
{
assert(callback);
_mesa_HashLockMutex(table);
+ #ifndef NDEBUG
table->InDeleteAll = GL_TRUE;
+ #endif
hash_table_foreach(table->ht, entry) {
callback(entry->data, userData);
_mesa_hash_table_remove(table->ht, entry);
callback(table->deleted_key_data, userData);
table->deleted_key_data = NULL;
}
- table->InDeleteAll = GL_FALSE;
if (table->id_alloc) {
util_idalloc_fini(table->id_alloc);
free(table->id_alloc);
init_name_reuse(table);
}
+ #ifndef NDEBUG
+ table->InDeleteAll = GL_FALSE;
+ #endif
table->MaxKey = 0;
_mesa_HashUnlockMutex(table);
}
struct hash_table *ht;
GLuint MaxKey; /**< highest key inserted so far */
simple_mtx_t Mutex; /**< mutual exclusion lock */
- GLboolean InDeleteAll; /**< Debug check */
/* Used when name reuse is enabled */
struct util_idalloc* id_alloc;
/** Value that would be in the table for DELETED_KEY_VALUE. */
void *deleted_key_data;
+ #ifndef NDEBUG
+ GLboolean InDeleteAll; /**< Debug check */
+ #endif
};
extern struct _mesa_HashTable *_mesa_NewHashTable(void);