feat(heap): Link heap raw malloc/free from flash to iram

Remove raw malloc internal calling function.
This commit is contained in:
dongheng
2019-04-02 10:53:52 +08:00
parent 0460e53434
commit 86df7f879a
2 changed files with 12 additions and 8 deletions

View File

@ -42,8 +42,9 @@
#endif
static const char *TAG = "heap_trace";
static int s_heap_trace_mode = HEAP_TRACE_NONE;
extern heap_region_t g_heap_region[HEAP_REGIONS_MAX];
extern int __g_heap_trace_mode;
/**
* @brief Empty function just for passing compiling some place.
@ -58,7 +59,7 @@ esp_err_t heap_trace_init_standalone(heap_trace_record_t *record_buffer, size_t
*/
int heap_trace_is_on(void)
{
return s_heap_trace_mode == HEAP_TRACE_LEAKS;
return __g_heap_trace_mode == HEAP_TRACE_LEAKS;
}
/**
@ -66,7 +67,7 @@ int heap_trace_is_on(void)
*/
esp_err_t heap_trace_start(heap_trace_mode_t mode)
{
s_heap_trace_mode = mode;
__g_heap_trace_mode = mode;
return ESP_OK;
}
@ -76,7 +77,7 @@ esp_err_t heap_trace_start(heap_trace_mode_t mode)
*/
esp_err_t heap_trace_stop(void)
{
s_heap_trace_mode = HEAP_TRACE_NONE;
__g_heap_trace_mode = HEAP_TRACE_NONE;
return ESP_OK;
}
@ -86,7 +87,7 @@ esp_err_t heap_trace_stop(void)
*/
esp_err_t heap_trace_resume(void)
{
s_heap_trace_mode = HEAP_TRACE_LEAKS;
__g_heap_trace_mode = HEAP_TRACE_LEAKS;
return ESP_OK;
}