57 #ifndef LWIP_HDR_MEMP_PRIV_H 58 #define LWIP_HDR_MEMP_PRIV_H 68 #if MEMP_OVERFLOW_CHECK 77 #ifndef MEMP_SANITY_REGION_BEFORE 78 #define MEMP_SANITY_REGION_BEFORE 16 80 #if MEMP_SANITY_REGION_BEFORE > 0 81 #define MEMP_SANITY_REGION_BEFORE_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_BEFORE) 83 #define MEMP_SANITY_REGION_BEFORE_ALIGNED 0 85 #ifndef MEMP_SANITY_REGION_AFTER 86 #define MEMP_SANITY_REGION_AFTER 16 88 #if MEMP_SANITY_REGION_AFTER > 0 89 #define MEMP_SANITY_REGION_AFTER_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_AFTER) 91 #define MEMP_SANITY_REGION_AFTER_ALIGNED 0 95 #define MEMP_SIZE (LWIP_MEM_ALIGN_SIZE(sizeof(struct memp)) + MEMP_SANITY_REGION_BEFORE_ALIGNED) 96 #define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x) + MEMP_SANITY_REGION_AFTER_ALIGNED) 105 #define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x)) 109 #if !MEMP_MEM_MALLOC || MEMP_OVERFLOW_CHECK 112 #if MEMP_OVERFLOW_CHECK 119 #if MEM_USE_POOLS && MEMP_USE_CUSTOM_POOLS 124 MEMP_POOL_HELPER_FIRST = ((u8_t)
125 #define LWIP_MEMPOOL(name,num,size,desc)
126 #define LWIP_MALLOC_MEMPOOL_START 1 127 #define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0 128 #define LWIP_MALLOC_MEMPOOL_END 133 MEMP_POOL_HELPER_LAST = ((u8_t)
134 #define LWIP_MEMPOOL(name,num,size,desc) 135 #define LWIP_MALLOC_MEMPOOL_START 136 #define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size * 137 #define LWIP_MALLOC_MEMPOOL_END 1 140 } memp_pool_helper_t;
144 #define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST) 145 #define MEMP_POOL_LAST ((memp_t) MEMP_POOL_HELPER_LAST) 150 #if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY 156 struct stats_mem *stats;
174 #if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY 175 #define DECLARE_LWIP_MEMPOOL_DESC(desc) (desc), 177 #define DECLARE_LWIP_MEMPOOL_DESC(desc) 181 #define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name) static struct stats_mem name; 182 #define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name) &name, 184 #define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name) 185 #define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name) 190 #if MEMP_OVERFLOW_CHECK 191 void *memp_malloc_pool_fn(
const struct memp_desc* desc,
const char* file,
const int line);
192 #define memp_malloc_pool(d) memp_malloc_pool_fn((d), __FILE__, __LINE__)
void memp_init_pool(const struct memp_desc *desc)
void memp_free_pool(const struct memp_desc *desc, void *mem)
void * memp_malloc_pool(const struct memp_desc *desc)