Fixed incorrect counting of m_BlocksFreeSize when merging margin blocks.

Code by @medranSolus
This commit is contained in:
Adam Sawicki 2022-07-25 11:18:01 +02:00
parent 4b01ef07ef
commit 99d6fcb985

View File

@ -10587,9 +10587,10 @@ void VmaBlockMetadata_TLSF::Free(VmaAllocHandle allocHandle)
VkDeviceSize debugMargin = GetDebugMargin();
if (debugMargin > 0)
{
VMA_ASSERT(next->size == debugMargin);
// Adjust stats for one less block
--m_BlocksFreeCount;
m_BlocksFreeSize -= block->size;
m_BlocksFreeSize -= debugMargin;
MergeBlock(next, block);
block = next;
next = next->nextPhysical;