66 instantiations of ObjectPool
IdeCoreBenchmarks (1)
CloudCachePersistentStorage.cs (1)
27
private static readonly ObjectPool<byte[]> s_byteArrayPool =
new
(() => new byte[Checksum.HashSize]);
Microsoft.CodeAnalysis.CSharp.Workspaces (11)
Simplification\Reducers\CSharpCastReducer.cs (1)
19
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Simplification\Reducers\CSharpDefaultExpressionReducer.cs (1)
13
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Simplification\Reducers\CSharpEscapingReducer.cs (1)
21
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Simplification\Reducers\CSharpExtensionMethodReducer.cs (1)
21
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Simplification\Reducers\CSharpInferredMemberNameReducer.cs (1)
18
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
24
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Simplification\Reducers\CSharpNameReducer.cs (1)
21
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Simplification\Reducers\CSharpNullableAnnotationReducer.cs (1)
19
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Simplification\Reducers\CSharpParenthesizedExpressionReducer.cs (1)
19
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Simplification\Reducers\CSharpParenthesizedPatternReducer.cs (1)
21
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Simplification\Reducers\CSharpVarReducer.cs (1)
13
private static readonly ObjectPool<IReductionRewriter> s_pool =
new
(
Microsoft.CodeAnalysis.EditorFeatures (2)
IntelliSense\AsyncCompletion\ItemManager.CompletionListUpdater.cs (1)
68
private static readonly ObjectPool<List<MatchResult>> s_listOfMatchResultPool =
new
(factory: () => new());
KeywordHighlighting\HighlighterViewTaggerProvider.cs (1)
40
private static readonly PooledObjects.ObjectPool<List<TextSpan>> s_listPool =
new
(() => new List<TextSpan>());
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Internal\Classification\FSharpClassificationService.cs (1)
24
private readonly ObjectPool<List<ClassifiedSpan>> s_listPool =
new
(() => new());
Microsoft.CodeAnalysis.Features (12)
AbstractUseAutoPropertyAnalyzer.cs (5)
36
private static readonly ObjectPool<ConcurrentStack<AnalysisResult>> s_analysisResultPool =
new
(() => new());
37
private static readonly ObjectPool<ConcurrentSet<IFieldSymbol>> s_fieldSetPool =
new
(() => new());
38
private static readonly ObjectPool<ConcurrentSet<SyntaxNode>> s_nodeSetPool =
new
(() => new());
39
private static readonly ObjectPool<ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>>> s_fieldWriteLocationPool =
new
(() => new());
55
_fieldNamesPool =
new
(() => new(this.SyntaxFacts.StringComparer));
Completion\CompletionService.cs (1)
239
private static readonly ObjectPool<List<MatchResult>> s_listOfMatchResultPool =
new
(factory: () => new());
Completion\CompletionService_GetCompletions.cs (2)
346
private static readonly ObjectPool<Dictionary<string, object>> s_uniqueSourcesPool =
new
(factory: () => new Dictionary<string, object>(), size: 5);
347
private static readonly ObjectPool<List<CompletionItem>> s_sortListPool =
new
(factory: () => new List<CompletionItem>(), size: 5);
EmbeddedLanguages\Json\LanguageServices\JsonClassifier.cs (1)
30
private static readonly ObjectPool<Visitor> s_visitorPool =
new
(() => new Visitor());
Highlighting\HighlightingService.cs (1)
22
private static readonly PooledObjects.ObjectPool<List<TextSpan>> s_listPool =
new
(() => new List<TextSpan>());
Highlighting\Keywords\AbstractKeywordHighlighter.cs (2)
26
private static readonly ObjectPool<List<TextSpan>> s_textSpanListPool =
new
(() => new List<TextSpan>());
27
private static readonly ObjectPool<List<SyntaxToken>> s_tokenListPool =
new
(() => new List<SyntaxToken>());
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
CloudCachePersistentStorage.cs (1)
27
private static readonly ObjectPool<byte[]> s_byteArrayPool =
new
(() => new byte[Checksum.HashSize]);
Microsoft.CodeAnalysis.VisualBasic.Workspaces (9)
Simplification\Reducers\VisualBasicCallReducer.vb (1)
16
New
ObjectPool
(Of IReductionRewriter)(Function() New Rewriter(s_pool))
Simplification\Reducers\VisualBasicCastReducer.vb (1)
16
New
ObjectPool
(Of IReductionRewriter)(Function() New Rewriter(s_pool))
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
16
New
ObjectPool
(Of IReductionRewriter)(Function() New Rewriter(s_pool))
Simplification\Reducers\VisualBasicExtensionMethodReducer.vb (1)
15
New
ObjectPool
(Of IReductionRewriter)(Function() New Rewriter(s_pool))
Simplification\Reducers\VisualBasicInferredMemberNameReducer.vb (1)
17
New
ObjectPool
(Of IReductionRewriter)(Function() New Rewriter(s_pool))
Simplification\Reducers\VisualBasicMiscellaneousReducer.vb (1)
16
New
ObjectPool
(Of IReductionRewriter)(Function() New Rewriter(s_pool))
Simplification\Reducers\VisualBasicNameReducer.vb (1)
20
New
ObjectPool
(Of IReductionRewriter)(Function() New Rewriter(s_pool))
Simplification\Reducers\VisualBasicParenthesesReducer.vb (1)
11
New
ObjectPool
(Of IReductionRewriter)(Function() New Rewriter(s_pool))
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
19
New
ObjectPool
(Of IReductionRewriter)(Function() New Rewriter(s_pool))
Microsoft.CodeAnalysis.Workspaces (27)
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (1)
39
private static readonly ObjectPool<Stack<SyntaxNodeOrToken>> s_pool =
new
(() => new());
Differencing\LongestCommonSubsequence.cs (1)
18
private static readonly ObjectPool<VBuffer> s_pool =
new
(() => new VBuffer());
ExternalAccess\Pythia\Api\PythiaObjectPool.cs (1)
42
public static readonly ObjectPool<T> Instance =
new
(() => new T(), 20);
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (1)
23
private static readonly ObjectPool<MetadataUnifyingSymbolHashSet> s_metadataUnifyingSymbolHashSetPool =
new
(() => new());
J\s\src\Dependencies\PooledObjects\ArrayBuilder.cs\ArrayBuilder.cs (1)
426
pool = new
ObjectPool
<ArrayBuilder<T>>(() => new ArrayBuilder<T>(pool!), size);
J\s\src\Dependencies\PooledObjects\PooledDictionary.cs\PooledDictionary.cs (1)
46
pool = new
ObjectPool
<PooledDictionary<K, V>>(() => new PooledDictionary<K, V>(pool!, keyComparer), 128);
J\s\src\Dependencies\PooledObjects\PooledHashSet.cs\PooledHashSet.cs (1)
35
pool = new
ObjectPool
<PooledHashSet<T>>(() => new PooledHashSet<T>(pool!, equalityComparer), 128);
J\s\src\Dependencies\PooledObjects\PooledStringBuilder.cs\PooledStringBuilder.cs (1)
84
pool = new
ObjectPool
<PooledStringBuilder>(() => new PooledStringBuilder(pool!), size);
Log\KeyValueLogMessage.cs (1)
20
private static readonly ObjectPool<KeyValueLogMessage> s_pool =
new
(() => new KeyValueLogMessage(), 20);
Logger.LogBlock.cs (1)
17
private static readonly ObjectPool<RoslynLogBlock> s_pool =
new
(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256));
ObjectReader.cs (1)
322
=
new
(() => new SegmentedList<T>(20));
ObjectWriter.cs (2)
393
new
(() => new SegmentedDictionary<object, int>(128, ReferenceEqualityComparer.Instance));
396
new
(() => new SegmentedDictionary<object, int>(128));
OrderPreservingMultiDictionary.cs (1)
59
var pool = new
ObjectPool
<OrderPreservingMultiDictionary<K, V>>(
PooledDelegates.cs (1)
18
public static readonly ObjectPool<T> Instance =
new
(() => new T(), 20);
Serialization\SolutionReplicationContext.cs (1)
13
private static readonly ObjectPool<ConcurrentSet<IDisposable>> s_pool =
new
(() => new());
SharedPools.cs (7)
44
new
(() => new HashSet<string>(StringComparer.OrdinalIgnoreCase), 20);
50
new
(() => new HashSet<string>(StringComparer.Ordinal), 20);
56
public static readonly ObjectPool<byte[]> ByteArray =
new
(() => new byte[ByteBufferSize], ByteBufferCount);
57
public static readonly ObjectPool<char[]> CharArray =
new
(() => new char[ByteBufferSize], CharBufferCount);
68
public static readonly ObjectPool<T> Instance =
new
(() => new T(), 100);
73
public static readonly ObjectPool<T> Instance =
new
(() => new T(), 20);
79
new
(() => new Dictionary<string, T>(StringComparer.OrdinalIgnoreCase), 20);
StringTable.cs (1)
94
var pool = new
ObjectPool
<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
SymbolUsageAnalysis.BasicBlockAnalysisData.cs (1)
24
new
(() => new BasicBlockAnalysisData());
SymbolUsageAnalysis.Walker.cs (1)
32
private static readonly ObjectPool<Walker> s_visitorPool =
new
(() => new Walker());
Workspace\Solution\Checksum_Factory.cs (1)
23
new
(() => IncrementalHash.CreateHash(HashAlgorithmName.SHA256), size: 20);
Microsoft.VisualStudio.LanguageServices (2)
InheritanceMargin\InheritanceMarginHelpers.cs (1)
21
private static readonly ObjectPool<MultiDictionary<string, InheritanceTargetItem>> s_pool =
new
(() => new());
Storage\CloudCachePersistentStorage.cs (1)
27
private static readonly ObjectPool<byte[]> s_byteArrayPool =
new
(() => new byte[Checksum.HashSize]);
201 references to ObjectPool
IdeCoreBenchmarks (1)
CloudCachePersistentStorage.cs (1)
27
private static readonly
ObjectPool
<byte[]> s_byteArrayPool = new(() => new byte[Checksum.HashSize]);
Microsoft.CodeAnalysis.CSharp.Features (1)
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (1)
24
private static readonly
ObjectPool
<Stack<SyntaxNode>> s_stackPool
Microsoft.CodeAnalysis.CSharp.Workspaces (26)
ParenthesizedExpressionSyntaxExtensions.cs (1)
320
private static readonly
ObjectPool
<Stack<SyntaxNode>> s_nodeStackPool = SharedPools.Default<Stack<SyntaxNode>>();
Simplification\Reducers\AbstractCSharpReducer.AbstractReductionRewriter.cs (2)
22
private readonly
ObjectPool
<IReductionRewriter> _pool;
37
protected AbstractReductionRewriter(
ObjectPool
<IReductionRewriter> pool)
Simplification\Reducers\AbstractCSharpReducer.cs (1)
14
protected AbstractCSharpReducer(
ObjectPool
<IReductionRewriter> pool) : base(pool)
Simplification\Reducers\CSharpCastReducer.cs (1)
19
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpCastReducer.Rewriter.cs (1)
18
public Rewriter(
ObjectPool
<IReductionRewriter> pool)
Simplification\Reducers\CSharpDefaultExpressionReducer.cs (1)
13
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpDefaultExpressionReducer.Rewriter.cs (1)
22
public Rewriter(
ObjectPool
<IReductionRewriter> pool)
Simplification\Reducers\CSharpEscapingReducer.cs (1)
21
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpEscapingReducer.Rewriter.cs (1)
15
public Rewriter(
ObjectPool
<IReductionRewriter> pool)
Simplification\Reducers\CSharpExtensionMethodReducer.cs (1)
21
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpExtensionMethodReducer.Rewriter.cs (1)
16
public Rewriter(
ObjectPool
<IReductionRewriter> pool)
Simplification\Reducers\CSharpInferredMemberNameReducer.cs (1)
18
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpInferredMemberNameReducer.Rewriter.cs (1)
22
public Rewriter(
ObjectPool
<IReductionRewriter> pool)
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
24
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpMiscellaneousReducer.Rewriter.cs (1)
16
public Rewriter(
ObjectPool
<IReductionRewriter> pool)
Simplification\Reducers\CSharpNameReducer.cs (1)
21
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpNameReducer.Rewriter.cs (1)
19
public Rewriter(
ObjectPool
<IReductionRewriter> pool)
Simplification\Reducers\CSharpNullableAnnotationReducer.cs (1)
19
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpNullableAnnotationReducer.Rewriter.cs (1)
16
public Rewriter(
ObjectPool
<IReductionRewriter> pool) : base(pool)
Simplification\Reducers\CSharpParenthesizedExpressionReducer.cs (1)
19
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpParenthesizedExpressionReducer.Rewriter.cs (1)
16
public Rewriter(
ObjectPool
<IReductionRewriter> pool)
Simplification\Reducers\CSharpParenthesizedPatternReducer.cs (1)
21
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpParenthesizedPatternReducer.Rewriter.cs (1)
16
public Rewriter(
ObjectPool
<IReductionRewriter> pool)
Simplification\Reducers\CSharpVarReducer.cs (1)
13
private static readonly
ObjectPool
<IReductionRewriter> s_pool = new(
Simplification\Reducers\CSharpVarReducer.Rewriter.cs (1)
18
public Rewriter(
ObjectPool
<IReductionRewriter> pool)
Microsoft.CodeAnalysis.EditorFeatures (2)
IntelliSense\AsyncCompletion\ItemManager.CompletionListUpdater.cs (1)
68
private static readonly
ObjectPool
<List<MatchResult>> s_listOfMatchResultPool = new(factory: () => new());
KeywordHighlighting\HighlighterViewTaggerProvider.cs (1)
40
private static readonly PooledObjects.
ObjectPool
<List<TextSpan>> s_listPool = new(() => new List<TextSpan>());
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Internal\Classification\FSharpClassificationService.cs (1)
24
private readonly
ObjectPool
<List<ClassifiedSpan>> s_listPool = new(() => new());
Microsoft.CodeAnalysis.Features (16)
AbstractUseAutoPropertyAnalyzer.cs (5)
36
private static readonly
ObjectPool
<ConcurrentStack<AnalysisResult>> s_analysisResultPool = new(() => new());
37
private static readonly
ObjectPool
<ConcurrentSet<IFieldSymbol>> s_fieldSetPool = new(() => new());
38
private static readonly
ObjectPool
<ConcurrentSet<SyntaxNode>> s_nodeSetPool = new(() => new());
39
private static readonly
ObjectPool
<ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>>> s_fieldWriteLocationPool = new(() => new());
46
private readonly
ObjectPool
<HashSet<string>> _fieldNamesPool;
Completion\CompletionService.cs (1)
239
private static readonly
ObjectPool
<List<MatchResult>> s_listOfMatchResultPool = new(factory: () => new());
Completion\CompletionService_GetCompletions.cs (2)
346
private static readonly
ObjectPool
<Dictionary<string, object>> s_uniqueSourcesPool = new(factory: () => new Dictionary<string, object>(), size: 5);
347
private static readonly
ObjectPool
<List<CompletionItem>> s_sortListPool = new(factory: () => new List<CompletionItem>(), size: 5);
EmbeddedLanguages\Json\LanguageServices\JsonClassifier.cs (1)
30
private static readonly
ObjectPool
<Visitor> s_visitorPool = new(() => new Visitor());
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexClassifier.cs (1)
32
private static readonly
ObjectPool
<Visitor> s_visitorPool = SharedPools.Default<Visitor>();
Highlighting\HighlightingService.cs (1)
22
private static readonly PooledObjects.
ObjectPool
<List<TextSpan>> s_listPool = new(() => new List<TextSpan>());
Highlighting\Keywords\AbstractKeywordHighlighter.cs (2)
26
private static readonly
ObjectPool
<List<TextSpan>> s_textSpanListPool = new(() => new List<TextSpan>());
27
private static readonly
ObjectPool
<List<SyntaxToken>> s_tokenListPool = new(() => new List<SyntaxToken>());
MetadataAsSource\DocumentationCommentUtilities.cs (1)
16
private static readonly
ObjectPool
<List<string>> s_pool = SharedPools.Default<List<string>>();
UseCollectionInitializerAnalyzer.cs (1)
36
private static readonly
ObjectPool
<UseCollectionInitializerAnalyzer<TExpressionSyntax, TStatementSyntax, TObjectCreationExpressionSyntax, TMemberAccessExpressionSyntax, TInvocationExpressionSyntax, TExpressionStatementSyntax, TVariableDeclaratorSyntax>> s_pool
UseNamedMemberInitializerAnalyzer.cs (1)
32
private static readonly
ObjectPool
<UseNamedMemberInitializerAnalyzer<TExpressionSyntax, TStatementSyntax, TObjectCreationExpressionSyntax, TMemberAccessExpressionSyntax, TAssignmentStatementSyntax, TVariableDeclaratorSyntax>> s_pool
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
CloudCachePersistentStorage.cs (1)
27
private static readonly
ObjectPool
<byte[]> s_byteArrayPool = new(() => new byte[Checksum.HashSize]);
Microsoft.CodeAnalysis.VisualBasic.Workspaces (21)
Simplification\Reducers\AbstractVisualBasicReducer.AbstractReductionRewriter.vb (2)
17
Private ReadOnly _pool As
ObjectPool
(Of IReductionRewriter)
29
Protected Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\AbstractVisualBasicReducer.vb (1)
17
Protected Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\VisualBasicCallReducer.Rewriter.vb (1)
13
Public Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\VisualBasicCallReducer.vb (1)
15
Private Shared ReadOnly s_pool As
ObjectPool
(Of IReductionRewriter) =
Simplification\Reducers\VisualBasicCastReducer.Rewriter.vb (1)
13
Public Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\VisualBasicCastReducer.vb (1)
15
Private Shared ReadOnly s_pool As
ObjectPool
(Of IReductionRewriter) =
Simplification\Reducers\VisualBasicEscapingReducer.Rewriter.vb (1)
13
Public Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
15
Private Shared ReadOnly s_pool As
ObjectPool
(Of IReductionRewriter) =
Simplification\Reducers\VisualBasicExtensionMethodReducer.Rewriter.vb (1)
14
Public Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\VisualBasicExtensionMethodReducer.vb (1)
14
Private Shared ReadOnly s_pool As
ObjectPool
(Of IReductionRewriter) =
Simplification\Reducers\VisualBasicInferredMemberNameReducer.Rewriter.vb (1)
17
Public Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\VisualBasicInferredMemberNameReducer.vb (1)
16
Private Shared ReadOnly s_pool As
ObjectPool
(Of IReductionRewriter) =
Simplification\Reducers\VisualBasicMiscellaneousReducer.Rewriter.vb (1)
14
Public Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\VisualBasicMiscellaneousReducer.vb (1)
15
Private Shared ReadOnly s_pool As
ObjectPool
(Of IReductionRewriter) =
Simplification\Reducers\VisualBasicNameReducer.Rewriter.vb (1)
14
Public Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\VisualBasicNameReducer.vb (1)
19
Private Shared ReadOnly s_pool As
ObjectPool
(Of IReductionRewriter) =
Simplification\Reducers\VisualBasicParenthesesReducer.Rewriter.vb (1)
13
Public Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\VisualBasicParenthesesReducer.vb (1)
10
Private Shared ReadOnly s_pool As
ObjectPool
(Of IReductionRewriter) =
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.Rewriter.vb (1)
13
Public Sub New(pool As
ObjectPool
(Of IReductionRewriter))
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
18
Private Shared ReadOnly s_pool As
ObjectPool
(Of IReductionRewriter) =
Microsoft.CodeAnalysis.Workspaces (130)
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (1)
39
private static readonly
ObjectPool
<Stack<SyntaxNodeOrToken>> s_pool = new(() => new());
Differencing\LongestCommonSubsequence.cs (3)
18
private static readonly
ObjectPool
<VBuffer> s_pool = new(() => new VBuffer());
120
private readonly
ObjectPool
<VBuffer> _bufferPool;
126
public VStack(
ObjectPool
<VBuffer> bufferPool)
Extensions.cs (23)
17
public static PooledObject<StringBuilder> GetPooledObject(this
ObjectPool
<StringBuilder> pool)
20
public static PooledObject<Stack<TItem>> GetPooledObject<TItem>(this
ObjectPool
<Stack<TItem>> pool)
23
public static PooledObject<Queue<TItem>> GetPooledObject<TItem>(this
ObjectPool
<Queue<TItem>> pool)
26
public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this
ObjectPool
<HashSet<TItem>> pool)
29
public static PooledObject<Dictionary<TKey, TValue>> GetPooledObject<TKey, TValue>(this
ObjectPool
<Dictionary<TKey, TValue>> pool)
33
public static PooledObject<List<TItem>> GetPooledObject<TItem>(this
ObjectPool
<List<TItem>> pool)
36
public static PooledObject<List<TItem>> GetPooledObject<TItem>(this
ObjectPool
<List<TItem>> pool, out List<TItem> list)
43
public static PooledObject<T> GetPooledObject<T>(this
ObjectPool
<T> pool) where T : class
46
public static StringBuilder AllocateAndClear(this
ObjectPool
<StringBuilder> pool)
54
public static Stack<T> AllocateAndClear<T>(this
ObjectPool
<Stack<T>> pool)
62
public static Queue<T> AllocateAndClear<T>(this
ObjectPool
<Queue<T>> pool)
70
public static HashSet<T> AllocateAndClear<T>(this
ObjectPool
<HashSet<T>> pool)
78
public static Dictionary<TKey, TValue> AllocateAndClear<TKey, TValue>(this
ObjectPool
<Dictionary<TKey, TValue>> pool)
87
public static List<T> AllocateAndClear<T>(this
ObjectPool
<List<T>> pool)
95
public static void ClearAndFree(this
ObjectPool
<StringBuilder> pool, StringBuilder sb)
112
public static void ClearAndFree<T>(this
ObjectPool
<HashSet<T>> pool, HashSet<T> set)
130
public static void ClearAndFree<T>(this
ObjectPool
<ConcurrentSet<T>> pool, ConcurrentSet<T> set) where T : notnull
146
public static void ClearAndFree<T>(this
ObjectPool
<Stack<T>> pool, Stack<T> set)
164
public static void ClearAndFree<T>(this
ObjectPool
<ConcurrentStack<T>> pool, ConcurrentStack<T> stack)
180
public static void ClearAndFree<T>(this
ObjectPool
<Queue<T>> pool, Queue<T> set)
198
public static void ClearAndFree<TKey, TValue>(this
ObjectPool
<Dictionary<TKey, TValue>> pool, Dictionary<TKey, TValue> map)
217
public static void ClearAndFree<TKey, TValue>(this
ObjectPool
<ConcurrentDictionary<TKey, TValue>> pool, ConcurrentDictionary<TKey, TValue> map)
234
public static void ClearAndFree<T>(this
ObjectPool
<List<T>> pool, List<T> list)
ExternalAccess\Pythia\Api\PythiaObjectPool.cs (2)
37
private static
ObjectPool
<T> Default<T>() where T : class, new()
42
public static readonly
ObjectPool
<T> Instance = new(() => new T(), 20);
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
49
private static readonly
ObjectPool
<PooledHashSet<INamedTypeSymbol>> s_symbolSetPool = PooledHashSet<INamedTypeSymbol>.CreatePool(SymbolEquivalenceComparer.Instance);
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (1)
23
private static readonly
ObjectPool
<MetadataUnifyingSymbolHashSet> s_metadataUnifyingSymbolHashSetPool = new(() => new());
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (2)
241
private static readonly
ObjectPool
<List<string>> s_stringListPool = SharedPools.Default<List<string>>();
793
private static readonly
ObjectPool
<MetadataNode> s_pool = SharedPools.Default<MetadataNode>();
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (2)
28
public static readonly
ObjectPool
<HashSet<string>> StringLiteralHashSetPool = SharedPools.Default<HashSet<string>>();
29
public static readonly
ObjectPool
<HashSet<long>> LongLiteralHashSetPool = SharedPools.Default<HashSet<long>>();
IntervalTree`1.cs (1)
29
private static readonly
ObjectPool
<Stack<(Node? node, bool firstTime)>> s_stackPool
ISyntaxFactsExtensions.cs (1)
20
private static readonly
ObjectPool
<Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)>> s_stackPool
J\s\src\Dependencies\PooledObjects\ArrayBuilder.cs\ArrayBuilder.cs (7)
47
private readonly
ObjectPool
<ArrayBuilder<T>>? _pool;
58
private ArrayBuilder(
ObjectPool
<ArrayBuilder<T>> pool)
359
var
pool = _pool;
390
private static readonly
ObjectPool
<ArrayBuilder<T>> s_poolInstance = CreatePool();
418
public static
ObjectPool
<ArrayBuilder<T>> CreatePool()
423
public static
ObjectPool
<ArrayBuilder<T>> CreatePool(int size)
425
ObjectPool
<ArrayBuilder<T>>? pool = null;
J\s\src\Dependencies\PooledObjects\PooledDictionary.cs\PooledDictionary.cs (5)
16
private readonly
ObjectPool
<PooledDictionary<K, V>> _pool;
18
private PooledDictionary(
ObjectPool
<PooledDictionary<K, V>> pool, IEqualityComparer<K> keyComparer)
40
private static readonly
ObjectPool
<PooledDictionary<K, V>> s_poolInstance = CreatePool(EqualityComparer<K>.Default);
43
public static
ObjectPool
<PooledDictionary<K, V>> CreatePool(IEqualityComparer<K> keyComparer)
45
ObjectPool
<PooledDictionary<K, V>>? pool = null;
J\s\src\Dependencies\PooledObjects\PooledHashSet.cs\PooledHashSet.cs (5)
14
private readonly
ObjectPool
<PooledHashSet<T>> _pool;
16
private PooledHashSet(
ObjectPool
<PooledHashSet<T>> pool, IEqualityComparer<T> equalityComparer) :
29
private static readonly
ObjectPool
<PooledHashSet<T>> s_poolInstance = CreatePool(EqualityComparer<T>.Default);
32
public static
ObjectPool
<PooledHashSet<T>> CreatePool(IEqualityComparer<T> equalityComparer)
34
ObjectPool
<PooledHashSet<T>>? pool = null;
J\s\src\Dependencies\PooledObjects\PooledStringBuilder.cs\PooledStringBuilder.cs (5)
21
private readonly
ObjectPool
<PooledStringBuilder> _pool;
23
private PooledStringBuilder(
ObjectPool
<PooledStringBuilder> pool)
73
private static readonly
ObjectPool
<PooledStringBuilder> s_poolInstance = CreatePool();
81
public static
ObjectPool
<PooledStringBuilder> CreatePool(int size = 32)
83
ObjectPool
<PooledStringBuilder>? pool = null;
LanguageServices\DeclaredSymbolFactoryService\AbstractDeclaredSymbolInfoFactoryService.cs (2)
36
private static readonly
ObjectPool
<List<Dictionary<string, string>>> s_aliasMapListPool
44
private static readonly
ObjectPool
<Dictionary<string, string>> s_aliasMapPool
Log\KeyValueLogMessage.cs (1)
20
private static readonly
ObjectPool
<KeyValueLogMessage> s_pool = new(() => new KeyValueLogMessage(), 20);
Logger.LogBlock.cs (3)
17
private static readonly
ObjectPool
<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256));
34
private readonly
ObjectPool
<RoslynLogBlock> _pool;
45
public RoslynLogBlock(
ObjectPool
<RoslynLogBlock> pool)
LogMessage.cs (6)
61
private static readonly
ObjectPool
<StaticLogMessage> s_pool = SharedPools.Default<StaticLogMessage>();
89
private static readonly
ObjectPool
<LazyLogMessage> s_pool = SharedPools.Default<LazyLogMessage>();
119
private static readonly
ObjectPool
<LazyLogMessage<TArg0>> s_pool = SharedPools.Default<LazyLogMessage<TArg0>>();
152
private static readonly
ObjectPool
<LazyLogMessage<TArg0, TArg1>> s_pool = SharedPools.Default<LazyLogMessage<TArg0, TArg1>>();
188
private static readonly
ObjectPool
<LazyLogMessage<TArg0, TArg1, TArg2>> s_pool = SharedPools.Default<LazyLogMessage<TArg0, TArg1, TArg2>>();
227
private static readonly
ObjectPool
<LazyLogMessage<TArg0, TArg1, TArg2, TArg3>> s_pool = SharedPools.Default<LazyLogMessage<TArg0, TArg1, TArg2, TArg3>>();
ObjectPool`1.cs (1)
118
internal ObjectPool(Func<
ObjectPool
<T>, T> factory, int size)
ObjectReader.cs (1)
321
private static readonly
ObjectPool
<SegmentedList<T>> s_objectListPool
ObjectWriter.cs (4)
392
private static readonly
ObjectPool
<SegmentedDictionary<object, int>> s_referenceDictionaryPool =
395
private static readonly
ObjectPool
<SegmentedDictionary<object, int>> s_valueDictionaryPool =
405
private static
ObjectPool
<SegmentedDictionary<object, int>> GetDictionaryPool(bool valueEquality)
410
var
pool = GetDictionaryPool(_valueEquality);
OrderPreservingMultiDictionary.cs (5)
29
private readonly
ObjectPool
<OrderPreservingMultiDictionary<K, V>>? _pool;
31
private OrderPreservingMultiDictionary(
ObjectPool
<OrderPreservingMultiDictionary<K, V>> pool)
54
private static readonly
ObjectPool
<OrderPreservingMultiDictionary<K, V>> s_poolInstance = CreatePool();
57
public static
ObjectPool
<OrderPreservingMultiDictionary<K, V>> CreatePool()
59
var
pool = new ObjectPool<OrderPreservingMultiDictionary<K, V>>(
PooledDelegates.cs (1)
18
public static readonly
ObjectPool
<T> Instance = new(() => new T(), 20);
PooledObject.cs (23)
17
private readonly Action<
ObjectPool
<T>, T> _releaser;
18
private readonly
ObjectPool
<T> _pool;
21
public PooledObject(
ObjectPool
<T> pool, Func<
ObjectPool
<T>, T> allocator, Action<
ObjectPool
<T>, T> releaser) : this()
40
public static PooledObject<StringBuilder> Create(
ObjectPool
<StringBuilder> pool)
48
public static PooledObject<Stack<TItem>> Create<TItem>(
ObjectPool
<Stack<TItem>> pool)
56
public static PooledObject<Queue<TItem>> Create<TItem>(
ObjectPool
<Queue<TItem>> pool)
64
public static PooledObject<HashSet<TItem>> Create<TItem>(
ObjectPool
<HashSet<TItem>> pool)
72
public static PooledObject<Dictionary<TKey, TValue>> Create<TKey, TValue>(
ObjectPool
<Dictionary<TKey, TValue>> pool)
81
public static PooledObject<List<TItem>> Create<TItem>(
ObjectPool
<List<TItem>> pool)
91
private static StringBuilder Allocator(
ObjectPool
<StringBuilder> pool)
94
private static void Releaser(
ObjectPool
<StringBuilder> pool, StringBuilder sb)
97
private static Stack<TItem> Allocator<TItem>(
ObjectPool
<Stack<TItem>> pool)
100
private static void Releaser<TItem>(
ObjectPool
<Stack<TItem>> pool, Stack<TItem> obj)
103
private static Queue<TItem> Allocator<TItem>(
ObjectPool
<Queue<TItem>> pool)
106
private static void Releaser<TItem>(
ObjectPool
<Queue<TItem>> pool, Queue<TItem> obj)
109
private static HashSet<TItem> Allocator<TItem>(
ObjectPool
<HashSet<TItem>> pool)
112
private static void Releaser<TItem>(
ObjectPool
<HashSet<TItem>> pool, HashSet<TItem> obj)
115
private static Dictionary<TKey, TValue> Allocator<TKey, TValue>(
ObjectPool
<Dictionary<TKey, TValue>> pool)
119
private static void Releaser<TKey, TValue>(
ObjectPool
<Dictionary<TKey, TValue>> pool, Dictionary<TKey, TValue> obj)
123
private static List<TItem> Allocator<TItem>(
ObjectPool
<List<TItem>> pool)
126
private static void Releaser<TItem>(
ObjectPool
<List<TItem>> pool, List<TItem> obj)
Serialization\SolutionReplicationContext.cs (1)
13
private static readonly
ObjectPool
<ConcurrentSet<IDisposable>> s_pool = new(() => new());
Shared\Utilities\XmlFragmentParser.cs (1)
25
private static readonly
ObjectPool
<XmlFragmentParser> s_pool = SharedPools.Default<XmlFragmentParser>();
SharedPools.cs (10)
25
public static
ObjectPool
<T> BigDefault<T>() where T : class, new()
31
public static
ObjectPool
<T> Default<T>() where T : class, new()
37
public static
ObjectPool
<Dictionary<string, T>> StringIgnoreCaseDictionary<T>()
43
public static readonly
ObjectPool
<HashSet<string>> StringIgnoreCaseHashSet =
49
public static readonly
ObjectPool
<HashSet<string>> StringHashSet =
56
public static readonly
ObjectPool
<byte[]> ByteArray = new(() => new byte[ByteBufferSize], ByteBufferCount);
57
public static readonly
ObjectPool
<char[]> CharArray = new(() => new char[ByteBufferSize], CharBufferCount);
68
public static readonly
ObjectPool
<T> Instance = new(() => new T(), 100);
73
public static readonly
ObjectPool
<T> Instance = new(() => new T(), 20);
78
public static readonly
ObjectPool
<Dictionary<string, T>> Instance =
Simplification\AbstractReducer.cs (2)
13
private readonly
ObjectPool
<IReductionRewriter> _pool;
15
protected AbstractReducer(
ObjectPool
<IReductionRewriter> pool)
StringTable.cs (5)
84
private StringTable(
ObjectPool
<StringTable>? pool)
89
private readonly
ObjectPool
<StringTable>? _pool;
90
private static readonly
ObjectPool
<StringTable> s_staticPool = CreatePool();
92
private static
ObjectPool
<StringTable> CreatePool()
94
var
pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
SymbolKey.SymbolKeyReader.cs (1)
322
private static readonly
ObjectPool
<SymbolKeyReader> s_readerPool = SharedPools.Default<SymbolKeyReader>();
SymbolKey.SymbolKeyWriter.cs (1)
55
private static readonly
ObjectPool
<SymbolKeyWriter> s_writerPool = SharedPools.Default<SymbolKeyWriter>();
SymbolUsageAnalysis.BasicBlockAnalysisData.cs (1)
23
private static readonly
ObjectPool
<BasicBlockAnalysisData> s_pool =
SymbolUsageAnalysis.Walker.cs (1)
32
private static readonly
ObjectPool
<Walker> s_visitorPool = new(() => new Walker());
Workspace\Solution\Checksum_Factory.cs (1)
22
private static readonly
ObjectPool
<IncrementalHash> s_incrementalHashPool =
Microsoft.VisualStudio.LanguageServices (2)
InheritanceMargin\InheritanceMarginHelpers.cs (1)
21
private static readonly
ObjectPool
<MultiDictionary<string, InheritanceTargetItem>> s_pool = new(() => new());
Storage\CloudCachePersistentStorage.cs (1)
27
private static readonly
ObjectPool
<byte[]> s_byteArrayPool = new(() => new byte[Checksum.HashSize]);