コード例 #1
0
TraditionalImage::~TraditionalImage()
{
    if(m_Allocation)
    {
        vmaFreeMemory(g_hAllocator, m_Allocation);
    }
}
コード例 #2
0
ファイル: backend_vma.cpp プロジェクト: mp3butcher/Anvil
/** Please see header for specification */
void Anvil::MemoryAllocatorBackends::VMA::VMAAllocator::on_vma_alloced_mem_block_gone_out_of_scope(Anvil::MemoryBlock* in_memory_block_ptr,
                                                                                                   VmaAllocation       in_vma_allocation)
{
    /* Only physically deallocate those memory blocks that are not derivatives of another memory blocks! */
    if (in_memory_block_ptr->get_create_info_ptr()->get_parent_memory_block() == nullptr)
    {
        vmaFreeMemory(get_handle(),
                      in_vma_allocation);

        /* Remove one cached pointer to the VMA wrapper class instance. This means that VMA instance
         * is going to be destroyed in case the vector's size reaches zero!
         */
        anvil_assert(m_refcount_helper.size() >= 1);

        m_refcount_helper.pop_back();

        /* WARNING: *this is potentially out of scope from this point onward!: */
    }
}