Also correct the allocated size.

This commit is contained in:
shenweip 2020-08-05 19:01:00 +08:00
parent acc952d839
commit 77da51c418

View File

@ -169,7 +169,7 @@ u32 BlockAllocator::AllocAt(u32 position, u32 size, const char *tag)
// Upalign size to grain.
alignedSize = (alignedSize + grain_ - 1) & ~(grain_ - 1);
// Tell the caller the allocated size from their requested starting position.
size = alignedSize - (alignedPosition - position);
size = alignedSize - (position - alignedPosition);
Block *bp = GetBlockFromAddress(alignedPosition);
if (bp != NULL)