fix(freertos): Fixed memory leak issue in vTaskDeleteWithCaps()

vTaskDeleteWithCaps() leaked memory when a task uses the API to delete
itself. This commit adds a fix to avoid the memory leak.

Closes https://github.com/espressif/esp-idf/issues/14222
This commit is contained in:
Sudeep Mohanty
2024-07-23 16:19:24 +02:00
parent 7806aeb372
commit c3da2ace27
5 changed files with 207 additions and 15 deletions

View File

@@ -244,6 +244,12 @@ static inline BaseType_t xPortInIsrContext(void)
return xPortCheckIfInISR();
}
static inline void vPortAssertIfInISR(void)
{
/* Assert if the interrupt nesting count is > 0 */
configASSERT(xPortInIsrContext() == 0);
}
// xPortInterruptedFromISRContext() is only used in panic handler and core dump,
// both probably not relevant on POSIX sim.
//BaseType_t xPortInterruptedFromISRContext(void);
@@ -301,7 +307,7 @@ extern void vPortCancelThread( void *pxTaskToDelete );
* are always a full memory barrier. ISRs are emulated as signals
* which also imply a full memory barrier.
*
* Thus, only a compilier barrier is needed to prevent the compiler
* Thus, only a compiler barrier is needed to prevent the compiler
* reordering.
*/
#define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" )