mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-02-03 07:39:02 +01:00
Add asserts to check stack overflow at task creation
This commit adds assert to allow developers to check for overflow of undersized task stack during task creation.
This commit is contained in:
parent
a9cb459206
commit
3ace38969b
10
tasks.c
10
tasks.c
@ -2010,6 +2010,16 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
|||||||
}
|
}
|
||||||
#endif /* portUSING_MPU_WRAPPERS */
|
#endif /* portUSING_MPU_WRAPPERS */
|
||||||
|
|
||||||
|
#if ( portSTACK_GROWTH < 0 )
|
||||||
|
{
|
||||||
|
configASSERT( ( ( portPOINTER_SIZE_TYPE ) ( pxTopOfStack - pxNewTCB->pxTopOfStack ) ) < ( ( portPOINTER_SIZE_TYPE ) uxStackDepth ) );
|
||||||
|
}
|
||||||
|
#else /* portSTACK_GROWTH */
|
||||||
|
{
|
||||||
|
configASSERT( ( ( portPOINTER_SIZE_TYPE ) ( pxNewTCB->pxTopOfStack - pxTopOfStack ) ) < ( ( portPOINTER_SIZE_TYPE ) uxStackDepth ) );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize task state and task attributes. */
|
/* Initialize task state and task attributes. */
|
||||||
#if ( configNUMBER_OF_CORES > 1 )
|
#if ( configNUMBER_OF_CORES > 1 )
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user