Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 public PinnedList(int size = 0)
 {
     m_data = new T[size];
     m_list = PinnedListImpl.CreateIntrusiveList(m_data);
     m_gch  = GCHandle.Alloc(m_data, GCHandleType.Pinned);
 }