Skip to content

Commit

Permalink
Omit configTOTAL_HEAP_SIZE with Application Allocated Heap
Browse files Browse the repository at this point in the history
  • Loading branch information
Finwood committed Jun 9, 2021
1 parent 9c048e0 commit d687545
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions portable/MemMang/heap_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

/* The application writer has already defined the array used for the RTOS
* heap - probably so it can be placed in a special segment or address. */
extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
extern uint8_t ucHeap[ ];
#else
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#endif /* configAPPLICATION_ALLOCATED_HEAP */
Expand All @@ -80,8 +80,8 @@ void * pvPortMalloc( size_t xWantedSize )
if ( (xWantedSize + ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) )) > xWantedSize )
{
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
}
else
}
else
{
xWantedSize = 0;
}
Expand Down
12 changes: 6 additions & 6 deletions portable/MemMang/heap_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static void prvHeapInit( void );

/* The application writer has already defined the array used for the RTOS
* heap - probably so it can be placed in a special segment or address. */
extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
extern uint8_t ucHeap[ ];
#else
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#endif /* configAPPLICATION_ALLOCATED_HEAP */
Expand Down Expand Up @@ -133,13 +133,13 @@ void * pvPortMalloc( size_t xWantedSize )

/* The wanted size must be increased so it can contain a BlockLink_t
* structure in addition to the requested amount of bytes. */
if( ( xWantedSize > 0 ) &&
if( ( xWantedSize > 0 ) &&
( ( xWantedSize + heapSTRUCT_SIZE ) > xWantedSize ) ) /* Overflow check */
{
xWantedSize += heapSTRUCT_SIZE;

/* Byte alignment required. Check for overflow. */
if( ( xWantedSize + ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ) )
if( ( xWantedSize + ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ) )
> xWantedSize )
{
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
Expand All @@ -148,11 +148,11 @@ void * pvPortMalloc( size_t xWantedSize )
else
{
xWantedSize = 0;
}
}
}
else
else
{
xWantedSize = 0;
xWantedSize = 0;
}


Expand Down
12 changes: 6 additions & 6 deletions portable/MemMang/heap_4.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

/* The application writer has already defined the array used for the RTOS
* heap - probably so it can be placed in a special segment or address. */
extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
extern uint8_t ucHeap[ ];
#else
PRIVILEGED_DATA static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#endif /* configAPPLICATION_ALLOCATED_HEAP */
Expand Down Expand Up @@ -138,7 +138,7 @@ void * pvPortMalloc( size_t xWantedSize )
{
/* The wanted size must be increased so it can contain a BlockLink_t
* structure in addition to the requested amount of bytes. */
if( ( xWantedSize > 0 ) &&
if( ( xWantedSize > 0 ) &&
( ( xWantedSize + xHeapStructSize ) > xWantedSize ) ) /* Overflow check */
{
xWantedSize += xHeapStructSize;
Expand All @@ -147,7 +147,7 @@ void * pvPortMalloc( size_t xWantedSize )
if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 )
{
/* Byte alignment required. Check for overflow. */
if( ( xWantedSize + ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ) )
if( ( xWantedSize + ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ) )
> xWantedSize )
{
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
Expand All @@ -156,14 +156,14 @@ void * pvPortMalloc( size_t xWantedSize )
else
{
xWantedSize = 0;
}
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
}
else
{
xWantedSize = 0;
}
Expand Down

0 comments on commit d687545

Please sign in to comment.