68#if MEMP_OVERFLOW_CHECK
74#if MEMP_OVERFLOW_CHECK
83#ifndef MEMP_SANITY_REGION_BEFORE
84#define MEMP_SANITY_REGION_BEFORE 16
86#if MEMP_SANITY_REGION_BEFORE > 0
87#define MEMP_SANITY_REGION_BEFORE_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_BEFORE)
89#define MEMP_SANITY_REGION_BEFORE_ALIGNED 0
91#ifndef MEMP_SANITY_REGION_AFTER
92#define MEMP_SANITY_REGION_AFTER 16
94#if MEMP_SANITY_REGION_AFTER > 0
95#define MEMP_SANITY_REGION_AFTER_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_AFTER)
97#define MEMP_SANITY_REGION_AFTER_ALIGNED 0
101#define MEMP_SIZE (LWIP_MEM_ALIGN_SIZE(sizeof(struct memp)) + MEMP_SANITY_REGION_BEFORE_ALIGNED)
102#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x) + MEMP_SANITY_REGION_AFTER_ALIGNED)
111#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x))
121#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x))
126#if !MEM_USE_POOLS && !MEMP_MEM_MALLOC
130#define LWIP_MEMPOOL(name,num,size,desc) LWIP_MEM_ALIGN_SIZE(size),
138#define LWIP_MEMPOOL(name,num,size,desc) (num),
144static const char *memp_desc[
MEMP_MAX] = {
145#define LWIP_MEMPOOL(name,num,size,desc) (desc),
150#if MEMP_SEPARATE_POOLS
157#define LWIP_MEMPOOL(name,num,size,desc) u8_t memp_memory_ ## name ## _base \
158 [((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))];
162static u8_t *
const memp_bases[] = {
163#define LWIP_MEMPOOL(name,num,size,desc) memp_memory_ ## name ## _base,
171#define LWIP_MEMPOOL(name,num,size,desc) + ( (num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size) ) )
191 h = (((
h->next !=
NULL) && (
h->next->next !=
NULL)) ?
h->next->next :
NULL)) {
201#if MEMP_OVERFLOW_CHECK
202#if defined(LWIP_DEBUG) && MEMP_STATS
203static const char * memp_overflow_names[] = {
204#define LWIP_MEMPOOL(name,num,size,desc) "/"desc,
217memp_overflow_check_element_overflow(
struct memp *
p,
u16_t memp_type)
221#if MEMP_SANITY_REGION_AFTER_ALIGNED > 0
223 for (
k = 0;
k < MEMP_SANITY_REGION_AFTER_ALIGNED;
k++) {
225 char errstr[128] =
"detected memp overflow in pool ";
227 if(memp_type >= 10) {
228 digit[0] =
'0' + (memp_type/10);
231 digit[0] =
'0' + (memp_type%10);
233#if defined(LWIP_DEBUG) && MEMP_STATS
250memp_overflow_check_element_underflow(
struct memp *
p,
u16_t memp_type)
254#if MEMP_SANITY_REGION_BEFORE_ALIGNED > 0
256 for (
k = 0;
k < MEMP_SANITY_REGION_BEFORE_ALIGNED;
k++) {
258 char errstr[128] =
"detected memp underflow in pool ";
260 if(memp_type >= 10) {
261 digit[0] =
'0' + (memp_type/10);
264 digit[0] =
'0' + (memp_type%10);
266#if defined(LWIP_DEBUG) && MEMP_STATS
281memp_overflow_check_all(
void)
290 memp_overflow_check_element_overflow(
p,
i);
298 memp_overflow_check_element_underflow(
p,
i);
308memp_overflow_init(
void)
318#if MEMP_SANITY_REGION_BEFORE_ALIGNED > 0
320 memset(
m, 0xcd, MEMP_SANITY_REGION_BEFORE_ALIGNED);
322#if MEMP_SANITY_REGION_AFTER_ALIGNED > 0
324 memset(
m, 0xcd, MEMP_SANITY_REGION_AFTER_ALIGNED);
350#if !MEMP_SEPARATE_POOLS
356#if MEMP_SEPARATE_POOLS
365 + MEMP_SANITY_REGION_AFTER_ALIGNED
370#if MEMP_OVERFLOW_CHECK
371 memp_overflow_init();
373 memp_overflow_check_all();
389#if !MEMP_OVERFLOW_CHECK
401#if MEMP_OVERFLOW_CHECK >= 2
402 memp_overflow_check_all();
409#if MEMP_OVERFLOW_CHECK
449#if MEMP_OVERFLOW_CHECK
450#if MEMP_OVERFLOW_CHECK >= 2
451 memp_overflow_check_all();
453 memp_overflow_check_element_overflow(
memp,
type);
454 memp_overflow_check_element_underflow(
memp,
type);
char * strcat(char *DstString, const char *SrcString)
#define SYS_ARCH_UNPROTECT(lev)
#define SYS_ARCH_PROTECT(lev)
#define SYS_ARCH_DECL_PROTECT(lev)
#define LWIP_DBG_LEVEL_SERIOUS
#define LWIP_DEBUGF(debug, message)
#define LWIP_ERROR(message, expression, handler)
#define LWIP_ASSERT(message, assertion)
#define LWIP_MEM_ALIGN(addr)
GLuint GLuint GLsizei GLenum type
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static const u16_t memp_num[MEMP_MAX]
static u8_t memp_memory[MEM_ALIGNMENT - 1 #define LWIP_MEMPOOL(name, num, size, desc)]
static const u16_t memp_sizes[MEMP_MAX]
static struct memp * memp_tab[MEMP_MAX]
void * memp_malloc(memp_t type)
void memp_free(memp_t type, void *mem)
#define MEMP_OVERFLOW_CHECK
#define MEMP_STATS_INC_USED(x, i)
#define MEMP_STATS_INC(x, i)
#define MEMP_STATS_AVAIL(x, i, y)
#define MEMP_STATS_DEC(x, i)
const char * errstr(int errcode)