59 references to SegmentedArrayHelper
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (59)
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)
186=> SegmentedArrayHelper.CalculateSegmentSize(elementSize); 189=> SegmentedArrayHelper.CalculateSegmentShift(segmentSize); 192=> 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\SegmentedDictionary`2.cs (4)
675var newSegmentCount = (newSize + SegmentedArrayHelper.GetSegmentSize<Entry>() - 1) >> SegmentedArrayHelper.GetSegmentShift<Entry>(); 683Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 686var lastSegmentSize = newSize - ((newSegmentCount - 1) << SegmentedArrayHelper.GetSegmentShift<Entry>());
src\Dependencies\Collections\SegmentedHashSet`1.cs (4)
929var newSegmentCount = (newSize + SegmentedArrayHelper.GetSegmentSize<Entry>() - 1) >> SegmentedArrayHelper.GetSegmentShift<Entry>(); 937Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 940var lastSegmentSize = newSize - ((newSegmentCount - 1) << SegmentedArrayHelper.GetSegmentShift<Entry>());
src\Dependencies\Collections\SegmentedList`1.cs (14)
161var newSegmentCount = (newSize + SegmentedArrayHelper.GetSegmentSize<T>() - 1) >> SegmentedArrayHelper.GetSegmentShift<T>(); 169Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 172var lastSegmentSize = newSize - ((newSegmentCount - 1) << SegmentedArrayHelper.GetSegmentShift<T>()); 522if (_items.Length < SegmentedArrayHelper.GetSegmentSize<T>() / 2) 528else if (_items.Length < SegmentedArrayHelper.GetSegmentSize<T>()) 531newCapacity = SegmentedArrayHelper.GetSegmentSize<T>(); 536if (0 == (_items.Length & SegmentedArrayHelper.GetOffsetMask<T>())) 543var oldSegmentCount = (_items.Length + SegmentedArrayHelper.GetSegmentSize<T>() - 1) >> SegmentedArrayHelper.GetSegmentShift<T>(); 546newCapacity = SegmentedArrayHelper.GetSegmentSize<T>() * newSegmentCount; 555if (newCapacity > SegmentedArrayHelper.GetSegmentSize<T>()) 558var lastSegmentLength = newCapacity & SegmentedArrayHelper.GetOffsetMask<T>(); 560newCapacity = (newCapacity - lastSegmentLength) + SegmentedArrayHelper.GetSegmentSize<T>();