Skip to content

Commit 2f8d25b

Browse files
committed
Fix the same byte waste issue in heap_2
Signed-off-by: Gaurav Aggarwal <[email protected]>
1 parent e6fc819 commit 2f8d25b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

portable/MemMang/heap_2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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. */

0 commit comments

Comments
 (0)