From da380f69bd4547cd776c525ae225bb9d13df94e2 Mon Sep 17 00:00:00 2001 From: asawicki Date: Wed, 6 Nov 2024 16:24:40 +0100 Subject: [PATCH] Fixed a warning in BlockMetadata_TLSF::WriteAllocationInfoToJson Fixes #67 - thanks @ttcvetkov --- src/D3D12MemAlloc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/D3D12MemAlloc.cpp b/src/D3D12MemAlloc.cpp index 4b85b11..ecb1330 100644 --- a/src/D3D12MemAlloc.cpp +++ b/src/D3D12MemAlloc.cpp @@ -5030,7 +5030,8 @@ void BlockMetadata_TLSF::WriteAllocationInfoToJson(JsonWriter& json) const } D3D12MA_ASSERT(i == 0); - PrintDetailedMap_Begin(json, GetSumFreeSize(), GetAllocationCount(), m_BlocksFreeCount + static_cast(m_NullBlock->size)); + PrintDetailedMap_Begin(json, GetSumFreeSize(), GetAllocationCount(), m_BlocksFreeCount + + (m_NullBlock->size > 0 ? 1 : 0)); for (; i < blockCount; ++i) { Block* block = blockList[i];