feat(heap): Link heap to IRAM

This commit is contained in:
dongheng
2019-03-06 10:26:11 +08:00
parent d67265f034
commit 1c975959fb
2 changed files with 7 additions and 5 deletions

View File

@ -133,6 +133,8 @@ SECTIONS
*libesp8266.a:ets_printf.o(.literal .text .literal.* .text.* .rodata.* .rodata) *libesp8266.a:ets_printf.o(.literal .text .literal.* .text.* .rodata.* .rodata)
#endif #endif
*libheap.a:(.literal .text .literal.* .text.*)
_text_end = ABSOLUTE(.); _text_end = ABSOLUTE(.);
_etext = .; _etext = .;
} >iram1_0_seg :iram1_0_phdr } >iram1_0_seg :iram1_0_phdr

View File

@ -272,7 +272,7 @@ static bool timer_delete_wrapper(void *timer, uint32_t ticks)
return xTimerDelete(timer, ticks); return xTimerDelete(timer, ticks);
} }
static void *malloc_wrapper(uint32_t s, uint32_t cap, const char *file, size_t line) static void IRAM_ATTR *malloc_wrapper(uint32_t s, uint32_t cap, const char *file, size_t line)
{ {
uint32_t os_caps; uint32_t os_caps;
@ -284,7 +284,7 @@ static void *malloc_wrapper(uint32_t s, uint32_t cap, const char *file, size_t l
return _heap_caps_malloc(s, os_caps, file, line); return _heap_caps_malloc(s, os_caps, file, line);
} }
static void *zalloc_wrapper(uint32_t s, uint32_t cap, const char *file, size_t line) static void IRAM_ATTR *zalloc_wrapper(uint32_t s, uint32_t cap, const char *file, size_t line)
{ {
uint32_t os_caps; uint32_t os_caps;
@ -296,7 +296,7 @@ static void *zalloc_wrapper(uint32_t s, uint32_t cap, const char *file, size_t l
return _heap_caps_zalloc(s, os_caps, file, line); return _heap_caps_zalloc(s, os_caps, file, line);
} }
static void *realloc_wrapper(void *ptr, uint32_t s, uint32_t cap, const char *file, size_t line) static void IRAM_ATTR *realloc_wrapper(void *ptr, uint32_t s, uint32_t cap, const char *file, size_t line)
{ {
uint32_t os_caps; uint32_t os_caps;
@ -308,7 +308,7 @@ static void *realloc_wrapper(void *ptr, uint32_t s, uint32_t cap, const char *fi
return _heap_caps_realloc(ptr, s, os_caps, file, line); return _heap_caps_realloc(ptr, s, os_caps, file, line);
} }
static void *calloc_wrapper(uint32_t cnt, uint32_t s, uint32_t cap, const char *file, size_t line) static void IRAM_ATTR *calloc_wrapper(uint32_t cnt, uint32_t s, uint32_t cap, const char *file, size_t line)
{ {
uint32_t os_caps; uint32_t os_caps;
@ -320,7 +320,7 @@ static void *calloc_wrapper(uint32_t cnt, uint32_t s, uint32_t cap, const char *
return _heap_caps_calloc(cnt , s, os_caps, file, line); return _heap_caps_calloc(cnt , s, os_caps, file, line);
} }
static void free_wrapper(void *ptr, const char *file, size_t line) static void IRAM_ATTR free_wrapper(void *ptr, const char *file, size_t line)
{ {
_heap_caps_free(ptr, file, line); _heap_caps_free(ptr, file, line);
} }