File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ void * pvPortMalloc( size_t xWantedSize )
96
96
if ( pucAlignedHeap == NULL )
97
97
{
98
98
/* Ensure the heap starts on a correctly aligned boundary. */
99
- pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) & ucHeap [ portBYTE_ALIGNMENT ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
99
+ pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) & ucHeap [ portBYTE_ALIGNMENT - 1 ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
100
100
}
101
101
102
102
/* Check there is enough room left for the allocation and. */
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ static void prvHeapInit( void )
266
266
uint8_t * pucAlignedHeap ;
267
267
268
268
/* Ensure the heap starts on a correctly aligned boundary. */
269
- pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) & ucHeap [ portBYTE_ALIGNMENT ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
269
+ pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) & ucHeap [ portBYTE_ALIGNMENT - 1 ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
270
270
271
271
/* xStart is used to hold a pointer to the first item in the list of free
272
272
* blocks. The void cast is used to prevent compiler warnings. */
You can’t perform that action at this time.
0 commit comments