lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] structure packaging


From: mgroups
Subject: Re: [lwip-users] structure packaging
Date: Thu, 06 May 2010 14:39:36 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4

address@hidden wrote:
address@hidden wrote:
There are some structures that are by default not packed but only work
if they are packed.
The following structures are:
struct mem in mem.c
struct pbuf in pbuf.h
struct dhcp in dhcp.h

Is there any reason that they are not packed by default? Because I think
they should be.
Has anyone had similar problems?
Can you explain why these should be packed? Structure packing should only be necessary for protocol headers where the structures are used to describe a well-defined header layout. In contrast to this, the structures above are used internally only and thus don't need to be packed.

The only exception to this in the lwIP code currently is the struct ip_reass_helper, which is only packed to know that its size isn't enlarged by an optimizing compiler, but that's not valid for mem/pbuf/dhcp.

Simon


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users

I had some problems with memory alignment on my platform. The packaging of these structures solved the symptoms.
I changed to the right pragma pack and now everything works fine.

Yours
Matthias




reply via email to

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