38 #ifndef LWIP_HDR_MEMP_PRIV_H
39 #define LWIP_HDR_MEMP_PRIV_H
50 #if MEMP_OVERFLOW_CHECK
54 #define MEMP_SIZE (LWIP_MEM_ALIGN_SIZE(sizeof(struct memp)) + MEM_SANITY_REGION_BEFORE_ALIGNED)
55 #define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x) + MEM_SANITY_REGION_AFTER_ALIGNED)
64 #define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x))
68 #if !MEMP_MEM_MALLOC || MEMP_OVERFLOW_CHECK
71 #if MEMP_OVERFLOW_CHECK
78 #if MEM_USE_POOLS && MEMP_USE_CUSTOM_POOLS
83 MEMP_POOL_HELPER_FIRST = ((
u8_t)
85 #define LWIP_MALLOC_MEMPOOL_START 1
86 #define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0
87 #define LWIP_MALLOC_MEMPOOL_END
92 MEMP_POOL_HELPER_LAST = ((
u8_t)
93 #define LWIP_MEMPOOL(name,num,size,desc)
94 #define LWIP_MALLOC_MEMPOOL_START
95 #define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size *
96 #define LWIP_MALLOC_MEMPOOL_END 1
103 #define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST)
104 #define MEMP_POOL_LAST ((memp_t) MEMP_POOL_HELPER_LAST)
109 #if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY
115 struct stats_mem *stats;
133 #if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY
134 #define DECLARE_LWIP_MEMPOOL_DESC(desc) (desc),
136 #define DECLARE_LWIP_MEMPOOL_DESC(desc)
140 #define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name) static struct stats_mem name;
141 #define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name) &name,
143 #define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name)
144 #define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name)
149 #if MEMP_OVERFLOW_CHECK
150 void *memp_malloc_pool_fn(
const struct memp_desc* desc,
const char* file,
const int line);
151 #define memp_malloc_pool(d) memp_malloc_pool_fn((d), __FILE__, __LINE__)
uint8_t u8_t
Definition: arch.h:125
uint16_t u16_t
Definition: arch.h:127
#define LWIP_MEMPOOL(name, num, size, desc)
Definition: memp.c:78
void * memp_malloc_pool(const struct memp_desc *desc)
Definition: memp.c:311
void memp_free_pool(const struct memp_desc *desc, void *mem)
Definition: memp.c:403
void memp_init_pool(const struct memp_desc *desc)
Definition: memp.c:175
Definition: memp_priv.h:108
u16_t size
Definition: memp_priv.h:119
u16_t num
Definition: memp_priv.h:123
u8_t * base
Definition: memp_priv.h:126
struct memp ** tab
Definition: memp_priv.h:129
Definition: memp_priv.h:69
struct memp * next
Definition: memp_priv.h:70