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