lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Struct packing/alignment problems


From: Leon Woestenberg
Subject: Re: [lwip-users] Struct packing/alignment problems
Date: Tue, 04 May 2004 19:28:01 +0200
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)


Hello all,

Timmy Brolin wrote:

Why would they be put on 4 byte boundaries? The natural boundary of u16s is 2 bytes, not 4 bytes. Putting a u16 on a 4 byte boundary changes nothing.
>
OK, we all seem to agree on the fact that types should always be aligned on their natural alignment boundaries.

The real question is whether the compiler is allowed to add *extra*
padding (for performance reasons or whatever). If a compiler is free
to add extra padding (i.e. other than for alignment reasons) we need
to keep it from doing this (through packing).

Can we give live examples of extranous padding?

I remember the packing stuff being added for *some* reason, although
I cannot remember the specific compiler or platform.

Regards,

Leon.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]