mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
Add destructor for symbol_table
This commit is contained in:
parent
0044d3ba94
commit
946ea82bff
2 changed files with 18 additions and 3 deletions
|
|
@ -325,10 +325,24 @@ _mesa_symbol_table_ctor(void)
|
|||
{
|
||||
struct _mesa_symbol_table *table = calloc(1, sizeof(*table));
|
||||
|
||||
table->ht = hash_table_ctor(32, hash_table_string_hash,
|
||||
hash_table_string_compare);
|
||||
if (table != NULL) {
|
||||
table->ht = hash_table_ctor(32, hash_table_string_hash,
|
||||
hash_table_string_compare);
|
||||
|
||||
_mesa_symbol_table_push_scope(table);
|
||||
_mesa_symbol_table_push_scope(table);
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_symbol_table_dtor(struct _mesa_symbol_table *table)
|
||||
{
|
||||
while (table->current_scope != NULL) {
|
||||
_mesa_symbol_table_pop_scope(table);
|
||||
}
|
||||
|
||||
hash_table_dtor(table->ht);
|
||||
free(table);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ extern void *_mesa_symbol_table_find_symbol(
|
|||
|
||||
extern struct _mesa_symbol_table *_mesa_symbol_table_ctor(void);
|
||||
|
||||
extern void _mesa_symbol_table_dtor(struct _mesa_symbol_table *);
|
||||
|
||||
extern struct _mesa_symbol_table_iterator *_mesa_symbol_table_iterator_ctor(
|
||||
struct _mesa_symbol_table *table, int name_space, const char *name);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue