@@ -377,17 +377,17 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
377
377
{
378
378
BlockLink_t * pxFirstFreeBlock ;
379
379
uint8_t * pucAlignedHeap ;
380
- size_t uxAddress ;
380
+ portPOINTER_SIZE_TYPE uxAddress ;
381
381
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE ;
382
382
383
383
/* Ensure the heap starts on a correctly aligned boundary. */
384
- uxAddress = ( size_t ) ucHeap ;
384
+ uxAddress = ( portPOINTER_SIZE_TYPE ) ucHeap ;
385
385
386
386
if ( ( uxAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
387
387
{
388
388
uxAddress += ( portBYTE_ALIGNMENT - 1 );
389
- uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
390
- xTotalHeapSize -= uxAddress - ( size_t ) ucHeap ;
389
+ uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
390
+ xTotalHeapSize -= uxAddress - ( portPOINTER_SIZE_TYPE ) ucHeap ;
391
391
}
392
392
393
393
pucAlignedHeap = ( uint8_t * ) uxAddress ;
@@ -399,17 +399,17 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
399
399
400
400
/* pxEnd is used to mark the end of the list of free blocks and is inserted
401
401
* at the end of the heap space. */
402
- uxAddress = ( ( size_t ) pucAlignedHeap ) + xTotalHeapSize ;
402
+ uxAddress = ( ( portPOINTER_SIZE_TYPE ) pucAlignedHeap ) + xTotalHeapSize ;
403
403
uxAddress -= xHeapStructSize ;
404
- uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
405
- pxEnd = ( void * ) uxAddress ;
404
+ uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
405
+ pxEnd = ( BlockLink_t * ) uxAddress ;
406
406
pxEnd -> xBlockSize = 0 ;
407
407
pxEnd -> pxNextFreeBlock = NULL ;
408
408
409
409
/* To start with there is a single free block that is sized to take up the
410
410
* entire heap space, minus the space taken by pxEnd. */
411
- pxFirstFreeBlock = ( void * ) pucAlignedHeap ;
412
- pxFirstFreeBlock -> xBlockSize = uxAddress - ( size_t ) pxFirstFreeBlock ;
411
+ pxFirstFreeBlock = ( BlockLink_t * ) pucAlignedHeap ;
412
+ pxFirstFreeBlock -> xBlockSize = ( size_t ) ( uxAddress - ( portPOINTER_SIZE_TYPE ) pxFirstFreeBlock ) ;
413
413
pxFirstFreeBlock -> pxNextFreeBlock = pxEnd ;
414
414
415
415
/* Only one block exists - and it covers the entire usable heap space. */
0 commit comments