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)
43
return new
PooledObject
<StringBuilder>(
51
return new
PooledObject
<Stack<TItem>>(
59
return new
PooledObject
<Queue<TItem>>(
67
return new
PooledObject
<HashSet<TItem>>(
75
return new
PooledObject
<ConcurrentSet<TItem>>(
84
return new
PooledObject
<Dictionary<TKey, TValue>>(
92
return new
PooledObject
<List<TItem>>(
100
return new
PooledObject
<SegmentedList<TItem>>(
56 references to PooledObject
Microsoft.CodeAnalysis.CodeStyle (56)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.cs (1)
84
using
var
_ = s_nodeStackPool.GetPooledObject(out var candidates);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.NodeEnumerator.cs (1)
26
private readonly
PooledObject
<Stack<TNode>> _pooledStack;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
864
using
var
_1 = s_stackPool.GetPooledObject(out var regionStack);
865
using
var
_2 = s_stackPool.GetPooledObject(out var ifStack);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeOrTokenExtensions.cs (1)
28
using
var
pooledStack = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (1)
86
using
var
pooledObject = SharedPools.Default<Stack<Node>>().GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
121
using
var
tokenOperations = s_tokenPairListPool.GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
95
using
var
pooledObject = SharedPools.Default<Dictionary<ValueTuple<SyntaxToken, SyntaxToken>, TriviaData>>().GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (36)
18
public static
PooledObject
<StringBuilder> GetPooledObject(this ObjectPool<StringBuilder> pool)
19
=>
PooledObject
<StringBuilder>.Create(pool);
21
public static
PooledObject
<StringBuilder> GetPooledObject(this ObjectPool<StringBuilder> pool, out StringBuilder builder)
23
var
pooledObject =
PooledObject
<StringBuilder>.Create(pool);
28
public static
PooledObject
<Stack<TItem>> GetPooledObject<TItem>(this ObjectPool<Stack<TItem>> pool)
29
=>
PooledObject
<Stack<TItem>>.Create(pool);
31
public static
PooledObject
<Queue<TItem>> GetPooledObject<TItem>(this ObjectPool<Queue<TItem>> pool)
32
=>
PooledObject
<Queue<TItem>>.Create(pool);
34
public static
PooledObject
<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool)
35
=>
PooledObject
<HashSet<TItem>>.Create(pool);
37
public static
PooledObject
<Dictionary<TKey, TValue>> GetPooledObject<TKey, TValue>(this ObjectPool<Dictionary<TKey, TValue>> pool) where TKey : notnull
38
=>
PooledObject
<Dictionary<TKey, TValue>>.Create(pool);
40
public static
PooledObject
<List<TItem>> GetPooledObject<TItem>(this ObjectPool<List<TItem>> pool)
41
=>
PooledObject
<List<TItem>>.Create(pool);
43
public static
PooledObject
<SegmentedList<TItem>> GetPooledObject<TItem>(this ObjectPool<SegmentedList<TItem>> pool)
44
=>
PooledObject
<SegmentedList<TItem>>.Create(pool);
46
public static
PooledObject
<Stack<TItem>> GetPooledObject<TItem>(this ObjectPool<Stack<TItem>> pool, out Stack<TItem> stack)
48
var
pooledObject =
PooledObject
<Stack<TItem>>.Create(pool);
53
public static
PooledObject
<List<TItem>> GetPooledObject<TItem>(this ObjectPool<List<TItem>> pool, out List<TItem> list)
55
var
pooledObject =
PooledObject
<List<TItem>>.Create(pool);
60
public static
PooledObject
<SegmentedList<TItem>> GetPooledObject<TItem>(this ObjectPool<SegmentedList<TItem>> pool, out SegmentedList<TItem> list)
62
var
pooledObject =
PooledObject
<SegmentedList<TItem>>.Create(pool);
67
public static
PooledObject
<HashSet<TItem>> GetPooledObject<TItem>(this ObjectPool<HashSet<TItem>> pool, out HashSet<TItem> set)
69
var
pooledObject =
PooledObject
<HashSet<TItem>>.Create(pool);
74
public static
PooledObject
<Dictionary<TKey, TValue>> GetPooledObject<TKey, TValue>(this ObjectPool<Dictionary<TKey, TValue>> pool, out Dictionary<TKey, TValue> dictionary)
77
var
pooledObject =
PooledObject
<Dictionary<TKey, TValue>>.Create(pool);
82
public static
PooledObject
<ConcurrentSet<T>> GetPooledObject<T>(this ObjectPool<ConcurrentSet<T>> pool, out ConcurrentSet<T> set)
85
var
pooledObject =
PooledObject
<ConcurrentSet<T>>.Create(pool);
90
public static
PooledObject
<T> GetPooledObject<T>(this ObjectPool<T> pool) where T : class
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (8)
41
public static
PooledObject
<StringBuilder> Create(ObjectPool<StringBuilder> pool)
49
public static
PooledObject
<Stack<TItem>> Create<TItem>(ObjectPool<Stack<TItem>> pool)
57
public static
PooledObject
<Queue<TItem>> Create<TItem>(ObjectPool<Queue<TItem>> pool)
65
public static
PooledObject
<HashSet<TItem>> Create<TItem>(ObjectPool<HashSet<TItem>> pool)
73
public static
PooledObject
<ConcurrentSet<TItem>> Create<TItem>(ObjectPool<ConcurrentSet<TItem>> pool) where TItem : notnull
81
public static
PooledObject
<Dictionary<TKey, TValue>> Create<TKey, TValue>(ObjectPool<Dictionary<TKey, TValue>> pool)
90
public static
PooledObject
<List<TItem>> Create<TItem>(ObjectPool<List<TItem>> pool)
98
public static
PooledObject
<SegmentedList<TItem>> Create<TItem>(ObjectPool<SegmentedList<TItem>> pool)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
351
using
var
pooledObj = BufferPool<T>.Shared.GetPooledObject();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (2)
407
PooledObject
<List<SyntaxNode>> GetTopLevelAndMethodLevelMembers(SyntaxNode? root);
409
PooledObject
<List<SyntaxNode>> GetMethodLevelMembers(SyntaxNode? root);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
39
using
var
_ = s_stackPool.GetPooledObject(out var stack);