File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -78,15 +78,7 @@ void * pvPortMalloc( size_t xWantedSize )
78
78
{
79
79
if ( xWantedSize & portBYTE_ALIGNMENT_MASK )
80
80
{
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 ) );
90
82
}
91
83
}
92
84
#endif /* if ( portBYTE_ALIGNMENT != 1 ) */
@@ -101,8 +93,7 @@ void * pvPortMalloc( size_t xWantedSize )
101
93
102
94
/* Check there is enough room left for the allocation and. */
103
95
if ( ( xWantedSize > 0 ) && /* valid size */
104
- ( ( xNextFreeByte + xWantedSize ) < configADJUSTED_HEAP_SIZE ) &&
105
- ( ( xNextFreeByte + xWantedSize ) > xNextFreeByte ) ) /* Check for overflow. */
96
+ ( ( xNextFreeByte + xWantedSize ) < configADJUSTED_HEAP_SIZE )) /* check for overflow */
106
97
{
107
98
/* Return the next free byte then increment the index past this
108
99
* block. */
You can’t perform that action at this time.
0 commit comments