the big memory changes. the most important changes are:

ei_aligned_malloc now really behaves like a malloc
 (untyped, doesn't call ctor)
ei_aligned_new is the typed variant calling ctor
EIGEN_MAKE_ALIGNED_OPERATOR_NEW now takes the class name as parameter
This commit is contained in:
Benoit Jacob
2009-01-08 15:20:21 +00:00
parent e2d2a7d222
commit 1d52bd4cad
21 changed files with 215 additions and 243 deletions

View File

@@ -31,8 +31,8 @@ template<typename VectorType> void map_class(const VectorType& m)
int size = m.size();
// test Map.h
Scalar* array1 = ei_aligned_malloc<Scalar>(size);
Scalar* array2 = ei_aligned_malloc<Scalar>(size);
Scalar* array1 = ei_aligned_new<Scalar>(size);
Scalar* array2 = ei_aligned_new<Scalar>(size);
Scalar* array3 = new Scalar[size+1];
Scalar* array3unaligned = size_t(array3)%16 == 0 ? array3+1 : array3;
@@ -45,8 +45,8 @@ template<typename VectorType> void map_class(const VectorType& m)
VERIFY_IS_APPROX(ma1, ma2);
VERIFY_IS_APPROX(ma1, ma3);
ei_aligned_free(array1, size);
ei_aligned_free(array2, size);
ei_aligned_delete(array1, size);
ei_aligned_delete(array2, size);
delete[] array3;
}
@@ -57,8 +57,8 @@ template<typename VectorType> void map_static_methods(const VectorType& m)
int size = m.size();
// test Map.h
Scalar* array1 = ei_aligned_malloc<Scalar>(size);
Scalar* array2 = ei_aligned_malloc<Scalar>(size);
Scalar* array1 = ei_aligned_new<Scalar>(size);
Scalar* array2 = ei_aligned_new<Scalar>(size);
Scalar* array3 = new Scalar[size+1];
Scalar* array3unaligned = size_t(array3)%16 == 0 ? array3+1 : array3;
@@ -71,8 +71,8 @@ template<typename VectorType> void map_static_methods(const VectorType& m)
VERIFY_IS_APPROX(ma1, ma2);
VERIFY_IS_APPROX(ma1, ma3);
ei_aligned_free(array1, size);
ei_aligned_free(array2, size);
ei_aligned_delete(array1, size);
ei_aligned_delete(array2, size);
delete[] array3;
}