symbol_table: Don't maintain the HT as we're destroying the table.

Release Mesa build runtime of
KHR-Single-GL46.arrays_of_arrays_gl.SizedDeclarationsPrimitive -5.05801%
+/- 3.41206% (n=12)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22451>
This commit is contained in:
Emma Anholt
2023-04-12 11:55:13 -07:00
committed by Marge Bot
parent 6db7d72b4b
commit 0a400f933f
+14 -2
View File
@@ -296,8 +296,20 @@ _mesa_symbol_table_ctor(void)
void
_mesa_symbol_table_dtor(struct _mesa_symbol_table *table)
{
while (table->current_scope != NULL) {
_mesa_symbol_table_pop_scope(table);
/* Free all the scopes and symbols left in the table. This is like repeated
* _mesa_symbol_table_pop_scope(), but not maintining the hash table as we
* blow it all away.
*/
while (table->current_scope) {
struct scope_level *scope = table->current_scope;
table->current_scope = scope->next;
while (scope->symbols) {
struct symbol *sym = scope->symbols;
scope->symbols = sym->next_with_same_scope;
free(sym);
}
free(scope);
}
_mesa_hash_table_destroy(table->ht, NULL);