From: richardbarry Date: Fri, 19 Mar 2010 09:45:12 +0000 (+0000) Subject: Initialised xFreeBytesRemaining where it is declared so xPortGetFreeHeapSize() return... X-Git-Tag: V6.0.5~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=39c56b74a90791da5aa9b44d90f91a8ec16dcac5;p=freertos Initialised xFreeBytesRemaining where it is declared so xPortGetFreeHeapSize() returns a valid value even before the heap has been initialised. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@997 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/portable/MemMang/heap_2.c b/Source/portable/MemMang/heap_2.c index 891405d4b..d6cdb4fb1 100644 --- a/Source/portable/MemMang/heap_2.c +++ b/Source/portable/MemMang/heap_2.c @@ -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; \ } /*-----------------------------------------------------------*/