1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-31 16:52:10 +01:00

Merge pull request #38 from skarlsso/skarlsso/LP-37_memory_wasted_in_pvPortMallocGeneric

LP-37 Fix alignment bug in in pvPortMallocGeneric
This commit is contained in:
a*morale 2015-07-19 14:09:06 +02:00
commit a66a725fcb

View File

@ -103,7 +103,7 @@ static uint8_t *pucAlignedHeap = NULL;
size_t mask = alignment - 1;
/* Ensure that blocks are always aligned to the required number of bytes. */
#if portBYTE_ALIGNMENT != 1
if( xWantedSize & portBYTE_ALIGNMENT_MASK )
if( xWantedSize & mask )
{
/* Byte alignment required. */
xWantedSize += ( alignment - ( xWantedSize & mask ) );