/// <summary>Given free suballocation, it inserts it into sorted list of <see cref="m_FreeSuballocationsBySize"/> if it's suitable.</summary>
        public void RegisterFreeSuballocation(D3D12MA_List <D3D12MA_Suballocation> .iterator item)
        {
            D3D12MA_ASSERT((D3D12MA_DEBUG_LEVEL > 0) && (item.Get()->type == D3D12MA_SUBALLOCATION_TYPE_FREE));
            D3D12MA_ASSERT((D3D12MA_DEBUG_LEVEL > 0) && (item.Get()->size > 0));

            // You may want to enable this validation at the beginning or at the end of
            // this function, depending on what do you want to check.
            D3D12MA_HEAVY_ASSERT((D3D12MA_DEBUG_LEVEL > 1) && ValidateFreeSuballocationList());

            if (item.Get()->size >= MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
            {
                if (m_FreeSuballocationsBySize.empty())
                {
                    m_FreeSuballocationsBySize.push_back(in item);
                }
                else
                {
                    m_FreeSuballocationsBySize.InsertSorted(in item, new D3D12MA_SuballocationItemSizeLess());
                }
            }

            // D3D12MA_HEAVY_ASSERT((D3D12MA_DEBUG_LEVEL > 1) && ValidateFreeSuballocatioNList());
        }
コード例 #2
0
        public bool IsEmpty()
        {
            using var @lock = new D3D12MA_MutexLockRead(ref m_Mutex, m_hAllocator->UseMutex());

            return(m_Blocks.empty());
        }