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