Change the macro from portMAX_DELAY to SIZE_MAX in order to initialize size_t-type variable correctly

This commit is contained in:
DuYicheng 2025-08-15 13:54:23 +08:00
parent 43947413b9
commit a6af049a7e
No known key found for this signature in database
GPG key ID: 92D93312D0BE5936
2 changed files with 2 additions and 2 deletions

View file

@ -572,7 +572,7 @@ static void prvInsertBlockIntoFreeList( BlockLink_t * pxBlockToInsert ) /* PRIVI
void vPortGetHeapStats( HeapStats_t * pxHeapStats )
{
BlockLink_t * pxBlock;
size_t xBlocks = 0, xMaxSize = 0, xMinSize = portMAX_DELAY; /* portMAX_DELAY used as a portable way of getting the maximum value. */
size_t xBlocks = 0, xMaxSize = 0, xMinSize = SIZE_MAX;
vTaskSuspendAll();
{

View file

@ -672,7 +672,7 @@ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) /* PRIVI
void vPortGetHeapStats( HeapStats_t * pxHeapStats )
{
BlockLink_t * pxBlock;
size_t xBlocks = 0, xMaxSize = 0, xMinSize = portMAX_DELAY; /* portMAX_DELAY used as a portable way of getting the maximum value. */
size_t xBlocks = 0, xMaxSize = 0, xMinSize = SIZE_MAX;
vTaskSuspendAll();
{