summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/program_lexer.l
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2016-10-21 16:50:52 +1100
committerEmil Velikov <emil.l.velikov@gmail.com>2016-10-27 19:11:47 +0100
commitea37a0603773467a567fbdf933104410ad8c3916 (patch)
tree80eecb19c59d89b9ad7ac096f6bbb09b5e4abbb3 /src/mesa/program/program_lexer.l
parent02d5e60ee0261a86227a0dbd058a87608dc174bf (diff)
downloadexternal_mesa3d-ea37a0603773467a567fbdf933104410ad8c3916.zip
external_mesa3d-ea37a0603773467a567fbdf933104410ad8c3916.tar.gz
external_mesa3d-ea37a0603773467a567fbdf933104410ad8c3916.tar.bz2
glsl/mesa: remove unused namespace support from the symbol table
Namespace support seems to have been unused for a very long time. Previously the hash table entry was never removed and the symbol name wasn't freed until the symbol table was destroyed. In theory this could reduced the number of times we need to copy a string as duplicate names are reused. However in practice there is likely only a limited number of symbols that are the same and this is likely to cause other less than optimal behaviour such as the hash_table continuously growing. Along with dropping namespace support this change removes entries from the hash table as they become unused. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> (cherry picked from commit 6dbe8a1b9fd750b4c1bb600a0bb43129d95e6eca) Nominated-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Diffstat (limited to 'src/mesa/program/program_lexer.l')
-rw-r--r--src/mesa/program/program_lexer.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/program/program_lexer.l b/src/mesa/program/program_lexer.l
index bb169b9..dee66cb 100644
--- a/src/mesa/program/program_lexer.l
+++ b/src/mesa/program/program_lexer.l
@@ -123,7 +123,7 @@ handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval)
{
lval->string = strdup(text);
- return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL)
+ return (_mesa_symbol_table_find_symbol(state->st, text) == NULL)
? IDENTIFIER : USED_IDENTIFIER;
}