MeterLogger
memp.c
Go to the documentation of this file.
1 /**
2  * @file
3  * Dynamic pool memory manager
4  *
5  * lwIP has dedicated pools for many structures (netconn, protocol control blocks,
6  * packet buffers, ...). All these pools are managed here.
7  */
8 
9 /*
10  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
11  * All rights reserved.
12  *
13  * Redistribution and use in source and binary forms, with or without modification,
14  * are permitted provided that the following conditions are met:
15  *
16  * 1. Redistributions of source code must retain the above copyright notice,
17  * this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright notice,
19  * this list of conditions and the following disclaimer in the documentation
20  * and/or other materials provided with the distribution.
21  * 3. The name of the author may not be used to endorse or promote products
22  * derived from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
25  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
27  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
29  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
33  * OF SUCH DAMAGE.
34  *
35  * This file is part of the lwIP TCP/IP stack.
36  *
37  * Author: Adam Dunkels <adam@sics.se>
38  *
39  */
40 
41 #include "lwip/opt.h"
42 
43 #include "lwip/memp.h"
44 #include "lwip/pbuf.h"
45 #include "lwip/udp.h"
46 #include "lwip/raw.h"
47 #include "lwip/tcp_impl.h"
48 #include "lwip/igmp.h"
49 #include "lwip/api.h"
50 #include "lwip/api_msg.h"
51 #include "lwip/tcpip.h"
52 #include "lwip/sys.h"
53 #include "lwip/timers.h"
54 #include "lwip/stats.h"
55 #include "netif/etharp.h"
56 #include "lwip/ip_frag.h"
57 #include "lwip/snmp_structs.h"
58 #include "lwip/snmp_msg.h"
59 #include "lwip/dns.h"
60 #include "netif/ppp_oe.h"
61 
62 #include <string.h>
63 
64 #if !MEMP_MEM_MALLOC /* don't build if not configured for use in lwipopts.h */
65 
66 struct memp {
67  struct memp *next;
68 #if MEMP_OVERFLOW_CHECK
69  const char *file;
70  int line;
71 #endif /* MEMP_OVERFLOW_CHECK */
72 };
73 
74 #if MEMP_OVERFLOW_CHECK
75 /* if MEMP_OVERFLOW_CHECK is turned on, we reserve some bytes at the beginning
76  * and at the end of each element, initialize them as 0xcd and check
77  * them later. */
78 /* If MEMP_OVERFLOW_CHECK is >= 2, on every call to memp_malloc or memp_free,
79  * every single element in each pool is checked!
80  * This is VERY SLOW but also very helpful. */
81 /* MEMP_SANITY_REGION_BEFORE and MEMP_SANITY_REGION_AFTER can be overridden in
82  * lwipopts.h to change the amount reserved for checking. */
83 #ifndef MEMP_SANITY_REGION_BEFORE
84 #define MEMP_SANITY_REGION_BEFORE 16
85 #endif /* MEMP_SANITY_REGION_BEFORE*/
86 #if MEMP_SANITY_REGION_BEFORE > 0
87 #define MEMP_SANITY_REGION_BEFORE_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_BEFORE)
88 #else
89 #define MEMP_SANITY_REGION_BEFORE_ALIGNED 0
90 #endif /* MEMP_SANITY_REGION_BEFORE*/
91 #ifndef MEMP_SANITY_REGION_AFTER
92 #define MEMP_SANITY_REGION_AFTER 16
93 #endif /* MEMP_SANITY_REGION_AFTER*/
94 #if MEMP_SANITY_REGION_AFTER > 0
95 #define MEMP_SANITY_REGION_AFTER_ALIGNED LWIP_MEM_ALIGN_SIZE(MEMP_SANITY_REGION_AFTER)
96 #else
97 #define MEMP_SANITY_REGION_AFTER_ALIGNED 0
98 #endif /* MEMP_SANITY_REGION_AFTER*/
99 
100 /* MEMP_SIZE: save space for struct memp and for sanity check */
101 #define MEMP_SIZE (LWIP_MEM_ALIGN_SIZE(sizeof(struct memp)) + MEMP_SANITY_REGION_BEFORE_ALIGNED)
102 #define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x) + MEMP_SANITY_REGION_AFTER_ALIGNED)
103 
104 #else /* MEMP_OVERFLOW_CHECK */
105 
106 /* No sanity checks
107  * We don't need to preserve the struct memp while not allocated, so we
108  * can save a little space and set MEMP_SIZE to 0.
109  */
110 #define MEMP_SIZE 0
111 #define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x))
112 
113 #endif /* MEMP_OVERFLOW_CHECK */
114 
115 /** This array holds the first free element of each pool.
116  * Elements form a linked list. */
117 static struct memp *memp_tab[MEMP_MAX];
118 
119 #else /* MEMP_MEM_MALLOC */
120 
121 #define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x))
122 
123 #endif /* MEMP_MEM_MALLOC */
124 
125 /** This array holds the element sizes of each pool. */
126 #if !MEM_USE_POOLS && !MEMP_MEM_MALLOC
127 static
128 #endif
129 const u32_t memp_sizes[MEMP_MAX] ICACHE_RODATA_ATTR = { //LWIP_MEM_ALIGN_SIZE
130 #define LWIP_MEMPOOL(name,num,size,desc,attr) LWIP_MEM_ALIGN_SIZE(size),
131 #include "lwip/memp_std.h"
132 };
133 
135 
136 #if !MEMP_MEM_MALLOC /* don't build if not configured for use in lwipopts.h */
137 
138 /** This array holds the number of elements in each pool. */
139 static const u16_t memp_num[MEMP_MAX] = {
140 #define LWIP_MEMPOOL(name,num,size,desc,attr) (num),
141 #include "lwip/memp_std.h"
142 };
143 
144 /** This array holds a textual description of each pool. */
145 //#ifdef LWIP_DEBUG
146 //static const char *memp_desc[MEMP_MAX] = {
147 const char *memp_desc[MEMP_MAX] = {
148 #define LWIP_MEMPOOL(name,num,size,desc,attr) (desc),
149 #include "lwip/memp_std.h"
150 };
151 //#endif /* LWIP_DEBUG */
152 
153 #if MEMP_SEPARATE_POOLS
154 
155 /** This creates each memory pool. These are named memp_memory_XXX_base (where
156  * XXX is the name of the pool defined in memp_std.h).
157  * To relocate a pool, declare it as extern in cc.h. Example for GCC:
158  * extern u8_t __attribute__((section(".onchip_mem"))) memp_memory_UDP_PCB_base[];
159  */
160 #define LWIP_MEMPOOL(name,num,size,desc,attr) u8_t memp_memory_ ## name ## _base \
161  [((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))] attr;
162 #include "lwip/memp_std.h"
163 
164 /** This array holds the base of each memory pool. */
165 static u8_t *const memp_bases[] = {
166 #define LWIP_MEMPOOL(name,num,size,desc,attr) memp_memory_ ## name ## _base,
167 #include "lwip/memp_std.h"
168 };
169 
170 #else /* MEMP_SEPARATE_POOLS */
171 
172 /** This is the actual memory used by the pools (all pools in one big block). */
173 static u8_t memp_memory[MEM_ALIGNMENT - 1
174 #define LWIP_MEMPOOL(name,num,size,desc, attr) + ( (num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size) ) )
175 #include "lwip/memp_std.h"
176 ];
177 
178 #endif /* MEMP_SEPARATE_POOLS */
179 
180 #if MEMP_SANITY_CHECK
181 /**
182  * Check that memp-lists don't form a circle, modify by ives at 2014.4.23.
183  */
184 static int ICACHE_FLASH_ATTR
185 memp_sanity(void)
186 {
187  s16_t i;
188  struct memp *t, *h;
189 
190  for (i = 0; i < MEMP_MAX; i++) {
191  t = memp_tab[i];
192  if(t != NULL) {
193  for (h = t->next; (t != NULL) && (h != NULL); t = t->next,
194  h = (((h->next != NULL) && (h->next->next != NULL)) ? h->next->next : NULL)) {
195  if (t == h) {
196  return 0;
197  }
198  }
199  }
200  }
201  return 1;
202 }
203 #endif /* MEMP_SANITY_CHECK*/
204 #if MEMP_OVERFLOW_CHECK
205 #if defined(LWIP_DEBUG) && MEMP_STATS
206 static const char * memp_overflow_names[] = {
207 #define LWIP_MEMPOOL(name,num,size,desc,attr) "/"desc,
208 #include "lwip/memp_std.h"
209  };
210 #endif
211 
212 /**
213  * Check if a memp element was victim of an overflow
214  * (e.g. the restricted area after it has been altered)
215  *
216  * @param p the memp element to check
217  * @param memp_type the pool p comes from
218  */
219 static void ICACHE_FLASH_ATTR
220 memp_overflow_check_element_overflow(struct memp *p, u16_t memp_type)
221 {
222  u16_t k;
223  u8_t *m;
224 #if MEMP_SANITY_REGION_AFTER_ALIGNED > 0
225  m = (u8_t*)p + MEMP_SIZE + memp_sizes[memp_type];
226  for (k = 0; k < MEMP_SANITY_REGION_AFTER_ALIGNED; k++) {
227  if (m[k] != 0xcd) {
228  char errstr[128] = "detected memp overflow in pool ";
229  char digit[] = "0";
230  if(memp_type >= 10) {
231  digit[0] = '0' + (memp_type/10);
232  strcat(errstr, digit);
233  }
234  digit[0] = '0' + (memp_type%10);
235  strcat(errstr, digit);
236 #if defined(LWIP_DEBUG) && MEMP_STATS
237  strcat(errstr, memp_overflow_names[memp_type]);
238 #endif
239  LWIP_ASSERT(errstr, 0);
240  }
241  }
242 #endif
243 }
244 
245 /**
246  * Check if a memp element was victim of an underflow
247  * (e.g. the restricted area before it has been altered)
248  *
249  * @param p the memp element to check
250  * @param memp_type the pool p comes from
251  */
252 static void ICACHE_FLASH_ATTR
253 memp_overflow_check_element_underflow(struct memp *p, u16_t memp_type)
254 {
255  u16_t k;
256  u8_t *m;
257 #if MEMP_SANITY_REGION_BEFORE_ALIGNED > 0
258  m = (u8_t*)p + MEMP_SIZE - MEMP_SANITY_REGION_BEFORE_ALIGNED;
259  for (k = 0; k < MEMP_SANITY_REGION_BEFORE_ALIGNED; k++) {
260  if (m[k] != 0xcd) {
261  char errstr[128] = "detected memp underflow in pool ";
262  char digit[] = "0";
263  if(memp_type >= 10) {
264  digit[0] = '0' + (memp_type/10);
265  strcat(errstr, digit);
266  }
267  digit[0] = '0' + (memp_type%10);
268  strcat(errstr, digit);
269 #if defined(LWIP_DEBUG) && MEMP_STATS
270  strcat(errstr, memp_overflow_names[memp_type]);
271 #endif
272  LWIP_ASSERT(errstr, 0);
273  }
274  }
275 #endif
276 }
277 
278 /**
279  * Do an overflow check for all elements in every pool.
280  *
281  * @see memp_overflow_check_element for a description of the check
282  */
283 static void ICACHE_FLASH_ATTR
284 memp_overflow_check_all(void)
285 {
286  u16_t i, j;
287  struct memp *p;
288 
289  p = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
290  for (i = 0; i < MEMP_MAX; ++i) {
291  p = p;
292  for (j = 0; j < memp_num[i]; ++j) {
293  memp_overflow_check_element_overflow(p, i);
294  p = (struct memp*)((u8_t*)p + MEMP_SIZE + memp_sizes[i] + MEMP_SANITY_REGION_AFTER_ALIGNED);
295  }
296  }
297  p = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
298  for (i = 0; i < MEMP_MAX; ++i) {
299  p = p;
300  for (j = 0; j < memp_num[i]; ++j) {
301  memp_overflow_check_element_underflow(p, i);
302  p = (struct memp*)((u8_t*)p + MEMP_SIZE + memp_sizes[i] + MEMP_SANITY_REGION_AFTER_ALIGNED);
303  }
304  }
305 }
306 
307 /**
308  * Initialize the restricted areas of all memp elements in every pool.
309  */
310 static void ICACHE_FLASH_ATTR
311 memp_overflow_init(void)
312 {
313  u16_t i, j;
314  struct memp *p;
315  u8_t *m;
316 
317  p = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
318  for (i = 0; i < MEMP_MAX; ++i) {
319  p = p;
320  for (j = 0; j < memp_num[i]; ++j) {
321 #if MEMP_SANITY_REGION_BEFORE_ALIGNED > 0
322  m = (u8_t*)p + MEMP_SIZE - MEMP_SANITY_REGION_BEFORE_ALIGNED;
323  os_memset(m, 0xcd, MEMP_SANITY_REGION_BEFORE_ALIGNED);
324 #endif
325 #if MEMP_SANITY_REGION_AFTER_ALIGNED > 0
326  m = (u8_t*)p + MEMP_SIZE + memp_sizes[i];
327  os_memset(m, 0xcd, MEMP_SANITY_REGION_AFTER_ALIGNED);
328 #endif
329  p = (struct memp*)((u8_t*)p + MEMP_SIZE + memp_sizes[i] + MEMP_SANITY_REGION_AFTER_ALIGNED);
330  }
331  }
332 }
333 #endif /* MEMP_OVERFLOW_CHECK */
334 
335 /**
336  * Initialize this module.
337  *
338  * Carves out memp_memory into linked lists for each pool-type.
339  */
340 void
342 {
343  struct memp *memp;
344  u16_t i, j;
345 
346  for (i = 0; i < MEMP_MAX; ++i) {
347  MEMP_STATS_AVAIL(used, i, 0);
348  MEMP_STATS_AVAIL(max, i, 0);
349  MEMP_STATS_AVAIL(err, i, 0);
350  MEMP_STATS_AVAIL(avail, i, memp_num[i]);
351  }
352 
353 #if !MEMP_SEPARATE_POOLS
354  memp = (struct memp *)LWIP_MEM_ALIGN(memp_memory);
355 #endif /* !MEMP_SEPARATE_POOLS */
356  /* for every pool: */
357  for (i = 0; i < MEMP_MAX; ++i) {
358  memp_tab[i] = NULL;
359 #if MEMP_SEPARATE_POOLS
360  memp = (struct memp*)memp_bases[i];
361 #endif /* MEMP_SEPARATE_POOLS */
362  /* create a linked list of memp elements */
363  for (j = 0; j < memp_num[i]; ++j) {
364  memp->next = (struct memp *)memp_tab[i];
365  memp_tab[i] = memp;
366  memp = (struct memp *)(void *)((u8_t *)memp + MEMP_SIZE + memp_sizes[i]
368  + MEMP_SANITY_REGION_AFTER_ALIGNED
369 #endif
370  );
371  }
372  }
373 #if MEMP_OVERFLOW_CHECK
374  memp_overflow_init();
375  /* check everything a first time to see if it worked */
376  memp_overflow_check_all();
377 #endif /* MEMP_OVERFLOW_CHECK */
378 }
379 
380 /**
381  * Get an element from a specific pool.
382  *
383  * @param type the pool to get an element from
384  *
385  * the debug version has two more parameters:
386  * @param file file name calling this function
387  * @param line number of line where this function is called
388  *
389  * @return a pointer to the allocated memory or a NULL pointer on error
390  */
391 void *
392 #if !MEMP_OVERFLOW_CHECK
394 #else
395 memp_malloc_fn(memp_t type, const char* file, const int line)
396 #endif
397 {
398  struct memp *memp;
399  SYS_ARCH_DECL_PROTECT(old_level);
400 
401  LWIP_ERROR("memp_malloc: type < MEMP_MAX", (type < MEMP_MAX), return NULL;);
402 
403  SYS_ARCH_PROTECT(old_level);
404 #if MEMP_OVERFLOW_CHECK >= 2
405  memp_overflow_check_all();
406 #endif /* MEMP_OVERFLOW_CHECK >= 2 */
407 
408  memp = memp_tab[type];
409 
410  if (memp != NULL) {
411  memp_tab[type] = memp->next;
412 #if MEMP_OVERFLOW_CHECK
413  memp->next = NULL;
414  memp->file = file;
415  memp->line = line;
416 #endif /* MEMP_OVERFLOW_CHECK */
417  MEMP_STATS_INC_USED(used, type);
418  LWIP_ASSERT("memp_malloc: memp properly aligned",
419  ((mem_ptr_t)memp % MEM_ALIGNMENT) == 0);
420  memp = (struct memp*)(void *)((u8_t*)memp + MEMP_SIZE);
421  } else {
422  LWIP_DEBUGF(MEMP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("memp_malloc: out of memory in pool %s\n", memp_desc[type]));
423  MEMP_STATS_INC(err, type);
424  }
425 
426  SYS_ARCH_UNPROTECT(old_level);
427 
428  return memp;
429 }
430 
431 /**
432  * Put an element back into its pool.
433  *
434  * @param type the pool where to put mem
435  * @param mem the memp element to free
436  */
437 void
438 memp_free(memp_t type, void *mem)
439 {
440  struct memp *memp;
441  SYS_ARCH_DECL_PROTECT(old_level);
442 
443  if (mem == NULL) {
444  return;
445  }
446  LWIP_ASSERT("memp_free: mem properly aligned",
447  ((mem_ptr_t)mem % MEM_ALIGNMENT) == 0);
448 
449  memp = (struct memp *)(void *)((u8_t*)mem - MEMP_SIZE);
450 
451  SYS_ARCH_PROTECT(old_level);
452 #if MEMP_OVERFLOW_CHECK
453 #if MEMP_OVERFLOW_CHECK >= 2
454  memp_overflow_check_all();
455 #else
456  memp_overflow_check_element_overflow(memp, type);
457  memp_overflow_check_element_underflow(memp, type);
458 #endif /* MEMP_OVERFLOW_CHECK >= 2 */
459 #endif /* MEMP_OVERFLOW_CHECK */
460 
461  MEMP_STATS_DEC(used, type);
462 
463  memp->next = memp_tab[type];
464  memp_tab[type] = memp;
465 
466 #if MEMP_SANITY_CHECK
467  LWIP_ASSERT("memp sanity", memp_sanity());
468 #endif /* MEMP_SANITY_CHECK */
469 
470  SYS_ARCH_UNPROTECT(old_level);
471 }
472 
473 #endif /* MEMP_MEM_MALLOC */
474 #if 0
475 void memp_dump(void)
476 {
477  printf("sizeof raw_pcb %u, memp_s1 %u, %s\n", sizeof(struct raw_pcb), memp_sizes[0], memp_desc[0]);
478  printf("sizeof udp_pcb %u, memp_s2 %u, %s\n", sizeof(struct udp_pcb), memp_sizes[1], memp_desc[1]);
479  printf("sizeof tcp_pcb %u, memp_s3 %u, %s\n", sizeof(struct tcp_pcb), memp_sizes[2], memp_desc[2]);
480  printf("sizeof tcp_pcb_listen %u, memp_s4 %u, %s\n", sizeof(struct tcp_pcb_listen), memp_sizes[3], memp_desc[3]);
481  printf("sizeof tcp_seg %u, memp_s5 %u, %s\n", sizeof(struct tcp_seg), memp_sizes[4], memp_desc[4]);
482  printf("sizeof sys_timeo %u, memp_s6 %u, %s\n", sizeof(struct sys_timeo), memp_sizes[5], memp_desc[5]);
483  printf("sizeof pbuf %u, memp_s7 %u, %s\n", sizeof(struct pbuf), memp_sizes[6], memp_desc[6]);
484  printf("align pbuf size %u, memp_s8 %u, %s\n", (PBUF_POOL_BUFSIZE), memp_sizes[7], memp_desc[7]);
485  printf("TCP_MSS %d PBUF_LINK_HLEN %d ETH_PAD_SIZE %d\n", TCP_MSS, PBUF_LINK_HLEN, ETH_PAD_SIZE);
486  printf("TCP_MSS + PBUF_LINK_HLEN + ETH_PAD_SIZE %d \n", TCP_MSS+PBUF_LINK_HLEN+ETH_PAD_SIZE+40);
487  printf("test size %u\n",memp_sizes_test[0]);
488  printf("sizeof memp_memory_PBUF_pool %u \n", sizeof(memp_memory_PBUF_POOL_base));
489 }
490 #endif //0000
Definition: memp.h:46
#define MEMP_STATS_AVAIL(x, i, y)
Definition: stats.h:252
memp_t
Definition: memp.h:43
static u8_t memp_memory[MEM_ALIGNMENT - 1 #define LWIP_MEMPOOL(name, num, size, desc, attr)]
Definition: memp.c:176
#define MEMP_SIZE
Definition: memp.c:110
signed short s16_t
Definition: cc.h:55
#define NULL
Definition: def.h:47
#define strcat(a, b)
Definition: platform.h:23
#define ICACHE_FLASH_ATTR
Definition: c_types.h:99
#define MEM_ALIGNMENT
Definition: opt.h:124
static const u16_t memp_num[MEMP_MAX]
Definition: memp.c:139
#define MEMP_DEBUG
Definition: opt.h:1903
void memp_free(memp_t type, void *mem)
Definition: memp.c:438
#define SYS_ARCH_DECL_PROTECT(x)
Definition: cc.h:86
#define LWIP_ERROR(message, expression, handler)
Definition: debug.h:73
u8_t memp_memory_PBUF_POOL_base[]
u16_t memp_sizes_test[1]
Definition: memp.c:134
void memp_init(void)
Definition: memp.c:341
unsigned long u32_t
Definition: cc.h:56
#define LWIP_DEBUGF(debug, message)
Definition: debug.h:94
#define os_memset
Definition: osapi.h:38
#define LWIP_DBG_LEVEL_SERIOUS
Definition: debug.h:46
#define MEMP_OVERFLOW_CHECK
Definition: opt.h:154
Definition: pbuf.h:76
#define MEMP_STATS_INC_USED(x, i)
Definition: stats.h:255
struct memp * next
Definition: memp.c:67
unsigned long mem_ptr_t
Definition: cc.h:58
const char * memp_desc[MEMP_MAX]
Definition: memp.c:147
Definition: memp.c:66
#define PBUF_POOL_BUFSIZE
Definition: opt.h:1070
static struct memp * memp_tab[MEMP_MAX]
Definition: memp.c:117
#define SYS_ARCH_PROTECT(x)
Definition: cc.h:87
#define ETH_PAD_SIZE
Definition: opt.h:482
unsigned char u8_t
Definition: cc.h:52
#define LWIP_ASSERT(message, assertion)
Definition: debug.h:65
#define TCP_MSS
Definition: opt.h:936
Definition: mem.c:155
#define MEMP_STATS_DEC(x, i)
Definition: stats.h:254
#define printf(...)
Definition: platform.h:13
static const u32_t memp_sizes [MEMP_MAX] ICACHE_RODATA_ATTR
Definition: memp.c:129
#define MEMP_STATS_INC(x, i)
Definition: stats.h:253
void * memp_malloc(memp_t type)
Definition: memp.c:393
#define PBUF_LINK_HLEN
Definition: opt.h:1061
#define SYS_ARCH_UNPROTECT(x)
Definition: cc.h:88
#define LWIP_MEM_ALIGN(addr)
Definition: mem.h:159
unsigned short u16_t
Definition: cc.h:54