Assets/Plugins/Unity.Media.Utilities/Runtime/GrowableBuffer.cs
/// <summary>
/// Ensure that the buffer has at least the given capacity
/// </summary>
/// <param name="newCapacity">The required capacity</param>
Ensure that the buffer has at least the given capacity
Ensure that the buffer has at least the given capacity
public void CheckCapacity(int newCapacity)
        {
            if (newCapacity <= Capacity)
                return;
            *m_Capacity = Math.Max(Capacity * 2, newCapacity);
            var newArray = Utility.AllocateUnsafe<T>(Capacity,  m_Allocator);
            UnsafeUtility.MemCpy(newArray, *m_Array, Count * UnsafeUtility.SizeOf<T>());
            Utility.FreeUnsafe(*m_Array, m_Allocator);
            *m_Array = newArray;
        }
public void CheckCapacity ( int newCapacity ) { if ( newCapacity <= Capacity ) return ; * m_Capacity = Math . Max ( Capacity * 2 , newCapacity ) ; var newArray = Utility . AllocateUnsafe < T > ( Capacity , m_Allocator ) ; UnsafeUtility . MemCpy ( newArray , * m_Array , Count * UnsafeUtility . SizeOf < T > ( ) ) ; Utility . FreeUnsafe ( * m_Array , m_Allocator ) ; * m_Array = newArray ; }
Ensure that the buffer has at least the given capacity
Ensure that the buffer has at least the given capacity
newCapacity
int
The required capacity
The required capacity