Prusa MINI Firmware overview
|
Go to the documentation of this file.
38 #ifndef LWIP_HDR_MEMP_PRIV_H
39 #define LWIP_HDR_MEMP_PRIV_H
49 #if MEMP_OVERFLOW_CHECK
58 #ifndef MEMP_SANITY_REGION_BEFORE
59 #define MEMP_SANITY_REGION_BEFORE 16
61 #if MEMP_SANITY_REGION_BEFORE > 0
62 #define MEMP_SANITY_REGION_BEFORE_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_BEFORE)
64 #define MEMP_SANITY_REGION_BEFORE_ALIGNED 0
66 #ifndef MEMP_SANITY_REGION_AFTER
67 #define MEMP_SANITY_REGION_AFTER 16
69 #if MEMP_SANITY_REGION_AFTER > 0
70 #define MEMP_SANITY_REGION_AFTER_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_AFTER)
72 #define MEMP_SANITY_REGION_AFTER_ALIGNED 0
76 #define MEMP_SIZE (LWIP_MEM_ALIGN_SIZE(sizeof(struct memp)) + MEMP_SANITY_REGION_BEFORE_ALIGNED)
77 #define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x) + MEMP_SANITY_REGION_AFTER_ALIGNED)
86 #define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x))
90 #if !MEMP_MEM_MALLOC || MEMP_OVERFLOW_CHECK
93 #if MEMP_OVERFLOW_CHECK
100 #if MEM_USE_POOLS && MEMP_USE_CUSTOM_POOLS
105 MEMP_POOL_HELPER_FIRST = ((
u8_t)
107 #define LWIP_MALLOC_MEMPOOL_START 1
108 #define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0
109 #define LWIP_MALLOC_MEMPOOL_END
114 MEMP_POOL_HELPER_LAST = ((
u8_t)
115 #define LWIP_MEMPOOL(name,num,size,desc)
116 #define LWIP_MALLOC_MEMPOOL_START
117 #define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size *
118 #define LWIP_MALLOC_MEMPOOL_END 1
121 } memp_pool_helper_t;
125 #define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST)
126 #define MEMP_POOL_LAST ((memp_t) MEMP_POOL_HELPER_LAST)
131 #if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY
137 struct stats_mem *stats;
155 #if defined(LWIP_DEBUG) || MEMP_OVERFLOW_CHECK || LWIP_STATS_DISPLAY
156 #define DECLARE_LWIP_MEMPOOL_DESC(desc) (desc),
158 #define DECLARE_LWIP_MEMPOOL_DESC(desc)
162 #define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name) static struct stats_mem name;
163 #define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name) &name,
165 #define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name)
166 #define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name)
171 #if MEMP_OVERFLOW_CHECK
172 void *memp_malloc_pool_fn(
const struct memp_desc* desc,
const char* file,
const int line);
173 #define memp_malloc_pool(d) memp_malloc_pool_fn((d), __FILE__, __LINE__)
Definition: memp_priv.h:130
uint16_t u16_t
Definition: arch.h:121
u8_t * base
Definition: memp_priv.h:148
void memp_free_pool(const struct memp_desc *desc, void *mem)
Definition: memp.c:452
#define LWIP_MEMPOOL(name, num, size, desc)
Definition: memp.c:78
struct memp * next
Definition: memp_priv.h:92
uint8_t u8_t
Definition: arch.h:119
u16_t num
Definition: memp_priv.h:145
u16_t size
Definition: memp_priv.h:141
void memp_init_pool(const struct memp_desc *desc)
Definition: memp.c:230
struct memp ** tab
Definition: memp_priv.h:151
Definition: memp_priv.h:91
void * memp_malloc_pool(const struct memp_desc *desc)
Definition: memp.c:359
static png_bytep size_t size
Definition: pngwrite.c:2170