124 references to CollectionsMarshal
aspire (1)
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
Aspire.Dashboard (12)
Components\Controls\Chart\ChartContainer.razor.cs (1)
179DimensionFilters = ImmutableList.Create(CollectionsMarshal.AsSpan(CreateUpdatedFilters(hasInstrumentChanged)));
Model\SpanDetailsViewModel.cs (1)
64ref var trace = ref CollectionsMarshal.GetValueRefOrAddDefault(traceCache, traceId, out _);
Model\TraceHelpers.cs (1)
29ref var childSpans = ref CollectionsMarshal.GetValueRefOrAddDefault(spanLookup, parentSpan, out _);
Otlp\Model\OtlpHelpers.cs (1)
470ref var scopeRef = ref CollectionsMarshal.GetValueRefOrAddDefault(scopes, name, out _);
Otlp\Model\OtlpInstrument.cs (1)
81ref var values = ref CollectionsMarshal.GetValueRefOrAddDefault(KnownAttributeValues, key, out _);
Otlp\Model\OtlpResource.cs (1)
89ref var instrumentRef = ref CollectionsMarshal.GetValueRefOrAddDefault(_instruments, instrumentKey, out _);
Otlp\Storage\TelemetryRepository.cs (5)
384ref var count = ref CollectionsMarshal.GetValueRefOrAddDefault(_resourceUnviewedErrorLogs, resourceView.ResourceKey, out _); 911ref var count = ref CollectionsMarshal.GetValueRefOrAddDefault(attributesValues, values.Value1, out _); 917ref var count = ref CollectionsMarshal.GetValueRefOrAddDefault(attributesValues, values.Value2, out _); 945ref var count = ref CollectionsMarshal.GetValueRefOrAddDefault(attributesValues, value, out _); 1535ref var values = ref CollectionsMarshal.GetValueRefOrAddDefault(allKnownAttributes, knownAttributeValues.Key, out _);
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
Aspire.Hosting (1)
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
202span = CollectionsMarshal.AsSpan((List<KeyValuePair<TKey, TValue>>)enumerable);
ILCompiler.Compiler (1)
Compiler\DependencyAnalysis\DehydratedDataNode.cs (1)
75CollectionsMarshal.GetValueRefOrAddDefault(relocOccurences, target, out _)++;
ILCompiler.MetadataTransform (2)
Internal\Metadata\NativeFormat\Writer\NativeMetadataWriter.cs (2)
995return CollectionsMarshal.AsSpan(first).SequenceEqual(CollectionsMarshal.AsSpan(second), comparer);
Microsoft.AspNetCore.Components (2)
Reflection\MemberAssignment.cs (1)
74foreach (var other in CollectionsMarshal.AsSpan(many))
src\aspnetcore\src\Components\Shared\src\QueryParameterValueSupplier.cs (1)
26ref var values = ref CollectionsMarshal.GetValueRefOrAddDefault(_queryParameterValuesByName, decodedName, out _);
Microsoft.AspNetCore.Components.Forms (1)
EditContextDataAnnotationsExtensions.cs (1)
278foreach (var result in CollectionsMarshal.AsSpan(results))
Microsoft.AspNetCore.Components.QuickGrid (1)
src\aspnetcore\src\Components\Shared\src\QueryParameterValueSupplier.cs (1)
26ref var values = ref CollectionsMarshal.GetValueRefOrAddDefault(_queryParameterValuesByName, decodedName, out _);
Microsoft.AspNetCore.CookiePolicy (1)
ResponseCookiesWrapper.cs (1)
159Cookies.Append(CollectionsMarshal.AsSpan(nonSuppressedValues), options);
Microsoft.AspNetCore.Http.Extensions (1)
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
136return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
136return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.OpenApi (1)
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
136return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.Razor.Runtime (1)
Runtime\TagHelpers\TagHelperRunner.cs (1)
26var tagHelpers = CollectionsMarshal.AsSpan(executionContext.TagHelperList);
Microsoft.AspNetCore.Routing (1)
Matching\HttpMethodMatcherPolicy.cs (1)
398var methods = CollectionsMarshal.AsSpan(httpMethods);
Microsoft.Build (1)
src\5057ed6cf5d6323b\SegmentedDictionary`2.cs (1)
202span = CollectionsMarshal.AsSpan((List<KeyValuePair<TKey, TValue>>)enumerable);
Microsoft.CodeAnalysis (1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
202span = CollectionsMarshal.AsSpan((List<KeyValuePair<TKey, TValue>>)enumerable);
Microsoft.CodeAnalysis.Workspaces (1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
202span = CollectionsMarshal.AsSpan((List<KeyValuePair<TKey, TValue>>)enumerable);
Microsoft.Extensions.Logging.Console (1)
ConsoleControlCharacterSanitizer.cs (1)
106return SearchValues.Create(System.Runtime.InteropServices.CollectionsMarshal.AsSpan(chars));
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (1)
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (1)
397SortByRelatedAssetInPlace(System.Runtime.InteropServices.CollectionsMarshal.AsSpan(assets));
Microsoft.NET.Sdk.StaticWebAssets.Tasks (1)
Data\StaticWebAsset.cs (1)
397SortByRelatedAssetInPlace(System.Runtime.InteropServices.CollectionsMarshal.AsSpan(assets));
PresentationFramework (3)
Microsoft\Win32\FileDialog.cs (1)
741return CollectionsMarshal.AsSpan(extensions);
MS\Internal\Globalization\BamlResourceContent.cs (1)
254return CollectionsMarshal.AsSpan(tokens);
MS\Internal\Ink\LassoSelectionBehavior.cs (1)
447return CollectionsMarshal.AsSpan(pointArray);
System.Linq (28)
System\Linq\AggregateBy.cs (2)
126ref TAccumulate? acc = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists); 158ref TAccumulate? acc = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);
System\Linq\CountBy.cs (1)
63ref int currentCount = ref CollectionsMarshal.GetValueRefOrAddDefault(countsBy, key, out _);
System\Linq\Enumerable.cs (3)
38CollectionsMarshal.SetCount(list, count); 39return CollectionsMarshal.AsSpan(list); 60span = CollectionsMarshal.AsSpan(Unsafe.As<List<TSource>>(source));
System\Linq\OrderedEnumerable.SpeedOpt.cs (1)
376Sort(CollectionsMarshal.AsSpan(list), _descending);
System\Linq\SegmentedArrayBuilder.cs (2)
265CollectionsMarshal.SetCount(result, count); 266ToSpanInlined(CollectionsMarshal.AsSpan(result));
System\Linq\Select.SpeedOpt.cs (2)
398ReadOnlySpan<TSource> source = CollectionsMarshal.AsSpan(_source); 412ReadOnlySpan<TSource> source = CollectionsMarshal.AsSpan(_source);
System\Linq\Shuffle.SpeedOpt.cs (2)
24Random.Shared.Shuffle(CollectionsMarshal.AsSpan(list)); 279Random.Shared.Shuffle(CollectionsMarshal.AsSpan(reservoir));
System\Linq\ToCollection.cs (2)
165ReadOnlySpan<TSource> span = CollectionsMarshal.AsSpan(list); 223ReadOnlySpan<TSource> span = CollectionsMarshal.AsSpan(list);
System\Linq\Where.SpeedOpt.cs (13)
316public override int GetCount(bool onlyIfCheap) => ArrayWhereIterator<TSource>.GetCount(onlyIfCheap, CollectionsMarshal.AsSpan(_source), _predicate); 318public override TSource[] ToArray() => ArrayWhereIterator<TSource>.ToArray(CollectionsMarshal.AsSpan(_source), _predicate); 320public override List<TSource> ToList() => ArrayWhereIterator<TSource>.ToList(CollectionsMarshal.AsSpan(_source), _predicate); 326foreach (TSource item in CollectionsMarshal.AsSpan(_source)) 341ReadOnlySpan<TSource> source = CollectionsMarshal.AsSpan(_source); 363foreach (TSource item in CollectionsMarshal.AsSpan(_source)) 548public override int GetCount(bool onlyIfCheap) => ArrayWhereSelectIterator<TSource, TResult>.GetCount(onlyIfCheap, CollectionsMarshal.AsSpan(_source), _predicate, _selector); 550public override TResult[] ToArray() => ArrayWhereSelectIterator<TSource, TResult>.ToArray(CollectionsMarshal.AsSpan(_source), _predicate, _selector); 552public override List<TResult> ToList() => ArrayWhereSelectIterator<TSource, TResult>.ToList(CollectionsMarshal.AsSpan(_source), _predicate, _selector); 554public override TResult? TryGetElementAt(int index, out bool found) => ArrayWhereSelectIterator<TSource, TResult>.TryGetElementAt(CollectionsMarshal.AsSpan(_source), _predicate, _selector, index, out found); 556public override TResult? TryGetFirst(out bool found) => ArrayWhereSelectIterator<TSource, TResult>.TryGetFirst(CollectionsMarshal.AsSpan(_source), _predicate, _selector, out found); 558public override TResult? TryGetLast(out bool found) => ArrayWhereSelectIterator<TSource, TResult>.TryGetLast(CollectionsMarshal.AsSpan(_source), _predicate, _selector, out found); 560public override bool Contains(TResult value) => ArrayWhereSelectIterator<TSource, TResult>.Contains(CollectionsMarshal.AsSpan(_source), _predicate, _selector, value);
System.Linq.AsyncEnumerable (4)
System\Linq\AggregateBy.cs (2)
72ref TAccumulate? acc = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists); 210ref TAccumulate? acc = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);
System\Linq\CountBy.cs (2)
49ref int currentCount = ref CollectionsMarshal.GetValueRefOrAddDefault(countsBy, key, out _); 100ref int currentCount = ref CollectionsMarshal.GetValueRefOrAddDefault(countsBy, key, out _);
System.Net.Http (6)
System\Net\Http\Headers\HttpHeaders.cs (4)
419: ref CollectionsMarshal.GetValueRefOrNullRef((Dictionary<HeaderDescriptor, object>)_headerStore, entry.Key); 1511valueRef = ref CollectionsMarshal.GetValueRefOrNullRef((Dictionary<HeaderDescriptor, object>)store, key); 1580return ref CollectionsMarshal.GetValueRefOrAddDefault(dictionary, key, out _); 1586ref object? value = ref CollectionsMarshal.GetValueRefOrAddDefault(dictionary, key, out _);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (2)
977http2Connections = CollectionsMarshal.AsSpan(http2); 994http3Connections = CollectionsMarshal.AsSpan(http3);
System.Private.CoreLib (30)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (4)
164span = CollectionsMarshal.AsSpan((List<KeyValuePair<TKey, TValue>>)enumerable); 959/// <inheritdoc cref="CollectionsMarshal.GetValueRefOrAddDefault{TKey, TValue}(Dictionary{TKey, TValue}, TKey, out bool)"/> 1064/// A helper class containing APIs exposed through <see cref="CollectionsMarshal"/> or <see cref="CollectionExtensions"/>. 1070/// <inheritdoc cref="CollectionsMarshal.GetValueRefOrAddDefault{TKey, TValue}(Dictionary{TKey, TValue}, TKey, out bool)"/>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (15)
778ref EventMetadata eventMetadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, metaKey); 1365ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventId); 1435ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventId); 1995ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventId); 2087ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventId); 2101ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventId); 2121ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventId); 2151ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventCallbackArgs.EventId); 2379ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventNum); 2786ref EventMetadata eventMeta = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventID); 2840ref EventMetadata eventMeta = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventId); 3062ref EventMetadata newEventMetadata = ref CollectionsMarshal.GetValueRefOrAddDefault(eventData, 0, out _); 3230ref EventMetadata startEventMetadata = ref CollectionsMarshal.GetValueRefOrNullRef(eventData, startEventId); 3525ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrAddDefault(eventData, eventAttribute.EventId, out _); 4179private ref EventSource.EventMetadata Metadata => ref CollectionsMarshal.GetValueRefOrNullRef(EventSource.m_eventData!, EventId);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\NativeRuntimeEventSource.cs (1)
56ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData!, (int)eventID);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (1)
1317ref GCHandle rcwEntry = ref CollectionsMarshal.GetValueRefOrAddDefault(_cache, comPointer, out bool exists);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (3)
168return Concat(CollectionsMarshal.AsSpan((List<string?>)values)); 808return JoinCore(separator.AsSpan(), CollectionsMarshal.AsSpan(valuesList)); 946return JoinCore(separator, CollectionsMarshal.AsSpan((List<string?>)values));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (5)
3679Span<object?> continuations = CollectionsMarshal.AsSpan(list); 5106tasks is List<Task> list ? CollectionsMarshal.AsSpan(list) : 5108CollectionsMarshal.AsSpan(new List<Task>(tasks)); 6113return WhenAll(CollectionsMarshal.AsSpan(taskList)); 6909return WhenAnyCore((ReadOnlySpan<TTask>)CollectionsMarshal.AsSpan(Unsafe.As<List<TTask>>(tasks)));
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (1)
574ReadOnlySpan<TypeName> GetGenericArguments() => CollectionsMarshal.AsSpan(_genericArguments);
System.Private.Windows.Core (1)
System\IO\BinaryReaderExtensions.cs (1)
250span = CollectionsMarshal.AsSpan(list);
System.Reflection.Metadata (1)
System\Reflection\Metadata\Ecma335\BlobDictionary.cs (1)
30ref var entry = ref CollectionsMarshal.GetValueRefOrAddDefault(_dictionary, dictionaryKey, out exists);
System.Runtime.InteropServices (1)
src\runtime\artifacts\obj\System.Runtime.InteropServices\Release\net11.0\System.Runtime.InteropServices.Forwards.cs (1)
17[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.CollectionsMarshal))]
System.Text.Json (4)
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
73Span<T> span = CollectionsMarshal.AsSpan(items);
System\Text\Json\Document\JsonElement.cs (2)
1373ref ValueQueue<JsonElement> values = ref CollectionsMarshal.GetValueRefOrAddDefault(properties2, prop2.Name, out bool _); 1388ref ValueQueue<JsonElement> values = ref CollectionsMarshal.GetValueRefOrAddDefault(properties2, prop.Name, out bool exists);
System\Text\Json\Schema\JsonSchemaExporter.cs (1)
551ref string[]? pathToSchema = ref CollectionsMarshal.GetValueRefOrAddDefault(_generated, key, out bool exists);
System.Text.Json.SourceGeneration (1)
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
73Span<T> span = CollectionsMarshal.AsSpan(items);
System.Text.RegularExpressions (10)
System\Text\RegularExpressions\RegexWriter.cs (1)
181ref int i = ref CollectionsMarshal.GetValueRefOrAddDefault(_stringTable, str, out bool exists);
System\Text\RegularExpressions\Symbolic\CharSetSolver.cs (1)
381ref BDD? bdd = ref CollectionsMarshal.GetValueRefOrAddDefault(_bddCache, (ordinal, one, zero), out _);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (3)
339ref BDD? result = ref CollectionsMarshal.GetValueRefOrAddDefault(_setBddCache, set, out _); 461(negate ? charSetSolver.And(CollectionsMarshal.AsSpan(conditions)) : charSetSolver.Or(CollectionsMarshal.AsSpan(conditions)));
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (1)
254ref SymbolicRegexNode<TSet>? result = ref CollectionsMarshal.GetValueRefOrAddDefault(_singletonCache, set, out _);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (4)
1316foreach (ref KeyValuePair<int, int> nfaState in CollectionsMarshal.AsSpan(state.NfaState!.NfaStateSet.Values)) 1330foreach (ref KeyValuePair<int, int> nfaState in CollectionsMarshal.AsSpan(state.NfaState!.NfaStateSet.Values)) 1375foreach (ref KeyValuePair<int, int> sourceState in CollectionsMarshal.AsSpan(sourceStates.Values)) 1429foreach (ref KeyValuePair<int, int> nfaState in CollectionsMarshal.AsSpan(state.NfaState!.NfaStateSet.Values))
UIAutomationClientSideProviders (1)
MS\Internal\AutomationProxies\ProxyHwnd.cs (1)
523return CollectionsMarshal.AsSpan(automationEvents);