| 14683 | } |
| 14684 | |
| 14685 | void VmaAllocator_T::FreeMemory( |
| 14686 | size_t allocationCount, |
| 14687 | const VmaAllocation* pAllocations) |
| 14688 | { |
| 14689 | VMA_ASSERT(pAllocations); |
| 14690 | |
| 14691 | for(size_t allocIndex = allocationCount; allocIndex--; ) |
| 14692 | { |
| 14693 | VmaAllocation allocation = pAllocations[allocIndex]; |
| 14694 | |
| 14695 | if(allocation != VK_NULL_HANDLE) |
| 14696 | { |
| 14697 | #if VMA_DEBUG_INITIALIZE_ALLOCATIONS |
| 14698 | FillAllocation(allocation, VMA_ALLOCATION_FILL_PATTERN_DESTROYED); |
| 14699 | #endif |
| 14700 | |
| 14701 | switch(allocation->GetType()) |
| 14702 | { |
| 14703 | case VmaAllocation_T::ALLOCATION_TYPE_BLOCK: |
| 14704 | { |
| 14705 | VmaBlockVector* pBlockVector = VMA_NULL; |
| 14706 | VmaPool hPool = allocation->GetParentPool(); |
| 14707 | if(hPool != VK_NULL_HANDLE) |
| 14708 | { |
| 14709 | pBlockVector = &hPool->m_BlockVector; |
| 14710 | } |
| 14711 | else |
| 14712 | { |
| 14713 | const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex(); |
| 14714 | pBlockVector = m_pBlockVectors[memTypeIndex]; |
| 14715 | VMA_ASSERT(pBlockVector && "Trying to free memory of unsupported type!"); |
| 14716 | } |
| 14717 | pBlockVector->Free(allocation); |
| 14718 | } |
| 14719 | break; |
| 14720 | case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED: |
| 14721 | FreeDedicatedMemory(allocation); |
| 14722 | break; |
| 14723 | default: |
| 14724 | VMA_ASSERT(0); |
| 14725 | } |
| 14726 | } |
| 14727 | } |
| 14728 | } |
| 14729 | |
| 14730 | void VmaAllocator_T::CalculateStatistics(VmaTotalStatistics* pStats) |
| 14731 | { |
no test coverage detected