2 instantiations of TemporaryArray
Microsoft.CodeAnalysis (1)
Collections\TemporaryArray`1.cs (1)
328_array = new TemporaryArray<T>(in array);
Microsoft.CodeAnalysis.UnitTests (1)
Collections\TemporaryArrayTests.cs (1)
20Assert.Equal(0, new TemporaryArray<int>().Count);
89 references to TemporaryArray
Microsoft.CodeAnalysis (19)
Collections\ImmutableArrayExtensions.cs (1)
758internal static ImmutableArray<T> AddRange<T>(this ImmutableArray<T> self, in TemporaryArray<T> items)
Collections\TemporaryArray`1.cs (10)
75/// This field is initialized to non-<see langword="null"/> the first time the <see cref="TemporaryArray{T}"/> 81private TemporaryArray(in TemporaryArray<T> array) 89public static TemporaryArray<T> Empty => default; 185public void AddRange(in TemporaryArray<T> items) 254/// Transitions the current <see cref="TemporaryArray{T}"/> from inline storage to dynamic storage storage. An 320private readonly TemporaryArray<T> _array; 325public Enumerator(in TemporaryArray<T> array) 352public static int InlineCapacity => TemporaryArray<T>.InlineCapacity; 354public static bool HasDynamicStorage(in TemporaryArray<T> array) 357public static int InlineCount(in TemporaryArray<T> array)
Collections\TemporaryArrayExtensions.cs (8)
13/// Gets a mutable reference to a <see cref="TemporaryArray{T}"/> stored in a <c>using</c> variable. 16/// <para>This supporting method allows <see cref="TemporaryArray{T}"/>, a non-copyable <see langword="struct"/> 37public static ref TemporaryArray<T> AsRef<T>(this in TemporaryArray<T> array) 40public static bool Any<T>(this in TemporaryArray<T> array, Func<T, bool> predicate) 51public static bool All<T>(this in TemporaryArray<T> array, Func<T, bool> predicate) 62public static void AddIfNotNull<T>(this ref TemporaryArray<T> array, T? value) 71public static void AddIfNotNull<T>(this ref TemporaryArray<T> array, T? value)
Microsoft.CodeAnalysis.CSharp (22)
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (4)
1327using var uninst1 = TemporaryArray<TypeSymbol>.Empty; 1328using var uninst2 = TemporaryArray<TypeSymbol>.Empty;
Binder\Semantics\OverloadResolution\OverloadResolution.cs (10)
2048using (var uninst1 = TemporaryArray<TypeSymbol>.Empty) 2049using (var uninst2 = TemporaryArray<TypeSymbol>.Empty) 2234private static BetterResult MoreSpecificType(ref TemporaryArray<TypeSymbol> t1, ref TemporaryArray<TypeSymbol> t2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2343using var allTypeArgs1 = TemporaryArray<TypeSymbol>.Empty; 2344using var allTypeArgs2 = TemporaryArray<TypeSymbol>.Empty;
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
237public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\CompoundInstrumenter.cs (1)
87public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\DebugInfoInjector.cs (1)
145public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\Instrumenter.cs (1)
73public virtual void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
279public override void InstrumentBlock(BoundBlock original, LocalRewriter rewriter, ref TemporaryArray<LocalSymbol> additionalLocals, out BoundStatement? prologue, out BoundStatement? epilogue, out BoundBlockInstrumentation? instrumentation)
Lowering\LocalRewriter\LocalRewriter_Block.cs (2)
25var additionalLocals = TemporaryArray<LocalSymbol>.Empty;
Symbols\NamedTypeSymbol.cs (1)
1271internal void GetAllTypeArguments(ref TemporaryArray<TypeSymbol> builder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Microsoft.CodeAnalysis.UnitTests (48)
Collections\TemporaryArrayTests.cs (48)
18Assert.Equal(0, TemporaryArray<int>.Empty.Count); 19Assert.Equal(0, default(TemporaryArray<int>).Count); 22Assert.Throws<IndexOutOfRangeException>(() => TemporaryArray<int>.Empty[-1]); 25using var array = TemporaryArray<int>.Empty; 29Assert.Throws<IndexOutOfRangeException>(() => TemporaryArray<int>.Empty[0]); 32using var array = TemporaryArray<int>.Empty; 36Assert.False(TemporaryArray<int>.Empty.GetEnumerator().MoveNext()); 42using var array = TemporaryArray<int>.Empty; 43for (var i = 0; i < TemporaryArray<int>.TestAccessor.InlineCapacity; i++) 47Assert.False(TemporaryArray<int>.TestAccessor.HasDynamicStorage(in array)); 48Assert.Equal(i + 1, TemporaryArray<int>.TestAccessor.InlineCount(in array)); 52Assert.Equal(TemporaryArray<int>.TestAccessor.InlineCapacity, array.Count); 53Assert.False(TemporaryArray<int>.TestAccessor.HasDynamicStorage(in array)); 55Assert.True(TemporaryArray<int>.TestAccessor.HasDynamicStorage(in array)); 56Assert.Equal(0, TemporaryArray<int>.TestAccessor.InlineCount(in array)); 59Assert.Equal(TemporaryArray<int>.TestAccessor.InlineCapacity + 1, array.Count); 61Assert.True(TemporaryArray<int>.TestAccessor.HasDynamicStorage(in array)); 62Assert.Equal(0, TemporaryArray<int>.TestAccessor.InlineCount(in array)); 82Assert.Equal(0, TemporaryArray<int>.Empty.Count); 83TemporaryArray<int>.Empty.Add(0); 84Assert.Equal(0, TemporaryArray<int>.Empty.Count); 90var array = TemporaryArray<int>.Empty; 91array.AddRange(Enumerable.Range(0, TemporaryArray<int>.TestAccessor.InlineCapacity + 1).ToImmutableArray()); 92Assert.True(TemporaryArray<int>.TestAccessor.HasDynamicStorage(in array)); 95Assert.False(TemporaryArray<int>.TestAccessor.HasDynamicStorage(in array)); 102using var array = TemporaryArray<int>.Empty; 110if (array.Count > TemporaryArray<int>.TestAccessor.InlineCapacity) 112Assert.True(TemporaryArray<int>.TestAccessor.HasDynamicStorage(in array)); 113Assert.Equal(0, TemporaryArray<int>.TestAccessor.InlineCount(in array)); 117Assert.False(TemporaryArray<int>.TestAccessor.HasDynamicStorage(in array)); 118Assert.Equal(array.Count, TemporaryArray<int>.TestAccessor.InlineCount(in array)); 132using var array = TemporaryArray<int>.Empty; 144initialItems > TemporaryArray<int>.TestAccessor.InlineCapacity, 145TemporaryArray<int>.TestAccessor.HasDynamicStorage(in array)); 152using var array = TemporaryArray<int>.Empty; 172using var array = TemporaryArray<int>.Empty; 186initialItems > TemporaryArray<int>.TestAccessor.InlineCapacity, 187TemporaryArray<int>.TestAccessor.HasDynamicStorage(in array)); 194using var array = TemporaryArray<int>.Empty;