mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Fix bug of heap_2 introduced by pr738. (#743)
* Fix bug of heap_2 introduced by pr738. * Fix formatting check Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> --------- Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> Co-authored-by: moral-hao <405197809@qq.com> Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
parent
02be485e04
commit
ee0a82be1b
|
@ -229,9 +229,10 @@ void * pvPortMalloc( size_t xWantedSize )
|
||||||
pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;
|
pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;
|
||||||
pxBlock->xBlockSize = xWantedSize;
|
pxBlock->xBlockSize = xWantedSize;
|
||||||
|
|
||||||
/* Insert the new block into the list of free blocks. */
|
/* Insert the new block into the list of free blocks.
|
||||||
pxNewBlockLink->pxNextFreeBlock = pxPreviousBlock->pxNextFreeBlock;
|
* The list of free blocks is sorted by their size, we have to
|
||||||
pxPreviousBlock->pxNextFreeBlock = pxNewBlockLink;
|
* iterate to find the right place to insert new block. */
|
||||||
|
prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
|
|
Loading…
Reference in a new issue