1 instantiation of ArrayBuilder
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
495
pool = new ObjectPool<ArrayBuilder<T>>(() => new
ArrayBuilder
<T>(pool!), size);
55 references to ArrayBuilder
Microsoft.CodeAnalysis.InteractiveHost (55)
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\FileSystem\PathUtilities.cs (2)
857
var
resolvedParts =
ArrayBuilder
<string>.GetInstance();
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)