We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6fc819 commit 2f8d25bCopy full SHA for 2f8d25b
portable/MemMang/heap_2.c
@@ -266,7 +266,7 @@ static void prvHeapInit( void )
266
uint8_t * pucAlignedHeap;
267
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 ) ) );
+ pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) & ucHeap[ portBYTE_ALIGNMENT - 1 ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
270
271
/* xStart is used to hold a pointer to the first item in the list of free
272
* blocks. The void cast is used to prevent compiler warnings. */
0 commit comments