Mesa (master): glsl: use the linear allocator in glsl_symbol_table

Marek Olšák mareko at kemper.freedesktop.org
Mon Oct 31 11:26:38 UTC 2016


Module: Mesa
Branch: master
Commit: 23e373eb4f9ca374313306701890642c30e8877e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=23e373eb4f9ca374313306701890642c30e8877e

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Fri Oct  7 20:41:10 2016 +0200

glsl: use the linear allocator in glsl_symbol_table

no ralloc_free occurences

Tested-by: Edmondo Tommasina <edmondo.tommasina at gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/compiler/glsl/glsl_symbol_table.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/compiler/glsl/glsl_symbol_table.cpp b/src/compiler/glsl/glsl_symbol_table.cpp
index 8922bb4..9ae5fd3 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;




More information about the mesa-commit mailing list