Merge pull request #187 from aws-lumberyard-dev/LY123349_Emfx_MotionInstancePoolReduceFragmentation

Change reservation strategy in MotionInstancePool to reduce fragmentation.
This commit is contained in:
Gene Walters
2021-05-03 16:27:55 -07:00
committed by GitHub
@@ -220,7 +220,7 @@ namespace EMotionFX
//mPool->mFreeList.Reserve( numInstances * 2 );
if (mPool->mFreeList.GetMaxLength() < mPool->mNumInstances)
{
mPool->mFreeList.Reserve(mPool->mNumInstances);
mPool->mFreeList.Reserve(mPool->mNumInstances + mPool->mFreeList.GetMaxLength() / 2);
}
mPool->mFreeList.ResizeFast(startIndex + numInstances);