]> git.sur5r.net Git - freertos/commitdiff
Initialised xFreeBytesRemaining where it is declared so xPortGetFreeHeapSize() return...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 19 Mar 2010 09:45:12 +0000 (09:45 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 19 Mar 2010 09:45:12 +0000 (09:45 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@997 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/portable/MemMang/heap_2.c

index 891405d4b5be42495a895527c2893fd4866f14ec..d6cdb4fb15f8d76cfe2efc4e674e8922dfd5ad65 100644 (file)
@@ -100,7 +100,7 @@ static xBlockLink xStart, xEnd;
 \r
 /* Keeps track of the number of free bytes remaining, but says nothing about\r
 fragmentation. */\r
 \r
 /* Keeps track of the number of free bytes remaining, but says nothing about\r
 fragmentation. */\r
-static size_t xFreeBytesRemaining;\r
+static size_t xFreeBytesRemaining = configTOTAL_HEAP_SIZE;\r
 \r
 /* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */\r
 \r
 \r
 /* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */\r
 \r
@@ -148,8 +148,6 @@ xBlockLink *pxFirstFreeBlock;                                                                                                               \
        pxFirstFreeBlock = ( void * ) xHeap.ucHeap;                                                                             \\r
        pxFirstFreeBlock->xBlockSize = configTOTAL_HEAP_SIZE;                                                   \\r
        pxFirstFreeBlock->pxNextFreeBlock = &xEnd;                                                                              \\r
        pxFirstFreeBlock = ( void * ) xHeap.ucHeap;                                                                             \\r
        pxFirstFreeBlock->xBlockSize = configTOTAL_HEAP_SIZE;                                                   \\r
        pxFirstFreeBlock->pxNextFreeBlock = &xEnd;                                                                              \\r
-                                                                                                                                                                       \\r
-       xFreeBytesRemaining = configTOTAL_HEAP_SIZE;                                                                    \\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
 }\r
 /*-----------------------------------------------------------*/\r
 \r