The change adds support for allocating task stacks from separate heap.
When configSTACK_ALLOCATION_FROM_SEPARATE_HEAP is defined as 1 in
FreeRTOSConfig.h, task stacks are allocated and freed using
pvPortMallocStack and vPortFreeStack functions. This allows the
application writer to provide a separate allocator for task stacks.
When configSTACK_ALLOCATION_FROM_SEPARATE_HEAP is defined as 0, task
stacks are allocated and freed using FreeRTOS heap functions
pvPortMalloc and vPortFree.
For backward compatibility, configSTACK_ALLOCATION_FROM_SEPARATE_HEAP
defaults to 0.
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
pxNewTCB->pxStack=(StackType_t*)pvPortMalloc((((size_t)usStackDepth)*sizeof(StackType_t)));/*lint !e961 MISRA exception as the casts are only redundant for some ports. */
pxNewTCB->pxStack=(StackType_t*)pvPortMallocStack((((size_t)usStackDepth)*sizeof(StackType_t)));/*lint !e961 MISRA exception as the casts are only redundant for some ports. */
/* Allocate space for the stack used by the task being created. */
pxStack=pvPortMalloc((((size_t)usStackDepth)*sizeof(StackType_t)));/*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */
pxStack=pvPortMallocStack((((size_t)usStackDepth)*sizeof(StackType_t)));/*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */