This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

sizeof std::tr1::array


This has probably been discussed before, but I can't find any information on it.

Unlike boost::array, std::tr1::array (and std::array in 4.3.x) has an
attribute-alignment on its data, which means that sizeof(the_array) is
always a multiple of 16, at least on all systems I'm currently using:

    value_type _M_instance[_Nm ? _Nm : 1] __attribute__((__aligned__));

This is rather inconvenient, and somewhat unnecessary, especially on
embedded systems, since there's a nontrivial hidden cost here.  I have
a harder time convincing programmers not to roll-their-own when I see
stuff like that.

Can I get an explanation please?
Thanks in advance.
Aaron


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]