9 instantiations of PooledObject
Microsoft.CodeAnalysis.CodeStyle (9)
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>>(
56 references to PooledObject
Microsoft.CodeAnalysis.CodeStyle (56)
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);