Beispiel #1
0
        public void Assign(List <T> sourceList)
        {
            var sourceData = PinnedListImpl.GetInternalArray(sourceList);
            var count      = sourceList.Count;

            ResizeDiscard(count);
            System.Array.Copy(sourceData, m_data, count);
        }
Beispiel #2
0
 public void LockList(Action <List <T> > body)
 {
     if (m_gch.IsAllocated)
     {
         m_gch.Free();
     }
     body(m_list);
     m_data = PinnedListImpl.GetInternalArray(m_list);
     m_gch  = GCHandle.Alloc(m_data, GCHandleType.Pinned);
 }
Beispiel #3
0
 public PinnedList(List <T> data, bool clone = false)
 {
     m_list = clone ? new List <T>(data) : data;
     m_data = PinnedListImpl.GetInternalArray(m_list);
     m_gch  = GCHandle.Alloc(m_data, GCHandleType.Pinned);
 }