mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Initialised xFreeBytesRemaining where it is declared so xPortGetFreeHeapSize() returns a valid value even before the heap has been initialised.
This commit is contained in:
parent
808bb8e159
commit
2596728679
|
@ -100,7 +100,7 @@ static xBlockLink xStart, xEnd;
|
|||
|
||||
/* Keeps track of the number of free bytes remaining, but says nothing about
|
||||
fragmentation. */
|
||||
static size_t xFreeBytesRemaining;
|
||||
static size_t xFreeBytesRemaining = configTOTAL_HEAP_SIZE;
|
||||
|
||||
/* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */
|
||||
|
||||
|
@ -148,8 +148,6 @@ xBlockLink *pxFirstFreeBlock; \
|
|||
pxFirstFreeBlock = ( void * ) xHeap.ucHeap; \
|
||||
pxFirstFreeBlock->xBlockSize = configTOTAL_HEAP_SIZE; \
|
||||
pxFirstFreeBlock->pxNextFreeBlock = &xEnd; \
|
||||
\
|
||||
xFreeBytesRemaining = configTOTAL_HEAP_SIZE; \
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
Loading…
Reference in a new issue