1 instantiation of PooledDictionary
Roslyn.Diagnostics.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
89
pool = new ObjectPool<PooledDictionary<K, V>>(() => new
PooledDictionary
<K, V>(pool, keyComparer), 128);
33 references to PooledDictionary
Roslyn.Diagnostics.Analyzers (33)
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
69
var
perTreeOptionsBuilder =
PooledDictionary
<SyntaxTree, Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>>.GetInstance();
src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (15)
89
var
namesBuilder =
PooledDictionary
<string, TValue>.GetInstance();
90
var
symbolsBuilder =
PooledDictionary
<ISymbol, TValue>.GetInstance();
91
var
wildcardNamesBuilder =
PooledDictionary
<SymbolKind,
PooledDictionary
<string, TValue>>.GetInstance();
141
static void ProcessWildcardName(NameParts parts,
PooledDictionary
<SymbolKind,
PooledDictionary
<string, TValue>> wildcardNamesBuilder)
148
if (!wildcardNamesBuilder.TryGetValue(AllKinds, out
var
associatedValues))
150
associatedValues =
PooledDictionary
<string, TValue>.GetInstance();
171
if (!wildcardNamesBuilder.TryGetValue(symbolKind.Value, out
var
associatedValues))
173
associatedValues =
PooledDictionary
<string, TValue>.GetInstance();
181
static void ProcessName(NameParts parts,
PooledDictionary
<string, TValue> namesBuilder)
189
static void ProcessSymbolName(NameParts parts, Compilation compilation, string? optionalPrefix,
PooledDictionary
<ISymbol, TValue> symbolsBuilder)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (11)
21
private readonly ObjectPool<
PooledDictionary
<K, V>>? _pool;
23
private PooledDictionary(ObjectPool<
PooledDictionary
<K, V>>? pool, IEqualityComparer<K>? keyComparer)
81
private static readonly ObjectPool<
PooledDictionary
<K, V>> s_poolInstance = CreatePool();
82
private static readonly ConcurrentDictionary<IEqualityComparer<K>, ObjectPool<
PooledDictionary
<K, V>>> s_poolInstancesByComparer
86
public static ObjectPool<
PooledDictionary
<K, V>> CreatePool(IEqualityComparer<K>? keyComparer = null)
88
ObjectPool<
PooledDictionary
<K, V>>? pool = null;
89
pool = new ObjectPool<
PooledDictionary
<K, V>>(() => new PooledDictionary<K, V>(pool, keyComparer), 128);
93
public static
PooledDictionary
<K, V> GetInstance(IEqualityComparer<K>? keyComparer = null)
98
var
instance = pool.Allocate();
103
public static
PooledDictionary
<K, V> GetInstance(IEnumerable<KeyValuePair<K, V>> initializer, IEqualityComparer<K>? keyComparer = null)
105
var
instance = GetInstance(keyComparer);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporaryDictionary`2.cs (5)
27
private
PooledDictionary
<TKey, TValue>? _storage;
37
private
PooledDictionary
<TKey, TValue> GetOrCreateStorage(CancellationToken cancellationToken)
41
var
newStorage =
PooledDictionary
<TKey, TValue>.GetInstance();
55
var
storage = GetOrCreateStorage(cancellationToken);