1 instantiation of PooledSortedSet
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
53
() => new
PooledSortedSet
<T>(pool, comparer),
15 references to PooledSortedSet
Microsoft.CodeAnalysis.ResxSourceGenerator (15)
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);