56
56
#define configHEAP_CLEAR_MEMORY_ON_FREE 0
57
57
#endif
58
58
59
- /* A few bytes might be lost to byte aligning the heap start address. */
60
- #define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )
61
-
62
59
/* Assumes 8bit bytes! */
63
60
#define heapBITS_PER_BYTE ( ( size_t ) 8 )
64
61
@@ -111,7 +108,7 @@ PRIVILEGED_DATA static BlockLink_t xStart, xEnd;
111
108
112
109
/* Keeps track of the number of free bytes remaining, but says nothing about
113
110
* fragmentation. */
114
- PRIVILEGED_DATA static size_t xFreeBytesRemaining = configADJUSTED_HEAP_SIZE ;
111
+ PRIVILEGED_DATA static size_t xFreeBytesRemaining = configTOTAL_HEAP_SIZE ;
115
112
116
113
/* Indicates whether the heap has been initialised or not. */
117
114
PRIVILEGED_DATA static BaseType_t xHeapHasBeenInitialised = pdFALSE ;
@@ -376,13 +373,13 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
376
373
xStart .xBlockSize = ( size_t ) 0 ;
377
374
378
375
/* xEnd is used to mark the end of the list of free blocks. */
379
- xEnd .xBlockSize = configADJUSTED_HEAP_SIZE ;
376
+ xEnd .xBlockSize = configTOTAL_HEAP_SIZE ;
380
377
xEnd .pxNextFreeBlock = NULL ;
381
378
382
379
/* To start with there is a single free block that is sized to take up the
383
380
* entire heap space. */
384
381
pxFirstFreeBlock = ( BlockLink_t * ) pucAlignedHeap ;
385
- pxFirstFreeBlock -> xBlockSize = configADJUSTED_HEAP_SIZE ;
382
+ pxFirstFreeBlock -> xBlockSize = configTOTAL_HEAP_SIZE ;
386
383
pxFirstFreeBlock -> pxNextFreeBlock = & xEnd ;
387
384
}
388
385
/*-----------------------------------------------------------*/
@@ -394,7 +391,7 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
394
391
*/
395
392
void vPortHeapResetState ( void )
396
393
{
397
- xFreeBytesRemaining = configADJUSTED_HEAP_SIZE ;
394
+ xFreeBytesRemaining = configTOTAL_HEAP_SIZE ;
398
395
399
396
xHeapHasBeenInitialised = pdFALSE ;
400
397
}
0 commit comments