glsl/loops: Allocate loop_terminator using new(mem_ctx) syntax.
authorPaul Berry <stereotype441@gmail.com>
Thu, 28 Nov 2013 22:46:38 +0000 (14:46 -0800)
committerPaul Berry <stereotype441@gmail.com>
Mon, 9 Dec 2013 18:54:53 +0000 (10:54 -0800)
Patches to follow will introduce code into the loop_terminator
constructor.  Allocating loop_terminator using new(mem_ctx) syntax
will ensure that the constructor runs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/loop_analysis.cpp

index 56191447166239871e2995298d572d534a0f27c5..302e931234f1486030ae2ca12e370920366a8393 100644 (file)
@@ -134,7 +134,7 @@ loop_terminator *
 loop_variable_state::insert(ir_if *if_stmt)
 {
    void *mem_ctx = ralloc_parent(this);
-   loop_terminator *t = rzalloc(mem_ctx, loop_terminator);
+   loop_terminator *t = new(mem_ctx) loop_terminator();
 
    t->ir = if_stmt;
    this->terminators.push_tail(t);