From bfe6d389a0657d75bc97cca2bce451a4a3279f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 6 Feb 2024 02:28:56 -0500 Subject: [PATCH] mesa: remove _mesa_HashTable::InDeleteAll It's not necessary if we don't remove entries from the hash table, which we don't have to do because we are going to destroy it anyway. Reviewed-by: Adam Jackson Part-of: --- src/mesa/main/hash.c | 18 ------------------ src/mesa/main/hash.h | 3 --- 2 files changed, 21 deletions(-) diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index 8212ebe5e93..6443ae2983b 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -148,23 +148,12 @@ _mesa_DeleteHashTable(struct _mesa_HashTable *table, void *userData) { if (free_callback) { -#ifndef NDEBUG - table->InDeleteAll = GL_TRUE; -#endif hash_table_foreach(table->ht, entry) { free_callback(entry->data, userData); - _mesa_hash_table_remove(table->ht, entry); } if (table->deleted_key_data) { free_callback(table->deleted_key_data, userData); } -#ifndef NDEBUG - table->InDeleteAll = GL_FALSE; -#endif - } - - if (_mesa_hash_table_next_entry(table->ht, NULL) != NULL) { - _mesa_problem(NULL, "In _mesa_DeleteHashTable, found non-freed data"); } _mesa_hash_table_destroy(table->ht, NULL); @@ -315,13 +304,6 @@ _mesa_HashRemoveLocked(struct _mesa_HashTable *table, GLuint key) assert(key); - #ifndef NDEBUG - /* assert if _mesa_HashRemove illegally called from _mesa_DeleteHashTable - * callback function. Have to check this outside of mutex lock. - */ - assert(!table->InDeleteAll); - #endif - if (key == DELETED_KEY_VALUE) { table->deleted_key_data = NULL; } else { diff --git a/src/mesa/main/hash.h b/src/mesa/main/hash.h index 0a6c0c35791..72842a5ec13 100644 --- a/src/mesa/main/hash.h +++ b/src/mesa/main/hash.h @@ -51,9 +51,6 @@ struct _mesa_HashTable { /** Value that would be in the table for DELETED_KEY_VALUE. */ void *deleted_key_data; - #ifndef NDEBUG - GLboolean InDeleteAll; /**< Debug check */ - #endif }; struct _mesa_HashTable *