diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 0e230c4..c3daf3c 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -4336,8 +4336,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