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: Jani Monoses
Subject: Re: [lwip-users] Struct packing/alignment problems
Date: Wed, 5 May 2004 07:41:31 +0300

> >
> Why would they be put on 4 byte boundaries? The natural boundary of
> u16s 
for more efficient access on platforms which access 32 bit aligned
values faster then if they were nonaligned (this requiring two bus
cycles)
And this optimization is good in general because most programs don't
care about padding or whatever the compiler does with its data as
long as _all_ access to that data is from the same program. However when
that data is seen by other apps (network packets, binary file contents)
the exact layout matters.
You don't really think that people added packing directives to
compilers and that we use it from lwip to confuse others do you :)




reply via email to

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