From 816b55748ab7e42a495e4cf2c9a8989b020a975a Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Thu, 10 Aug 2017 14:49:54 +0200 Subject: [PATCH] VectorInsert, VectorRemove functions: Added missing Vma- prefix. --- src/vk_mem_alloc.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h index 74cbc22..83b2c38 100644 --- a/src/vk_mem_alloc.h +++ b/src/vk_mem_alloc.h @@ -1243,13 +1243,13 @@ public: #define VmaVector std::vector template -static void VectorInsert(std::vector& vec, size_t index, const T& item) +static void VmaVectorInsert(std::vector& vec, size_t index, const T& item) { vec.insert(vec.begin() + index, item); } template -static void VectorRemove(std::vector& vec, size_t index) +static void VmaVectorRemove(std::vector& vec, size_t index) { vec.erase(vec.begin() + index); } @@ -1461,13 +1461,13 @@ private: }; template -static void VectorInsert(VmaVector& vec, size_t index, const T& item) +static void VmaVectorInsert(VmaVector& vec, size_t index, const T& item) { vec.insert(index, item); } template -static void VectorRemove(VmaVector& vec, size_t index) +static void VmaVectorRemove(VmaVector& vec, size_t index) { vec.remove(index); } @@ -2139,7 +2139,7 @@ void VmaMap::insert(const PairType& pair) m_Vector.data() + m_Vector.size(), pair, VmaPairFirstLess()) - m_Vector.data(); - VectorInsert(m_Vector, indexToInsert, pair); + VmaVectorInsert(m_Vector, indexToInsert, pair); } template @@ -2163,7 +2163,7 @@ VmaPair* VmaMap::find(const KeyT& key) template void VmaMap::erase(iterator it) { - VectorRemove(m_Vector, it - m_Vector.begin()); + VmaVectorRemove(m_Vector, it - m_Vector.begin()); } #endif // #if VMA_USE_STL_UNORDERED_MAP @@ -3376,7 +3376,7 @@ void VmaBlock::RegisterFreeSuballocation(VmaSuballocationList::iterator item) item, VmaSuballocationItemSizeLess()); size_t index = it - m_FreeSuballocationsBySize.data(); - VectorInsert(m_FreeSuballocationsBySize, index, item); + VmaVectorInsert(m_FreeSuballocationsBySize, index, item); } } } @@ -3399,7 +3399,7 @@ void VmaBlock::UnregisterFreeSuballocation(VmaSuballocationList::iterator item) { if(m_FreeSuballocationsBySize[index] == item) { - VectorRemove(m_FreeSuballocationsBySize, index); + VmaVectorRemove(m_FreeSuballocationsBySize, index); return; } VMA_ASSERT((m_FreeSuballocationsBySize[index]->size == item->size) && "Not found."); @@ -3492,7 +3492,7 @@ void VmaBlockVector::Remove(VmaBlock* pBlock) { if(m_Blocks[blockIndex] == pBlock) { - VectorRemove(m_Blocks, blockIndex); + VmaVectorRemove(m_Blocks, blockIndex); return; } } @@ -3878,7 +3878,7 @@ VkResult VmaDefragmentator::DefragmentRound( ++m_AllocationsMoved; m_BytesMoved += size; - VectorRemove(pSrcBlockInfo->m_Allocations, srcAllocIndex); + VmaVectorRemove(pSrcBlockInfo->m_Allocations, srcAllocIndex); break; } @@ -4304,7 +4304,7 @@ VkResult VmaAllocator_T::AllocateOwnMemory( pOwnAllocationsEnd, *pAllocation, VmaPointerLess()) - pOwnAllocationsBeg; - VectorInsert(*pOwnAllocations, indexToInsert, *pAllocation); + VmaVectorInsert(*pOwnAllocations, indexToInsert, *pAllocation); } VMA_DEBUG_LOG(" Allocated OwnMemory MemoryTypeIndex=#%u", memTypeIndex); @@ -4651,7 +4651,7 @@ VkResult VmaAllocator_T::Defragment( pDefragmentationStats->bytesFreed += pBlock->m_Size; } - VectorRemove(pBlockVector->m_Blocks, blockIndex); + VmaVectorRemove(pBlockVector->m_Blocks, blockIndex); pBlock->Destroy(this); vma_delete(this, pBlock); } @@ -4707,7 +4707,7 @@ void VmaAllocator_T::FreeOwnMemory(VmaAllocation allocation) if(pOwnAllocationIt != pOwnAllocationsEnd) { const size_t ownAllocationIndex = pOwnAllocationIt - pOwnAllocationsBeg; - VectorRemove(*pOwnAllocations, ownAllocationIndex); + VmaVectorRemove(*pOwnAllocations, ownAllocationIndex); } else {