1 instantiation of PooledDictionary
Test.Utilities (1)
PooledDictionary.cs (1)
87
pool = new ObjectPool<PooledDictionary<K, V>>(() => new
PooledDictionary
<K, V>(pool, keyComparer), 128);
33 references to PooledDictionary
Test.Utilities (33)
AggregateCategorizedAnalyzerConfigOptions.cs (2)
67
var
perTreeOptionsBuilder =
PooledDictionary
<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.GetInstance();
PooledDictionary.cs (11)
19
private readonly ObjectPool<
PooledDictionary
<K, V>>? _pool;
21
private PooledDictionary(ObjectPool<
PooledDictionary
<K, V>>? pool, IEqualityComparer<K>? keyComparer)
79
private static readonly ObjectPool<
PooledDictionary
<K, V>> s_poolInstance = CreatePool();
80
private static readonly ConcurrentDictionary<IEqualityComparer<K>, ObjectPool<
PooledDictionary
<K, V>>> s_poolInstancesByComparer
84
public static ObjectPool<
PooledDictionary
<K, V>> CreatePool(IEqualityComparer<K>? keyComparer = null)
86
ObjectPool<
PooledDictionary
<K, V>>? pool = null;
87
pool = new ObjectPool<
PooledDictionary
<K, V>>(() => new PooledDictionary<K, V>(pool, keyComparer), 128);
91
public static
PooledDictionary
<K, V> GetInstance(IEqualityComparer<K>? keyComparer = null)
96
var
instance = pool.Allocate();
101
public static
PooledDictionary
<K, V> GetInstance(IEnumerable<KeyValuePair<K, V>> initializer, IEqualityComparer<K>? keyComparer = null)
103
var
instance = GetInstance(keyComparer);
SymbolNamesWithValueOption.cs (15)
87
var
namesBuilder =
PooledDictionary
<string, TValue>.GetInstance();
88
var
symbolsBuilder =
PooledDictionary
<ISymbol, TValue>.GetInstance();
89
var
wildcardNamesBuilder =
PooledDictionary
<SymbolKind,
PooledDictionary
<string, TValue>>.GetInstance();
139
static void ProcessWildcardName(NameParts parts,
PooledDictionary
<SymbolKind,
PooledDictionary
<string, TValue>> wildcardNamesBuilder)
146
if (!wildcardNamesBuilder.TryGetValue(AllKinds, out
var
associatedValues))
148
associatedValues =
PooledDictionary
<string, TValue>.GetInstance();
169
if (!wildcardNamesBuilder.TryGetValue(symbolKind.Value, out
var
associatedValues))
171
associatedValues =
PooledDictionary
<string, TValue>.GetInstance();
179
static void ProcessName(NameParts parts,
PooledDictionary
<string, TValue> namesBuilder)
187
static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix,
PooledDictionary
<ISymbol, TValue> symbolsBuilder)
TemporaryDictionary`2.cs (5)
25
private
PooledDictionary
<TKey, TValue>? _storage;
35
private
PooledDictionary
<TKey, TValue> GetOrCreateStorage(CancellationToken cancellationToken)
39
var
newStorage =
PooledDictionary
<TKey, TValue>.GetInstance();
53
var
storage = GetOrCreateStorage(cancellationToken);