Merge remote branch 'origin/master' into pipe-video
[mesa.git] / src / glsl / glsl_symbol_table.cpp
index 3dcd928016ac1b1c5c7af45d4a6e5e8b0ac26e63..2f291d4f97fe95e8a9c33b1aa085a611e8bbf695 100644 (file)
 
 class symbol_table_entry {
 public:
-   /* Callers of this talloc-based new need not call delete. It's
-    * easier to just talloc_free 'ctx' (or any of its ancestors). */
+   /* Callers of this ralloc-based new need not call delete. It's
+    * easier to just ralloc_free 'ctx' (or any of its ancestors). */
    static void* operator new(size_t size, void *ctx)
    {
-      void *entry = talloc_size(ctx, size);
+      void *entry = ralloc_size(ctx, size);
       assert(entry != NULL);
       return entry;
    }
 
-   /* If the user *does* call delete, that's OK, we will just
-    * talloc_free in that case. Here, C++ will have already called the
-    * destructor so tell talloc not to do that again. */
-   static void operator delete(void *table)
+   /* If the user *does* call delete, that's OK, we will just ralloc_free. */
+   static void operator delete(void *entry)
    {
-      talloc_set_destructor(table, NULL);
-      talloc_free(table);
+      ralloc_free(entry);
    }
 
    symbol_table_entry(ir_variable *v)                     : v(v), f(0), t(0) {}
@@ -57,13 +54,13 @@ glsl_symbol_table::glsl_symbol_table()
 {
    this->language_version = 120;
    this->table = _mesa_symbol_table_ctor();
-   this->mem_ctx = talloc_init("symbol table entries");
+   this->mem_ctx = ralloc_context(NULL);
 }
 
 glsl_symbol_table::~glsl_symbol_table()
 {
    _mesa_symbol_table_dtor(table);
-   talloc_free(mem_ctx);
+   ralloc_free(mem_ctx);
 }
 
 void glsl_symbol_table::push_scope()