41 references to SegmentedArrayHelper
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (41)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
152if (partitionSize <= SegmentedArrayHelper.IntrosortSizeThreshold) 190Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 431if (partitionSize <= SegmentedArrayHelper.IntrosortSizeThreshold) 472Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 743if (partitionSize <= SegmentedArrayHelper.IntrosortSizeThreshold) 781Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 982if (partitionSize <= SegmentedArrayHelper.IntrosortSizeThreshold) 1020Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold);
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (3)
177=> SegmentedArrayHelper.CalculateSegmentSize(elementSize); 180=> SegmentedArrayHelper.CalculateSegmentShift(segmentSize); 183=> SegmentedArrayHelper.CalculateOffsetMask(segmentSize);
src\Dependencies\Collections\SegmentedArray.cs (23)
486var initialFirstSegment = _firstOffset >> SegmentedArrayHelper.GetSegmentShift<T>(); 487var initialSecondSegment = _secondOffset >> SegmentedArrayHelper.GetSegmentShift<T>(); 488var offset = _firstOffset & SegmentedArrayHelper.GetOffsetMask<T>(); 489Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset"); 501var firstSegment = _firstSegments[(_completed + _firstOffset) >> SegmentedArrayHelper.GetSegmentShift<T>()]; 502var secondSegment = _secondSegments[(_completed + _secondOffset) >> SegmentedArrayHelper.GetSegmentShift<T>()]; 503var currentSegmentLength = Math.Min(SegmentedArrayHelper.GetSegmentSize<T>(), _length - _completed); 589var initialFirstSegment = (_completed + _firstOffset) >> SegmentedArrayHelper.GetSegmentShift<T>(); 590var initialSecondSegment = (_completed + _secondOffset) >> SegmentedArrayHelper.GetSegmentShift<T>(); 591var firstOffset = (_completed + _firstOffset) & SegmentedArrayHelper.GetOffsetMask<T>(); 592var secondOffset = (_completed + _secondOffset) & SegmentedArrayHelper.GetOffsetMask<T>(); 637var initialFirstSegment = (_firstOffset + _length - _completed - 1) >> SegmentedArrayHelper.GetSegmentShift<T>(); 638var initialSecondSegment = (_secondOffset + _length - _completed - 1) >> SegmentedArrayHelper.GetSegmentShift<T>(); 639var firstOffset = (_firstOffset + _length - _completed - 1) & SegmentedArrayHelper.GetOffsetMask<T>(); 640var secondOffset = (_secondOffset + _length - _completed - 1) & SegmentedArrayHelper.GetOffsetMask<T>(); 731var firstSegment = _offset >> SegmentedArrayHelper.GetSegmentShift<T>(); 732var offset = _offset & SegmentedArrayHelper.GetOffsetMask<T>(); 742var segment = _segments[(_completed + _offset) >> SegmentedArrayHelper.GetSegmentShift<T>()]; 743_current = segment.AsMemory().Slice(0, Math.Min(SegmentedArrayHelper.GetSegmentSize<T>(), _length - _completed)); 780var firstSegment = _offset >> SegmentedArrayHelper.GetSegmentShift<T>(); 781var offset = _offset & SegmentedArrayHelper.GetOffsetMask<T>(); 791var 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)
37return SegmentedArrayHelper.GetSegmentSize<T>(); 48return SegmentedArrayHelper.GetSegmentShift<T>(); 59return SegmentedArrayHelper.GetOffsetMask<T>();
src\Dependencies\Collections\SegmentedList`1.cs (4)
154var newSegmentCount = (value + SegmentedArrayHelper.GetSegmentSize<T>() - 1) >> SegmentedArrayHelper.GetSegmentShift<T>(); 162Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 165var lastSegmentSize = value - ((newSegmentCount - 1) << SegmentedArrayHelper.GetSegmentShift<T>());