diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-01-06 03:16:50 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-01-06 03:16:50 +0000 |
commit | 1c29d703123f876d75885a03b10c5deb3d36813f (patch) | |
tree | 72a4a68207e5cd25c5829e5655ff78c9e8d12b1d /Eigen/src/Core/Matrix.h | |
parent | e71de20f1667e9e10dc315108a34550fb3226270 (diff) |
* 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
Diffstat (limited to 'Eigen/src/Core/Matrix.h')
-rw-r--r-- | Eigen/src/Core/Matrix.h | 26 |
1 files changed, 1 insertions, 25 deletions
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<NeedsToAlign, ei_byte_forcing_aligned_malloc, char>::ret ByteAlignedAsNeeded; - void *operator new(size_t size) throw() - { - return ei_aligned_malloc<ByteAlignedAsNeeded>(size); - } - - void *operator new(size_t, void *ptr) throw() - { - return ptr; - } - - void *operator new[](size_t size) throw() - { - return ei_aligned_malloc<ByteAlignedAsNeeded>(size); - } - - void *operator new[](size_t, void *ptr) throw() - { - return ptr; - } - - void operator delete(void * ptr) { ei_aligned_free(static_cast<ByteAlignedAsNeeded *>(ptr), 0); } - void operator delete[](void * ptr) { ei_aligned_free(static_cast<ByteAlignedAsNeeded *>(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(); } |