12 instantiations of SegmentedArray
Microsoft.CodeAnalysis.Collections.Package (12)
SegmentedArray`1.cs (1)
150return new SegmentedArray<T>(Length, items);
SegmentedArray`1+PrivateMarshal.cs (1)
19=> new SegmentedArray<T>(length, segments);
SegmentedDictionary`2.cs (3)
493var buckets = new SegmentedArray<int>(size); 494var entries = new SegmentedArray<Entry>(size); 655_buckets = new SegmentedArray<int>(newSize);
SegmentedHashSet`1.cs (3)
908_buckets = new SegmentedArray<int>(newSize); 999var buckets = new SegmentedArray<int>(size); 1000var entries = new SegmentedArray<Entry>(size);
SegmentedList`1.cs (4)
42private static readonly SegmentedArray<T> s_emptyArray = new(0); 66_items = new SegmentedArray<T>(capacity); 95_items = new SegmentedArray<T>(count); 146_items = new SegmentedArray<T>(value);
131 references to SegmentedArray
Microsoft.CodeAnalysis.Collections.Package (131)
Internal\ArraySortHelper.cs (4)
49public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer) 82internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer) 339public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer) 364private static int BinarySearch(SegmentedArray<T> array, int index, int length, T value)
Internal\SegmentedArraySegment`1.cs (2)
9public SegmentedArray<T> Array { get; } 13public SegmentedArraySegment(SegmentedArray<T> array, int start, int length)
SegmentedArray.cs (50)
19internal static void Clear<T>(SegmentedArray<T> array) 23internal static void Clear<T>(SegmentedArray<T> array, int index, int length) 32internal static void Copy<T>(SegmentedArray<T> sourceArray, SegmentedArray<T> destinationArray, int length) 50public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 77public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, SegmentedArray<T> destinationArray, int destinationIndex, int length) 110private static void CopyOverlapped<T>(SegmentedArray<T> array, int sourceIndex, int destinationIndex, int length) 136public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 172public static int BinarySearch<T>(SegmentedArray<T> array, T value) 177public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer) 182public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value) 187public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer) 199public static int IndexOf<T>(SegmentedArray<T> array, T value) 204public static int IndexOf<T>(SegmentedArray<T> array, T value, int startIndex) 209public static int IndexOf<T>(SegmentedArray<T> array, T value, int startIndex, int count) 214public static int IndexOf<T>(SegmentedArray<T> array, T value, int startIndex, int count, IEqualityComparer<T>? comparer) 264public static int LastIndexOf<T>(SegmentedArray<T> array, T value) 269public static int LastIndexOf<T>(SegmentedArray<T> array, T value, int startIndex) 274public static int LastIndexOf<T>(SegmentedArray<T> array, T value, int startIndex, int count) 279public static int LastIndexOf<T>(SegmentedArray<T> array, T value, int startIndex, int count, IEqualityComparer<T>? comparer) 333public static void Reverse<T>(SegmentedArray<T> array) 338public static void Reverse<T>(SegmentedArray<T> array, int index, int length) 362public static void Sort<T>(SegmentedArray<T> array) 371public static void Sort<T>(SegmentedArray<T> array, int index, int length) 376public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer) 381public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer) 397public static void Sort<T>(SegmentedArray<T> array, Comparison<T> comparison) 411private static SegmentEnumerable<T> GetSegments<T>(this SegmentedArray<T> array, int offset, int length) 414private static AlignedSegmentEnumerable<T> GetSegments<T>(SegmentedArray<T> first, SegmentedArray<T> second, int length) 418private static AlignedSegmentEnumerable<T> GetSegmentsAligned<T>(SegmentedArray<T> first, int firstOffset, SegmentedArray<T> second, int secondOffset, int length) 422private static UnalignedSegmentEnumerable<T> GetSegmentsUnaligned<T>(SegmentedArray<T> first, int firstOffset, SegmentedArray<T> second, int secondOffset, int length) 427private readonly SegmentedArray<T> _first; 429private readonly SegmentedArray<T> _second; 433public AlignedSegmentEnumerable(SegmentedArray<T> first, SegmentedArray<T> second, int length) 438public AlignedSegmentEnumerable(SegmentedArray<T> first, int firstOffset, SegmentedArray<T> second, int secondOffset, int length) 513private readonly SegmentedArray<T> _first; 515private readonly SegmentedArray<T> _second; 519public UnalignedSegmentEnumerable(SegmentedArray<T> first, SegmentedArray<T> second, int length) 524public UnalignedSegmentEnumerable(SegmentedArray<T> first, int firstOffset, SegmentedArray<T> second, int secondOffset, int length) 656private readonly SegmentedArray<T> _array; 660public SegmentEnumerable(SegmentedArray<T> array) 667public SegmentEnumerable(SegmentedArray<T> array, int offset, int length)
SegmentedArray`1.cs (7)
20internal readonly partial struct SegmentedArray<T> : ICloneable, IList, IStructuralComparable, IStructuralEquatable, IList<T>, IReadOnlyList<T>, IEquatable<SegmentedArray<T>> 175return obj is SegmentedArray<T> other 184public bool Equals(SegmentedArray<T> other) 310if (other is not SegmentedArray<T> o 331if (other is not SegmentedArray<T> o) 375public Enumerator(SegmentedArray<T> array) 421public static int SegmentSize => SegmentedArray<T>.SegmentSize;
SegmentedArray`1+PrivateMarshal.cs (3)
14/// <inheritdoc cref="SegmentedCollectionsMarshal.AsSegments{T}(SegmentedArray{T})"/> 15public static T[][] AsSegments(SegmentedArray<T> array) 18public static SegmentedArray<T> AsSegmentedArray(int length, T[][] segments)
SegmentedCollectionsMarshal.cs (11)
16/// Gets the backing storage array for a <see cref="SegmentedArray{T}"/>. 21/// value will invalidate the <see cref="SegmentedArray{T}"/> data structure.</returns> 22public static T[][] AsSegments<T>(SegmentedArray<T> array) 23=> SegmentedArray<T>.PrivateMarshal.AsSegments(array); 26/// Gets a <see cref="SegmentedArray{T}"/> value wrapping the input T[][]. 30/// <param name="segments">The input array to wrap in the returned <see cref="SegmentedArray{T}"/> value.</param> 31/// <returns>A <see cref="SegmentedArray{T}"/> value wrapping <paramref name="segments"/>.</returns> 35/// array, and that it won't be modified once the returned <see cref="SegmentedArray{T}"/> value starts 37/// <see cref="SegmentedArray{T}"/> values to change outside their control. 41public static SegmentedArray<T> AsSegmentedArray<T>(int length, T[][] segments) 42=> SegmentedArray<T>.PrivateMarshal.AsSegmentedArray(length, segments);
SegmentedDictionary`2.cs (25)
46private SegmentedArray<int> _buckets; 47private SegmentedArray<Entry> _entries; 169var oldEntries = source._entries; 316var entries = _entries; 374var entries = _entries; 414var entries = _entries; 448var entries = _entries; 493var buckets = new SegmentedArray<int>(size); 494var entries = new SegmentedArray<Entry>(size); 518var entries = _entries; 652var entries = CreateNewSegmentedArrayReusingOldSegments(_entries, newSize); 670private static SegmentedArray<Entry> CreateNewSegmentedArrayReusingOldSegments(SegmentedArray<Entry> oldArray, int newSize) 713var entries = _entries; 790var entries = _entries; 906var entries = _entries; 926var entries = _entries; 1003var oldEntries = _entries; 1017private void CopyEntries(SegmentedArray<Entry> entries, int count) 1019var newEntries = _entries; 1153var buckets = _buckets; 1329var entries = _dictionary._entries; 1408var entries = _dictionary._entries; 1537var entries = _dictionary._entries; 1616var entries = _dictionary._entries;
SegmentedHashSet`1.cs (20)
53private SegmentedArray<int> _buckets; 54private SegmentedArray<Entry> _entries; 165_buckets = (SegmentedArray<int>)source._buckets.Clone(); 166_entries = (SegmentedArray<Entry>)source._entries.Clone(); 176var entries = source._entries; 221var buckets = _buckets; 224var entries = _entries; 285var buckets = _buckets; 293var entries = _entries; 819var entries = _entries; 839var entries = _entries; 905var entries = CreateNewSegmentedArrayReusingOldSegments(_entries, newSize); 924private static SegmentedArray<Entry> CreateNewSegmentedArrayReusingOldSegments(SegmentedArray<Entry> oldArray, int newSize) 955var oldEntries = _entries; 965var entries = _entries; 999var buckets = new SegmentedArray<int>(size); 1000var entries = new SegmentedArray<Entry>(size); 1023var entries = _entries; 1147var entries = _entries;
SegmentedList`1.cs (9)
38internal SegmentedArray<T> _items; 42private static readonly SegmentedArray<T> s_emptyArray = new(0); 80_items = (SegmentedArray<T>)segmentedList._items.Clone(); 156private static SegmentedArray<T> CreateNewSegmentedArrayReusingOldSegments(SegmentedArray<T> oldArray, int newSize) 251var array = _items; 316else if (c is SegmentedArray<T> array) 928else if (c is SegmentedArray<T> array) 1392public ref SegmentedArray<T> Items => ref instance._items;