10 instantiations of PooledObject
Microsoft.CodeAnalysis.Workspaces (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
91=> new(pool, p => p.Allocate(), (p, o) => p.Free(o));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (8)
43return new PooledObject<StringBuilder>( 51return new PooledObject<Stack<TItem>>( 59return new PooledObject<Queue<TItem>>( 67return new PooledObject<HashSet<TItem>>( 75return new PooledObject<ConcurrentSet<TItem>>( 84return new PooledObject<Dictionary<TKey, TValue>>( 92return new PooledObject<List<TItem>>( 100return new PooledObject<SegmentedList<TItem>>(
Utilities\SegmentedListPool.cs (1)
13var pooledObject = new PooledObject<SegmentedList<T>>(
130 references to PooledObject
IdeBenchmarks (1)
RegexClassifierBenchmarks.cs (1)
86using var _ = Classifier.GetPooledList(out var results);
IdeCoreBenchmarks (1)
ClassificationBenchmarks.cs (1)
88using var _ = Classifier.GetPooledList(out var result);
Microsoft.CodeAnalysis.EditorFeatures (19)
Classification\CopyPasteAndPrintingClassificationBufferTaggerProvider.Tagger.cs (3)
94using var pooledObject = SegmentedListPool.GetPooledList<TagSpan<IClassificationTag>>(out var list); 152using var _ = SegmentedListPool.GetPooledList<TagSpan<IClassificationTag>>(out var mergedTags); 192using var _ = Classifier.GetPooledList(out var tempBuffer);
Classification\Semantic\AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs (1)
230using var _ = Classifier.GetPooledList(out var classifiedSpans);
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (3)
421using var _ = Classifier.GetPooledList(out var classifiedSpans); 484using var _ = Classifier.GetPooledList(out var tempList); 537using var _ = Classifier.GetPooledList(out var tempList);
Classification\TotalClassificationTaggerProvider.cs (4)
112using var _1 = SegmentedListPool.GetPooledList<TagSpan<IClassificationTag>>(out var stringLiterals); 113using var _2 = SegmentedListPool.GetPooledList<TagSpan<IClassificationTag>>(out var syntacticSpans); 114using var _3 = SegmentedListPool.GetPooledList<TagSpan<IClassificationTag>>(out var semanticSpans); 227using var _1 = SegmentedListPool.GetPooledList<TagSpan<IClassificationTag>>(out var embeddedClassifications);
Editor\GoToAdjacentMemberCommandHandler.cs (1)
106using var pooledMembers = service.GetMethodLevelMembers(root);
Shared\Tagging\Utilities\TagSpanIntervalTree.cs (1)
184using var _1 = SegmentedListPool.GetPooledList<TagSpan<TTag>>(out var tempList);
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (5)
97using var _1 = SegmentedListPool.GetPooledList<TagSpan<TTag>>(out var tagsToRemove); 98using var _2 = SegmentedListPool.GetPooledList<TagSpan<TTag>>(out var allTagsList); 476using var _2 = SegmentedListPool.GetPooledList<TagSpan<TTag>>(out var newTagsInBuffer_safeToMutate); 645using var _1 = SegmentedListPool.GetPooledList<(SnapshotSpan, TTag)>(out var latestSpans); 646using var _2 = SegmentedListPool.GetPooledList<(SnapshotSpan, TTag)>(out var previousSpans);
Tagging\EfficientTagger.cs (1)
37using var pooledObject = SegmentedListPool.GetPooledList<TagSpan<TTag>>(out var list);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Classification\AbstractClassifierTests.cs (2)
273using var _ = Classifier.GetPooledList(out var result); 284using var _ = Classifier.GetPooledList(out var results);
Microsoft.CodeAnalysis.Features (1)
FindUsages\IRemoteFindUsagesService.cs (1)
263using var _ = Classifier.GetPooledList(out var temp);
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\SemanticTokens\SemanticTokensHelpers.cs (2)
91using var _1 = Classifier.GetPooledList(out var classifiedSpans); 92using var _2 = Classifier.GetPooledList(out var updatedClassifiedSpans);
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (2)
93using var _ = Classifier.GetPooledList(out var temp); 147using var _2 = Classifier.GetPooledList(out var classifiedSpans);
Services\SemanticClassification\RemoteSemanticClassificationService.cs (1)
41using var _ = Classifier.GetPooledList(out var temp);
Microsoft.CodeAnalysis.Workspaces (98)
Classification\Classifier.cs (3)
24internal static PooledObject<SegmentedList<ClassifiedSpan>> GetPooledList(out SegmentedList<ClassifiedSpan> classifiedSpans) 87using var _1 = GetPooledList(out var syntacticClassifications); 88using var _2 = GetPooledList(out var semanticClassifications);
Classification\ClassifierHelper.cs (5)
70using var _1 = Classifier.GetPooledList(out var syntaxSpans); 71using var _2 = Classifier.GetPooledList(out var semanticSpans); 133using var _1 = Classifier.GetPooledList(out var mergedSpans); 140using var _2 = Classifier.GetPooledList(out var filledInSpans); 242using var _1 = SegmentedListPool.GetPooledList<TClassifiedSpan>(out var semanticSpans);
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (2)
125using var obj = s_listPool.GetPooledObject(); 154using var obj = s_listPool.GetPooledObject();
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (4)
122using var _1 = s_enumeratorPool.GetPooledObject(out var oldStack); 123using var _2 = s_enumeratorPool.GetPooledObject(out var newStack); 173using var rightOldStack = s_reversedEnumeratorPool.GetPooledObject(); 174using var rightNewStack = s_reversedEnumeratorPool.GetPooledObject();
ExternalAccess\Pythia\Api\PythiaObjectPool.cs (3)
18var disposer = Default<T>().GetPooledObject<T>(); 25var disposer = Default<Stack<T>>().GetPooledObject(); 32var disposer = Default<HashSet<T>>().GetPooledObject();
FindSymbols\FindReferences\FindReferenceCache.cs (1)
156using var obj = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject();
SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (2)
109using var pooledCurrentMembers = this.SyntaxFacts.GetMethodLevelMembers(currentRoot); 119using var pooledPreviousMembers = this.SyntaxFacts.GetMethodLevelMembers(previousRoot);
Shared\Extensions\INamespaceSymbolExtensions.cs (1)
131using var namespaceQueue = SharedPools.Default<Queue<INamespaceOrTypeSymbol>>().GetPooledObject();
Shared\Extensions\SourceTextExtensions.cs (1)
197using var pooledObject = s_charArrayPool.GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.cs (1)
84using var _ = s_nodeStackPool.GetPooledObject(out var candidates);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.NodeEnumerator.cs (1)
26private readonly PooledObject<Stack<TNode>> _pooledStack;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
864using var _1 = s_stackPool.GetPooledObject(out var regionStack); 865using var _2 = s_stackPool.GetPooledObject(out var ifStack);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeOrTokenExtensions.cs (1)
28using var pooledStack = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (1)
86using var pooledObject = SharedPools.Default<Stack<Node>>().GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
121using var tokenOperations = s_tokenPairListPool.GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
95using var pooledObject = SharedPools.Default<Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData>>().GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (36)
18public static PooledObject<StringBuilder> GetPooledObject(this ObjectPool<StringBuilder> pool) 19=> PooledObject<StringBuilder>.Create(pool); 21public static PooledObject<StringBuilder> GetPooledObject(this ObjectPool<StringBuilder> pool, out StringBuilder builder) 23var pooledObject = PooledObject<StringBuilder>.Create(pool); 28public static PooledObject<Stack<TItem>> GetPooledObject<TItem>(this ObjectPool<Stack<TItem>> pool) 29=> PooledObject<Stack<TItem>>.Create(pool); 31public static PooledObject<Queue<TItem>> GetPooledObject<TItem>(this ObjectPool<Queue<TItem>> pool) 32=> PooledObject<Queue<TItem>>.Create(pool); 34public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool) 35=> PooledObject<HashSet<TItem>>.Create(pool); 37public static PooledObject<Dictionary<TKey, TValue>> GetPooledObject<TKey, TValue>(this ObjectPool<Dictionary<TKey, TValue>> pool) where TKey : notnull 38=> PooledObject<Dictionary<TKey, TValue>>.Create(pool); 40public static PooledObject<List<TItem>> GetPooledObject<TItem>(this ObjectPool<List<TItem>> pool) 41=> PooledObject<List<TItem>>.Create(pool); 43public static PooledObject<SegmentedList<TItem>> GetPooledObject<TItem>(this ObjectPool<SegmentedList<TItem>> pool) 44=> PooledObject<SegmentedList<TItem>>.Create(pool); 46public static PooledObject<Stack<TItem>> GetPooledObject<TItem>(this ObjectPool<Stack<TItem>> pool, out Stack<TItem> stack) 48var pooledObject = PooledObject<Stack<TItem>>.Create(pool); 53public static PooledObject<List<TItem>> GetPooledObject<TItem>(this ObjectPool<List<TItem>> pool, out List<TItem> list) 55var pooledObject = PooledObject<List<TItem>>.Create(pool); 60public static PooledObject<SegmentedList<TItem>> GetPooledObject<TItem>(this ObjectPool<SegmentedList<TItem>> pool, out SegmentedList<TItem> list) 62var pooledObject = PooledObject<SegmentedList<TItem>>.Create(pool); 67public static PooledObject<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set) 69var pooledObject = PooledObject<HashSet<TItem>>.Create(pool); 74public static PooledObject<Dictionary<TKey, TValue>> GetPooledObject<TKey, TValue>(this ObjectPool<Dictionary<TKey, TValue>> pool, out Dictionary<TKey, TValue> dictionary) 77var pooledObject = PooledObject<Dictionary<TKey, TValue>>.Create(pool); 82public static PooledObject<ConcurrentSet<T>> GetPooledObject<T>(this ObjectPool<ConcurrentSet<T>> pool, out ConcurrentSet<T> set) 85var pooledObject = PooledObject<ConcurrentSet<T>>.Create(pool); 90public static PooledObject<T> GetPooledObject<T>(this ObjectPool<T> pool) where T : class
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (8)
41public static PooledObject<StringBuilder> Create(ObjectPool<StringBuilder> pool) 49public static PooledObject<Stack<TItem>> Create<TItem>(ObjectPool<Stack<TItem>> pool) 57public static PooledObject<Queue<TItem>> Create<TItem>(ObjectPool<Queue<TItem>> pool) 65public static PooledObject<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool) 73public static PooledObject<ConcurrentSet<TItem>> Create<TItem>(ObjectPool<ConcurrentSet<TItem>> pool) where TItem : notnull 81public static PooledObject<Dictionary<TKey, TValue>> Create<TKey, TValue>(ObjectPool<Dictionary<TKey, TValue>> pool) 90public static PooledObject<List<TItem>> Create<TItem>(ObjectPool<List<TItem>> pool) 98public static PooledObject<SegmentedList<TItem>> Create<TItem>(ObjectPool<SegmentedList<TItem>> pool)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
351using var pooledObj = BufferPool<T>.Shared.GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (2)
407PooledObject<List<SyntaxNode>> GetTopLevelAndMethodLevelMembers(SyntaxNode? root); 409PooledObject<List<SyntaxNode>> GetMethodLevelMembers(SyntaxNode? root);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
39using var _ = s_stackPool.GetPooledObject(out var stack);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (3)
24using var nameSetPool = (isCaseSensitive ? SharedPools.StringHashSet : SharedPools.StringIgnoreCaseHashSet).GetPooledObject(); 91using var usedNamesPool = (isCaseSensitive ? SharedPools.StringHashSet : SharedPools.StringIgnoreCaseHashSet).GetPooledObject(); 94using var collisionMapPool = (isCaseSensitive ? SharedPools.Default<Dictionary<string, bool>>() : SharedPools.StringIgnoreCaseDictionary<bool>()).GetPooledObject();
TemporaryStorage\TemporaryStorageService.cs (1)
157using var pooledObject = SharedPools.ByteArray.GetPooledObject();
Utilities\SegmentedListPool.cs (2)
11internal static PooledObject<SegmentedList<T>> GetPooledList<T>(out SegmentedList<T> classifiedSpans) 13var pooledObject = new PooledObject<SegmentedList<T>>(
Workspace\Solution\Checksum_Factory.cs (3)
28using var pooledHash = s_incrementalHashPool.GetPooledObject(); 50using var pooledHash = s_incrementalHashPool.GetPooledObject(); 103using var pooledHash = s_incrementalHashPool.GetPooledObject();
Workspace\Solution\ProjectDependencyGraph.cs (9)
269using var pooledObject = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 321using var pooledObject = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 366using var seenProjects = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 367using var resultList = SharedPools.Default<List<ProjectId>>().GetPooledObject(); 418using var seenProjects = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 419using var results = SharedPools.Default<List<IEnumerable<ProjectId>>>().GetPooledObject(); 435using var dependencySet = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 442using var topologicallySeenProjects = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject(); 443using var sortedProjects = SharedPools.Default<List<ProjectId>>().GetPooledObject();
Workspace\Solution\SolutionState_Checksum.cs (1)
106using var projectCone = SharedPools.Default<HashSet<ProjectId>>().GetPooledObject();
Workspace\Solution\TextDocumentStates.cs (1)
142using var pooledIds = SharedPools.Default<List<DocumentId>>().GetPooledObject();
Microsoft.VisualStudio.LanguageServices (3)
DocumentOutline\DocumentOutlineViewModel.cs (1)
325using var _ = SegmentedListPool.GetPooledList<DocumentSymbolDataViewModel>(out var models);
Venus\ContainedDocument.DocumentServiceProvider.cs (2)
186using var _1 = Classifier.GetPooledList(out var list); 230using var _2 = Classifier.GetPooledList(out var builder);