mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-07-15 08:32:42 +08:00
feat(heap): add heap private config to enable/disable using IRAM as heap
This commit is contained in:
@ -18,7 +18,7 @@
|
||||
|
||||
#define HEAP_ALIGN_SIZE 4
|
||||
|
||||
#ifdef CONFIG_SOC_FULL_ICACHE
|
||||
#ifdef CONFIG_HEAP_DISABLE_IRAM
|
||||
#define HEAP_REGIONS_MAX 1
|
||||
#else
|
||||
#define HEAP_REGIONS_MAX 2
|
||||
|
@ -103,9 +103,11 @@ static inline size_t blk_link_size(mem_blk_t *blk)
|
||||
static inline size_t get_blk_region(void *ptr)
|
||||
{
|
||||
size_t num;
|
||||
extern heap_region_t g_heap_region[HEAP_REGIONS_MAX];
|
||||
extern size_t g_heap_region_num;
|
||||
extern heap_region_t g_heap_region[];
|
||||
|
||||
for (num = 0; num < HEAP_REGIONS_MAX; num++) {
|
||||
|
||||
for (num = 0; num < g_heap_region_num; num++) {
|
||||
if ((uint8_t *)ptr > (uint8_t *)g_heap_region[num].start_addr
|
||||
&& (uint8_t *)ptr < ((uint8_t *)g_heap_region[num].start_addr + g_heap_region[num].total_size)) {
|
||||
break;
|
||||
|
Reference in New Issue
Block a user