Skip to content

Commit 023976a

Browse files
Minor fix: Add missing mutex lock to VmaBlockVector::IsEmpty
1 parent 6d6b067 commit 023976a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/vk_mem_alloc.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6265,7 +6265,7 @@ struct VmaBlockVector
62656265

62666266
void GetPoolStats(VmaPoolStats* pStats);
62676267

6268-
bool IsEmpty() const { return m_Blocks.empty(); }
6268+
bool IsEmpty();
62696269
bool IsCorruptionDetectionEnabled() const;
62706270

62716271
VkResult Allocate(
@@ -11814,6 +11814,12 @@ void VmaBlockVector::GetPoolStats(VmaPoolStats* pStats)
1181411814
}
1181511815
}
1181611816

11817+
bool VmaBlockVector::IsEmpty()
11818+
{
11819+
VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
11820+
return m_Blocks.empty();
11821+
}
11822+
1181711823
bool VmaBlockVector::IsCorruptionDetectionEnabled() const
1181811824
{
1181911825
const uint32_t requiredMemFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;

0 commit comments

Comments
 (0)