Re: [eigen] Alignment issues

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]



Il giorno 13/feb/2014, alle ore 23:36, Gael Guennebaud <gael.guennebaud@xxxxxxxxx> ha scritto:


I tried the following: http://ideone.com/XpgXyG

and with clang3.3/macosx 64bits, I get:

Address 0x7fff5274aa60 is 32 bytes aligned.

Address 0x7fff5274a980 is 128 bytes aligned.

Address 0x7fb9d9403940 is 64 bytes aligned.

Address 0x7fb9d94039c0 is 64 bytes aligned.

Address 0x7fb9d9801200 is 512 bytes aligned.

Address 0x7fb9d9801800 is 1024 bytes aligned.


meaning that std::vector seems to honor the alignas directive while new does not. On ideone it's even worse::


Address 0xffffffffbfbf2780 is 128 bytes aligned.
Address 0xffffffffbfbf2800 is 1024 bytes aligned.
Address 0xa047008 is 8 bytes aligned.
Address 0xa047090 is 16 bytes aligned.
Address 0xa047198 is 8 bytes aligned.
Address 0xa0476a0 is 32 bytes aligned.

gael

I would not trust ideone at all to deduce anything serious, so let’s move to clang’s results...

In your test program, requesting an alignment of 128 bytes is asking for troubles. The standard only guarantees support for alignment up
to alignof(std::max_align_t), which on OS X 64bits is 16. However, an unsupported alignment requirement should trigger a compile-time
error, so this actually sounds like a bug in clang. Since you’re using version 3.3 and alignment support was introduced right in that version,
it could be. But are you using truly clang 3.3 or are you using the 3.3svn shipped with Xcode 5?

Nicola





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/