5 instantiations of ObjectPool
Roslyn.Diagnostics.Analyzers (5)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (1)
367
pool = new
ObjectPool
<ArrayBuilder<T>>(() => new ArrayBuilder<T>(pool), size);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (1)
57
pool = new
ObjectPool
<PooledConcurrentDictionary<K, V>>(() =>
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
89
pool = new
ObjectPool
<PooledDictionary<K, V>>(() => new PooledDictionary<K, V>(pool, keyComparer), 128);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
70
pool = new
ObjectPool
<PooledHashSet<T>>(() => new PooledHashSet<T>(pool, comparer), 128);
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
51
pool = new
ObjectPool
<PooledSortedSet<T>>(
37 references to ObjectPool
Roslyn.Diagnostics.Analyzers (37)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (8)
52
private readonly
ObjectPool
<ArrayBuilder<T>>? _pool;
63
private ArrayBuilder(
ObjectPool
<ArrayBuilder<T>>? pool)
300
var
pool = _pool;
324
ObjectPool
<ArrayBuilder<T>>.ForgetTrackedObject(this);
331
private static readonly
ObjectPool
<ArrayBuilder<T>> s_poolInstance = CreatePool();
359
internal static
ObjectPool
<ArrayBuilder<T>> CreatePool()
364
internal static
ObjectPool
<ArrayBuilder<T>> CreatePool(int size)
366
ObjectPool
<ArrayBuilder<T>>? pool = null;
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (8)
21
private readonly
ObjectPool
<PooledConcurrentDictionary<K, V>>? _pool;
23
private PooledConcurrentDictionary(
ObjectPool
<PooledConcurrentDictionary<K, V>>? pool)
28
private PooledConcurrentDictionary(
ObjectPool
<PooledConcurrentDictionary<K, V>>? pool, IEqualityComparer<K> keyComparer)
50
private static readonly
ObjectPool
<PooledConcurrentDictionary<K, V>> s_poolInstance = CreatePool();
51
private static readonly ConcurrentDictionary<IEqualityComparer<K>,
ObjectPool
<PooledConcurrentDictionary<K, V>>> s_poolInstancesByComparer = new();
54
public static
ObjectPool
<PooledConcurrentDictionary<K, V>> CreatePool(IEqualityComparer<K>? keyComparer = null)
56
ObjectPool
<PooledConcurrentDictionary<K, V>>? pool = null;
67
var
pool = keyComparer == null ?
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (7)
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;
95
var
pool = keyComparer == null ?
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledHashSet.cs (7)
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;
76
var
pool = comparer == null ?
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (7)
21
private readonly
ObjectPool
<PooledSortedSet<T>>? _pool;
23
public PooledSortedSet(
ObjectPool
<PooledSortedSet<T>>? pool, IComparer<T>? comparer = null)
45
private static readonly
ObjectPool
<PooledSortedSet<T>> s_poolInstance = CreatePool();
46
private static readonly ConcurrentDictionary<IComparer<T>,
ObjectPool
<PooledSortedSet<T>>> s_poolInstancesByComparer = new();
48
private static
ObjectPool
<PooledSortedSet<T>> CreatePool(IComparer<T>? comparer = null)
50
ObjectPool
<PooledSortedSet<T>>? pool = null;
64
var
pool = comparer == null ?