diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h index 900c15245a3..73ebf2324c0 100644 --- a/src/compiler/glsl/ir.h +++ b/src/compiler/glsl/ir.h @@ -106,6 +106,16 @@ class ir_instruction : public ir_exec_node { public: enum ir_node_type ir_type; + /* The linear_ctx this node was allocated with. If NULL, it's not allocated + * with linear_ctx. + */ + linear_ctx *node_linalloc; + + DECLARE_RZALLOC_CXX_OPERATORS(ir_instruction) + DECLARE_LINEAR_ZALLOC_CXX_OPERATORS(ir_instruction, + ((ir_instruction*)((uintptr_t)p))->node_linalloc = ctx;, + UNREACHABLE("don't allocate ir_instruction with new[]");) + /** * GCC 4.7+ and clang warn when deleting an ir_instruction unless * there's a virtual destructor present. Because we almost diff --git a/src/util/ralloc.h b/src/util/ralloc.h index e52f1000cd5..f3fe3c951ce 100644 --- a/src/util/ralloc.h +++ b/src/util/ralloc.h @@ -572,7 +572,6 @@ public: \ { \ void *p = ALLOC_FUNC(ctx, size); \ assert(p != NULL); \ - static_assert(HAS_TRIVIAL_DESTRUCTOR(TYPE)); \ new_cmd \ return p; \ } \ @@ -580,7 +579,6 @@ public: \ { \ void *p = ALLOC_FUNC(ctx, size); \ assert(p != NULL); \ - static_assert(HAS_TRIVIAL_DESTRUCTOR(TYPE)); \ new_array_cmd \ return p; \ }