aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/shader/symbol_table.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-12-22 18:18:58 +0000
committermarha <marha@users.sourceforge.net>2009-12-22 18:18:58 +0000
commit3b79162ea5c5be078326f2e0ea85b0f84c02f166 (patch)
tree6826d1ef026f16ec12d35ee6bd4a892d0a05b7e0 /mesalib/src/mesa/shader/symbol_table.c
parent4284aeba874b9168f2228c59639bec8346a56796 (diff)
parentb729d9e1cc1c60e415da24143cabcbaccb525ed7 (diff)
downloadvcxsrv-3b79162ea5c5be078326f2e0ea85b0f84c02f166.tar.gz
vcxsrv-3b79162ea5c5be078326f2e0ea85b0f84c02f166.tar.bz2
vcxsrv-3b79162ea5c5be078326f2e0ea85b0f84c02f166.zip
svn merge ^/branches/released
Diffstat (limited to 'mesalib/src/mesa/shader/symbol_table.c')
-rw-r--r--mesalib/src/mesa/shader/symbol_table.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/mesalib/src/mesa/shader/symbol_table.c b/mesalib/src/mesa/shader/symbol_table.c
index 7a9aa7b8f..1f6d9b844 100644
--- a/mesalib/src/mesa/shader/symbol_table.c
+++ b/mesalib/src/mesa/shader/symbol_table.c
@@ -20,12 +20,8 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
+#include "main/imports.h"
#include "symbol_table.h"
#include "hash_table.h"
@@ -73,6 +69,9 @@ struct symbol {
/**
*/
struct symbol_header {
+ /** Linkage in list of all headers in a given symbol table. */
+ struct symbol_header *next;
+
/** Symbol name. */
const char *name;
@@ -102,6 +101,9 @@ struct _mesa_symbol_table {
/** Top of scope stack. */
struct scope_level *current_scope;
+
+ /** List of all symbol headers in the table. */
+ struct symbol_header *hdr;
};
@@ -301,6 +303,8 @@ _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table,
hdr->name = name;
hash_table_insert(table->ht, hdr, name);
+ hdr->next = table->hdr;
+ table->hdr = hdr;
}
check_symbol_table(table);
@@ -341,10 +345,18 @@ _mesa_symbol_table_ctor(void)
void
_mesa_symbol_table_dtor(struct _mesa_symbol_table *table)
{
+ struct symbol_header *hdr;
+ struct symbol_header *next;
+
while (table->current_scope != NULL) {
_mesa_symbol_table_pop_scope(table);
}
+ for (hdr = table->hdr; hdr != NULL; hdr = next) {
+ next = hdr->next;
+ _mesa_free(hdr);
+ }
+
hash_table_dtor(table->ht);
free(table);
}