From 1d52bd4cad64d8d8662f40c11210b705351b43ab Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 8 Jan 2009 15:20:21 +0000 Subject: 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 --- test/unalignedassert.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/unalignedassert.cpp') 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 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 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(unaligned)&0xf)==0) ++unaligned; // make sure unaligned is really unaligned - T *x = new(static_cast(unaligned)) T; + T *x = ::new(static_cast(unaligned)) T; x->~T(); } -- cgit v1.2.3