mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 09:07:46 -04:00
Fix the defect that Heap_1.c may waste first 8 bytes of ucHeap[]
This commit is contained in:
parent
ef4c305244
commit
280eb768f2
1 changed files with 1 additions and 1 deletions
|
@ -94,7 +94,7 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
if( pucAlignedHeap == NULL )
|
if( pucAlignedHeap == NULL )
|
||||||
{
|
{
|
||||||
/* Ensure the heap starts on a correctly aligned boundary. */
|
/* Ensure the heap starts on a correctly aligned boundary. */
|
||||||
pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) & ucHeap[ portBYTE_ALIGNMENT ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
|
pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) & ucHeap[ portBYTE_ALIGNMENT - 1 ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check there is enough room left for the allocation and. */
|
/* Check there is enough room left for the allocation and. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue