/// <summary>
        /// Deletes this object.
        /// <para>
        /// This function must be used instead of destructor, which is private.
        /// There is no reference counting involved.
        /// </para>
        /// </summary>
        public void Release()
        {
            using var debugGlobalMutexLock = D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK();

            // Copy is needed because otherwise we would call destructor and invalidate the structure with callbacks before using it to free memory.
            D3D12MA_ALLOCATION_CALLBACKS allocationCallbacksCopy = *m_Pimpl->GetAllocs();

            D3D12MA_DELETE(&allocationCallbacksCopy, ref this);
        }
コード例 #2
0
 public static void _ctor(ref D3D12MA_AllocationObjectAllocator pThis, [NativeTypeName("const D3D12MA_ALLOCATION_CALLBACKS&")] ref D3D12MA_ALLOCATION_CALLBACKS allocationCallbacks)
 {
     D3D12MA_MUTEX._ctor(ref pThis.m_Mutex);
     D3D12MA_PoolAllocator <D3D12MA_Allocation> ._ctor(ref pThis.m_Allocator, (D3D12MA_ALLOCATION_CALLBACKS *)Unsafe.AsPointer(ref allocationCallbacks), 1024);
 }