9 instantiations of SegmentedDictionary
Microsoft.CodeAnalysis.Workspaces (9)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (2)
73
public static readonly ImmutableSegmentedDictionary<TKey, TValue> Empty = new(new
SegmentedDictionary
<TKey, TValue>());
283
return new ImmutableSegmentedDictionary<TKey, TValue>(new
SegmentedDictionary
<TKey, TValue>(keyComparer));
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (3)
49
_mutableDictionary = new
SegmentedDictionary
<TKey, TValue>(value);
102
_mutableDictionary = new
SegmentedDictionary
<TKey, TValue>(originalDictionary._dictionary, originalDictionary.KeyComparer);
134
_mutableDictionary = new
SegmentedDictionary
<TKey, TValue>(KeyComparer);
src\Dependencies\Collections\SegmentedDictionary`2.cs (3)
393
return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new
SegmentedDictionary
<TKey, TValue>(), Enumerator.KeyValuePair))!;
1362
return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new
SegmentedDictionary
<TKey, TValue>()))!;
1570
return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new
SegmentedDictionary
<TKey, TValue>()))!;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.WriterReferenceMap.cs (1)
22
private static readonly ObjectPool<SegmentedDictionary<string, int>> s_valueDictionaryPool = new(() =>
new
(128));
46 references to SegmentedDictionary
Microsoft.CodeAnalysis.Workspaces (46)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2.cs (2)
75
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
77
private ImmutableSegmentedDictionary(
SegmentedDictionary
<TKey, TValue> dictionary)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder.cs (2)
37
private
SegmentedDictionary
<TKey, TValue> ReadOnlyDictionary => _builder.ReadOnlyDictionary;
152
internal
SegmentedDictionary
<TKey, TValue> GetOrCreateMutableDictionary()
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Enumerator.cs (3)
14
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
16
private
SegmentedDictionary
<TKey, TValue>.Enumerator _enumerator;
18
internal Enumerator(
SegmentedDictionary
<TKey, TValue> dictionary, ReturnType returnType)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (6)
20
var
dictionary = Volatile.Read(ref Unsafe.AsRef(in location._dictionary));
29
var
dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
38
var
dictionary = Interlocked.CompareExchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary, comparand._dictionary);
49
/// <inheritdoc cref="SegmentedCollectionsMarshal.AsImmutableSegmentedDictionary{TKey, TValue}(
SegmentedDictionary
{TKey, TValue}?)"/>
50
internal static ImmutableSegmentedDictionary<TKey, TValue> AsImmutableSegmentedDictionary(
SegmentedDictionary
<TKey, TValue>? dictionary)
54
internal static
SegmentedDictionary
<TKey, TValue>? AsSegmentedDictionary(ImmutableSegmentedDictionary<TKey, TValue> dictionary)
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+ValueBuilder.cs (4)
25
private
SegmentedDictionary
<TKey, TValue>? _mutableDictionary;
48
var
valuesToAdd = ReadOnlyDictionary;
58
internal readonly
SegmentedDictionary
<TKey, TValue> ReadOnlyDictionary => _mutableDictionary ?? _dictionary._dictionary;
94
internal
SegmentedDictionary
<TKey, TValue> GetOrCreateMutableDictionary()
src\Dependencies\Collections\SegmentedCollectionsMarshal.cs (11)
45
/// Gets either a ref to a <typeparamref name="TValue"/> in the <see cref="
SegmentedDictionary
{TKey, TValue}"/> or a
53
/// Items should not be added or removed from the <see cref="
SegmentedDictionary
{TKey, TValue}"/> while the ref
57
public static ref TValue GetValueRefOrNullRef<TKey, TValue>(
SegmentedDictionary
<TKey, TValue> dictionary, TKey key)
59
=> ref
SegmentedDictionary
<TKey, TValue>.PrivateMarshal.FindValue(dictionary, key);
180
/// Gets an <see cref="ImmutableSegmentedDictionary{TKey, TValue}"/> value wrapping the input <see cref="
SegmentedDictionary
{TKey, TValue}"/>.
199
public static ImmutableSegmentedDictionary<TKey, TValue> AsImmutableSegmentedDictionary<TKey, TValue>(
SegmentedDictionary
<TKey, TValue>? dictionary)
204
/// Gets the underlying <see cref="
SegmentedDictionary
{TKey, TValue}"/> for an input <see cref="ImmutableSegmentedDictionary{TKey, TValue}"/> value.
208
/// <param name="dictionary">The input <see cref="ImmutableSegmentedDictionary{TKey, TValue}"/> value to get the underlying <see cref="
SegmentedDictionary
{TKey, TValue}"/> from.</param>
209
/// <returns>The underlying <see cref="
SegmentedDictionary
{TKey, TValue}"/> for <paramref name="dictionary"/>, if present; otherwise, <see langword="null"/>.</returns>
218
/// property is <see langword="true"/>), the resulting <see cref="
SegmentedDictionary
{TKey, TValue}"/> will be <see langword="null"/>.
221
public static
SegmentedDictionary
<TKey, TValue>? AsSegmentedDictionary<TKey, TValue>(ImmutableSegmentedDictionary<TKey, TValue> dictionary)
src\Dependencies\Collections\SegmentedDictionary`2.cs (13)
154
if (enumerable.GetType() == typeof(
SegmentedDictionary
<TKey, TValue>))
156
var
source = (
SegmentedDictionary
<TKey, TValue>)enumerable;
1172
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
1181
internal Enumerator(
SegmentedDictionary
<TKey, TValue> dictionary, int getEnumeratorRetType)
1296
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
1298
public KeyCollection(
SegmentedDictionary
<TKey, TValue> dictionary)
1430
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
1435
internal Enumerator(
SegmentedDictionary
<TKey, TValue> dictionary)
1504
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
1506
public ValueCollection(
SegmentedDictionary
<TKey, TValue> dictionary)
1638
private readonly
SegmentedDictionary
<TKey, TValue> _dictionary;
1643
internal Enumerator(
SegmentedDictionary
<TKey, TValue> dictionary)
src\Dependencies\Collections\SegmentedDictionary`2+PrivateMarshal.cs (2)
14
/// <inheritdoc cref="SegmentedCollectionsMarshal.GetValueRefOrNullRef{TKey, TValue}(
SegmentedDictionary
{TKey, TValue}, TKey)"/>
15
public static ref TValue FindValue(
SegmentedDictionary
<TKey, TValue> dictionary, TKey key)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (1)
43
private readonly
SegmentedDictionary
<SyntaxToken, AnchorData> _anchorBaseTokenMap = [];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.WriterReferenceMap.cs (2)
19
private readonly
SegmentedDictionary
<string, int> _valueToIdMap;
22
private static readonly ObjectPool<
SegmentedDictionary
<string, int>> s_valueDictionaryPool = new(() => new(128));