12 instantiations of SegmentedList
Microsoft.CodeAnalysis.CodeStyle (12)
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (3)
74
public static readonly ImmutableSegmentedList<T> Empty = new(new
SegmentedList
<T>());
145
var list = new
SegmentedList
<T> { value };
174
var list = new
SegmentedList
<T>(items);
src\Dependencies\Collections\ImmutableSegmentedList`1+ValueBuilder.cs (2)
78
_mutableList = new
SegmentedList
<T>(originalList._list);
110
_mutableList = new
SegmentedList
<T>();
src\Dependencies\Collections\RoslynEnumerable.cs (1)
18
return new
SegmentedList
<TSource>(source);
src\Dependencies\Collections\SegmentedList`1.cs (4)
436
var list = new
SegmentedList
<TOutput>(_size);
598
var list = new
SegmentedList
<T>();
742
return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new
SegmentedList
<T>(0)))!;
762
var list = new
SegmentedList
<T>(count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
62
_tokens = new
SegmentedList
<SyntaxToken>(sizeOfList);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.ReaderReferenceMap.cs (1)
21
= new(() => new
SegmentedList
<string>(20));
89 references to SegmentedList
Microsoft.CodeAnalysis.CodeStyle (89)
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (4)
76
private readonly
SegmentedList
<T> _list;
78
private ImmutableSegmentedList(
SegmentedList
<T> list)
145
var
list = new SegmentedList<T> { value };
174
var
list = new SegmentedList<T>(items);
src\Dependencies\Collections\ImmutableSegmentedList`1+Enumerator.cs (3)
14
private readonly
SegmentedList
<T> _list;
15
private
SegmentedList
<T>.Enumerator _enumerator;
17
internal Enumerator(
SegmentedList
<T> list)
src\Dependencies\Collections\ImmutableSegmentedList`1+PrivateMarshal.cs (6)
20
var
list = Volatile.Read(ref Unsafe.AsRef(in location._list));
29
var
list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
38
var
list = Interlocked.CompareExchange(ref Unsafe.AsRef(in location._list), value._list, comparand._list);
45
/// <inheritdoc cref="SegmentedCollectionsMarshal.AsImmutableSegmentedList{T}(
SegmentedList
{T}?)"/>
46
internal static ImmutableSegmentedList<T> AsImmutableSegmentedList(
SegmentedList
<T>? list)
50
internal static
SegmentedList
<T>? AsSegmentedList(ImmutableSegmentedList<T> list)
src\Dependencies\Collections\ImmutableSegmentedList`1+ValueBuilder.cs (3)
25
private
SegmentedList
<T>? _mutableList;
35
private readonly
SegmentedList
<T> ReadOnlyList => _mutableList ?? _list._list;
70
private
SegmentedList
<T> GetOrCreateMutableList()
src\Dependencies\Collections\RoslynEnumerable.cs (1)
13
public static
SegmentedList
<TSource> ToSegmentedList<TSource>(this IEnumerable<TSource> source)
src\Dependencies\Collections\SegmentedCollectionsMarshal.cs (7)
96
/// Gets an <see cref="ImmutableSegmentedList{T}"/> value wrapping the input <see cref="
SegmentedList
{T}"/>.
114
public static ImmutableSegmentedList<T> AsImmutableSegmentedList<T>(
SegmentedList
<T>? list)
118
/// Gets the underlying <see cref="
SegmentedList
{T}"/> for an input <see cref="ImmutableSegmentedList{T}"/> value.
121
/// <param name="list">The input <see cref="ImmutableSegmentedList{T}"/> value to get the underlying <see cref="
SegmentedList
{T}"/> from.</param>
122
/// <returns>The underlying <see cref="
SegmentedList
{T}"/> for <paramref name="list"/>, if present; otherwise, <see langword="null"/>.</returns>
131
/// <see langword="true"/>), the resulting <see cref="
SegmentedList
{T}"/> will be <see langword="null"/>.
134
public static
SegmentedList
<T>? AsSegmentedList<T>(ImmutableSegmentedList<T> list)
src\Dependencies\Collections\SegmentedList`1.cs (18)
78
if (collection is
SegmentedList
<T> segmentedList)
312
if (c is
SegmentedList
<T> list)
429
public
SegmentedList
<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter)
436
var
list = new SegmentedList<TOutput>(_size);
591
public
SegmentedList
<T> FindAll(Predicate<T> match)
598
var
list = new SegmentedList<T>();
745
public
SegmentedList
<T> GetRange(int index, int count)
762
var
list = new SegmentedList<T>(count);
769
/// Creates a shallow copy of a range of elements in the source <see cref="
SegmentedList
{T}" />.
771
/// <param name="start">The zero-based <see cref="
SegmentedList
{T}" /> index at which the range starts.</param>
773
/// <returns>A shallow copy of a range of elements in the source <see cref="
SegmentedList
{T}" />.</returns>
779
/// <exception cref="ArgumentException"><paramref name="start" /> and <paramref name="length" /> do not denote a valid range of elements in the <see cref="
SegmentedList
{T}" />.</exception>
780
public
SegmentedList
<T> Slice(int start, int length) => GetRange(start, length);
924
else if (c is
SegmentedList
<T> list)
1319
private readonly
SegmentedList
<T> _list;
1324
internal Enumerator(
SegmentedList
<T> list)
1338
var
localList = _list;
1390
internal readonly struct TestAccessor(
SegmentedList
<T> instance)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (3)
55
public static ImmutableIntervalTree<T> CreateFromUnsorted<TIntrospector>(in TIntrospector introspector,
SegmentedList
<T> values)
74
public static ImmutableIntervalTree<T> CreateFromSorted<TIntrospector>(in TIntrospector introspector,
SegmentedList
<T> values)
97
SegmentedList
<T> source, int sourceStartInclusive, int sourceEndExclusive, SegmentedArray<Node> destination, int destinationIndex)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
122
SegmentedList
<IndentBlockOperation> operations,
275
SegmentedList
<SuppressOperation> operations,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (8)
36
private static readonly ObjectPool<
SegmentedList
<TokenPairWithOperations>> s_tokenPairListPool = new(() => [], trimOnFree: false);
189
private static void AddOperations<T>(
SegmentedList
<T> operations, List<T> scratch, SyntaxNode node, Action<List<T>, SyntaxNode> addOperations)
203
private static void AddOperations<T>(
SegmentedList
<T> operations, ArrayBuilder<T> scratch, SyntaxNode node, Action<ArrayBuilder<T>, SyntaxNode> addOperations)
219
SegmentedList
<TokenPairWithOperations> list,
246
SegmentedList
<TokenPairWithOperations> tokenOperations,
355
var
alignmentOperations = nodeOperationsCollector.AlignmentOperation;
374
SegmentedList
<TokenPairWithOperations> tokenOperations,
429
SegmentedList
<TokenPairWithOperations> tokenOperations,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\NodeOperations.cs (8)
17
private static readonly ObjectPool<
SegmentedList
<IndentBlockOperation>> s_indentBlockOperationPool = new(() => []);
18
private static readonly ObjectPool<
SegmentedList
<SuppressOperation>> s_suppressOperationPool = new(() => []);
19
private static readonly ObjectPool<
SegmentedList
<AlignTokensOperation>> s_alignTokensOperationPool = new(() => []);
20
private static readonly ObjectPool<
SegmentedList
<AnchorIndentationOperation>> s_anchorIndentationOperationPool = new(() => []);
24
public
SegmentedList
<IndentBlockOperation> IndentBlockOperation { get; } = s_indentBlockOperationPool.Allocate();
25
public
SegmentedList
<SuppressOperation> SuppressOperation { get; } = s_suppressOperationPool.Allocate();
26
public
SegmentedList
<AlignTokensOperation> AlignmentOperation { get; } = s_alignTokensOperationPool.Allocate();
27
public
SegmentedList
<AnchorIndentationOperation> AnchorIndentationOperations { get; } = s_anchorIndentationOperationPool.Allocate();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
30
private readonly
SegmentedList
<SyntaxToken> _tokens;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.Iterator.cs (3)
13
public readonly struct Iterator(
SegmentedList
<SyntaxToken> tokensIncludingZeroWidth)
20
private readonly
SegmentedList
<SyntaxToken> _tokensIncludingZeroWidth;
26
public Enumerator(
SegmentedList
<SyntaxToken> tokensIncludingZeroWidth)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
43
public static PooledObject<
SegmentedList
<TItem>> GetPooledObject<TItem>(this ObjectPool<
SegmentedList
<TItem>> pool)
44
=> PooledObject<
SegmentedList
<TItem>>.Create(pool);
60
public static PooledObject<
SegmentedList
<TItem>> GetPooledObject<TItem>(this ObjectPool<
SegmentedList
<TItem>> pool, out
SegmentedList
<TItem> list)
62
var pooledObject = PooledObject<
SegmentedList
<TItem>>.Create(pool);
158
public static
SegmentedList
<T> AllocateAndClear<T>(this ObjectPool<
SegmentedList
<T>> pool)
160
var
list = pool.Allocate();
336
public static void ClearAndFree<T>(this ObjectPool<
SegmentedList
<T>> pool,
SegmentedList
<T> list, bool trim = true)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
98
public static PooledObject<
SegmentedList
<TItem>> Create<TItem>(ObjectPool<
SegmentedList
<TItem>> pool)
100
return new PooledObject<
SegmentedList
<TItem>>(
153
private static
SegmentedList
<TItem> Allocator<TItem>(ObjectPool<
SegmentedList
<TItem>> pool)
156
private static void Releaser<TItem>(ObjectPool<
SegmentedList
<TItem>> pool,
SegmentedList
<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.ReaderReferenceMap.cs (3)
18
private readonly
SegmentedList
<string> _values;
20
private static readonly ObjectPool<
SegmentedList
<string>> s_objectListPool
23
private ReaderReferenceMap(
SegmentedList
<string> values)