diff options
author | 2009-01-09 21:28:53 +0000 | |
---|---|---|
committer | 2009-01-09 21:28:53 +0000 | |
commit | 265ab860056bade3d4dc1c35b7c73820a76db55d (patch) | |
tree | 49f9f770e518d004b2267872c77cc221aa9e04f2 /Eigen/src/Core/MatrixStorage.h | |
parent | b3d580dec7af716e4e384dae0f7bb5c05278a0a1 (diff) |
overloaded operator delete should call ei_conditinal_aligned_free, not
ei_aligned_free
Diffstat (limited to 'Eigen/src/Core/MatrixStorage.h')
-rw-r--r-- | Eigen/src/Core/MatrixStorage.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Eigen/src/Core/MatrixStorage.h b/Eigen/src/Core/MatrixStorage.h index 9806dc6b2..b02c47a60 100644 --- a/Eigen/src/Core/MatrixStorage.h +++ b/Eigen/src/Core/MatrixStorage.h @@ -26,6 +26,9 @@ #ifndef EIGEN_MATRIXSTORAGE_H #define EIGEN_MATRIXSTORAGE_H +struct ei_select_matrix_storage_constructor_doing_absolutely_nothing {}; +struct ei_select_matrix_array_constructor_doing_absolutely_nothing {}; + /** \internal * Static array automatically aligned if the total byte size is a multiple of 16 and the matrix options require auto alignment */ @@ -42,6 +45,8 @@ template <typename T, int Size, int MatrixOptions, && "this assertion is explained here: http://eigen.tuxfamily.org/api/UnalignedArrayAssert.html **** READ THIS WEB PAGE !!! ****"); #endif } + + ei_matrix_array(ei_select_matrix_array_constructor_doing_absolutely_nothing) {} }; template <typename T, int Size, int MatrixOptions> struct ei_matrix_array<T,Size,MatrixOptions,false> @@ -68,6 +73,8 @@ template<typename T, int Size, int _Rows, int _Cols, int _Options> class ei_matr ei_matrix_array<T,Size,_Options> m_data; public: inline explicit ei_matrix_storage() {} + inline ei_matrix_storage(ei_select_matrix_storage_constructor_doing_absolutely_nothing) + : m_data(ei_select_matrix_array_constructor_doing_absolutely_nothing) {} inline ei_matrix_storage(int,int,int) {} inline void swap(ei_matrix_storage& other) { std::swap(m_data,other.m_data); } inline static int rows(void) {return _Rows;} @@ -85,6 +92,8 @@ template<typename T, int Size, int _Options> class ei_matrix_storage<T, Size, Dy int m_cols; public: inline explicit ei_matrix_storage() : m_rows(0), m_cols(0) {} + inline ei_matrix_storage(ei_select_matrix_storage_constructor_doing_absolutely_nothing) + : m_data(ei_select_matrix_array_constructor_doing_absolutely_nothing) {} inline ei_matrix_storage(int, int rows, int cols) : m_rows(rows), m_cols(cols) {} inline ~ei_matrix_storage() {} inline void swap(ei_matrix_storage& other) @@ -107,6 +116,8 @@ template<typename T, int Size, int _Cols, int _Options> class ei_matrix_storage< int m_rows; public: inline explicit ei_matrix_storage() : m_rows(0) {} + inline ei_matrix_storage(ei_select_matrix_storage_constructor_doing_absolutely_nothing) + : m_data(ei_select_matrix_array_constructor_doing_absolutely_nothing) {} inline ei_matrix_storage(int, int rows, int) : m_rows(rows) {} inline ~ei_matrix_storage() {} inline void swap(ei_matrix_storage& other) { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); } @@ -127,6 +138,8 @@ template<typename T, int Size, int _Rows, int _Options> class ei_matrix_storage< int m_cols; public: inline explicit ei_matrix_storage() : m_cols(0) {} + inline ei_matrix_storage(ei_select_matrix_storage_constructor_doing_absolutely_nothing) + : m_data(ei_select_matrix_array_constructor_doing_absolutely_nothing) {} inline ei_matrix_storage(int, int, int cols) : m_cols(cols) {} inline ~ei_matrix_storage() {} inline void swap(ei_matrix_storage& other) { std::swap(m_data,other.m_data); std::swap(m_cols,other.m_cols); } @@ -148,6 +161,8 @@ template<typename T, int _Options> class ei_matrix_storage<T, Dynamic, Dynamic, int m_cols; public: inline explicit ei_matrix_storage() : m_data(0), m_rows(0), m_cols(0) {} + inline ei_matrix_storage(ei_select_matrix_storage_constructor_doing_absolutely_nothing) + : m_data(ei_select_matrix_array_constructor_doing_absolutely_nothing) {} inline ei_matrix_storage(int size, int rows, int cols) : m_data(ei_aligned_new<T>(size)), m_rows(rows), m_cols(cols) {} inline ~ei_matrix_storage() { ei_aligned_delete(m_data, m_rows*m_cols); } @@ -176,6 +191,8 @@ template<typename T, int _Rows, int _Options> class ei_matrix_storage<T, Dynamic int m_cols; public: inline explicit ei_matrix_storage() : m_data(0), m_cols(0) {} + inline ei_matrix_storage(ei_select_matrix_storage_constructor_doing_absolutely_nothing) + : m_data(ei_select_matrix_array_constructor_doing_absolutely_nothing) {} inline ei_matrix_storage(int size, int, int cols) : m_data(ei_aligned_new<T>(size)), m_cols(cols) {} inline ~ei_matrix_storage() { ei_aligned_delete(m_data, _Rows*m_cols); } inline void swap(ei_matrix_storage& other) { std::swap(m_data,other.m_data); std::swap(m_cols,other.m_cols); } @@ -201,6 +218,8 @@ template<typename T, int _Cols, int _Options> class ei_matrix_storage<T, Dynamic int m_rows; public: inline explicit ei_matrix_storage() : m_data(0), m_rows(0) {} + inline ei_matrix_storage(ei_select_matrix_storage_constructor_doing_absolutely_nothing) + : m_data(ei_select_matrix_array_constructor_doing_absolutely_nothing) {} inline ei_matrix_storage(int size, int rows, int) : m_data(ei_aligned_new<T>(size)), m_rows(rows) {} inline ~ei_matrix_storage() { ei_aligned_delete(m_data, _Cols*m_rows); } inline void swap(ei_matrix_storage& other) { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); } |