MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator / InsertBefore

Method InsertBefore

include/vk_mem_alloc.h:5399–5421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5397
5398template<typename T>
5399VmaListItem<T>* VmaRawList<T>::InsertBefore(ItemType* pItem)
5400{
5401 if(pItem != VMA_NULL)
5402 {
5403 ItemType* const prevItem = pItem->pPrev;
5404 ItemType* const newItem = m_ItemAllocator.Alloc();
5405 newItem->pPrev = prevItem;
5406 newItem->pNext = pItem;
5407 pItem->pPrev = newItem;
5408 if(prevItem != VMA_NULL)
5409 {
5410 prevItem->pNext = newItem;
5411 }
5412 else
5413 {
5414 VMA_HEAVY_ASSERT(m_pFront == pItem);
5415 m_pFront = newItem;
5416 }
5417 ++m_Count;
5418 return newItem;
5419 }
5420 return PushBack();
5421}
5422
5423template<typename T>
5424VmaListItem<T>* VmaRawList<T>::InsertAfter(ItemType* pItem)

Callers 1

insertMethod · 0.80

Calls 1

AllocMethod · 0.80

Tested by

no test coverage detected