From 1c29d703123f876d75885a03b10c5deb3d36813f Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Tue, 6 Jan 2009 03:16:50 +0000 Subject: * introduce macros to replace inheritance for operator new overloading (former solution still available and tested) This plays much better with classes that already have base classes -- don't force the user to mess with multiple inheritance, which gave much trouble with MSVC. * Expand the unaligned assert dox page * Minor fixes in the lazy evaluation dox page --- Eigen/src/Core/Matrix.h | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'Eigen/src/Core/Matrix.h') diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index f990167c3..666d25cd9 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -135,31 +135,7 @@ class Matrix public: enum { NeedsToAlign = (Options&Matrix_AutoAlign) == Matrix_AutoAlign && SizeAtCompileTime!=Dynamic && ((sizeof(Scalar)*SizeAtCompileTime)%16)==0 }; - typedef typename ei_meta_if::ret ByteAlignedAsNeeded; - void *operator new(size_t size) throw() - { - return ei_aligned_malloc(size); - } - - void *operator new(size_t, void *ptr) throw() - { - return ptr; - } - - void *operator new[](size_t size) throw() - { - return ei_aligned_malloc(size); - } - - void *operator new[](size_t, void *ptr) throw() - { - return 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); } - - public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) EIGEN_STRONG_INLINE int rows() const { return m_storage.rows(); } EIGEN_STRONG_INLINE int cols() const { return m_storage.cols(); } -- cgit v1.2.3