Пример #1
0
        public D3D12MA_Allocation *Allocate(D3D12MA_AllocatorPimpl *allocator, ulong size, int wasZeroInitialized)
        {
            using var mutexLock = new D3D12MA_MutexLock(ref m_Mutex);

            var allocation = m_Allocator.Alloc();

            D3D12MA_Allocation._ctor(ref *allocation, allocator, size, wasZeroInitialized);

            return(allocation);
        }
Пример #2
0
        public Item *PushBack()
        {
            Item *pNewItem = m_ItemAllocator.Alloc();

            pNewItem->pNext = null;

            if (IsEmpty())
            {
                pNewItem->pPrev = null;
                m_pFront        = pNewItem;
                m_pBack         = pNewItem;
                m_Count         = 1;
            }
            else
            {
                pNewItem->pPrev = m_pBack;
                m_pBack->pNext  = pNewItem;
                m_pBack         = pNewItem;
                ++m_Count;
            }

            return(pNewItem);
        }