diff options
author | Kenneth Graunke <[email protected]> | 2013-09-18 14:11:32 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-09-21 09:17:21 -0700 |
commit | 4f1ebb8ddd0294698601a8c4fc38f1e39bfd51f6 (patch) | |
tree | de988eab944ebac1525f233ff33814d9f6e9fbda /src/mesa/drivers/dri/i965/brw_vec4.h | |
parent | 81a3759bb51a1a12ba1c6c6ad586c5ff5f31c411 (diff) |
i965, mesa: Use the new DECLARE_R[Z]ALLOC_CXX_OPERATORS macros.
These classes declared a placement new operator, but didn't declare a
delete operator. Switching to the macro gives them a delete operator,
which probably is a good idea anyway.
This also eliminates a lot of boilerplate.
v2: Properly use RZALLOC in Mesa IR/TGSI translators. Caught by Eric
and Chad.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vec4.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4.h | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index f0ab53d53f0..689040b9336 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_vec4.h @@ -118,17 +118,7 @@ public: class src_reg : public reg { public: - /* 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 *node; - - node = ralloc_size(ctx, size); - assert(node != NULL); - - return node; - } + DECLARE_RALLOC_CXX_OPERATORS(src_reg) void init(); @@ -156,17 +146,7 @@ public: class dst_reg : public reg { public: - /* 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 *node; - - node = ralloc_size(ctx, size); - assert(node != NULL); - - return node; - } + DECLARE_RALLOC_CXX_OPERATORS(dst_reg) void init(); @@ -188,17 +168,7 @@ with_writemask(dst_reg const &r, int mask); class vec4_instruction : public backend_instruction { public: - /* 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 *node; - - node = rzalloc_size(ctx, size); - assert(node != NULL); - - return node; - } + DECLARE_RZALLOC_CXX_OPERATORS(vec4_instruction) vec4_instruction(vec4_visitor *v, enum opcode opcode, dst_reg dst = dst_reg(), |