1 instantiation of PooledDictionary
Microsoft.CodeAnalysis.PooledObjects.Package (1)
11 references to PooledDictionary
Microsoft.CodeAnalysis.PooledObjects.Package (11)
PooledDictionary.cs (11)
21private readonly ObjectPool<PooledDictionary<K, V>> _pool;
23private PooledDictionary(ObjectPool<PooledDictionary<K, V>> pool, IEqualityComparer<K> keyComparer)
45private static readonly ObjectPool<PooledDictionary<K, V>> s_poolInstance = CreatePool(EqualityComparer<K>.Default);
48public static ObjectPool<PooledDictionary<K, V>> CreatePool(IEqualityComparer<K> keyComparer)
50ObjectPool<PooledDictionary<K, V>>? pool = null;
51pool = new ObjectPool<PooledDictionary<K, V>>(() => new PooledDictionary<K, V>(pool!, keyComparer), 128);
55public static PooledDictionary<K, V> GetInstance()
57var instance = s_poolInstance.Allocate();
63public static PooledDisposer<PooledDictionary<K, V>> GetInstance(out PooledDictionary<K, V> instance)
66return new PooledDisposer<PooledDictionary<K, V>>(instance);