Esempio n. 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);
     }
 }
Esempio n. 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);
 }
Esempio n. 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);
 }