Skip to content

Commit 06743b4

Browse files
author
huangly
committed
Remove that Heap_1.c unnecessary judgment and code logic
1 parent ef22228 commit 06743b4

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

portable/MemMang/heap_1.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,7 @@ void * pvPortMalloc( size_t xWantedSize )
7878
{
7979
if( xWantedSize & portBYTE_ALIGNMENT_MASK )
8080
{
81-
/* Byte alignment required. Check for overflow. */
82-
if( ( xWantedSize + ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ) ) > xWantedSize )
83-
{
84-
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
85-
}
86-
else
87-
{
88-
xWantedSize = 0;
89-
}
81+
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
9082
}
9183
}
9284
#endif /* if ( portBYTE_ALIGNMENT != 1 ) */

0 commit comments

Comments
 (0)