1 instantiation of PooledHashSet
Roslyn.Diagnostics.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
70
pool = new ObjectPool<PooledHashSet<T>>(() => new
PooledHashSet
<T>(pool, comparer), 128);
32 references to PooledHashSet
Roslyn.Diagnostics.Analyzers (32)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (2)
204
using
var
applicableAttributeNodes =
PooledHashSet
<SyntaxNode>.GetInstance();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ImmutableHashSetExtensions.cs (4)
14
using
var
builder =
PooledHashSet
<T>.GetInstance();
54
using
var
builder =
PooledHashSet
<T>.GetInstance();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (5)
503
public static
PooledHashSet
<ISymbol> GetCaptures(this IOperation operation, IMethodSymbol lambdaOrLocalFunction)
510
var
builder =
PooledHashSet
<ISymbol>.GetInstance();
511
using
var
nestedLambdasAndLocalFunctions =
PooledHashSet
<IMethodSymbol>.GetInstance();
src\RoslynAnalyzers\Utilities\Compiler\Extensions\PooledHashSetExtensions.cs (1)
11
public static void AddRange<T>(this
PooledHashSet
<T> builder, IEnumerable<T> set2)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (4)
501
using
var
set =
PooledHashSet
<T>.GetInstance();
519
using
var
set =
PooledHashSet
<S>.GetInstance();
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (11)
19
private readonly ObjectPool<
PooledHashSet
<T>>? _pool;
21
private PooledHashSet(ObjectPool<
PooledHashSet
<T>>? pool, IEqualityComparer<T>? comparer)
63
private static readonly ObjectPool<
PooledHashSet
<T>> s_poolInstance = CreatePool();
64
private static readonly ConcurrentDictionary<IEqualityComparer<T>, ObjectPool<
PooledHashSet
<T>>> s_poolInstancesByComparer = new();
67
public static ObjectPool<
PooledHashSet
<T>> CreatePool(IEqualityComparer<T>? comparer = null)
69
ObjectPool<
PooledHashSet
<T>>? pool = null;
70
pool = new ObjectPool<
PooledHashSet
<T>>(() => new PooledHashSet<T>(pool, comparer), 128);
74
public static
PooledHashSet
<T> GetInstance(IEqualityComparer<T>? comparer = null)
79
var
instance = pool.Allocate();
84
public static
PooledHashSet
<T> GetInstance(IEnumerable<T> initializer, IEqualityComparer<T>? comparer = null)
86
var
instance = GetInstance(comparer);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (5)
26
private
PooledHashSet
<T>? _storage;
36
private
PooledHashSet
<T> GetOrCreateStorage(CancellationToken cancellationToken)
40
var
newStorage =
PooledHashSet
<T>.GetInstance();
54
var
storage = GetOrCreateStorage(cancellationToken);