diff options
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/loop_analysis.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/glsl/loop_analysis.h b/src/glsl/loop_analysis.h index 8bed1db..05c982f 100644 --- a/src/glsl/loop_analysis.h +++ b/src/glsl/loop_analysis.h @@ -140,6 +140,23 @@ public: { hash_table_dtor(this->var_hash); } + + static void* operator new(size_t size, void *ctx) + { + void *lvs = ralloc_size(ctx, size); + assert(lvs != NULL); + + ralloc_set_destructor(lvs, (void (*)(void*)) destructor); + + return lvs; + } + +private: + static void + destructor(loop_variable_state *lvs) + { + lvs->~loop_variable_state(); + } }; |