aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/unalignedassert.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-01-08 15:20:21 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-01-08 15:20:21 +0000
commit1d52bd4cad64d8d8662f40c11210b705351b43ab (patch)
treec8fe83368e8e13ba7e8ec0c4ef078f5293cfea4d /test/unalignedassert.cpp
parente2d2a7d2226b85569a9360b9738c15498fb454ac (diff)
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
Diffstat (limited to 'test/unalignedassert.cpp')
-rw-r--r--test/unalignedassert.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/unalignedassert.cpp b/test/unalignedassert.cpp
index 7b6e3535d..8e0486e92 100644
--- a/test/unalignedassert.cpp
+++ b/test/unalignedassert.cpp
@@ -55,15 +55,16 @@ struct Bad6
Matrix<double, 3, 4> m; // bad: same reason
};
-struct Good7 : Eigen::WithAlignedOperatorNew
+struct Good7
{
+ EIGEN_MAKE_ALIGNED_OPERATOR_NEW(Good7)
Vector2d m;
float f; // make the struct have sizeof%16!=0 to make it a little more tricky when we allow an array of 2 such objects
};
struct Good8
{
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW
+ EIGEN_MAKE_ALIGNED_OPERATOR_NEW(Good8)
float f; // try the f at first -- the EIGEN_ALIGN_128 attribute of m should make that still work
Matrix4f m;
};
@@ -76,7 +77,7 @@ struct Good9
template<bool Align> struct Depends
{
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(Align)
+ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(Depends,Align)
Vector2d m;
float f;
};
@@ -97,7 +98,7 @@ void check_unalignedassert_bad()
float buf[sizeof(T)+16];
float *unaligned = buf;
while((reinterpret_cast<size_t>(unaligned)&0xf)==0) ++unaligned; // make sure unaligned is really unaligned
- T *x = new(static_cast<void*>(unaligned)) T;
+ T *x = ::new(static_cast<void*>(unaligned)) T;
x->~T();
}