diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-09-03 00:32:56 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-09-03 00:32:56 +0000 |
commit | f52d119b9c4f9b6dfbb91183de08143fdf3cc94c (patch) | |
tree | 2369642bacec55b4d372797d42d27c74c6ac75eb /Eigen/src/Geometry/Scaling.h | |
parent | d8df318d77b8a9bd9d6274f25145639603c2e8d4 (diff) |
Solve a big issue with data alignment and dynamic allocation:
* add a WithAlignedOperatorNew class with overloaded operator new
* make Matrix (and Quaternion, Transform, Hyperplane, etc.) use it
if needed such that "*(new Vector4) = xpr" does not failed anymore.
* Please: make sure your classes having fixed size Eigen's vector
or matrice attributes inherit WithAlignedOperatorNew
* add a ei_new_allocator STL memory allocator to use with STL containers.
This allocator really calls operator new on your types (unlike GCC's
new_allocator). Example:
std::vector<Vector4f> data(10);
will segfault if the vectorization is enabled, instead use:
std::vector<Vector4f,ei_new_allocator<Vector4f> > data(10);
NOTE: you only have to worry if you deal with fixed-size matrix types
with "sizeof(matrix_type)%16==0"...
Diffstat (limited to 'Eigen/src/Geometry/Scaling.h')
-rw-r--r-- | Eigen/src/Geometry/Scaling.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Eigen/src/Geometry/Scaling.h b/Eigen/src/Geometry/Scaling.h index ded1b6220..da7cca68e 100644 --- a/Eigen/src/Geometry/Scaling.h +++ b/Eigen/src/Geometry/Scaling.h @@ -41,6 +41,9 @@ */ template<typename _Scalar, int _Dim> class Scaling + #ifdef EIGEN_VECTORIZE + : public ei_with_aligned_operator_new<_Scalar,_Dim> + #endif { public: /** dimension of the space */ |