Skip to content

Commit edbeb62

Browse files
committed
Resolve merge conflict
1 parent 9b18b29 commit edbeb62

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

portable/MemMang/heap_4.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ void * pvPortCalloc( size_t xNum,
444444
static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
445445
{
446446
BlockLink_t * pxFirstFreeBlock;
447-
void * pvAlignedHeap;
448447
portPOINTER_SIZE_TYPE uxAddress;
449448
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;
450449

@@ -458,7 +457,6 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
458457
xTotalHeapSize -= ( size_t ) ( uxAddress - ( portPOINTER_SIZE_TYPE ) ucHeap );
459458
}
460459

461-
pvAlignedHeap = ( uint8_t * ) uxAddress;
462460

463461
#if ( configENABLE_HEAP_PROTECTOR == 1 )
464462
{
@@ -468,12 +466,12 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
468466

469467
/* xStart is used to hold a pointer to the first item in the list of free
470468
* blocks. The void cast is used to prevent compiler warnings. */
471-
xStart.pxNextFreeBlock = ( void * ) heapPROTECT_BLOCK_POINTER( pvAlignedHeap );
469+
xStart.pxNextFreeBlock = ( void * ) heapPROTECT_BLOCK_POINTER( uxAddress );
472470
xStart.xBlockSize = ( size_t ) 0;
473471

474472
/* pxEnd is used to mark the end of the list of free blocks and is inserted
475473
* at the end of the heap space. */
476-
uxAddress = ( portPOINTER_SIZE_TYPE ) ( ( ( uint8_t * ) pvAlignedHeap ) + xTotalHeapSize );
474+
uxAddress = ( portPOINTER_SIZE_TYPE ) ( uxAddress + xTotalHeapSize );
477475
uxAddress -= ( portPOINTER_SIZE_TYPE ) xHeapStructSize;
478476
uxAddress &= ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK );
479477
pxEnd = ( BlockLink_t * ) uxAddress;
@@ -482,7 +480,7 @@ static void prvHeapInit( void ) /* PRIVILEGED_FUNCTION */
482480

483481
/* To start with there is a single free block that is sized to take up the
484482
* entire heap space, minus the space taken by pxEnd. */
485-
pxFirstFreeBlock = ( BlockLink_t * ) pvAlignedHeap;
483+
pxFirstFreeBlock = ( BlockLink_t * ) uxAddress;
486484
pxFirstFreeBlock->xBlockSize = ( size_t ) ( uxAddress - ( portPOINTER_SIZE_TYPE ) pxFirstFreeBlock );
487485
pxFirstFreeBlock->pxNextFreeBlock = heapPROTECT_BLOCK_POINTER( pxEnd );
488486

portable/MemMang/heap_5.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140

141141
#define heapPROTECT_BLOCK_POINTER( pxBlock ) ( pxBlock )
142142

143-
#define heapVALIDATE_BLOCK_POINTER( pxBlock ) ( pxBlock )
143+
#define heapVALIDATE_BLOCK_POINTER( pxBlock )
144144

145145
#endif /* configENABLE_HEAP_PROTECTOR */
146146

@@ -562,7 +562,7 @@ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) /* PRIVI
562562
if( ( xAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
563563
{
564564
xAddress += ( portBYTE_ALIGNMENT - 1 );
565-
xAddress &= ~portBYTE_ALIGNMENT_MASK;
565+
xAddress &= ~( portPOINTER_SIZE_TYPE )portBYTE_ALIGNMENT_MASK;
566566

567567
/* Adjust the size for the bytes lost to alignment. */
568568
xTotalRegionSize -= ( size_t ) ( xAddress - ( portPOINTER_SIZE_TYPE ) pxHeapRegion->pucStartAddress );

0 commit comments

Comments
 (0)