1
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
53
54
58
59
70
71
72
73
74
75
76
77
78
79
80
81
82
/* ... */
/* ... */
#ifndef LWIP_HDR_MEM_H
#define LWIP_HDR_MEM_H
#include "lwip/opt.h"
#ifdef __cplusplus
extern "C" {
#endif
#if MEM_LIBC_MALLOC
#include "lwip/arch.h"
typedef size_t mem_size_t;
#define MEM_SIZE_F SZT_F
/* ... */
#elif MEM_USE_POOLS
typedef u16_t mem_size_t;
#define MEM_SIZE_F U16_F
/* ... */
#else
/* ... */
#if MEM_SIZE > 64000L
typedef u32_t mem_size_t;
#define MEM_SIZE_F U32_F
/* ... */#else
typedef u16_t mem_size_t;
#define MEM_SIZE_F U16_F
/* ... */#endif /* ... */
#endif
void mem_init(void);
void *mem_trim(void *mem, mem_size_t size);
void *mem_malloc(mem_size_t size);
void *mem_calloc(mem_size_t count, mem_size_t size);
void mem_free(void *mem);
#ifdef __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif