buglwIP - A Lightweight TCP/IP stack - Bugs: bug #36412, memp.c does not compile when...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #36412: memp.c does not compile when MEMP_OVERFLOW_CHECK > zero and MEMP_SEPARATE_POOLS == 1

Submitted by:  Simon Goldschmidt <goldsimon>
Submitted on:  Sun 06 May 2012 11:32:32 AM UTC  
Votes:  100  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Thu 06 Mar 2014 01:50:27 PM UTC, comment #3:

> Too bad it is not in the repo yet.


What do you mean with that? Are you using CVS maybe? We have switched to git a long time ago, CVS is not updated any more. I just don't know how to remove it from the menu....

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 06 Mar 2014 01:30:35 PM UTC, comment #2:

Thanks a lot for the update! Too bad it is not in the repo yet. This code should be added to Lwip, it is working great.

greetings,
Bart

Bart Houkes <mensfort>
Fri 11 May 2012 08:57:08 PM UTC, comment #1:

Fixed in master.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Sun 06 May 2012 11:32:32 AM UTC, original submission:

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);
}
}
}

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mensfort (Posted a comment)
  • -unavailable- added by mensfort (Voted in favor of this item)
  • -unavailable- added by goldsimon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 100 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 06 Mar 2014 01:28:07 PM UTCmensfortCarbon-Copy-=>Added mensfort
    Fri 11 May 2012 08:57:08 PM UTCgoldsimonStatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1