2 instantiations of ArrayBuilder
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
28_elements = new ArrayBuilder<T>();
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
495pool = new ObjectPool<ArrayBuilder<T>>(() => new ArrayBuilder<T>(pool!), size);
117 references to ArrayBuilder
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (117)
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (24)
15public static bool Any<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 27public static bool Any<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 39public static bool All<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 51public static bool All<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 71public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TResult> map) 91var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 111public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TArg, TResult> map, TArg arg) 131var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 151public static ImmutableArray<TResult> SelectAsArrayWithIndex<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, int, TArg, TResult> map, TArg arg) 171var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 181public static void AddOptional<T>(this ArrayBuilder<T> builder, T? item) 193public static void Push<T>(this ArrayBuilder<T> builder, T e) 198public static T Pop<T>(this ArrayBuilder<T> builder) 205public static bool TryPop<T>(this ArrayBuilder<T> builder, [MaybeNullWhen(false)] out T result) 217public static T Peek<T>(this ArrayBuilder<T> builder) 222public static ImmutableArray<T> ToImmutableOrEmptyAndFree<T>(this ArrayBuilder<T>? builder) 227public static void AddIfNotNull<T>(this ArrayBuilder<T> builder, T? value) 236public static void AddIfNotNull<T>(this ArrayBuilder<T> builder, T? value) 245public static void FreeAll<T>(this ArrayBuilder<T> builder, Func<T, ArrayBuilder<T>?> getNested) 275public static void RemoveWhere<TItem, TArg>(this ArrayBuilder<TItem> builder, Func<TItem, int, TArg, bool> filter, TArg arg)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (30)
191var builder = ArrayBuilder<TResult>.GetInstance(items.Length); 217var builder = ArrayBuilder<TResult>.GetInstance(); 247var builder = ArrayBuilder<TResult>.GetInstance(); 272var builder = ArrayBuilder<TResult>.GetInstance(); 292var builder = ArrayBuilder<TResult>.GetInstance(); 313var builder = ArrayBuilder<TResult>.GetInstance(); 337var builder = ArrayBuilder<TResult>.GetInstance(); 399var builder = ArrayBuilder<TResult>.GetInstance(); 453var builder = ArrayBuilder<TResult>.GetInstance(self.Length); 482ArrayBuilder<T>? builder = null; 502builder = ArrayBuilder<T>.GetInstance(); 520builder = ArrayBuilder<T>.GetInstance(); 753var builder = ArrayBuilder<T>.GetInstance(); 795var builder = ArrayBuilder<TValue>.GetInstance(); 1081if (existingValueOrArray is ArrayBuilder<T> arrayBuilder) 1088arrayBuilder = ArrayBuilder<T>.GetInstance(capacity: 2); 1116if (value is ArrayBuilder<TNamespaceOrTypeSymbol> builder) 1182var builder = ArrayBuilder<TNamedTypeSymbol>.GetInstance(count);
src\Compilers\Core\Portable\Collections\TemporaryArray`1.cs (5)
80private ArrayBuilder<T>? _builder; 98_builder = ArrayBuilder<T>.GetInstance(capacity) 327/// <see cref="ArrayBuilder{T}"/> instance is taken from the shared pool, and all elements currently in inline 335var builder = ArrayBuilder<T>.GetInstance();
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
857var resolvedParts = ArrayBuilder<string>.GetInstance();
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (20)
361var builder = ArrayBuilder<TResult>.GetInstance(); 372var builder = ArrayBuilder<TResult>.GetInstance(); 405var builder = ArrayBuilder<TResult>.GetInstance(); 417var builder = ArrayBuilder<TResult>.GetInstance(); 430var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 443var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(); 470var builder = ArrayBuilder<TResult>.GetInstance(); 485var builder = ArrayBuilder<TResult>.GetInstance(); 497var builder = ArrayBuilder<TResult>.GetInstance();
src\Compilers\Core\Portable\InternalUtilities\EnumField.cs (1)
39internal static EnumField FindValue(ArrayBuilder<EnumField> sortedFields, ulong value)
src\Compilers\Core\Portable\InternalUtilities\FileLockCheck.cs (2)
201var lockInfos = ArrayBuilder<(int, string)>.GetInstance((int)pnProcInfo);
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
98public void AddRangeTo(ArrayBuilder<T> builder)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
21private ArrayBuilder<T>? _elements = null;
src\Dependencies\PooledObjects\ArrayBuilder.cs (27)
17[DebuggerTypeProxy(typeof(ArrayBuilder<>.DebuggerProxy))] 29private readonly ArrayBuilder<T> _builder; 31public DebuggerProxy(ArrayBuilder<T> builder) 56private readonly ObjectPool<ArrayBuilder<T>>? _pool; 67private ArrayBuilder(ObjectPool<ArrayBuilder<T>> pool) 374var tmp = ArrayBuilder<U>.GetInstance(Count); 459private static readonly ObjectPool<ArrayBuilder<T>> s_poolInstance = CreatePool(); 460public static ArrayBuilder<T> GetInstance() 462var builder = s_poolInstance.Allocate(); 467public static ArrayBuilder<T> GetInstance(int capacity) 469var builder = GetInstance(); 474public static ArrayBuilder<T> GetInstance(int capacity, T fillWithValue) 476var builder = GetInstance(); 487public static ObjectPool<ArrayBuilder<T>> CreatePool() 492public static ObjectPool<ArrayBuilder<T>> CreatePool(int size) 494ObjectPool<ArrayBuilder<T>>? pool = null; 495pool = new ObjectPool<ArrayBuilder<T>>(() => new ArrayBuilder<T>(pool!), size); 534var accumulator = new Dictionary<K, ArrayBuilder<T>>(Count, comparer); 539if (!accumulator.TryGetValue(key, out var bucket)) 541bucket = ArrayBuilder<T>.GetInstance(); 559public void AddRange(ArrayBuilder<T> items) 564public void AddRange<U>(ArrayBuilder<U> items, Func<U, T> selector) 572public void AddRange<U>(ArrayBuilder<U> items) where U : T 577public void AddRange<U>(ArrayBuilder<U> items, int start, int length) where U : T 708var result = ArrayBuilder<S>.GetInstance(Count);
src\Dependencies\PooledObjects\ArrayBuilder.Enumerator.cs (2)
14private readonly ArrayBuilder<T> _builder; 17public Enumerator(ArrayBuilder<T> builder)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\FixedSizeArrayBuilder.cs (2)
37/// cref="ArrayBuilder{T}.GetInstance(int, T)"/> should be used instead. 71public void AddRange(ArrayBuilder<T> values)