[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] MEM_ALIGNMENT and mem.c
From: |
Martin Glunz |
Subject: |
[lwip-users] Re: [lwip] MEM_ALIGNMENT and mem.c |
Date: |
Wed, 08 Jan 2003 23:28:42 -0000 |
"Recker, John" wrote:
>
> I started looking at the CVS code, and
> noticed the following code in src/core/mem.c:
>
...
>
> I use MEM_ALIGNMENT == 4, for which the above
> code fails. (What do other people use on an ARM?)
> Also note that if one is going to use the "dummy"
> variable approach, or compute sizes that presume
> packing, one should probably also pack the structure.
>
In my knowledge there are two kinds of structs:
Such ones that are used as parts of packets (TCP/IP/ARP ...),
those should be packed with the exact sizes (and I think
they are, otherwise it wouldn not work).
And those that are used for internal purposes, as the
struct mem you mentioned. I do not see the need to
pack them or to fill in dummies, as usually the
compiles takes care of this.
In fact, I'd prefer using "int" instead of "u8_t"
or "u16_t" in non-critical places, as the explicit
usage of smaller types may cut down the performance
on 32 Bit systems.
Martin Glunz
fortune says today:
The typewriting machine, when played with expression, is no more
annoying than the piano when played by a sister or near relation.
-- Oscar Wilde
[This message was sent through the lwip discussion list.]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-users] Re: [lwip] MEM_ALIGNMENT and mem.c,
Martin Glunz <=