Re: Bloated Struct Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/6/4 . . <pkejjy@xxxxxxxxx>:
> 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?

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux