mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 09:07:46 -04:00
adjustments for consistency
This commit is contained in:
parent
8728996caf
commit
8aa5f3bba2
3 changed files with 4 additions and 4 deletions
|
@ -138,7 +138,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
{
|
{
|
||||||
/* Ensure xWantedSize will never wrap after adjustment, even if we need
|
/* Ensure xWantedSize will never wrap after adjustment, even if we need
|
||||||
* an alignment adjustment */
|
* an alignment adjustment */
|
||||||
if ( xWantedSize < ( SIZE_MAX - heapSTRUCT_SIZE - portBYTE_ALIGNMENT - 1) )
|
if( ( xWantedSize > 0 ) && ( ( xWantedSize + xHeapStructSize ) > xWantedSize ) )
|
||||||
{
|
{
|
||||||
xWantedSize += heapSTRUCT_SIZE;
|
xWantedSize += heapSTRUCT_SIZE;
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xWantedSize > 0 )
|
if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) )
|
||||||
{
|
{
|
||||||
/* Blocks are stored in byte order - traverse the list from the start
|
/* Blocks are stored in byte order - traverse the list from the start
|
||||||
* (smallest) block until one of adequate size is found. */
|
* (smallest) block until one of adequate size is found. */
|
||||||
|
|
|
@ -176,7 +176,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( xWantedSize > 0 ) && ( xWantedSize < xFreeBytesRemaining ) )
|
if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) )
|
||||||
{
|
{
|
||||||
/* Traverse the list from the start (lowest address) block until
|
/* Traverse the list from the start (lowest address) block until
|
||||||
* one of adequate size is found. */
|
* one of adequate size is found. */
|
||||||
|
|
|
@ -179,7 +179,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
xWantedSize = 0;
|
xWantedSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( xWantedSize > 0 ) && ( xWantedSize < xFreeBytesRemaining ) )
|
if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) )
|
||||||
{
|
{
|
||||||
/* Traverse the list from the start (lowest address) block until
|
/* Traverse the list from the start (lowest address) block until
|
||||||
* one of adequate size is found. */
|
* one of adequate size is found. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue