57 #ifndef LWIP_HDR_MEMP_H 58 #define LWIP_HDR_MEMP_H 65 #define LWIP_MEMPOOL(name,num,size,desc) 70 #define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name, 78 extern const struct memp_desc*
const memp_pools[MEMP_MAX];
84 #define LWIP_MEMPOOL_PROTOTYPE(name) extern const struct memp_desc memp_ ## name 88 #define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \ 89 LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \ 90 const struct memp_desc memp_ ## name = { \ 91 DECLARE_LWIP_MEMPOOL_DESC(desc) \ 92 LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \ 93 LWIP_MEM_ALIGN_SIZE(size) \ 112 #define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \ 113 LWIP_DECLARE_MEMORY_ALIGNED(memp_memory_ ## name ## _base, ((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))); \ 115 LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \ 117 static struct memp *memp_tab_ ## name; \ 119 const struct memp_desc memp_ ## name = { \ 120 DECLARE_LWIP_MEMPOOL_DESC(desc) \ 121 LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \ 122 LWIP_MEM_ALIGN_SIZE(size), \ 124 memp_memory_ ## name ## _base, \ 134 #define LWIP_MEMPOOL_INIT(name) memp_init_pool(&memp_ ## name) 139 #define LWIP_MEMPOOL_ALLOC(name) memp_malloc_pool(&memp_ ## name) 144 #define LWIP_MEMPOOL_FREE(name, x) memp_free_pool(&memp_ ## name, (x)) 149 struct memp_malloc_helper
152 #if MEMP_OVERFLOW_CHECK || (LWIP_STATS && MEM_STATS) 160 #if MEMP_OVERFLOW_CHECK 161 void *memp_malloc_fn(memp_t type,
const char* file,
const int line);
162 #define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__)
void * memp_malloc(memp_t type)
void memp_free(memp_t type, void *mem)