38 #ifndef LWIP_HDR_MEMP_H
39 #define LWIP_HDR_MEMP_H
48 #define LWIP_MEMPOOL(name,num,size,desc)
53 #define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name,
67 #define LWIP_MEMPOOL_PROTOTYPE(name) extern const struct memp_desc memp_ ## name
71 #define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \
72 LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \
73 const struct memp_desc memp_ ## name = { \
74 DECLARE_LWIP_MEMPOOL_DESC(desc) \
75 LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \
76 LWIP_MEM_ALIGN_SIZE(size) \
95 #define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \
96 LWIP_DECLARE_MEMORY_ALIGNED(memp_memory_ ## name ## _base, ((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))); \
98 LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \
100 static struct memp *memp_tab_ ## name; \
102 const struct memp_desc memp_ ## name = { \
103 DECLARE_LWIP_MEMPOOL_DESC(desc) \
104 LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \
105 LWIP_MEM_ALIGN_SIZE(size), \
107 memp_memory_ ## name ## _base, \
117 #define LWIP_MEMPOOL_INIT(name) memp_init_pool(&memp_ ## name)
122 #define LWIP_MEMPOOL_ALLOC(name) memp_malloc_pool(&memp_ ## name)
127 #define LWIP_MEMPOOL_FREE(name, x) memp_free_pool(&memp_ ## name, (x))
132 struct memp_malloc_helper
135 #if MEMP_OVERFLOW_CHECK || (LWIP_STATS && MEM_STATS)
143 #if MEMP_OVERFLOW_CHECK
144 void *memp_malloc_fn(
memp_t type,
const char* file,
const int line);
145 #define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__)
uint16_t u16_t
Definition: arch.h:127
void * memp_malloc(memp_t type)
Definition: memp.c:337
memp_t
Definition: memp.h:52
@ MEMP_MAX
Definition: memp.h:55
void memp_init(void)
Definition: memp.c:224
const struct memp_desc *const memp_pools[MEMP_MAX]
Definition: memp.c:81
void memp_free(memp_t type, void *mem)
Definition: memp.c:420
Definition: memp_priv.h:108