lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Putting memp_memory (in core/memp.c) in its own section


From: David Brown
Subject: Re: [lwip-devel] Putting memp_memory (in core/memp.c) in its own section
Date: Mon, 24 Oct 2011 12:22:38 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1

On 24/10/2011 09:22, Simon Goldschmidt wrote:

David Brown<address@hidden>  wrote:
These macros alone would not be sufficient, since some compilers require
a couple of #pragma's here, and that always works badly with #define'd
macros.
[..]
You would need something like:

#ifdef LWIP_MEM_USE_INCLUDES
#  include "arch/lwipmembefore.h"
#endif
LWIP_MEM_BEFORE
static u8_t memp_memory[MEM_ALIGNMENT - 1
#define LWIP_MEMPOOL(name,num,size,desc) + ( (num) * (MEMP_SIZE +
MEMP_ALIGN_SIZE(size) ) )
#include "lwip/memp_std.h"
]
LWIP_MEM_AFTER
;
#ifdef LWIP_MEM_USE_INCLUDES
#  include "arch/lwipmemafter.h"
#endif

For one big memp_memory, that would be enough, but to be able to
move*all* lwIP-defined data to different sections, we would need to encode
which variable is defined in to the various defines and includes. That
would make it very unreadable though. I'd only implement this if people
really, really need it.

Simon

I agree that it would be ugly to have such includes for all LWIP data. While there may be some people who would like to collect all LWIP data in one place, the cost in readability would be too high for everyone else. It is also normally possible to use linker scripts to arrange this if you /really/ want to. Typically it is only "big" blocks of memory that have particular non-standard placement requirements.

mvh.,

David





reply via email to

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