5 instantiations of ObjectPool
Microsoft.CodeAnalysis.PooledObjects.Package (5)
ArrayBuilder.cs (1)
495
pool = new
ObjectPool
<ArrayBuilder<T>>(() => new ArrayBuilder<T>(pool!), size);
PooledDelegates.cs (1)
19
public static readonly ObjectPool<T> Instance =
new
(() => new T(), 20);
PooledDictionary.cs (1)
46
pool = new
ObjectPool
<PooledDictionary<K, V>>(() => new PooledDictionary<K, V>(pool!, keyComparer), 128);
PooledHashSet.cs (1)
35
pool = new
ObjectPool
<PooledHashSet<T>>(() => new PooledHashSet<T>(pool!, equalityComparer), 128);
PooledStringBuilder.cs (1)
84
pool = new
ObjectPool
<PooledStringBuilder>(() => new PooledStringBuilder(pool!), size);
24 references to ObjectPool
Microsoft.CodeAnalysis.PooledObjects.Package (24)
ArrayBuilder.cs (7)
56
private readonly
ObjectPool
<ArrayBuilder<T>>? _pool;
67
private ArrayBuilder(
ObjectPool
<ArrayBuilder<T>> pool)
428
var
pool = _pool;
459
private static readonly
ObjectPool
<ArrayBuilder<T>> s_poolInstance = CreatePool();
487
public static
ObjectPool
<ArrayBuilder<T>> CreatePool()
492
public static
ObjectPool
<ArrayBuilder<T>> CreatePool(int size)
494
ObjectPool
<ArrayBuilder<T>>? pool = null;
ObjectPool`1.cs (1)
122
internal ObjectPool(Func<
ObjectPool
<T>, T> factory, int size)
PooledDelegates.cs (1)
19
public static readonly
ObjectPool
<T> Instance = new(() => new T(), 20);
PooledDictionary.cs (5)
16
private readonly
ObjectPool
<PooledDictionary<K, V>> _pool;
18
private PooledDictionary(
ObjectPool
<PooledDictionary<K, V>> pool, IEqualityComparer<K> keyComparer)
40
private static readonly
ObjectPool
<PooledDictionary<K, V>> s_poolInstance = CreatePool(EqualityComparer<K>.Default);
43
public static
ObjectPool
<PooledDictionary<K, V>> CreatePool(IEqualityComparer<K> keyComparer)
45
ObjectPool
<PooledDictionary<K, V>>? pool = null;
PooledHashSet.cs (5)
14
private readonly
ObjectPool
<PooledHashSet<T>> _pool;
16
private PooledHashSet(
ObjectPool
<PooledHashSet<T>> pool, IEqualityComparer<T> equalityComparer) :
29
private static readonly
ObjectPool
<PooledHashSet<T>> s_poolInstance = CreatePool(EqualityComparer<T>.Default);
32
public static
ObjectPool
<PooledHashSet<T>> CreatePool(IEqualityComparer<T> equalityComparer)
34
ObjectPool
<PooledHashSet<T>>? pool = null;
PooledStringBuilder.cs (5)
21
private readonly
ObjectPool
<PooledStringBuilder> _pool;
23
private PooledStringBuilder(
ObjectPool
<PooledStringBuilder> pool)
73
private static readonly
ObjectPool
<PooledStringBuilder> s_poolInstance = CreatePool();
81
public static
ObjectPool
<PooledStringBuilder> CreatePool(int size = 32)
83
ObjectPool
<PooledStringBuilder>? pool = null;