add switch for MEMP_SANITY_CHECK defaulting to off

This commit is contained in:
jani 2004-02-26 10:43:09 +00:00
parent ed4c5d88a3
commit 33d0096b81
2 changed files with 8 additions and 2 deletions

View File

@ -120,7 +120,7 @@ static u8_t memp_memory[(MEMP_NUM_PBUF *
static sys_sem_t mutex;
#endif
#ifndef LWIP_NOASSERT
#if MEMP_SANITY_CHECK
static int
memp_sanity(void)
{
@ -140,7 +140,7 @@ memp_sanity(void)
}
return 1;
}
#endif /* LWIP_DEBUG */
#endif /* MEMP_SANITY_CHECK*/
void
memp_init(void)
@ -261,7 +261,9 @@ memp_free(memp_t type, void *mem)
memp->next = memp_tab[type];
memp_tab[type] = memp;
#if MEMP_SANITY_CHECK
LWIP_ASSERT("memp sanity", memp_sanity());
#endif
#if SYS_LIGHTWEIGHT_PROT
SYS_ARCH_UNPROTECT(old_level);

View File

@ -67,6 +67,10 @@ a lot of data that needs to be copied, this should be set high. */
#define MEM_SIZE 1600
#endif
#ifndef MEMP_SANITY_CHECK
#define MEMP_SANITY_CHECK 0
#endif
/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
sends a lot of data out of ROM (or other static memory), this
should be set high. */