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 )
9696 if ( pucAlignedHeap == NULL )
9797 {
9898 /* 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 ) ) );
100100 }
101101
102102 /* 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 )
266266 uint8_t * pucAlignedHeap ;
267267
268268 /* 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 ) ) );
270270
271271 /* xStart is used to hold a pointer to the first item in the list of free
272272 * blocks. The void cast is used to prevent compiler warnings. */
You can’t perform that action at this time.
0 commit comments