1 instantiation of PooledSortedSet
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
53
() => new
PooledSortedSet
<T>(pool, comparer),
21 references to PooledSortedSet
Microsoft.CodeAnalysis.AnalyzerUtilities (21)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (15)
22
private readonly ObjectPool<
PooledSortedSet
<T>>? _pool;
24
public PooledSortedSet(ObjectPool<
PooledSortedSet
<T>>? pool, IComparer<T>? comparer = null)
46
private static readonly ObjectPool<
PooledSortedSet
<T>> s_poolInstance = CreatePool();
47
private static readonly ConcurrentDictionary<IComparer<T>, ObjectPool<
PooledSortedSet
<T>>> s_poolInstancesByComparer = new();
49
private static ObjectPool<
PooledSortedSet
<T>> CreatePool(IComparer<T>? comparer = null)
51
ObjectPool<
PooledSortedSet
<T>>? pool = null;
52
pool = new ObjectPool<
PooledSortedSet
<T>>(
59
/// Gets a pooled instance of a <see cref="
PooledSortedSet
{T}"/> with an optional comparer.
62
/// <returns>An empty <see cref="
PooledSortedSet
{T}"/>.</returns>
63
public static
PooledSortedSet
<T> GetInstance(IComparer<T>? comparer = null)
68
var
instance = pool.Allocate();
74
/// Gets a pooled instance of a <see cref="
PooledSortedSet
{T}"/> with the given initializer and an optional comparer.
78
/// <returns>An empty <see cref="
PooledSortedSet
{T}"/>.</returns>
79
public static
PooledSortedSet
<T> GetInstance(IEnumerable<T> initializer, IComparer<T>? comparer = null)
81
var
instance = GetInstance(comparer);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysis.cs (6)
69
using
var
worklist =
PooledSortedSet
<int>.GetInstance();
70
using
var
pendingBlocksNeedingAtLeastOnePass =
PooledSortedSet
<int>.GetInstance(cfg.Blocks.Select(b => b.Ordinal));
184
PooledSortedSet
<int> worklist,
185
PooledSortedSet
<int> pendingBlocksNeedingAtLeastOnePass,