1 instantiation of ArrayBuilder
Microsoft.CodeAnalysis.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (1)
367pool = new ObjectPool<ArrayBuilder<T>>(() => new ArrayBuilder<T>(pool), size);
37 references to ArrayBuilder
Microsoft.CodeAnalysis.Analyzers (37)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (2)
131using var textChanges = ArrayBuilder<TextChange>.GetInstance(fixInfos.Count);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ArrayBuilderExtensions.cs (1)
9public static void AddIfNotNull<T>(this ArrayBuilder<T> builder, T? item)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (4)
801using var stack = ArrayBuilder<IEnumerator<IOperation>>.GetInstance(); 893using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (26)
16[DebuggerTypeProxy(typeof(ArrayBuilder<>.DebuggerProxy))] 23private readonly ArrayBuilder<T> _builder; 25public DebuggerProxy(ArrayBuilder<T> builder) 52private readonly ObjectPool<ArrayBuilder<T>>? _pool; 63private ArrayBuilder(ObjectPool<ArrayBuilder<T>>? pool) 257var tmp = ArrayBuilder<U>.GetInstance(Count); 324ObjectPool<ArrayBuilder<T>>.ForgetTrackedObject(this); 331private static readonly ObjectPool<ArrayBuilder<T>> s_poolInstance = CreatePool(); 332public static ArrayBuilder<T> GetInstance() 334var builder = s_poolInstance.Allocate(); 339public static ArrayBuilder<T> GetInstance(int capacity) 341var builder = GetInstance(); 346public static ArrayBuilder<T> GetInstance(int capacity, T fillWithValue) 348var builder = GetInstance(); 359internal static ObjectPool<ArrayBuilder<T>> CreatePool() 364internal static ObjectPool<ArrayBuilder<T>> CreatePool(int size) 366ObjectPool<ArrayBuilder<T>>? pool = null; 367pool = new ObjectPool<ArrayBuilder<T>>(() => new ArrayBuilder<T>(pool), size); 406var accumulator = new Dictionary<K, ArrayBuilder<T>>(Count, comparer); 411if (!accumulator.TryGetValue(key, out var bucket)) 413bucket = ArrayBuilder<T>.GetInstance(); 431public void AddRange(ArrayBuilder<T> items) 436public void AddRange<U>(ArrayBuilder<U> items) where U : T 518using var result = ArrayBuilder<S>.GetInstance(Count);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.Enumerator.cs (2)
18private readonly ArrayBuilder<T> _builder; 21public Enumerator(ArrayBuilder<T> builder)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
214using ArrayBuilder<string> namespaceNamesBuilder = ArrayBuilder<string>.GetInstance();