32 #ifndef __LWIP_MEM_H__
33 #define __LWIP_MEM_H__
36 #include "mem_manager.h"
46 typedef size_t mem_size_t;
54 #define mem_free(p) vPortFree(p, "", 0)
57 #define mem_malloc(s) pvPortMalloc(s, "", 0)
60 #define mem_calloc(s) pvPortCalloc(s, "", 0)
63 #define mem_realloc(p, s) pvPortRealloc(p, s, "", 0)
66 #define mem_zalloc(s) pvPortZalloc(s, "", 0)
70 #define os_malloc(s) mem_malloc((s))
73 #define os_realloc(p, s) mem_realloc((p), (s))
76 #define os_zalloc(s) mem_zalloc((s))
79 #define os_free(p) mem_free((p))
85 #define mem_trim(mem, size) (mem)
93 typedef u32_t mem_size_t;
94 #define MEM_SIZE_F U32_F
96 typedef u16_t mem_size_t;
97 #define MEM_SIZE_F U16_F
105 #define mem_trim(mem, size) (mem)
108 void mem_init(
void)ICACHE_FLASH_ATTR;
109 void *mem_trim(
void *mem, mem_size_t size)ICACHE_FLASH_ATTR;
111 void *mem_malloc(mem_size_t size)ICACHE_FLASH_ATTR;
112 void *mem_calloc(mem_size_t count, mem_size_t size)ICACHE_FLASH_ATTR;
113 void mem_free(
void *mem)ICACHE_FLASH_ATTR;
120 #ifndef LWIP_MEM_ALIGN_SIZE
121 #define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1) & ~(MEM_ALIGNMENT-1))
128 #ifndef LWIP_MEM_ALIGN_BUFFER
129 #define LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1))
135 #ifndef LWIP_MEM_ALIGN
136 #define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1)))