From 9dcde48980f2c80462bf9da7a2af90480aebf14a Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 5 Jan 2009 19:49:07 +0000 Subject: [PATCH] we also had to overload the placement new... issue uncovered by Tim when doing QVector... --- Eigen/src/Core/Matrix.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index bfff6cc4c..80897c48a 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -141,11 +141,21 @@ class Matrix return ei_aligned_malloc(size); } + void *operator new(size_t, Matrix *ptr) throw() + { + return static_cast(ptr); + } + void *operator new[](size_t size) throw() { return ei_aligned_malloc(size); } + void *operator new[](size_t, Matrix *ptr) throw() + { + return static_cast(ptr); + } + void operator delete(void * ptr) { ei_aligned_free(static_cast(ptr), 0); } void operator delete[](void * ptr) { ei_aligned_free(static_cast(ptr), 0); }