mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-03 11:29:42 +08:00
feat(freertos): Add memory mark to trace heap over call levels
This commit is contained in:
@ -332,6 +332,17 @@ size_t xPortWantedSizeAlign(size_t xWantedSize)
|
||||
return xWantedSize;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief add trace information to allocated memory
|
||||
*/
|
||||
void esp_mem_trace(const void *ptr, const char *trace, int no)
|
||||
{
|
||||
BlockLink_t *pxLink = (BlockLink_t *)((uint8_t *)ptr - uxHeapStructSize);
|
||||
|
||||
pxLink->file = trace;
|
||||
pxLink->line = (unsigned)no;
|
||||
}
|
||||
|
||||
void *pvPortMalloc( size_t xWantedSize )
|
||||
#ifdef MEMLEAK_DEBUG
|
||||
{
|
||||
|
@ -208,6 +208,22 @@ typedef struct _xt_isr_entry_ {
|
||||
|
||||
void show_critical_info(void);
|
||||
|
||||
/*
|
||||
* @brief add trace information to allocated memory
|
||||
*
|
||||
* @param ptr memory pointer allocated by "os_maloc", "malloc" and so on
|
||||
* @param trace trace information, file name(__FILE__) or "__builtin_return_address(0)" is OK
|
||||
* @param no number of trace information, file line(__LINE__) or -1(using "__builtin_return_address(0)")
|
||||
*/
|
||||
void esp_mem_trace(const void *ptr, const char *trace, int no);
|
||||
|
||||
/*
|
||||
* @brief add file trace information to allocated memory
|
||||
*
|
||||
* @param ptr memory pointer allocated by "os_maloc", "malloc" and so on
|
||||
*/
|
||||
#define esp_mem_mark_file(ptr) esp_mem_trace((ptr), __FILE__, LINE__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user