mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-31 07:28:37 -04:00
Exercise the new vPortGetHeapStats() function from the Win32 demo projects.
This commit is contained in:
parent
fa404422b9
commit
4d6570b009
7 changed files with 113 additions and 9 deletions
|
@ -245,6 +245,7 @@ static void prvCheckTask( void *pvParameters )
|
|||
{
|
||||
TickType_t xNextWakeTime;
|
||||
const TickType_t xCycleFrequency = pdMS_TO_TICKS( 4000UL );
|
||||
HeapStats_t xHeapStats;
|
||||
|
||||
/* Just to remove compiler warning. */
|
||||
( void ) pvParameters;
|
||||
|
@ -370,10 +371,17 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 4000UL );
|
|||
|
||||
/* This is the only task that uses stdout so its ok to call printf()
|
||||
directly. */
|
||||
printf( "%s - tick count %zu - free heap %zu - min free heap %zu\r\n", pcStatusMessage,
|
||||
xTaskGetTickCount(),
|
||||
xPortGetFreeHeapSize(),
|
||||
xPortGetMinimumEverFreeHeapSize() );
|
||||
vPortGetHeapStats( &xHeapStats );
|
||||
|
||||
configASSERT( xHeapStats.xAvailableHeapSpaceInBytes == xPortGetFreeHeapSize() );
|
||||
configASSERT( xHeapStats.xMinimumEverFreeBytesRemaining == xPortGetMinimumEverFreeHeapSize() );
|
||||
|
||||
printf( "%s - tick count %zu - free heap %zu - min free heap %zu - largest free block %zu \r\n",
|
||||
pcStatusMessage,
|
||||
xTaskGetTickCount(),
|
||||
xHeapStats.xAvailableHeapSpaceInBytes,
|
||||
xHeapStats.xMinimumEverFreeBytesRemaining,
|
||||
xHeapStats.xSizeOfLargestFreeBlockInBytes );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue