59 references to SegmentedArrayHelper
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (59)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
152
if (partitionSize <=
SegmentedArrayHelper
.IntrosortSizeThreshold)
190
Debug.Assert(keys.Length >=
SegmentedArrayHelper
.IntrosortSizeThreshold);
431
if (partitionSize <=
SegmentedArrayHelper
.IntrosortSizeThreshold)
472
Debug.Assert(keys.Length >=
SegmentedArrayHelper
.IntrosortSizeThreshold);
743
if (partitionSize <=
SegmentedArrayHelper
.IntrosortSizeThreshold)
781
Debug.Assert(keys.Length >=
SegmentedArrayHelper
.IntrosortSizeThreshold);
982
if (partitionSize <=
SegmentedArrayHelper
.IntrosortSizeThreshold)
1020
Debug.Assert(keys.Length >=
SegmentedArrayHelper
.IntrosortSizeThreshold);
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (3)
186
=>
SegmentedArrayHelper
.CalculateSegmentSize(elementSize);
189
=>
SegmentedArrayHelper
.CalculateSegmentShift(segmentSize);
192
=>
SegmentedArrayHelper
.CalculateOffsetMask(segmentSize);
src\Dependencies\Collections\SegmentedArray.cs (23)
486
var initialFirstSegment = _firstOffset >>
SegmentedArrayHelper
.GetSegmentShift<T>();
487
var initialSecondSegment = _secondOffset >>
SegmentedArrayHelper
.GetSegmentShift<T>();
488
var offset = _firstOffset &
SegmentedArrayHelper
.GetOffsetMask<T>();
489
Debug.Assert(offset == (_secondOffset &
SegmentedArrayHelper
.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
501
var firstSegment = _firstSegments[(_completed + _firstOffset) >>
SegmentedArrayHelper
.GetSegmentShift<T>()];
502
var secondSegment = _secondSegments[(_completed + _secondOffset) >>
SegmentedArrayHelper
.GetSegmentShift<T>()];
503
var currentSegmentLength = Math.Min(
SegmentedArrayHelper
.GetSegmentSize<T>(), _length - _completed);
589
var initialFirstSegment = (_completed + _firstOffset) >>
SegmentedArrayHelper
.GetSegmentShift<T>();
590
var initialSecondSegment = (_completed + _secondOffset) >>
SegmentedArrayHelper
.GetSegmentShift<T>();
591
var firstOffset = (_completed + _firstOffset) &
SegmentedArrayHelper
.GetOffsetMask<T>();
592
var secondOffset = (_completed + _secondOffset) &
SegmentedArrayHelper
.GetOffsetMask<T>();
637
var initialFirstSegment = (_firstOffset + _length - _completed - 1) >>
SegmentedArrayHelper
.GetSegmentShift<T>();
638
var initialSecondSegment = (_secondOffset + _length - _completed - 1) >>
SegmentedArrayHelper
.GetSegmentShift<T>();
639
var firstOffset = (_firstOffset + _length - _completed - 1) &
SegmentedArrayHelper
.GetOffsetMask<T>();
640
var secondOffset = (_secondOffset + _length - _completed - 1) &
SegmentedArrayHelper
.GetOffsetMask<T>();
731
var firstSegment = _offset >>
SegmentedArrayHelper
.GetSegmentShift<T>();
732
var offset = _offset &
SegmentedArrayHelper
.GetOffsetMask<T>();
742
var segment = _segments[(_completed + _offset) >>
SegmentedArrayHelper
.GetSegmentShift<T>()];
743
_current = segment.AsMemory().Slice(0, Math.Min(
SegmentedArrayHelper
.GetSegmentSize<T>(), _length - _completed));
780
var firstSegment = _offset >>
SegmentedArrayHelper
.GetSegmentShift<T>();
781
var offset = _offset &
SegmentedArrayHelper
.GetOffsetMask<T>();
791
var segment = _segments[(_completed + _offset) >>
SegmentedArrayHelper
.GetSegmentShift<T>()];
792
_current = segment.AsMemory().Slice(0, Math.Min(
SegmentedArrayHelper
.GetSegmentSize<T>(), _length - _completed));
src\Dependencies\Collections\SegmentedArray`1.cs (3)
37
return
SegmentedArrayHelper
.GetSegmentSize<T>();
48
return
SegmentedArrayHelper
.GetSegmentShift<T>();
59
return
SegmentedArrayHelper
.GetOffsetMask<T>();
src\Dependencies\Collections\SegmentedDictionary`2.cs (4)
675
var newSegmentCount = (newSize +
SegmentedArrayHelper
.GetSegmentSize<Entry>() - 1) >>
SegmentedArrayHelper
.GetSegmentShift<Entry>();
683
Array.Resize(ref segments[i],
SegmentedArrayHelper
.GetSegmentSize<Entry>());
686
var lastSegmentSize = newSize - ((newSegmentCount - 1) <<
SegmentedArrayHelper
.GetSegmentShift<Entry>());
src\Dependencies\Collections\SegmentedHashSet`1.cs (4)
929
var newSegmentCount = (newSize +
SegmentedArrayHelper
.GetSegmentSize<Entry>() - 1) >>
SegmentedArrayHelper
.GetSegmentShift<Entry>();
937
Array.Resize(ref segments[i],
SegmentedArrayHelper
.GetSegmentSize<Entry>());
940
var lastSegmentSize = newSize - ((newSegmentCount - 1) <<
SegmentedArrayHelper
.GetSegmentShift<Entry>());
src\Dependencies\Collections\SegmentedList`1.cs (14)
161
var newSegmentCount = (newSize +
SegmentedArrayHelper
.GetSegmentSize<T>() - 1) >>
SegmentedArrayHelper
.GetSegmentShift<T>();
169
Array.Resize(ref segments[i],
SegmentedArrayHelper
.GetSegmentSize<T>());
172
var lastSegmentSize = newSize - ((newSegmentCount - 1) <<
SegmentedArrayHelper
.GetSegmentShift<T>());
522
if (_items.Length <
SegmentedArrayHelper
.GetSegmentSize<T>() / 2)
528
else if (_items.Length <
SegmentedArrayHelper
.GetSegmentSize<T>())
531
newCapacity =
SegmentedArrayHelper
.GetSegmentSize<T>();
536
if (0 == (_items.Length &
SegmentedArrayHelper
.GetOffsetMask<T>()))
543
var oldSegmentCount = (_items.Length +
SegmentedArrayHelper
.GetSegmentSize<T>() - 1) >>
SegmentedArrayHelper
.GetSegmentShift<T>();
546
newCapacity =
SegmentedArrayHelper
.GetSegmentSize<T>() * newSegmentCount;
555
if (newCapacity >
SegmentedArrayHelper
.GetSegmentSize<T>())
558
var lastSegmentLength = newCapacity &
SegmentedArrayHelper
.GetOffsetMask<T>();
560
newCapacity = (newCapacity - lastSegmentLength) +
SegmentedArrayHelper
.GetSegmentSize<T>();