Skip to content

Commit 2e89983

Browse files
committed
feat(system): Provide more heap region (16KB+)
1. Change cache size from 32KB to 16KB, reverse this 16KB region as heap; 2. New heap to support seperate heap region; 3. Modify pvPortMalloc, support to choose malloc in iram; 4. Add new macro os_malloc_iram to malloc in iram; 5. Default malloc will malloc in iram firstly; Limitation: 1. Don't malloc task stack in iram; 2. Dont't use iram buffer as wifi tx buffer; If possible, use all of iram heap region firstly. internal : 2d3fbebb
1 parent b6ddeca commit 2e89983

24 files changed

+909
-725
lines changed

VERSION

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
gwen:
2-
espnow: 1aafc07
3-
main: caff253
4-
mesh: 1aafc07
5-
net80211: caff253
6-
pp: caff253
7-
wpa: caff253
8-
wps: 1aafc07
2+
crypto: a8c4880
3+
espnow: a8c4880
4+
main: a8c4880
5+
mesh: a8c4880
6+
minic: a8c4880
7+
net80211: a8c4880
8+
pp: a8c4880
9+
pwm: a8c4880
10+
smartconfig:a8c4880
11+
wpa: a8c4880
12+
wps: a8c4880
913

1014
gitlab:
1115
espconn: 3a998034
12-
lwip: 2235ad17
16+
freertos: ac047746
17+
lwip: ac047746
1318
driver: 7bee5263
1419
mbedtls: 1ac9f1f4
20+
ssl: eefb383a

include/espressif/esp_libc.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,15 @@ do{\
126126
#define os_malloc(s) \
127127
({ \
128128
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \
129-
pvPortMalloc(s, mem_debug_file, __LINE__); \
129+
pvPortMalloc(s, mem_debug_file, __LINE__, false); \
130+
})
131+
#endif
132+
133+
#ifndef os_malloc_iram
134+
#define os_malloc_iram(s) \
135+
({ \
136+
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \
137+
pvPortMalloc(s, mem_debug_file, __LINE__, true); \
130138
})
131139
#endif
132140

include/freertos/portable.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ extern "C" {
368368
void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
369369
void vPortFree( void *pv ) PRIVILEGED_FUNCTION;
370370
#else
371-
void *pvPortMalloc( size_t xSize, const char *file, unsigned line) PRIVILEGED_FUNCTION;
371+
void *pvPortMalloc( size_t xSize, const char *file, unsigned line, bool use_iram) PRIVILEGED_FUNCTION;
372372
void vPortFree( void *pv, const char * file, unsigned line) PRIVILEGED_FUNCTION;
373373
#endif
374374

include/lwip/lwip/mem.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ typedef size_t mem_size_t;
8181
}while(0)
8282
#endif
8383
#ifndef mem_malloc
84-
#define mem_malloc(s) ({const char *file = mem_debug_file; pvPortMalloc(s, file, __LINE__);})
84+
#define mem_malloc(s) ({const char *file = mem_debug_file; pvPortMalloc(s, file, __LINE__, false);})
8585
#endif
8686
#ifndef mem_calloc
8787
#define mem_calloc(s) ({const char *file = mem_debug_file; pvPortCalloc(s, file, __LINE__);})

include/openssl/platform/ssl_port.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525

2626
#ifdef MEMLEAK_DEBUG
2727

28-
extern void *pvPortMalloc( size_t xWantedSize, const char * file, unsigned line);
28+
extern void *pvPortMalloc( size_t xWantedSize, const char * file, unsigned line, bool use_iram);
2929
extern void *pvPortZalloc( size_t xWantedSize, const char * file, unsigned line);
3030
extern void vPortFree(void *pv, const char * file, unsigned line);
3131

3232
#define ssl_mem_malloc(s) \
3333
({ \
3434
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \
35-
pvPortMalloc(s, mem_debug_file, __LINE__); \
35+
pvPortMalloc(s, mem_debug_file, __LINE__, false); \
3636
})
3737

3838
#define ssl_mem_zalloc(s) \

ld/eagle.app.v6.common.ld

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ SECTIONS
9494
*(.init.literal)
9595
*(.init)
9696
*libfreertos.a:(.literal .text .literal.* .text.*)
97+
*libmain.a:spi_flash.o(.literal .text .literal.* .text.*)
9798
*(.literal .text .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
9899
*(.fini.literal)
99100
*(.fini)

lib/libcrypto.a

16 Bytes
Binary file not shown.

lib/libespnow.a

0 Bytes
Binary file not shown.

lib/libfreertos.a

1.18 KB
Binary file not shown.

lib/liblwip.a

60 Bytes
Binary file not shown.

lib/libmain.a

8.63 KB
Binary file not shown.

lib/libmesh.a

0 Bytes
Binary file not shown.

lib/libminic.a

8 Bytes
Binary file not shown.

lib/libnet80211.a

8 Bytes
Binary file not shown.

lib/libpp.a

32 Bytes
Binary file not shown.

lib/libpwm.a

0 Bytes
Binary file not shown.

lib/libsmartconfig.a

0 Bytes
Binary file not shown.

lib/libssl.a

-3.05 KB
Binary file not shown.

lib/libwpa.a

28 Bytes
Binary file not shown.

lib/libwps.a

44 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)