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); }