/* Keeps track of the number of free bytes remaining, but says nothing about\r
fragmentation. */\r
static size_t xFreeBytesRemaining = ( ( size_t ) heapADJUSTED_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK );\r
+static size_t xMinimumEverFreeBytesRemaining = ( ( size_t ) heapADJUSTED_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK );\r
\r
/* Gets set to the top bit of an size_t type. When this bit in the xBlockSize \r
member of an xBlockLink structure is set then the block belongs to the \r
\r
xFreeBytesRemaining -= pxBlock->xBlockSize;\r
\r
+ if( xFreeBytesRemaining < xMinimumEverFreeBytesRemaining )\r
+ {\r
+ xMinimumEverFreeBytesRemaining = xFreeBytesRemaining;\r
+ }\r
+\r
/* The block is being returned - it is allocated and owned\r
by the application and has no "next" block. */\r
pxBlock->xBlockSize |= xBlockAllocatedBit;\r
}\r
/*-----------------------------------------------------------*/\r
\r
+size_t xPortGetMinimumEverFreeHeapSize( void )\r
+{\r
+ return xMinimumEverFreeBytesRemaining;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
void vPortInitialiseBlocks( void )\r
{\r
/* This just exists to keep the linker quiet. */\r