Пример #1
0
        public AllocatedList(ListAllocator <T> allocator, int capacity)
        {
            this.allocator = allocator;
            ArraySegment <T> allocation = allocator.Allocate(capacity);

            this.array    = allocation.Array;
            this.offset   = allocation.Offset;
            this.capacity = capacity;
            this.count    = 0;
            this.comparer = EqualityComparer <T> .Default;
        }
Пример #2
0
 public AllocatedList(ListAllocator <T> allocator, IList <T> other)
     : this(allocator, other.Count)
 {
     AddRange(other, 0, other.Count);
 }
Пример #3
0
 public AllocatedList(ListAllocator <T> allocator)
     : this(allocator, 10)
 {
 }
Пример #4
0
 public AllocatedList(ListAllocator <T> allocator, int capacity, int count)
     : this(allocator, capacity)
 {
     this.count = count;
 }