Assets/Plugins/Unity.Media.Utilities/Runtime/BatchAllocator.cs
/// <summary>
/// Perform the actual allocation and populate the registered suballocation pointers
/// </summary>
Perform the actual allocation and populate the registered suballocation pointers
Perform the actual allocation and populate the registered suballocation pointers
public void Dispose()
        {
            if (m_TotalSize > 0)
            {
                var block = (byte*)UnsafeUtility.Malloc(m_TotalSize, m_LargestAlignment, m_Allocator);
                Utility.RegisterAllocation(block, m_Allocator);
                AllocationRoot = block;
                for (int i = 0; i < m_Allocations.Count; ++i)
                {
                    var allocation = m_Allocations[i];
                    *allocation.Pointer = block + allocation.Offset;
                }
            }
            m_Allocations.Dispose();
        }
public void Dispose ( ) { if ( m_TotalSize > 0 ) { var block = ( byte * ) UnsafeUtility . Malloc ( m_TotalSize , m_LargestAlignment , m_Allocator ) ; Utility . RegisterAllocation ( block , m_Allocator ) ; AllocationRoot = block ; for ( int i = 0 ; i < m_Allocations . Count ; ++ i ) { var allocation = m_Allocations [ i ] ; * allocation . Pointer = block + allocation . Offset ; } } m_Allocations . Dispose ( ) ; }
Perform the actual allocation and populate the registered suballocation pointers
Perform the actual allocation and populate the registered suballocation pointers