コード行は千の言葉に値します:)これが私の問題です:
/* Platform specific 16-byte alignment macro switch.
On Visual C++ it would substitute __declspec(align(16)).
On GCC it substitutes __attribute__((aligned (16))).
*/
#define ALIGN_16 ...
struct ALIGN_16 A {...};
A* ptr = new A;
A* ptr2 = new A[20];
assert(size_t(ptr) % 16 == 0);
for (int i=0; i<20; ++i)
assert(size_t(ptr2+i) % 16 == 0);
assert(sizeof(A) % 16 == 0);
SSE をサポートするプラットフォームですべてのアサーションが渡されると期待できますか? ありがとうございました。
編集。部分的な回答。VS2008、GCC、ICC でいくつかのテストを行いました。MS コンパイラはptrとptr2の両方を整列させましたが、GCC と ICC はptr2の整列に失敗しました。