What does this C++ code do? How come the __attribute__ is there?
struct foo { double t[4] __attribute__((aligned(64))); };
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Type-Attributes.html:
Therefore, that code in question effectively asks the compiler to align
ton a 64-byte boundary (normally, it would be aligned on an 8-byte boundary due as it is an array ofdouble).