From f86818b5a6a1e47f95e42c4387c0cda5671b532e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 12 Jan 2009 14:20:21 +0000 Subject: [PATCH] bug fix in ei_stack_free --- Eigen/src/Core/util/Memory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index c16c52dd4..21d9491d3 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -229,8 +229,8 @@ inline static int ei_alignmentOffset(const Scalar* ptr, int maxOffset) #endif #define ei_aligned_stack_new(TYPE,SIZE) ::new(ei_aligned_stack_alloc(sizeof(TYPE)*SIZE)) TYPE[SIZE] -#define ei_aligned_stack_delete(TYPE,PTR,SIZE) ei_delete_elements_of_array(PTR, SIZE); \ - ei_aligned_stack_free(PTR,sizeof(TYPE)*SIZE) +#define ei_aligned_stack_delete(TYPE,PTR,SIZE) do {ei_delete_elements_of_array(PTR, SIZE); \ + ei_aligned_stack_free(PTR,sizeof(TYPE)*SIZE);} while(0) /** Qt <= 4.4 has a bug where it calls new(ptr) T instead of ::new(ptr) T. * This fails as we overload other operator new but not this one. What Qt really means is placement new.