7 instantiations of RefAsValueType
System.Collections.Immutable (7)
System\Collections\Immutable\AllocFreeConcurrentStack.cs (1)
33
localStack.Push(new
RefAsValueType
<T>(item));
System\Collections\Immutable\ImmutableList_1.Enumerator.cs (3)
211
stack.Push(new
RefAsValueType
<Node>(node));
223
stack.Push(new
RefAsValueType
<Node>(node));
279
stack.Push(new
RefAsValueType
<Node>(node));
System\Collections\Immutable\ImmutableSortedDictionary_2.Enumerator.cs (1)
214
stack.Push(new
RefAsValueType
<Node>(node));
System\Collections\Immutable\ImmutableSortedSet_1.Enumerator.cs (1)
219
stack.Push(new
RefAsValueType
<Node>(node));
System\Collections\Immutable\SortedInt32KeyNode.Enumerator.cs (1)
185
stack.Push(new
RefAsValueType
<SortedInt32KeyNode<TValue>>(node));
43 references to RefAsValueType
System.Collections.Immutable (43)
System\Collections\Immutable\AllocFreeConcurrentStack.cs (4)
15
private static Stack<
RefAsValueType
<T>>? t_stack;
22
Stack<
RefAsValueType
<T>> localStack =
24
t_stack ??= new Stack<
RefAsValueType
<T>>(MaxSize);
40
Stack<
RefAsValueType
<T>>? localStack = t_stack; // cache in a local to avoid unnecessary TLS hits on repeated accesses
System\Collections\Immutable\ImmutableList_1.Enumerator.cs (9)
67
private SecurePooledObject<Stack<
RefAsValueType
<Node>>>? _stack;
107
if (!SecureObjectPool<Stack<
RefAsValueType
<Node>>, Enumerator>.TryTake(this, out _stack))
109
_stack = SecureObjectPool<Stack<
RefAsValueType
<Node>>, Enumerator>.PrepNew(this, new Stack<
RefAsValueType
<Node>>(root.Height));
148
if (_stack != null && _stack.TryUse(ref this, out Stack<
RefAsValueType
<Node>>? stack))
151
SecureObjectPool<Stack<
RefAsValueType
<Node>>, Enumerator>.TryAdd(this, _stack!);
168
Stack<
RefAsValueType
<ImmutableList<T>.Node>> stack = _stack.Use(ref this);
202
Stack<
RefAsValueType
<ImmutableList<T>.Node>> stack = _stack.Use(ref this);
276
Stack<
RefAsValueType
<ImmutableList<T>.Node>> stack = _stack.Use(ref this);
System\Collections\Immutable\ImmutableSortedDictionary_2.Enumerator.cs (9)
47
private SecurePooledObject<Stack<
RefAsValueType
<Node>>>? _stack;
76
if (!SecureObjectPool<Stack<
RefAsValueType
<Node>>, Enumerator>.TryTake(this, out _stack))
78
_stack = SecureObjectPool<Stack<
RefAsValueType
<Node>>, Enumerator>.PrepNew(this, new Stack<
RefAsValueType
<Node>>(root.Height));
123
if (_stack != null && _stack.TryUse(ref this, out Stack<
RefAsValueType
<Node>>? stack))
126
SecureObjectPool<Stack<
RefAsValueType
<Node>>, Enumerator>.TryAdd(this, _stack!);
143
Stack<
RefAsValueType
<ImmutableSortedDictionary<TKey, TValue>.Node>> stack = _stack.Use(ref this);
168
Stack<
RefAsValueType
<ImmutableSortedDictionary<TKey, TValue>.Node>> stack = _stack.Use(ref this);
211
Stack<
RefAsValueType
<ImmutableSortedDictionary<TKey, TValue>.Node>> stack = _stack.Use(ref this);
System\Collections\Immutable\ImmutableSortedSet_1.Enumerator.cs (10)
52
/// We use <see cref="
RefAsValueType
{T}"/> as a wrapper to avoid paying the cost of covariant checks whenever
59
private SecurePooledObject<Stack<
RefAsValueType
<Node>>>? _stack;
88
if (!SecureObjectPool<Stack<
RefAsValueType
<Node>>, Enumerator>.TryTake(this, out _stack))
90
_stack = SecureObjectPool<Stack<
RefAsValueType
<Node>>, Enumerator>.PrepNew(this, new Stack<
RefAsValueType
<Node>>(root.Height));
134
if (_stack != null && _stack.TryUse(ref this, out Stack<
RefAsValueType
<Node>>? stack))
137
SecureObjectPool<Stack<
RefAsValueType
<Node>>, Enumerator>.TryAdd(this, _stack!);
151
Stack<
RefAsValueType
<ImmutableSortedSet<T>.Node>> stack = _stack!.Use(ref this);
175
Stack<
RefAsValueType
<ImmutableSortedSet<T>.Node>> stack = _stack!.Use(ref this);
216
Stack<
RefAsValueType
<ImmutableSortedSet<T>.Node>> stack = _stack!.Use(ref this);
System\Collections\Immutable\RefAsValueType.cs (2)
14
/// We use <see cref="
RefAsValueType
{T}"/> as a wrapper to avoid paying the cost of covariant checks whenever
25
/// Initializes a new instance of the <see cref="
RefAsValueType
{T}"/> struct.
System\Collections\Immutable\SortedInt32KeyNode.Enumerator.cs (9)
41
private SecurePooledObject<Stack<
RefAsValueType
<SortedInt32KeyNode<TValue>>>>? _stack;
62
if (!SecureObjectPool<Stack<
RefAsValueType
<SortedInt32KeyNode<TValue>>>, Enumerator>.TryTake(this, out _stack))
64
_stack = SecureObjectPool<Stack<
RefAsValueType
<SortedInt32KeyNode<TValue>>>, Enumerator>.PrepNew(this, new Stack<
RefAsValueType
<SortedInt32KeyNode<TValue>>>(root.Height));
109
if (_stack != null && _stack.TryUse(ref this, out Stack<
RefAsValueType
<SortedInt32KeyNode<TValue>>>? stack))
112
SecureObjectPool<Stack<
RefAsValueType
<SortedInt32KeyNode<TValue>>>, Enumerator>.TryAdd(this, _stack!);
128
Stack<
RefAsValueType
<SortedInt32KeyNode<TValue>>> stack = _stack.Use(ref this);
152
Stack<
RefAsValueType
<SortedInt32KeyNode<TValue>>> stack = _stack.Use(ref this);
182
Stack<
RefAsValueType
<SortedInt32KeyNode<TValue>>> stack = _stack!.Use(ref this);