/* Create a couple of list links to mark the start and end of the list. */\r
static xBlockLink xStart, xEnd;\r
\r
+/* Keeps track of the number of free bytes remaining, but says nothing about\r
+fragmentation. */\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
/* Insert the new block into the list of free blocks. */\r
prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );\r
}\r
+ \r
+ xFreeBytesRemaining -= xWantedSize;\r
}\r
}\r
}\r
{\r
/* Add this block to the list of free blocks. */\r
prvInsertBlockIntoFreeList( ( ( xBlockLink * ) pxLink ) );\r
+ xFreeBytesRemaining += pxLink->xBlockSize;\r
}\r
xTaskResumeAll();\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
+size_t xPortGetFreeHeapSize( void )\r
+{\r
+ return xFreeBytesRemaining;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r