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), 144 static 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)))]; 162 static 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) ) ) 177 #if MEMP_SANITY_CHECK 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 203 static const char * memp_overflow_names[] = {
204 #define LWIP_MEMPOOL(name,num,size,desc) "/"desc, 217 memp_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 250 memp_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 281 memp_overflow_check_all(
void)
290 memp_overflow_check_element_overflow(
p,
i);
298 memp_overflow_check_element_underflow(
p,
i);
308 memp_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);
463 #if MEMP_SANITY_CHECK static const u16_t memp_sizes[MEMP_MAX]
#define MEMP_STATS_AVAIL(x, i, y)
char * strcat(char *DstString, const char *SrcString)
#define LWIP_ASSERT(message, assertion)
static const u16_t memp_num[MEMP_MAX]
void memp_free(memp_t type, void *mem)
GLfloat GLfloat GLfloat GLfloat h
#define LWIP_DEBUGF(debug, message)
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
#define MEMP_OVERFLOW_CHECK
#define MEMP_STATS_INC_USED(x, i)
#define SYS_ARCH_PROTECT(lev)
static struct memp * memp_tab[MEMP_MAX]
static u8_t memp_memory[MEM_ALIGNMENT - 1 #define LWIP_MEMPOOL(name, num, size, desc)]
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
#define LWIP_ERROR(message, expression, handler)
#define LWIP_DBG_LEVEL_SERIOUS
#define SYS_ARCH_DECL_PROTECT(lev)
#define LWIP_MEM_ALIGN(addr)
#define SYS_ARCH_UNPROTECT(lev)
#define MEMP_STATS_DEC(x, i)
#define MEMP_STATS_INC(x, i)
GLuint GLuint GLsizei GLenum type
void * memp_malloc(memp_t type)
const char * errstr(int errcode)