From: Marek Olšák Date: Fri, 7 Oct 2016 18:41:10 +0000 (+0200) Subject: glsl: use the linear allocator in glsl_symbol_table X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=23e373eb4f9ca374313306701890642c30e8877e;p=mesa.git glsl: use the linear allocator in glsl_symbol_table no ralloc_free occurences Tested-by: Edmondo Tommasina Reviewed-by: Nicolai Hähnle --- diff --git a/src/compiler/glsl/glsl_symbol_table.cpp b/src/compiler/glsl/glsl_symbol_table.cpp index 8922bb4effb..9ae5fd3e552 100644 --- a/src/compiler/glsl/glsl_symbol_table.cpp +++ b/src/compiler/glsl/glsl_symbol_table.cpp @@ -27,7 +27,7 @@ class symbol_table_entry { public: - DECLARE_RALLOC_CXX_OPERATORS(symbol_table_entry); + DECLARE_LINEAR_ALLOC_CXX_OPERATORS(symbol_table_entry); bool add_interface(const glsl_type *i, enum ir_variable_mode mode) { @@ -150,7 +150,7 @@ bool glsl_symbol_table::add_variable(ir_variable *v) * entry includes a function, propagate that to this block - otherwise * the new variable declaration would shadow the function. */ - symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(v); + symbol_table_entry *entry = new(linalloc) symbol_table_entry(v); if (existing != NULL) entry->f = existing->f; int added = _mesa_symbol_table_add_symbol(table, v->name, entry); @@ -162,13 +162,13 @@ bool glsl_symbol_table::add_variable(ir_variable *v) } /* 1.20+ rules: */ - symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(v); + symbol_table_entry *entry = new(linalloc) symbol_table_entry(v); return _mesa_symbol_table_add_symbol(table, v->name, entry) == 0; } bool glsl_symbol_table::add_type(const char *name, const glsl_type *t) { - symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(t); + symbol_table_entry *entry = new(linalloc) symbol_table_entry(t); return _mesa_symbol_table_add_symbol(table, name, entry) == 0; } @@ -179,7 +179,7 @@ bool glsl_symbol_table::add_interface(const char *name, const glsl_type *i, symbol_table_entry *entry = get_entry(name); if (entry == NULL) { symbol_table_entry *entry = - new(mem_ctx) symbol_table_entry(i, mode); + new(linalloc) symbol_table_entry(i, mode); bool add_interface_symbol_result = _mesa_symbol_table_add_symbol(table, name, entry) == 0; assert(add_interface_symbol_result); @@ -199,7 +199,7 @@ bool glsl_symbol_table::add_function(ir_function *f) return true; } } - symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f); + symbol_table_entry *entry = new(linalloc) symbol_table_entry(f); return _mesa_symbol_table_add_symbol(table, f->name, entry) == 0; } @@ -212,7 +212,7 @@ bool glsl_symbol_table::add_default_precision_qualifier(const char *type_name, default_specifier->default_precision = precision; symbol_table_entry *entry = - new(mem_ctx) symbol_table_entry(default_specifier); + new(linalloc) symbol_table_entry(default_specifier); if (!get_entry(name)) return _mesa_symbol_table_add_symbol(table, name, entry) == 0; @@ -222,7 +222,7 @@ bool glsl_symbol_table::add_default_precision_qualifier(const char *type_name, void glsl_symbol_table::add_global_function(ir_function *f) { - symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f); + symbol_table_entry *entry = new(linalloc) symbol_table_entry(f); int added = _mesa_symbol_table_add_global_symbol(table, f->name, entry); assert(added == 0); (void)added;