From d3f5c5348c6b9b5fa7ab0c6262d17993b738ebeb Mon Sep 17 00:00:00 2001
From: Richard Barry <ribarry@amazon.com>
Date: Tue, 6 Oct 2009 08:46:22 +0000
Subject: [PATCH] Change where the free heap space variable is initialised.

---
 Source/portable/MemMang/heap_2.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Source/portable/MemMang/heap_2.c b/Source/portable/MemMang/heap_2.c
index 1f81a08a5..0cce43621 100644
--- a/Source/portable/MemMang/heap_2.c
+++ b/Source/portable/MemMang/heap_2.c
@@ -95,7 +95,7 @@ static xBlockLink xStart, xEnd;
 
 /* Keeps track of the number of free bytes remaining, but says nothing about
 fragmentation. */
-static size_t xFreeBytesRemaining = configTOTAL_HEAP_SIZE;
+static size_t xFreeBytesRemaining;
 
 /* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */
 
@@ -143,6 +143,8 @@ xBlockLink *pxFirstFreeBlock;														\
 	pxFirstFreeBlock = ( void * ) xHeap.ucHeap;										\
 	pxFirstFreeBlock->xBlockSize = configTOTAL_HEAP_SIZE;							\
 	pxFirstFreeBlock->pxNextFreeBlock = &xEnd;										\
+																					\
+	xFreeBytesRemaining = configTOTAL_HEAP_SIZE;									\
 }
 /*-----------------------------------------------------------*/
 
@@ -267,3 +269,7 @@ size_t xPortGetFreeHeapSize( void )
 }
 /*-----------------------------------------------------------*/
 
+void vPortInitialiseBlocks( void )
+{
+	/* This just exists to keep the linker quiet. */
+}