fix(heap): Fix bugs in heap task tracking

Update task tracking feature to fix bugs introduced when
decoupling task tracking from heap poisoning.

Closes https://github.com/espressif/esp-idf/issues/12498
Closes https://github.com/espressif/esp-idf/issues/12493
This commit is contained in:
Guillaume Souchere
2023-10-27 15:06:58 +02:00
parent c8c7f999ef
commit 872bc74954
6 changed files with 61 additions and 12 deletions

View File

@@ -72,6 +72,7 @@ inline static void multi_heap_assert(bool condition, const char *format, int lin
#define MULTI_HEAP_REMOVE_BLOCK_OWNER_OFFSET(HEAD) ((TaskHandle_t*)(HEAD) - 1)
#define MULTI_HEAP_ADD_BLOCK_OWNER_SIZE(SIZE) ((SIZE) + sizeof(TaskHandle_t))
#define MULTI_HEAP_REMOVE_BLOCK_OWNER_SIZE(SIZE) ((SIZE) - sizeof(TaskHandle_t))
#define MULTI_HEAP_BLOCK_OWNER_SIZE() sizeof(TaskHandle_t)
#else
#define MULTI_HEAP_SET_BLOCK_OWNER(HEAD)
#define MULTI_HEAP_GET_BLOCK_OWNER(HEAD) (NULL)
@@ -79,6 +80,7 @@ inline static void multi_heap_assert(bool condition, const char *format, int lin
#define MULTI_HEAP_REMOVE_BLOCK_OWNER_OFFSET(HEAD) (HEAD)
#define MULTI_HEAP_ADD_BLOCK_OWNER_SIZE(SIZE) (SIZE)
#define MULTI_HEAP_REMOVE_BLOCK_OWNER_SIZE(SIZE) (SIZE)
#define MULTI_HEAP_BLOCK_OWNER_SIZE() 0
#endif // CONFIG_HEAP_TASK_TRACKING
#else // MULTI_HEAP_FREERTOS