63 references to SharedPools
Microsoft.CodeAnalysis.Workspaces (63)
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (2)
52_set = SharedPools.Default<SegmentedHashSet<ClassifiedSpan>>().AllocateAndClear(); 82SharedPools.Default<SegmentedHashSet<ClassifiedSpan>>().Free(_set);
FindSymbols\FindReferences\FindReferenceCache.cs (1)
156using var obj = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject();
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (2)
254private static readonly ObjectPool<List<string>> s_stringListPool = SharedPools.Default<List<string>>(); 790private static readonly ObjectPool<MetadataNode> s_pool = SharedPools.Default<MetadataNode>();
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (10)
26public static readonly ObjectPool<HashSet<string>> StringLiteralHashSetPool = SharedPools.Default<HashSet<string>>(); 27public static readonly ObjectPool<HashSet<long>> LongLiteralHashSetPool = SharedPools.Default<HashSet<long>>(); 337identifiers = SharedPools.StringIgnoreCaseHashSet.AllocateAndClear(); 338escapedIdentifiers = SharedPools.StringIgnoreCaseHashSet.AllocateAndClear(); 345identifiers = SharedPools.StringHashSet.AllocateAndClear(); 346escapedIdentifiers = SharedPools.StringHashSet.AllocateAndClear(); 359SharedPools.StringIgnoreCaseHashSet.ClearAndFree(identifiers); 360SharedPools.StringIgnoreCaseHashSet.ClearAndFree(escapedIdentifiers); 367SharedPools.StringHashSet.ClearAndFree(identifiers); 368SharedPools.StringHashSet.ClearAndFree(escapedIdentifiers);
LanguageServices\DeclaredSymbolFactoryService\AbstractDeclaredSymbolInfoFactoryService.cs (2)
37= SharedPools.Default<List<Dictionary<string, string>>>(); 45= SharedPools.StringIgnoreCaseDictionary<string>();
Log\KeyValueLogMessage.cs (2)
148SharedPools.Default<Dictionary<string, object?>>().ClearAndFree(_lazyMap); 164_lazyMap = SharedPools.Default<Dictionary<string, object?>>().AllocateAndClear();
Shared\Extensions\INamespaceSymbolExtensions.cs (1)
131using var namespaceQueue = SharedPools.Default<Queue<INamespaceOrTypeSymbol>>().GetPooledObject();
Shared\Utilities\XmlFragmentParser.cs (1)
25private static readonly ObjectPool<XmlFragmentParser> s_pool = SharedPools.Default<XmlFragmentParser>();
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\AbstractFormattingResult.cs (1)
95using var pooledObject = SharedPools.Default<Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData>>().GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\StringBuilderPool.cs (3)
12=> SharedPools.Default<StringBuilder>().AllocateAndClear(); 15=> SharedPools.Default<StringBuilder>().ClearAndFree(builder); 19SharedPools.Default<StringBuilder>().ForgetTrackedObject(builder);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\LogMessage.cs (6)
61private static readonly ObjectPool<StaticLogMessage> s_pool = SharedPools.Default<StaticLogMessage>(); 89private static readonly ObjectPool<LazyLogMessage> s_pool = SharedPools.Default<LazyLogMessage>(); 119private static readonly ObjectPool<LazyLogMessage<TArg0>> s_pool = SharedPools.Default<LazyLogMessage<TArg0>>(); 152private static readonly ObjectPool<LazyLogMessage<TArg0, TArg1>> s_pool = SharedPools.Default<LazyLogMessage<TArg0, TArg1>>(); 188private static readonly ObjectPool<LazyLogMessage<TArg0, TArg1, TArg2>> s_pool = SharedPools.Default<LazyLogMessage<TArg0, TArg1, TArg2>>(); 227private static readonly ObjectPool<LazyLogMessage<TArg0, TArg1, TArg2, TArg3>> s_pool = SharedPools.Default<LazyLogMessage<TArg0, TArg1, TArg2, TArg3>>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
21= SharedPools.Default<Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)>>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
322private static readonly ObjectPool<SymbolKeyReader> s_readerPool = SharedPools.Default<SymbolKeyReader>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
55private static readonly ObjectPool<SymbolKeyWriter> s_writerPool = SharedPools.Default<SymbolKeyWriter>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (8)
20private const int ChunkSize = SharedPools.ByteBufferSize; 46var chunk = SharedPools.ByteArray.Allocate(); 85SharedPools.ByteArray.Free(chunks[c]); 261SharedPools.ByteArray.Free(chunk); 282: base(length: 0, chunks: SharedPools.BigDefault<List<byte[]>>().AllocateAndClear()) 314var chunk = SharedPools.ByteArray.Allocate(); 342SharedPools.ByteArray.Free(chunks[i]); 404SharedPools.BigDefault<List<byte[]>>().ClearAndFree(temp);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NameGenerator.cs (6)
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 (1)
16SharedPools.BigDefault<SegmentedList<T>>(),
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();