Re: Alignment - Structures and Other Things

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

 



Hi,

On Wed, Apr 13, 2011 at 2:26 PM, Andrew Bell <andrew.bell.ia@xxxxxxxxx> wrote:
>
> malloc() will return memory on a boundary suitable for any type.  If
> some types must be, say, 8-byte aligned, malloc will return memory
> that is 8-byte aligned.  This of course satisfies types that are
> 4-byte, 2-byte and non-aligned.
>
> Your example code will end up breaking on some systems.
>
Even if it doesn't break it will likely incur a performance penalty
from unaligned accesses, right?

> --
> Andrew Bell
> andrew.bell.ia@xxxxxxxxx
>



[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