We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef4c305 commit 280eb76Copy full SHA for 280eb76
portable/MemMang/heap_1.c
@@ -94,7 +94,7 @@ void * pvPortMalloc( size_t xWantedSize )
94
if( pucAlignedHeap == NULL )
95
{
96
/* Ensure the heap starts on a correctly aligned boundary. */
97
- 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 ) ) );
98
}
99
100
/* Check there is enough room left for the allocation and. */
0 commit comments