This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Bloated Struct Problem
2009/6/4 . . <pkejjy@gmail.com>:
> If so, that would be a bad performance decision in this
> multicore world, where memory footprint size matters much more than
> alignment, generally speaking.
>
But sharing of cache lines between unrelated things can be even worse.
And as you said, the point is to make the 64-bit ints properly aligned
when arrays of the type are used. There are numerous architectures
which cannot read mis-aligned types, and those that can are usually
fairly slow at it -- especially when then end up straddling cache
lines, as an array of 17-byte structs certainly would, at some point.
There is, iirc, an __attribute__ that'll let you pack it, if you
insist. Do you have profiler feedback that says it actually matters?