Kenneth Graunke <[email protected]> writes: > 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. > > Signed-off-by: Kenneth Graunke <[email protected]>
> diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
> index cef32dc..9612f4e 100644
> --- a/src/mesa/program/ir_to_mesa.cpp
> +++ b/src/mesa/program/ir_to_mesa.cpp
> @@ -149,17 +149,7 @@ dst_reg::dst_reg(src_reg reg)
>
> class ir_to_mesa_instruction : public exec_node {
> 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_RALLOC_CXX_OPERATORS(ir_to_mesa_instruction)
>
> enum prog_opcode op;
> dst_reg dst;
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 0a1837f..0e2682a 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -217,17 +217,7 @@ st_dst_reg::st_dst_reg(st_src_reg reg)
>
> class glsl_to_tgsi_instruction : public exec_node {
> 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_RALLOC_CXX_OPERATORS(glsl_to_tgsi_instruction)
>
> unsigned op;
> st_dst_reg dst;
These two went from rzalloc to ralloc, apparently unintentionally.
Other than that, this series is:
Reviewed-by: Eric Anholt <[email protected]>
pgpHvsk02JLU3.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
