diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 6972e08..01c447d 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -4301,8 +4301,9 @@ VmaSmallVector::VmaSmallVector(size_t count, const AllocatorT& template void VmaSmallVector::push_back(const T& src) { - resize(m_Count + 1); - data()[m_Count] = src; + const size_t newIndex = size(); + resize(newIndex + 1); + data()[newIndex] = src; } template