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); } }
public PinnedList(T[] data, bool clone = false) { m_data = clone ? (T[])data.Clone() : data; m_list = PinnedListImpl.CreateIntrusiveList(m_data); m_gch = GCHandle.Alloc(m_data, GCHandleType.Pinned); }
public PinnedList(int size = 0) { m_data = new T[size]; m_list = PinnedListImpl.CreateIntrusiveList(m_data); m_gch = GCHandle.Alloc(m_data, GCHandleType.Pinned); }