public void Clear() { if (m_data.Length > 0) { PinnedListImpl.SetCount(m_list, 0); } }
public void Resize(int size) { if (size > m_data.Length) { LockList(l => { l.Capacity = size; }); } PinnedListImpl.SetCount(m_list, size); }
public void ResizeDiscard(int size) { if (size > m_data.Length) { if (m_gch.IsAllocated) m_gch.Free(); m_data = new T[size]; m_list = PinnedListImpl.CreateIntrusiveList(m_data); m_gch = GCHandle.Alloc(m_data, GCHandleType.Pinned); } else { PinnedListImpl.SetCount(m_list, size); } }