[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #36412] memp.c does not compile when MEMP_OVERFLOW_CHE
From: |
Simon Goldschmidt |
Subject: |
[lwip-devel] [bug #36412] memp.c does not compile when MEMP_OVERFLOW_CHECK > zero and MEMP_SEPARATE_POOLS == 1 |
Date: |
Sun, 06 May 2012 11:32:33 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20100101 Firefox/11.0 |
URL:
<http://savannah.nongnu.org/bugs/?36412>
Summary: memp.c does not compile when MEMP_OVERFLOW_CHECK >
zero and MEMP_SEPARATE_POOLS == 1
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: goldsimon
Submitted on: So 06 Mai 2012 11:32:32 GMT
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release:
lwIP version: CVS Head
_______________________________________________________
Details:
This came in on lwip-devel:
When MEMP_OVERFLOW_CHECK > zero and MEMP_SEPARATE_POOLS == one, memp.c does
not compile. The fixed code is copied below (lines are bolded, if that comes
through), replicating the pattern from memp_init(). It's just wrapping the
initializations of "p" appropriately.
Not sure what the procedure is for getting this reviewed and included...
Marty
static void
memp_overflow_check_all(void)
{
u16_t i, j;
struct memp *p;
#if !MEMP_SEPARATE_POOLS
p = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
#endif /* !MEMP_SEPARATE_POOLS */
for (i = 0; i < MEMP_MAX; ++i) {
#if MEMP_SEPARATE_POOLS
p = (struct memp *)(memp_bases[i]);
#endif /* MEMP_SEPARATE_POOLS */
for (j = 0; j < memp_num[i]; ++j) {
memp_overflow_check_element_overflow(p, i);
p = (struct memp*)((u8_t*)p + MEMP_SIZE + memp_sizes[i] +
MEMP_SANITY_REGION_AFTER_ALIGNED);
}
}
#if !MEMP_SEPARATE_POOLS
p = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
#endif /* !MEMP_SEPARATE_POOLS */
for (i = 0; i < MEMP_MAX; ++i) {
#if MEMP_SEPARATE_POOLS
p = (struct memp *)(memp_bases[i]);
#endif /* MEMP_SEPARATE_POOLS */
for (j = 0; j < memp_num[i]; ++j) {
memp_overflow_check_element_underflow(p, i);
p = (struct memp*)((u8_t*)p + MEMP_SIZE + memp_sizes[i] +
MEMP_SANITY_REGION_AFTER_ALIGNED);
}
}
}
/**
* Initialize the restricted areas of all memp elements in every pool.
*/
static void
memp_overflow_init(void)
{
u16_t i, j;
struct memp *p;
u8_t *m;
#if !MEMP_SEPARATE_POOLS
p = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
#endif /* !MEMP_SEPARATE_POOLS */
for (i = 0; i < MEMP_MAX; ++i) {
#if MEMP_SEPARATE_POOLS
p = (struct memp *)(memp_bases[i]);
#endif /* MEMP_SEPARATE_POOLS */
for (j = 0; j < memp_num[i]; ++j) {
#if MEMP_SANITY_REGION_BEFORE_ALIGNED > 0
m = (u8_t*)p + MEMP_SIZE - MEMP_SANITY_REGION_BEFORE_ALIGNED;
memset(m, 0xcd, MEMP_SANITY_REGION_BEFORE_ALIGNED);
#endif
#if MEMP_SANITY_REGION_AFTER_ALIGNED > 0
m = (u8_t*)p + MEMP_SIZE + memp_sizes[i];
memset(m, 0xcd, MEMP_SANITY_REGION_AFTER_ALIGNED);
#endif
p = (struct memp*)((u8_t*)p + MEMP_SIZE + memp_sizes[i] +
MEMP_SANITY_REGION_AFTER_ALIGNED);
}
}
}
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?36412>
_______________________________________________
Nachricht gesendet von/durch Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #36412] memp.c does not compile when MEMP_OVERFLOW_CHECK > zero and MEMP_SEPARATE_POOLS == 1,
Simon Goldschmidt <=