1599 references to As
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
150return Unsafe.As<TFromEnum, TToEnum>(ref value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ModifierExtensions.cs (1)
16return Unsafe.As<Modifiers, DeclarationModifiers>(ref modifiers);
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Internal\Json\EnumConverter.cs (2)
88integer = Unsafe.As<TEnum, int>(ref value); 100value = Unsafe.As<int, TEnum>(ref integer);
Microsoft.AspNetCore.Razor.Utilities.Shared (8)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\EnumExtensions.cs (8)
19Unsafe.As<T, byte>(ref value) |= *(byte*)&flag; 24Unsafe.As<T, ushort>(ref value) |= *(ushort*)&flag; 29Unsafe.As<T, uint>(ref value) |= *(uint*)&flag; 34Unsafe.As<T, ulong>(ref value) |= *(ulong*)&flag; 48Unsafe.As<T, byte>(ref value) &= (byte)~*(byte*)&flag; 53Unsafe.As<T, ushort>(ref value) &= (ushort)~*(ushort*)&flag; 58Unsafe.As<T, uint>(ref value) &= ~*(uint*)&flag; 63Unsafe.As<T, ulong>(ref value) &= ~*(ulong*)&flag;
Microsoft.AspNetCore.Routing (2)
Matching\ILEmitTrieFactory.cs (2)
546ref var p = ref Unsafe.As<char, byte>(ref MemoryMarshal.GetReference(span)); 745/// <see cref="Unsafe.As{TFrom, TTo}(ref TFrom)"/> - As[char, byte]
Microsoft.AspNetCore.Server.HttpSys (2)
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
113ref Unsafe.As<byte, long>(ref MemoryMarshal.GetReference(timingInfo.Span[sizeof(long)..])),
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (1)
171ref Unsafe.As<char, byte>(
Microsoft.AspNetCore.Server.IIS (2)
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
113ref Unsafe.As<byte, long>(ref MemoryMarshal.GetReference(timingInfo.Span[sizeof(long)..])),
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (1)
171ref Unsafe.As<char, byte>(
Microsoft.AspNetCore.Server.Kestrel.Core (71)
Internal\Http\HttpProtocol.Generated.cs (70)
500feature = Unsafe.As<IHttpRequestFeature?, TFeature?>(ref _currentIHttpRequestFeature); 504feature = Unsafe.As<IHttpResponseFeature?, TFeature?>(ref _currentIHttpResponseFeature); 508feature = Unsafe.As<IHttpResponseBodyFeature?, TFeature?>(ref _currentIHttpResponseBodyFeature); 512feature = Unsafe.As<IRouteValuesFeature?, TFeature?>(ref _currentIRouteValuesFeature); 516feature = Unsafe.As<IEndpointFeature?, TFeature?>(ref _currentIEndpointFeature); 520feature = Unsafe.As<IServiceProvidersFeature?, TFeature?>(ref _currentIServiceProvidersFeature); 524feature = Unsafe.As<IHttpActivityFeature?, TFeature?>(ref _currentIHttpActivityFeature); 528feature = Unsafe.As<IHttpMetricsTagsFeature?, TFeature?>(ref _currentIHttpMetricsTagsFeature); 532feature = Unsafe.As<IItemsFeature?, TFeature?>(ref _currentIItemsFeature); 536feature = Unsafe.As<IQueryFeature?, TFeature?>(ref _currentIQueryFeature); 540feature = Unsafe.As<IRequestBodyPipeFeature?, TFeature?>(ref _currentIRequestBodyPipeFeature); 544feature = Unsafe.As<IFormFeature?, TFeature?>(ref _currentIFormFeature); 548feature = Unsafe.As<IHttpAuthenticationFeature?, TFeature?>(ref _currentIHttpAuthenticationFeature); 552feature = Unsafe.As<IHttpRequestIdentifierFeature?, TFeature?>(ref _currentIHttpRequestIdentifierFeature); 556feature = Unsafe.As<IHttpConnectionFeature?, TFeature?>(ref _currentIHttpConnectionFeature); 560feature = Unsafe.As<ISessionFeature?, TFeature?>(ref _currentISessionFeature); 564feature = Unsafe.As<IResponseCookiesFeature?, TFeature?>(ref _currentIResponseCookiesFeature); 568feature = Unsafe.As<IHttpRequestTrailersFeature?, TFeature?>(ref _currentIHttpRequestTrailersFeature); 572feature = Unsafe.As<IHttpResponseTrailersFeature?, TFeature?>(ref _currentIHttpResponseTrailersFeature); 576feature = Unsafe.As<ITlsConnectionFeature?, TFeature?>(ref _currentITlsConnectionFeature); 580feature = Unsafe.As<IHttpExtendedConnectFeature?, TFeature?>(ref _currentIHttpExtendedConnectFeature); 584feature = Unsafe.As<IHttpUpgradeFeature?, TFeature?>(ref _currentIHttpUpgradeFeature); 588feature = Unsafe.As<IHttpWebSocketFeature?, TFeature?>(ref _currentIHttpWebSocketFeature); 592feature = Unsafe.As<IHttpWebTransportFeature?, TFeature?>(ref _currentIHttpWebTransportFeature); 596feature = Unsafe.As<IBadRequestExceptionFeature?, TFeature?>(ref _currentIBadRequestExceptionFeature); 600feature = Unsafe.As<IHttpRequestTimeoutFeature?, TFeature?>(ref _currentIHttpRequestTimeoutFeature); 604feature = Unsafe.As<IHttp2StreamIdFeature?, TFeature?>(ref _currentIHttp2StreamIdFeature); 608feature = Unsafe.As<IHttpRequestLifetimeFeature?, TFeature?>(ref _currentIHttpRequestLifetimeFeature); 612feature = Unsafe.As<IHttpMaxRequestBodySizeFeature?, TFeature?>(ref _currentIHttpMaxRequestBodySizeFeature); 616feature = Unsafe.As<IHttpMinRequestBodyDataRateFeature?, TFeature?>(ref _currentIHttpMinRequestBodyDataRateFeature); 620feature = Unsafe.As<IHttpMinResponseDataRateFeature?, TFeature?>(ref _currentIHttpMinResponseDataRateFeature); 624feature = Unsafe.As<IHttpBodyControlFeature?, TFeature?>(ref _currentIHttpBodyControlFeature); 628feature = Unsafe.As<IHttpRequestBodyDetectionFeature?, TFeature?>(ref _currentIHttpRequestBodyDetectionFeature); 632feature = Unsafe.As<IHttpResetFeature?, TFeature?>(ref _currentIHttpResetFeature); 636feature = Unsafe.As<IPersistentStateFeature?, TFeature?>(ref _currentIPersistentStateFeature); 660_currentIHttpRequestFeature = Unsafe.As<TFeature?, IHttpRequestFeature?>(ref feature); 664_currentIHttpResponseFeature = Unsafe.As<TFeature?, IHttpResponseFeature?>(ref feature); 668_currentIHttpResponseBodyFeature = Unsafe.As<TFeature?, IHttpResponseBodyFeature?>(ref feature); 672_currentIRouteValuesFeature = Unsafe.As<TFeature?, IRouteValuesFeature?>(ref feature); 676_currentIEndpointFeature = Unsafe.As<TFeature?, IEndpointFeature?>(ref feature); 680_currentIServiceProvidersFeature = Unsafe.As<TFeature?, IServiceProvidersFeature?>(ref feature); 684_currentIHttpActivityFeature = Unsafe.As<TFeature?, IHttpActivityFeature?>(ref feature); 688_currentIHttpMetricsTagsFeature = Unsafe.As<TFeature?, IHttpMetricsTagsFeature?>(ref feature); 692_currentIItemsFeature = Unsafe.As<TFeature?, IItemsFeature?>(ref feature); 696_currentIQueryFeature = Unsafe.As<TFeature?, IQueryFeature?>(ref feature); 700_currentIRequestBodyPipeFeature = Unsafe.As<TFeature?, IRequestBodyPipeFeature?>(ref feature); 704_currentIFormFeature = Unsafe.As<TFeature?, IFormFeature?>(ref feature); 708_currentIHttpAuthenticationFeature = Unsafe.As<TFeature?, IHttpAuthenticationFeature?>(ref feature); 712_currentIHttpRequestIdentifierFeature = Unsafe.As<TFeature?, IHttpRequestIdentifierFeature?>(ref feature); 716_currentIHttpConnectionFeature = Unsafe.As<TFeature?, IHttpConnectionFeature?>(ref feature); 720_currentISessionFeature = Unsafe.As<TFeature?, ISessionFeature?>(ref feature); 724_currentIResponseCookiesFeature = Unsafe.As<TFeature?, IResponseCookiesFeature?>(ref feature); 728_currentIHttpRequestTrailersFeature = Unsafe.As<TFeature?, IHttpRequestTrailersFeature?>(ref feature); 732_currentIHttpResponseTrailersFeature = Unsafe.As<TFeature?, IHttpResponseTrailersFeature?>(ref feature); 736_currentITlsConnectionFeature = Unsafe.As<TFeature?, ITlsConnectionFeature?>(ref feature); 740_currentIHttpExtendedConnectFeature = Unsafe.As<TFeature?, IHttpExtendedConnectFeature?>(ref feature); 744_currentIHttpUpgradeFeature = Unsafe.As<TFeature?, IHttpUpgradeFeature?>(ref feature); 748_currentIHttpWebSocketFeature = Unsafe.As<TFeature?, IHttpWebSocketFeature?>(ref feature); 752_currentIHttpWebTransportFeature = Unsafe.As<TFeature?, IHttpWebTransportFeature?>(ref feature); 756_currentIBadRequestExceptionFeature = Unsafe.As<TFeature?, IBadRequestExceptionFeature?>(ref feature); 760_currentIHttpRequestTimeoutFeature = Unsafe.As<TFeature?, IHttpRequestTimeoutFeature?>(ref feature); 764_currentIHttp2StreamIdFeature = Unsafe.As<TFeature?, IHttp2StreamIdFeature?>(ref feature); 768_currentIHttpRequestLifetimeFeature = Unsafe.As<TFeature?, IHttpRequestLifetimeFeature?>(ref feature); 772_currentIHttpMaxRequestBodySizeFeature = Unsafe.As<TFeature?, IHttpMaxRequestBodySizeFeature?>(ref feature); 776_currentIHttpMinRequestBodyDataRateFeature = Unsafe.As<TFeature?, IHttpMinRequestBodyDataRateFeature?>(ref feature); 780_currentIHttpMinResponseDataRateFeature = Unsafe.As<TFeature?, IHttpMinResponseDataRateFeature?>(ref feature); 784_currentIHttpBodyControlFeature = Unsafe.As<TFeature?, IHttpBodyControlFeature?>(ref feature); 788_currentIHttpRequestBodyDetectionFeature = Unsafe.As<TFeature?, IHttpRequestBodyDetectionFeature?>(ref feature); 792_currentIHttpResetFeature = Unsafe.As<TFeature?, IHttpResetFeature?>(ref feature); 796_currentIPersistentStateFeature = Unsafe.As<TFeature?, IPersistentStateFeature?>(ref feature);
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (1)
171ref Unsafe.As<char, byte>(
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (28)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (28)
274feature = Unsafe.As<IConnectionIdFeature?, TFeature?>(ref _currentIConnectionIdFeature); 278feature = Unsafe.As<IConnectionTransportFeature?, TFeature?>(ref _currentIConnectionTransportFeature); 282feature = Unsafe.As<IConnectionItemsFeature?, TFeature?>(ref _currentIConnectionItemsFeature); 286feature = Unsafe.As<IPersistentStateFeature?, TFeature?>(ref _currentIPersistentStateFeature); 290feature = Unsafe.As<IMemoryPoolFeature?, TFeature?>(ref _currentIMemoryPoolFeature); 294feature = Unsafe.As<IConnectionLifetimeFeature?, TFeature?>(ref _currentIConnectionLifetimeFeature); 298feature = Unsafe.As<IConnectionSocketFeature?, TFeature?>(ref _currentIConnectionSocketFeature); 302feature = Unsafe.As<IProtocolErrorCodeFeature?, TFeature?>(ref _currentIProtocolErrorCodeFeature); 306feature = Unsafe.As<IStreamDirectionFeature?, TFeature?>(ref _currentIStreamDirectionFeature); 310feature = Unsafe.As<IStreamIdFeature?, TFeature?>(ref _currentIStreamIdFeature); 314feature = Unsafe.As<IStreamAbortFeature?, TFeature?>(ref _currentIStreamAbortFeature); 318feature = Unsafe.As<IStreamClosedFeature?, TFeature?>(ref _currentIStreamClosedFeature); 322feature = Unsafe.As<IConnectionMetricsTagsFeature?, TFeature?>(ref _currentIConnectionMetricsTagsFeature); 326feature = Unsafe.As<IConnectionEndPointFeature?, TFeature?>(ref _currentIConnectionEndPointFeature); 350_currentIConnectionIdFeature = Unsafe.As<TFeature?, IConnectionIdFeature?>(ref feature); 354_currentIConnectionTransportFeature = Unsafe.As<TFeature?, IConnectionTransportFeature?>(ref feature); 358_currentIConnectionItemsFeature = Unsafe.As<TFeature?, IConnectionItemsFeature?>(ref feature); 362_currentIPersistentStateFeature = Unsafe.As<TFeature?, IPersistentStateFeature?>(ref feature); 366_currentIMemoryPoolFeature = Unsafe.As<TFeature?, IMemoryPoolFeature?>(ref feature); 370_currentIConnectionLifetimeFeature = Unsafe.As<TFeature?, IConnectionLifetimeFeature?>(ref feature); 374_currentIConnectionSocketFeature = Unsafe.As<TFeature?, IConnectionSocketFeature?>(ref feature); 378_currentIProtocolErrorCodeFeature = Unsafe.As<TFeature?, IProtocolErrorCodeFeature?>(ref feature); 382_currentIStreamDirectionFeature = Unsafe.As<TFeature?, IStreamDirectionFeature?>(ref feature); 386_currentIStreamIdFeature = Unsafe.As<TFeature?, IStreamIdFeature?>(ref feature); 390_currentIStreamAbortFeature = Unsafe.As<TFeature?, IStreamAbortFeature?>(ref feature); 394_currentIStreamClosedFeature = Unsafe.As<TFeature?, IStreamClosedFeature?>(ref feature); 398_currentIConnectionMetricsTagsFeature = Unsafe.As<TFeature?, IConnectionMetricsTagsFeature?>(ref feature); 402_currentIConnectionEndPointFeature = Unsafe.As<TFeature?, IConnectionEndPointFeature?>(ref feature);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (28)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (28)
274feature = Unsafe.As<IConnectionIdFeature?, TFeature?>(ref _currentIConnectionIdFeature); 278feature = Unsafe.As<IConnectionTransportFeature?, TFeature?>(ref _currentIConnectionTransportFeature); 282feature = Unsafe.As<IConnectionItemsFeature?, TFeature?>(ref _currentIConnectionItemsFeature); 286feature = Unsafe.As<IPersistentStateFeature?, TFeature?>(ref _currentIPersistentStateFeature); 290feature = Unsafe.As<IMemoryPoolFeature?, TFeature?>(ref _currentIMemoryPoolFeature); 294feature = Unsafe.As<IConnectionLifetimeFeature?, TFeature?>(ref _currentIConnectionLifetimeFeature); 298feature = Unsafe.As<IConnectionSocketFeature?, TFeature?>(ref _currentIConnectionSocketFeature); 302feature = Unsafe.As<IProtocolErrorCodeFeature?, TFeature?>(ref _currentIProtocolErrorCodeFeature); 306feature = Unsafe.As<IStreamDirectionFeature?, TFeature?>(ref _currentIStreamDirectionFeature); 310feature = Unsafe.As<IStreamIdFeature?, TFeature?>(ref _currentIStreamIdFeature); 314feature = Unsafe.As<IStreamAbortFeature?, TFeature?>(ref _currentIStreamAbortFeature); 318feature = Unsafe.As<IStreamClosedFeature?, TFeature?>(ref _currentIStreamClosedFeature); 322feature = Unsafe.As<IConnectionMetricsTagsFeature?, TFeature?>(ref _currentIConnectionMetricsTagsFeature); 326feature = Unsafe.As<IConnectionEndPointFeature?, TFeature?>(ref _currentIConnectionEndPointFeature); 350_currentIConnectionIdFeature = Unsafe.As<TFeature?, IConnectionIdFeature?>(ref feature); 354_currentIConnectionTransportFeature = Unsafe.As<TFeature?, IConnectionTransportFeature?>(ref feature); 358_currentIConnectionItemsFeature = Unsafe.As<TFeature?, IConnectionItemsFeature?>(ref feature); 362_currentIPersistentStateFeature = Unsafe.As<TFeature?, IPersistentStateFeature?>(ref feature); 366_currentIMemoryPoolFeature = Unsafe.As<TFeature?, IMemoryPoolFeature?>(ref feature); 370_currentIConnectionLifetimeFeature = Unsafe.As<TFeature?, IConnectionLifetimeFeature?>(ref feature); 374_currentIConnectionSocketFeature = Unsafe.As<TFeature?, IConnectionSocketFeature?>(ref feature); 378_currentIProtocolErrorCodeFeature = Unsafe.As<TFeature?, IProtocolErrorCodeFeature?>(ref feature); 382_currentIStreamDirectionFeature = Unsafe.As<TFeature?, IStreamDirectionFeature?>(ref feature); 386_currentIStreamIdFeature = Unsafe.As<TFeature?, IStreamIdFeature?>(ref feature); 390_currentIStreamAbortFeature = Unsafe.As<TFeature?, IStreamAbortFeature?>(ref feature); 394_currentIStreamClosedFeature = Unsafe.As<TFeature?, IStreamClosedFeature?>(ref feature); 398_currentIConnectionMetricsTagsFeature = Unsafe.As<TFeature?, IConnectionMetricsTagsFeature?>(ref feature); 402_currentIConnectionEndPointFeature = Unsafe.As<TFeature?, IConnectionEndPointFeature?>(ref feature);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (45)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (28)
274feature = Unsafe.As<IConnectionIdFeature?, TFeature?>(ref _currentIConnectionIdFeature); 278feature = Unsafe.As<IConnectionTransportFeature?, TFeature?>(ref _currentIConnectionTransportFeature); 282feature = Unsafe.As<IConnectionItemsFeature?, TFeature?>(ref _currentIConnectionItemsFeature); 286feature = Unsafe.As<IPersistentStateFeature?, TFeature?>(ref _currentIPersistentStateFeature); 290feature = Unsafe.As<IMemoryPoolFeature?, TFeature?>(ref _currentIMemoryPoolFeature); 294feature = Unsafe.As<IConnectionLifetimeFeature?, TFeature?>(ref _currentIConnectionLifetimeFeature); 298feature = Unsafe.As<IConnectionSocketFeature?, TFeature?>(ref _currentIConnectionSocketFeature); 302feature = Unsafe.As<IProtocolErrorCodeFeature?, TFeature?>(ref _currentIProtocolErrorCodeFeature); 306feature = Unsafe.As<IStreamDirectionFeature?, TFeature?>(ref _currentIStreamDirectionFeature); 310feature = Unsafe.As<IStreamIdFeature?, TFeature?>(ref _currentIStreamIdFeature); 314feature = Unsafe.As<IStreamAbortFeature?, TFeature?>(ref _currentIStreamAbortFeature); 318feature = Unsafe.As<IStreamClosedFeature?, TFeature?>(ref _currentIStreamClosedFeature); 322feature = Unsafe.As<IConnectionMetricsTagsFeature?, TFeature?>(ref _currentIConnectionMetricsTagsFeature); 326feature = Unsafe.As<IConnectionEndPointFeature?, TFeature?>(ref _currentIConnectionEndPointFeature); 350_currentIConnectionIdFeature = Unsafe.As<TFeature?, IConnectionIdFeature?>(ref feature); 354_currentIConnectionTransportFeature = Unsafe.As<TFeature?, IConnectionTransportFeature?>(ref feature); 358_currentIConnectionItemsFeature = Unsafe.As<TFeature?, IConnectionItemsFeature?>(ref feature); 362_currentIPersistentStateFeature = Unsafe.As<TFeature?, IPersistentStateFeature?>(ref feature); 366_currentIMemoryPoolFeature = Unsafe.As<TFeature?, IMemoryPoolFeature?>(ref feature); 370_currentIConnectionLifetimeFeature = Unsafe.As<TFeature?, IConnectionLifetimeFeature?>(ref feature); 374_currentIConnectionSocketFeature = Unsafe.As<TFeature?, IConnectionSocketFeature?>(ref feature); 378_currentIProtocolErrorCodeFeature = Unsafe.As<TFeature?, IProtocolErrorCodeFeature?>(ref feature); 382_currentIStreamDirectionFeature = Unsafe.As<TFeature?, IStreamDirectionFeature?>(ref feature); 386_currentIStreamIdFeature = Unsafe.As<TFeature?, IStreamIdFeature?>(ref feature); 390_currentIStreamAbortFeature = Unsafe.As<TFeature?, IStreamAbortFeature?>(ref feature); 394_currentIStreamClosedFeature = Unsafe.As<TFeature?, IStreamClosedFeature?>(ref feature); 398_currentIConnectionMetricsTagsFeature = Unsafe.As<TFeature?, IConnectionMetricsTagsFeature?>(ref feature); 402_currentIConnectionEndPointFeature = Unsafe.As<TFeature?, IConnectionEndPointFeature?>(ref feature);
src\aspnetcore\src\Servers\Kestrel\shared\TransportMultiplexedConnection.Generated.cs (16)
213feature = Unsafe.As<IConnectionIdFeature?, TFeature?>(ref _currentIConnectionIdFeature); 217feature = Unsafe.As<IConnectionTransportFeature?, TFeature?>(ref _currentIConnectionTransportFeature); 221feature = Unsafe.As<IConnectionItemsFeature?, TFeature?>(ref _currentIConnectionItemsFeature); 225feature = Unsafe.As<IMemoryPoolFeature?, TFeature?>(ref _currentIMemoryPoolFeature); 229feature = Unsafe.As<IConnectionLifetimeFeature?, TFeature?>(ref _currentIConnectionLifetimeFeature); 233feature = Unsafe.As<IConnectionEndPointFeature?, TFeature?>(ref _currentIConnectionEndPointFeature); 237feature = Unsafe.As<IProtocolErrorCodeFeature?, TFeature?>(ref _currentIProtocolErrorCodeFeature); 241feature = Unsafe.As<ITlsConnectionFeature?, TFeature?>(ref _currentITlsConnectionFeature); 260_currentIConnectionIdFeature = Unsafe.As<TFeature?, IConnectionIdFeature?>(ref feature); 264_currentIConnectionTransportFeature = Unsafe.As<TFeature?, IConnectionTransportFeature?>(ref feature); 268_currentIConnectionItemsFeature = Unsafe.As<TFeature?, IConnectionItemsFeature?>(ref feature); 272_currentIMemoryPoolFeature = Unsafe.As<TFeature?, IMemoryPoolFeature?>(ref feature); 276_currentIConnectionLifetimeFeature = Unsafe.As<TFeature?, IConnectionLifetimeFeature?>(ref feature); 280_currentIConnectionEndPointFeature = Unsafe.As<TFeature?, IConnectionEndPointFeature?>(ref feature); 284_currentIProtocolErrorCodeFeature = Unsafe.As<TFeature?, IProtocolErrorCodeFeature?>(ref feature); 288_currentITlsConnectionFeature = Unsafe.As<TFeature?, ITlsConnectionFeature?>(ref feature);
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (1)
171ref Unsafe.As<char, byte>(
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (28)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (28)
274feature = Unsafe.As<IConnectionIdFeature?, TFeature?>(ref _currentIConnectionIdFeature); 278feature = Unsafe.As<IConnectionTransportFeature?, TFeature?>(ref _currentIConnectionTransportFeature); 282feature = Unsafe.As<IConnectionItemsFeature?, TFeature?>(ref _currentIConnectionItemsFeature); 286feature = Unsafe.As<IPersistentStateFeature?, TFeature?>(ref _currentIPersistentStateFeature); 290feature = Unsafe.As<IMemoryPoolFeature?, TFeature?>(ref _currentIMemoryPoolFeature); 294feature = Unsafe.As<IConnectionLifetimeFeature?, TFeature?>(ref _currentIConnectionLifetimeFeature); 298feature = Unsafe.As<IConnectionSocketFeature?, TFeature?>(ref _currentIConnectionSocketFeature); 302feature = Unsafe.As<IProtocolErrorCodeFeature?, TFeature?>(ref _currentIProtocolErrorCodeFeature); 306feature = Unsafe.As<IStreamDirectionFeature?, TFeature?>(ref _currentIStreamDirectionFeature); 310feature = Unsafe.As<IStreamIdFeature?, TFeature?>(ref _currentIStreamIdFeature); 314feature = Unsafe.As<IStreamAbortFeature?, TFeature?>(ref _currentIStreamAbortFeature); 318feature = Unsafe.As<IStreamClosedFeature?, TFeature?>(ref _currentIStreamClosedFeature); 322feature = Unsafe.As<IConnectionMetricsTagsFeature?, TFeature?>(ref _currentIConnectionMetricsTagsFeature); 326feature = Unsafe.As<IConnectionEndPointFeature?, TFeature?>(ref _currentIConnectionEndPointFeature); 350_currentIConnectionIdFeature = Unsafe.As<TFeature?, IConnectionIdFeature?>(ref feature); 354_currentIConnectionTransportFeature = Unsafe.As<TFeature?, IConnectionTransportFeature?>(ref feature); 358_currentIConnectionItemsFeature = Unsafe.As<TFeature?, IConnectionItemsFeature?>(ref feature); 362_currentIPersistentStateFeature = Unsafe.As<TFeature?, IPersistentStateFeature?>(ref feature); 366_currentIMemoryPoolFeature = Unsafe.As<TFeature?, IMemoryPoolFeature?>(ref feature); 370_currentIConnectionLifetimeFeature = Unsafe.As<TFeature?, IConnectionLifetimeFeature?>(ref feature); 374_currentIConnectionSocketFeature = Unsafe.As<TFeature?, IConnectionSocketFeature?>(ref feature); 378_currentIProtocolErrorCodeFeature = Unsafe.As<TFeature?, IProtocolErrorCodeFeature?>(ref feature); 382_currentIStreamDirectionFeature = Unsafe.As<TFeature?, IStreamDirectionFeature?>(ref feature); 386_currentIStreamIdFeature = Unsafe.As<TFeature?, IStreamIdFeature?>(ref feature); 390_currentIStreamAbortFeature = Unsafe.As<TFeature?, IStreamAbortFeature?>(ref feature); 394_currentIStreamClosedFeature = Unsafe.As<TFeature?, IStreamClosedFeature?>(ref feature); 398_currentIConnectionMetricsTagsFeature = Unsafe.As<TFeature?, IConnectionMetricsTagsFeature?>(ref feature); 402_currentIConnectionEndPointFeature = Unsafe.As<TFeature?, IConnectionEndPointFeature?>(ref feature);
Microsoft.Build.Framework (2)
Coordinator\Messages\Message.cs (2)
49=> Unsafe.As<TMessageType, byte>(ref messageType); 52=> Unsafe.As<byte, TMessageType>(ref typeByte);
Microsoft.CodeAnalysis.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
150return Unsafe.As<TFromEnum, TToEnum>(ref value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ModifierExtensions.cs (1)
16return Unsafe.As<Modifiers, DeclarationModifiers>(ref modifiers);
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
150return Unsafe.As<TFromEnum, TToEnum>(ref value);
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
150return Unsafe.As<TFromEnum, TToEnum>(ref value);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ModifierExtensions.cs (1)
16return Unsafe.As<Modifiers, DeclarationModifiers>(ref modifiers);
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
2236var result = (TypeKind)Volatile.Read(ref Unsafe.As<TypeKind, byte>(ref _lazyKind));
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
150return Unsafe.As<TFromEnum, TToEnum>(ref value);
Microsoft.CodeAnalysis.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
150return Unsafe.As<TFromEnum, TToEnum>(ref value);
Microsoft.Data.Analysis (12)
PrimitiveColumnContainer.cs (1)
558ReadOnlyDataFrameBuffer<bool> boolLocalBuffer = Unsafe.As<ReadOnlyDataFrameBuffer<T>, ReadOnlyDataFrameBuffer<bool>>(ref localBuffer);
PrimitiveDataFrameColumn.cs (9)
1058newColumn._columnContainer.HandleOperation(operation, Unsafe.As<U, T>(ref value)); 1093newColumn._columnContainer.HandleOperation(operation, Unsafe.As<U, T>(ref value)); 1135newColumn._columnContainer.HandleReverseOperation(operation, Unsafe.As<U, T>(ref value)); 1169newColumn._columnContainer.HandleReverseOperation(operation, Unsafe.As<U, T>(ref value)); 1207retColumn._columnContainer.HandleOperation(operation, Unsafe.As<U, bool>(ref value)); 1364return new BooleanDataFrameColumn(Name, (this as PrimitiveDataFrameColumn<bool>)._columnContainer.HandleOperation(operation, Unsafe.As<U, bool>(ref value))); 1374return new BooleanDataFrameColumn(Name, primitiveColumn._columnContainer.HandleOperation(operation, Unsafe.As<U, T>(ref value))); 1386return new BooleanDataFrameColumn(Name, (this as PrimitiveDataFrameColumn<DateTime>)._columnContainer.HandleOperation(operation, Unsafe.As<U, DateTime>(ref value))); 1406return new BooleanDataFrameColumn(Name, primitiveColumn._columnContainer.HandleOperation(operation, Unsafe.As<U, T>(ref value)));
PrimitiveDataFrameColumn.Sort.cs (1)
63ReadOnlyMemory<T> typedBuffer = Unsafe.As<ReadOnlyMemory<byte>, ReadOnlyMemory<T>>(ref buffer);
ReadOnlyDataFrameBuffer.cs (1)
31return Unsafe.As<ReadOnlyMemory<byte>, ReadOnlyMemory<T>>(ref memory);
Microsoft.Extensions.ServiceDiscovery (7)
parent\parent\Shared\FxPolyfills\Interlocked.cs (7)
14(uint)Interlocked.Add(ref Unsafe.As<uint, int>(ref location), -1); 18(ulong)Interlocked.Add(ref Unsafe.As<ulong, long>(ref location), -1); 30(uint)Interlocked.Add(ref Unsafe.As<uint, int>(ref location1), (int)value); 34(ulong)Interlocked.Add(ref Unsafe.As<ulong, long>(ref location1), (long)value); 53(ulong)Interlocked.And(ref Unsafe.As<ulong, long>(ref location1), (long)value); 56(uint)Interlocked.And(ref Unsafe.As<uint, int>(ref location1), (int)value); 92(ulong)Or(ref Unsafe.As<ulong, long>(ref location1), (long)value);
Microsoft.Extensions.ServiceDiscovery.Abstractions (7)
parent\parent\Shared\FxPolyfills\Interlocked.cs (7)
14(uint)Interlocked.Add(ref Unsafe.As<uint, int>(ref location), -1); 18(ulong)Interlocked.Add(ref Unsafe.As<ulong, long>(ref location), -1); 30(uint)Interlocked.Add(ref Unsafe.As<uint, int>(ref location1), (int)value); 34(ulong)Interlocked.Add(ref Unsafe.As<ulong, long>(ref location1), (long)value); 53(ulong)Interlocked.And(ref Unsafe.As<ulong, long>(ref location1), (long)value); 56(uint)Interlocked.And(ref Unsafe.As<uint, int>(ref location1), (int)value); 92(ulong)Or(ref Unsafe.As<ulong, long>(ref location1), (long)value);
Microsoft.Maui.Controls.BindingSourceGen (2)
EquatableArray.cs (2)
17 this.array = Unsafe.As<ImmutableArray<T>, T[]?>(ref array); 65 return Unsafe.As<T[]?, ImmutableArray<T>>(ref Unsafe.AsRef(in this.array));
Microsoft.Private.Windows.Core (82)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\DecimalExtensions.cs (1)
28DecimalAccessor da = Unsafe.As<decimal, DecimalAccessor>(ref d);
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\Threading\InterlockedExtensions.cs (3)
27(uint)Interlocked.Add(ref Unsafe.As<uint, int>(ref location), -1); 36(uint)Interlocked.Exchange(ref Unsafe.As<uint, int>(ref location1), (int)value); 45(uint)Interlocked.Add(ref Unsafe.As<uint, int>(ref location1), (int)value);
System\IO\BinaryReaderExtensions.cs (1)
45return Unsafe.As<long, DateTime>(ref data);
System\IO\BinaryWriterExtensions.cs (1)
23long dateData = Unsafe.As<DateTime, long>(ref value);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
91Unsafe.As<DateTime, ulong>(ref value)).Write(writer);
System\Private\Windows\Ole\Composition.NativeToRuntimeAdapter.cs (7)
30fixed (Com.FORMATETC* nativeFormat = &Unsafe.As<FORMATETC, Com.FORMATETC>(ref pFormatetc)) 68HRESULT result = nativeDataObject.Value->GetCanonicalFormatEtc(Unsafe.As<FORMATETC, Com.FORMATETC>(ref formatIn), out Com.FORMATETC nativeFormat); 69formatOut = Unsafe.As<Com.FORMATETC, FORMATETC>(ref nativeFormat); 75Com.FORMATETC nativeFormat = Unsafe.As<FORMATETC, Com.FORMATETC>(ref format); 85Com.FORMATETC nativeFormat = Unsafe.As<FORMATETC, Com.FORMATETC>(ref format); 96return nativeDataObject.Value->QueryGetData(Unsafe.As<FORMATETC, Com.FORMATETC>(ref format)); 102Com.FORMATETC nativeFormat = Unsafe.As<FORMATETC, Com.FORMATETC>(ref formatIn);
System\Private\Windows\Ole\FormatEnumerator.cs (1)
121rgelt[i] = Unsafe.As<ComTypes.FORMATETC, FORMATETC>(ref elt[i]);
System\SpanReader.cs (1)
144value = Unsafe.ReadUnaligned<TValue>(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(_unread)));
System\Value.cs (59)
604return new(Unsafe.As<T, bool>(ref Unsafe.AsRef(in value))); 606return new(Unsafe.As<T, byte>(ref Unsafe.AsRef(in value))); 608return new(Unsafe.As<T, sbyte>(ref Unsafe.AsRef(in value))); 610return new(Unsafe.As<T, char>(ref Unsafe.AsRef(in value))); 612return new(Unsafe.As<T, short>(ref Unsafe.AsRef(in value))); 614return new(Unsafe.As<T, int>(ref Unsafe.AsRef(in value))); 616return new(Unsafe.As<T, long>(ref Unsafe.AsRef(in value))); 618return new(Unsafe.As<T, ushort>(ref Unsafe.AsRef(in value))); 620return new(Unsafe.As<T, uint>(ref Unsafe.AsRef(in value))); 622return new(Unsafe.As<T, ulong>(ref Unsafe.AsRef(in value))); 624return new(Unsafe.As<T, float>(ref Unsafe.AsRef(in value))); 626return new(Unsafe.As<T, double>(ref Unsafe.AsRef(in value))); 628return new(Unsafe.As<T, DateTime>(ref Unsafe.AsRef(in value))); 630return new(Unsafe.As<T, DateTimeOffset>(ref Unsafe.AsRef(in value))); 632return new(Unsafe.As<T, Color>(ref Unsafe.AsRef(in value))); 635return new(Unsafe.As<T, bool?>(ref Unsafe.AsRef(in value))); 637return new(Unsafe.As<T, byte?>(ref Unsafe.AsRef(in value))); 639return new(Unsafe.As<T, sbyte?>(ref Unsafe.AsRef(in value))); 641return new(Unsafe.As<T, char?>(ref Unsafe.AsRef(in value))); 643return new(Unsafe.As<T, short?>(ref Unsafe.AsRef(in value))); 645return new(Unsafe.As<T, int?>(ref Unsafe.AsRef(in value))); 647return new(Unsafe.As<T, long?>(ref Unsafe.AsRef(in value))); 649return new(Unsafe.As<T, ushort?>(ref Unsafe.AsRef(in value))); 651return new(Unsafe.As<T, uint?>(ref Unsafe.AsRef(in value))); 653return new(Unsafe.As<T, ulong?>(ref Unsafe.AsRef(in value))); 655return new(Unsafe.As<T, float?>(ref Unsafe.AsRef(in value))); 657return new(Unsafe.As<T, double?>(ref Unsafe.AsRef(in value))); 659return new(Unsafe.As<T, DateTime?>(ref Unsafe.AsRef(in value))); 661return new(Unsafe.As<T, DateTimeOffset?>(ref Unsafe.AsRef(in value))); 664return new(Unsafe.As<T, ArraySegment<byte>>(ref Unsafe.AsRef(in value))); 666return new(Unsafe.As<T, ArraySegment<char>>(ref Unsafe.AsRef(in value))); 671return new Value(StraightCastFlag<T>.Instance, Unsafe.As<T, ulong>(ref value)); 716value = Unsafe.As<Union, T>(ref Unsafe.AsRef(in _union)); 722value = Unsafe.As<Color, T>(ref Unsafe.AsRef(in color)); 727value = Unsafe.As<DateTime, T>(ref Unsafe.AsRef(in _union.DateTime)); 733value = Unsafe.As<DateTimeOffset, T>(ref Unsafe.AsRef(in dto)); 739value = Unsafe.As<DateTimeOffset, T>(ref Unsafe.AsRef(in dto)); 784value = Unsafe.As<ArraySegment<byte>, T>(ref segment); 800value = Unsafe.As<ArraySegment<char>, T>(ref segment); 811value = Unsafe.As<int?, T>(ref Unsafe.AsRef(in @int)); 817value = Unsafe.As<long?, T>(ref Unsafe.AsRef(in @long)); 823value = Unsafe.As<bool?, T>(ref Unsafe.AsRef(in @bool)); 829value = Unsafe.As<float?, T>(ref Unsafe.AsRef(in single)); 835value = Unsafe.As<double?, T>(ref Unsafe.AsRef(in @double)); 841value = Unsafe.As<uint?, T>(ref Unsafe.AsRef(in @uint)); 847value = Unsafe.As<ulong?, T>(ref Unsafe.AsRef(in @ulong)); 853value = Unsafe.As<char?, T>(ref Unsafe.AsRef(in @char)); 859value = Unsafe.As<short?, T>(ref Unsafe.AsRef(in @short)); 865value = Unsafe.As<ushort?, T>(ref Unsafe.AsRef(in @ushort)); 871value = Unsafe.As<byte?, T>(ref Unsafe.AsRef(in @byte)); 877value = Unsafe.As<sbyte?, T>(ref Unsafe.AsRef(in @sbyte)); 883value = Unsafe.As<Color?, T>(ref Unsafe.AsRef(in color)); 889value = Unsafe.As<DateTime?, T>(ref Unsafe.AsRef(in dateTime)); 895value = Unsafe.As<DateTimeOffset?, T>(ref Unsafe.AsRef(in dto)); 901value = Unsafe.As<DateTimeOffset?, T>(ref Unsafe.AsRef(in dto)); 920value = Unsafe.As<NullableTemplate<byte>, T>(ref Unsafe.AsRef(in byteTemplate)); 925value = Unsafe.As<NullableTemplate<ushort>, T>(ref Unsafe.AsRef(in ushortTemplate)); 930value = Unsafe.As<NullableTemplate<uint>, T>(ref Unsafe.AsRef(in uintTemplate)); 935value = Unsafe.As<NullableTemplate<ulong>, T>(ref Unsafe.AsRef(in ulongTemplate));
System\Value.PackedColor.cs (1)
35CastColor castColor = Unsafe.As<Color, CastColor>(ref Unsafe.AsRef(in color));
System\Value.StraightCastFlag.cs (1)
16public override T To(in Value value) => Unsafe.As<Union, T>(ref Unsafe.AsRef(in value._union));
Windows\Win32\Foundation\HandleRef.cs (2)
57return new(handle.Wrapper, Unsafe.As<THandle, nint>(ref local)); 68return new(handle.Wrapper, Unsafe.As<nint, THandle>(ref local));
Windows\Win32\Graphics\Gdi\ArgbBuffer.cs (1)
38ref Unsafe.As<ARGB, uint>(ref _bufferScope.GetPinnableReference());
Windows\Win32\Graphics\Gdi\HDC.cs (1)
24return Unsafe.As<XFORM, Matrix3x2>(ref matrix);
Windows\Win32\System\Com\IID.cs (1)
18return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EnumValueUtilities.cs (1)
150return Unsafe.As<TFromEnum, TToEnum>(ref value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ModifierExtensions.cs (1)
16return Unsafe.As<Modifiers, DeclarationModifiers>(ref modifiers);
System.DirectoryServices.Protocols (1)
System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs (1)
118internal ref readonly byte GetPinnableReference() => ref Unsafe.As<SecurityProtocol, byte>(ref _securityProtocol);
System.Drawing.Common (1)
System\Drawing\SystemFonts.cs (1)
268GetFontFromData(Unsafe.As<LOGFONTW, LOGFONT>(ref Unsafe.AsRef(in logFont)));
System.Memory (2)
System\Buffers\ReadOnlySequence.cs (1)
494ReadOnlySequence<char> charSequence = Unsafe.As<ReadOnlySequence<T>, ReadOnlySequence<char>>(ref localThis);
System\Buffers\ReadOnlySequence.Helpers.cs (1)
688return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As<char, T>(ref MemoryMarshal.GetReference(spanOfChar)), spanOfChar.Length);
System.Net.Quic (2)
System\Net\Quic\Internal\ResettableValueTaskSource.cs (1)
58public bool IsCompleted => (State)Volatile.Read(ref Unsafe.As<State, byte>(ref _state)) == State.Completed;
System\Net\Quic\Internal\ValueTaskSource.cs (1)
41public bool IsCompleted => (State)Volatile.Read(ref Unsafe.As<State, byte>(ref _state)) == State.Completed;
System.Net.Sockets (1)
System\Net\Sockets\SocketAsyncContext.Unix.cs (1)
820QueueState state = (QueueState)Volatile.Read(ref Unsafe.As<QueueState, int>(ref _state));
System.Numerics.Tensors (49)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IAggregationOperator.cs (24)
2396ref Unsafe.As<byte, T>(ref MemoryMarshal.GetReference(AlignmentByteMask_64x65)), 2403ref Unsafe.As<ushort, T>(ref MemoryMarshal.GetReference(AlignmentUInt16Mask_32x33)), 2410ref Unsafe.As<uint, T>(ref MemoryMarshal.GetReference(AlignmentUInt32Mask_16x17)), 2417ref Unsafe.As<ulong, T>(ref MemoryMarshal.GetReference(AlignmentUInt64Mask_8x9)), 2432ref Unsafe.As<byte, T>(ref MemoryMarshal.GetReference(AlignmentByteMask_64x65)), 2439ref Unsafe.As<ushort, T>(ref MemoryMarshal.GetReference(AlignmentUInt16Mask_32x33)), 2446ref Unsafe.As<uint, T>(ref MemoryMarshal.GetReference(AlignmentUInt32Mask_16x17)), 2453ref Unsafe.As<ulong, T>(ref MemoryMarshal.GetReference(AlignmentUInt64Mask_8x9)), 2468ref Unsafe.As<byte, T>(ref MemoryMarshal.GetReference(AlignmentByteMask_64x65)), 2475ref Unsafe.As<ushort, T>(ref MemoryMarshal.GetReference(AlignmentUInt16Mask_32x33)), 2482ref Unsafe.As<uint, T>(ref MemoryMarshal.GetReference(AlignmentUInt32Mask_16x17)), 2489ref Unsafe.As<ulong, T>(ref MemoryMarshal.GetReference(AlignmentUInt64Mask_8x9)), 2504ref Unsafe.As<byte, T>(ref MemoryMarshal.GetReference(RemainderByteMask_64x65)), 2511ref Unsafe.As<ushort, T>(ref MemoryMarshal.GetReference(RemainderUInt16Mask_32x33)), 2518ref Unsafe.As<uint, T>(ref MemoryMarshal.GetReference(RemainderUInt32Mask_16x17)), 2525ref Unsafe.As<ulong, T>(ref MemoryMarshal.GetReference(RemainderUInt64Mask_8x9)), 2540ref Unsafe.As<byte, T>(ref MemoryMarshal.GetReference(RemainderByteMask_64x65)), 2547ref Unsafe.As<ushort, T>(ref MemoryMarshal.GetReference(RemainderUInt16Mask_32x33)), 2554ref Unsafe.As<uint, T>(ref MemoryMarshal.GetReference(RemainderUInt32Mask_16x17)), 2561ref Unsafe.As<ulong, T>(ref MemoryMarshal.GetReference(RemainderUInt64Mask_8x9)), 2576ref Unsafe.As<byte, T>(ref MemoryMarshal.GetReference(RemainderByteMask_64x65)), 2583ref Unsafe.As<ushort, T>(ref MemoryMarshal.GetReference(RemainderUInt16Mask_32x33)), 2590ref Unsafe.As<uint, T>(ref MemoryMarshal.GetReference(RemainderUInt32Mask_16x17)), 2597ref Unsafe.As<ulong, T>(ref MemoryMarshal.GetReference(RemainderUInt64Mask_8x9)),
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBooleanUnaryOperator.cs (12)
243(v & Vector512<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 274(v & Vector256<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 305(v & Vector128<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 354(v & Vector512<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 388(v & Vector256<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 422(v & Vector128<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 475(v & Vector512<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 513(v & Vector256<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 551(v & Vector128<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 612(v & Vector512<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 660(v & Vector256<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i); 708(v & Vector128<byte>.One).StoreUnsafe(ref Unsafe.As<bool, byte>(ref destinationRef), (uint)i);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (3)
155? ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)) 182? ref Unsafe.Add(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), linearOffset) 324ref Unsafe.As<TDerived, T>(ref items._reference),
System\Numerics\Tensors\netcore\TensorPrimitives.CosineSimilarity.cs (6)
203ref short xRef = ref Unsafe.As<Half, short>(ref MemoryMarshal.GetReference(x)); 204ref short yRef = ref Unsafe.As<Half, short>(ref MemoryMarshal.GetReference(y)); 245ref short xRef = ref Unsafe.As<Half, short>(ref MemoryMarshal.GetReference(x)); 246ref short yRef = ref Unsafe.As<Half, short>(ref MemoryMarshal.GetReference(y)); 287ref short xRef = ref Unsafe.As<Half, short>(ref MemoryMarshal.GetReference(x)); 288ref short yRef = ref Unsafe.As<Half, short>(ref MemoryMarshal.GetReference(y));
System\Numerics\Tensors\netcore\TensorPrimitives.HammingDistance.cs (2)
55MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(x)), x.Length), 56MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(y)), y.Length));
System\Numerics\Tensors\netcore\TensorSpan_1.cs (2)
101? ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)) 113? ref Unsafe.Add(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), linearOffset)
System.Private.CoreLib (882)
Internal\Runtime\Augments\RuntimeAugments.cs (9)
164ref object element = ref Unsafe.Add(ref Unsafe.As<byte, object>(ref MemoryMarshal.GetArrayDataReference(array)), flattenedIndex); 269return ReflectionPointer.Box((void*)Unsafe.As<byte, IntPtr>(ref address), Type.GetTypeFromHandle(fieldType)); 274Volatile.Write<object>(ref Unsafe.As<IntPtr, object>(ref *(IntPtr*)address), fieldValue); 279return Volatile.Read<object>(ref Unsafe.As<IntPtr, object>(ref *(IntPtr*)address)); 285Volatile.Write<object>(ref Unsafe.As<byte, object>(ref address), fieldValue); 291return Unsafe.As<byte, object>(ref address); 316Unsafe.As<byte, object>(ref Unsafe.Add<byte>(ref typedReference.Value, fieldOffset)) = fieldValue; 324return Unsafe.As<byte, object>(ref Unsafe.Add<byte>(ref typedReference.Value, fieldOffset)); 331IntPtr ptrValue = Unsafe.As<byte, IntPtr>(ref Unsafe.Add<byte>(ref typedReference.Value, fieldOffset));
Internal\Runtime\FrozenObjectHeapManager.cs (1)
88return Unsafe.As<IntPtr, object>(ref result);
src\runtime\src\coreclr\nativeaot\Common\src\Internal\Runtime\CompilerHelpers\StartupCodeHelpers.cs (2)
141ref object rawSpineIndexData = ref Unsafe.As<byte, object>(ref Unsafe.As<RawArrayData>(gcStaticBaseSpines).Data); 194ref object rawSpineData = ref Unsafe.As<byte, object>(ref Unsafe.As<RawArrayData>(spine).Data);
src\runtime\src\coreclr\nativeaot\Common\src\Internal\Runtime\MethodTable.cs (2)
1280return ref Unsafe.As<byte, T>(ref *((byte*)Unsafe.AsPointer(ref this) + GetFieldOffset(eField))); 1286return ref Unsafe.As<byte, T>(ref *((byte*)Unsafe.AsPointer(ref this) + offset));
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\CachedInterfaceDispatch.cs (1)
31RuntimeImports.RhpRegisterDispatchCache(ref Unsafe.As<GenericCache<Key, nint>, byte>(ref s_cache));
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\RuntimeExports.cs (2)
180return Unsafe.As<byte, object>(ref data); 273Unsafe.As<byte, bool>(ref data) = true;
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (6)
99return Unsafe.As<byte, object>(ref Unsafe.Add(ref data, (DataOffset - PointerSize) + index * PointerSize)); 122execContext = Unsafe.As<byte, ExecutionContext?>(ref Unsafe.Add(ref data, (DataOffset - PointerSize) + index * PointerSize)); 133Unsafe.As<byte, Exception>(ref Unsafe.Add(ref data, (DataOffset - PointerSize) + index * PointerSize)) = ex; 487vtsCont.Initialize(Unsafe.As<object, IValueTaskSource>(ref obj), valueTask._token); 575vtsCont.Initialize<T>(Unsafe.As<object, IValueTaskSource<T>>(ref obj), valueTask._token); 1183private ref byte GetResultStorage() => ref Unsafe.As<T?, byte>(ref m_result);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.ValueTaskSourceContinuation.cs (5)
55IValueTaskSource typedSource = Unsafe.As<object, IValueTaskSource>(ref source); 62IValueTaskSource typedSource = Unsafe.As<object, IValueTaskSource>(ref source); 69IValueTaskSource<T> typedSource = Unsafe.As<object, IValueTaskSource<T>>(ref source); 76IValueTaskSource<T> typedSource = Unsafe.As<object, IValueTaskSource<T>>(ref source); 77Unsafe.As<byte, T>(ref result) = typedSource.GetResult(token);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.CoreCLR.cs (1)
256info.ContinuationTable = ref Unsafe.As<ContinuationWrapperTable, nint>(ref s_continuationWrappers);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeAsyncTaskContinuation.cs (2)
138Task<T> taskOfT = Unsafe.As<Task, Task<T>>(ref task); 140Unsafe.As<byte, T>(ref result) = taskOfT.ResultOnSuccess;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.cs (19)
543ref object? srcData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(sourceArray)), sourceIndex); 589ref object? destData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(destinationArray)), destinationIndex); 611ref object? srcData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(sourceArray)), sourceIndex); 612ref object? destData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(destinationArray)), destinationIndex); 680SpanHelpers.ClearWithReferences(ref Unsafe.As<byte, IntPtr>(ref pStart), totalByteLength / (nuint)sizeof(IntPtr)); 701lowerBound = Unsafe.Add(ref Unsafe.As<byte, int>(ref p), rank); 716SpanHelpers.ClearWithReferences(ref Unsafe.As<byte, IntPtr>(ref ptr), byteLength / (uint)sizeof(IntPtr)); 1344=> UnsafeArrayAsSpan<T>(array, adjustedIndex, length).BinarySearch(Unsafe.As<byte, T>(ref value.GetRawData())); 1852=> UnsafeArrayAsSpan<T>(array, adjustedIndex, length).IndexOf(Unsafe.As<byte, T>(ref value.GetRawData())); 1919ref Unsafe.Add(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex), 1927ref Unsafe.Add(ref Unsafe.As<T, short>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex), 1935ref Unsafe.Add(ref Unsafe.As<T, int>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex), 1943ref Unsafe.Add(ref Unsafe.As<T, long>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex), 2079=> UnsafeArrayAsSpan<T>(array, adjustedIndex, length).LastIndexOf(Unsafe.As<byte, T>(ref value.GetRawData())); 2164ref Unsafe.Add(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex), 2174ref Unsafe.Add(ref Unsafe.As<T, short>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex), 2184ref Unsafe.Add(ref Unsafe.As<T, int>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex), 2194ref Unsafe.Add(ref Unsafe.As<T, long>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex), 3073new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffer.cs (4)
138ref Unsafe.As<T, byte>(ref destination), 139ref Unsafe.As<T, byte>(ref source), 146ref Unsafe.As<T, byte>(ref destination), 147ref Unsafe.As<T, byte>(ref source),
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Integer.Signed.cs (4)
59return TryParseByteX(source, out Unsafe.As<sbyte, byte>(ref value), out bytesConsumed); 111return TryParseUInt16X(source, out Unsafe.As<short, ushort>(ref value), out bytesConsumed); 163return TryParseUInt32X(source, out Unsafe.As<int, uint>(ref value), out bytesConsumed); 215return TryParseUInt64X(source, out Unsafe.As<long, ulong>(ref value), out bytesConsumed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ByReference.cs (1)
17public static ByReference Create<T>(ref T p) => new ByReference(ref Unsafe.As<T, byte>(ref p));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\RandomizedStringEqualityComparer.cs (1)
90ref Unsafe.As<char, byte>(ref MemoryMarshal.GetReference(alternate)),
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (4)
25private static ref DecCalc AsMutable(ref decimal d) => ref Unsafe.As<decimal, DecCalc>(ref d); 2191int cmp = VarDecCmpSub(in Unsafe.As<DecCalc, decimal>(ref d1), in Unsafe.As<DecCalc, decimal>(ref d2)); 2689public Span<uint> AsSpan() => MemoryMarshal.CreateSpan(ref Unsafe.As<Buf24, uint>(ref this), Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (69)
421ushort flagsValue = Unsafe.As<byte, ushort>(ref pFlagsValue); 422return (Unsafe.As<byte, ushort>(ref pThisValue) & flagsValue) == flagsValue; 428uint flagsValue = Unsafe.As<byte, uint>(ref pFlagsValue); 429return (Unsafe.As<byte, uint>(ref pThisValue) & flagsValue) == flagsValue; 435ulong flagsValue = Unsafe.As<byte, ulong>(ref pFlagsValue); 436return (Unsafe.As<byte, ulong>(ref pThisValue) & flagsValue) == flagsValue; 894if (underlyingType == typeof(sbyte)) return TryParseByValueOrName<sbyte, byte>(rt, value, ignoreCase, throwOnFailure, out Unsafe.As<TEnum, sbyte>(ref result)); 895if (underlyingType == typeof(byte)) return TryParseByValueOrName<byte, byte>(rt, value, ignoreCase, throwOnFailure, out Unsafe.As<TEnum, byte>(ref result)); 896if (underlyingType == typeof(short)) return TryParseByValueOrName<short, ushort>(rt, value, ignoreCase, throwOnFailure, out Unsafe.As<TEnum, short>(ref result)); 897if (underlyingType == typeof(ushort)) return TryParseByValueOrName<ushort, ushort>(rt, value, ignoreCase, throwOnFailure, out Unsafe.As<TEnum, ushort>(ref result)); 898if (underlyingType == typeof(int)) return TryParseByValueOrName<int, uint>(rt, value, ignoreCase, throwOnFailure, out Unsafe.As<TEnum, int>(ref result)); 899if (underlyingType == typeof(uint)) return TryParseByValueOrName<uint, uint>(rt, value, ignoreCase, throwOnFailure, out Unsafe.As<TEnum, uint>(ref result)); 900if (underlyingType == typeof(long)) return TryParseByValueOrName<long, ulong>(rt, value, ignoreCase, throwOnFailure, out Unsafe.As<TEnum, long>(ref result)); 901if (underlyingType == typeof(ulong)) return TryParseByValueOrName<ulong, ulong>(rt, value, ignoreCase, throwOnFailure, out Unsafe.As<TEnum, ulong>(ref result)); 938return TryParseByName(enumType, value, ignoreCase, throwOnFailure, out Unsafe.As<TUnderlying, TStorage>(ref result)); 953return TryParseByName(enumType, value, ignoreCase, throwOnFailure, out Unsafe.As<TUnderlying, TStorage>(ref result)); 996return TryParseByName(enumType, value, ignoreCase, throwOnFailure, out Unsafe.As<TUnderlying, TStorage>(ref result)); 1169CorElementType.ELEMENT_TYPE_I1 => Unsafe.As<byte, sbyte>(ref data), 1171CorElementType.ELEMENT_TYPE_I2 => Unsafe.As<byte, short>(ref data), 1172CorElementType.ELEMENT_TYPE_U2 => Unsafe.As<byte, ushort>(ref data), 1173CorElementType.ELEMENT_TYPE_I4 => Unsafe.As<byte, int>(ref data), 1174CorElementType.ELEMENT_TYPE_U4 => Unsafe.As<byte, uint>(ref data), 1175CorElementType.ELEMENT_TYPE_I8 => Unsafe.As<byte, long>(ref data), 1176CorElementType.ELEMENT_TYPE_U8 => Unsafe.As<byte, ulong>(ref data), 1213return Unsafe.As<byte, ushort>(ref pThisValue) == Unsafe.As<byte, ushort>(ref pOtherValue); 1217return Unsafe.As<byte, uint>(ref pThisValue) == Unsafe.As<byte, uint>(ref pOtherValue); 1221return Unsafe.As<byte, ulong>(ref pThisValue) == Unsafe.As<byte, ulong>(ref pOtherValue); 1260CorElementType.ELEMENT_TYPE_I1 => Unsafe.As<byte, sbyte>(ref data).GetHashCode(), 1262CorElementType.ELEMENT_TYPE_I2 => Unsafe.As<byte, short>(ref data).GetHashCode(), 1263CorElementType.ELEMENT_TYPE_U2 => Unsafe.As<byte, ushort>(ref data).GetHashCode(), 1264CorElementType.ELEMENT_TYPE_I4 => Unsafe.As<byte, int>(ref data).GetHashCode(), 1265CorElementType.ELEMENT_TYPE_U4 => Unsafe.As<byte, uint>(ref data).GetHashCode(), 1266CorElementType.ELEMENT_TYPE_I8 => Unsafe.As<byte, long>(ref data).GetHashCode(), 1267CorElementType.ELEMENT_TYPE_U8 => Unsafe.As<byte, ulong>(ref data).GetHashCode(), 1298return Unsafe.As<byte, sbyte>(ref pThisValue).CompareTo(Unsafe.As<byte, sbyte>(ref pTargetValue)); 1304return Unsafe.As<byte, short>(ref pThisValue).CompareTo(Unsafe.As<byte, short>(ref pTargetValue)); 1307return Unsafe.As<byte, ushort>(ref pThisValue).CompareTo(Unsafe.As<byte, ushort>(ref pTargetValue)); 1310return Unsafe.As<byte, int>(ref pThisValue).CompareTo(Unsafe.As<byte, int>(ref pTargetValue)); 1313return Unsafe.As<byte, uint>(ref pThisValue).CompareTo(Unsafe.As<byte, uint>(ref pTargetValue)); 1316return Unsafe.As<byte, long>(ref pThisValue).CompareTo(Unsafe.As<byte, long>(ref pTargetValue)); 1319return Unsafe.As<byte, ulong>(ref pThisValue).CompareTo(Unsafe.As<byte, ulong>(ref pTargetValue)); 1470TStorage value = Unsafe.As<byte, TStorage>(ref rawData); 1500TStorage value = Unsafe.As<byte, TStorage>(ref rawData); 1567ushort value = Unsafe.As<byte, ushort>(ref data); 1578uint value = Unsafe.As<byte, uint>(ref data); 1591ulong value = Unsafe.As<byte, ulong>(ref data); 1700CorElementType.ELEMENT_TYPE_I2 => TryFormatPrimitiveDefault<short, ushort>(enumType, Unsafe.As<byte, short>(ref rawData), destination, out charsWritten), 1701CorElementType.ELEMENT_TYPE_U2 => TryFormatPrimitiveDefault<ushort, ushort>(enumType, Unsafe.As<byte, ushort>(ref rawData), destination, out charsWritten), 1702CorElementType.ELEMENT_TYPE_I4 => TryFormatPrimitiveDefault<int, uint>(enumType, Unsafe.As<byte, int>(ref rawData), destination, out charsWritten), 1703CorElementType.ELEMENT_TYPE_U4 => TryFormatPrimitiveDefault<uint, uint>(enumType, Unsafe.As<byte, uint>(ref rawData), destination, out charsWritten), 1704CorElementType.ELEMENT_TYPE_I8 => TryFormatPrimitiveDefault<long, ulong>(enumType, Unsafe.As<byte, long>(ref rawData), destination, out charsWritten), 1705CorElementType.ELEMENT_TYPE_U8 => TryFormatPrimitiveDefault<ulong, ulong>(enumType, Unsafe.As<byte, ulong>(ref rawData), destination, out charsWritten), 1722CorElementType.ELEMENT_TYPE_I2 => TryFormatPrimitiveNonDefault<short, ushort>(enumType, Unsafe.As<byte, short>(ref rawData), destination, out charsWritten, format), 1723CorElementType.ELEMENT_TYPE_U2 => TryFormatPrimitiveNonDefault<ushort, ushort>(enumType, Unsafe.As<byte, ushort>(ref rawData), destination, out charsWritten, format), 1724CorElementType.ELEMENT_TYPE_I4 => TryFormatPrimitiveNonDefault<int, uint>(enumType, Unsafe.As<byte, int>(ref rawData), destination, out charsWritten, format), 1725CorElementType.ELEMENT_TYPE_U4 => TryFormatPrimitiveNonDefault<uint, uint>(enumType, Unsafe.As<byte, uint>(ref rawData), destination, out charsWritten, format), 1726CorElementType.ELEMENT_TYPE_I8 => TryFormatPrimitiveNonDefault<long, ulong>(enumType, Unsafe.As<byte, long>(ref rawData), destination, out charsWritten, format), 1727CorElementType.ELEMENT_TYPE_U8 => TryFormatPrimitiveNonDefault<ulong, ulong>(enumType, Unsafe.As<byte, ulong>(ref rawData), destination, out charsWritten, format), 1911return TryFormatNumberAsHex<TStorage>(ref Unsafe.As<TUnderlying, byte>(ref value), destination, out charsWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfo.cs (4)
287ref short rsStart = ref Unsafe.As<byte, short>(ref MemoryMarshal.GetReference(UppercaseValues)); 306ref ushort rsStart = ref Unsafe.As<byte, ushort>(ref MemoryMarshal.GetReference(UppercaseValues)); 322ref short rsStart = ref Unsafe.As<byte, short>(ref MemoryMarshal.GetReference(LowercaseValues)); 341ref ushort rsStart = ref Unsafe.As<byte, ushort>(ref MemoryMarshal.GetReference(LowercaseValues));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (8)
97vec1 = TVector.LoadUnsafe(ref Unsafe.As<char, ushort>(ref charA), i); 98vec2 = TVector.LoadUnsafe(ref Unsafe.As<char, ushort>(ref charB), i); 124vec1 = TVector.LoadUnsafe(ref Unsafe.As<char, ushort>(ref charA), i); 125vec2 = TVector.LoadUnsafe(ref Unsafe.As<char, ushort>(ref charB), i); 188valueAu64 = Unsafe.ReadUnaligned<ulong>(ref Unsafe.As<char, byte>(ref Unsafe.AddByteOffset(ref charA, byteOffset))); 189valueBu64 = Unsafe.ReadUnaligned<ulong>(ref Unsafe.As<char, byte>(ref Unsafe.AddByteOffset(ref charB, byteOffset))); 223valueAu32 = Unsafe.ReadUnaligned<uint>(ref Unsafe.As<char, byte>(ref Unsafe.AddByteOffset(ref charA, byteOffset))); 224valueBu32 = Unsafe.ReadUnaligned<uint>(ref Unsafe.As<char, byte>(ref Unsafe.AddByteOffset(ref charB, byteOffset)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (1)
249return Unsafe.As<GuidResult, Guid>(ref Unsafe.AsRef(in this));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (12)
250return nint_t.TryParse(s, out Unsafe.As<nint, nint_t>(ref result)); 257return nint_t.TryParse(s, provider, out Unsafe.As<nint, nint_t>(ref result)); 263return nint_t.TryParse(s, style, provider, out Unsafe.As<nint, nint_t>(ref result)); 269return nint_t.TryParse(s, out Unsafe.As<nint, nint_t>(ref result)); 279return nint_t.TryParse(utf8Text, out Unsafe.As<nint, nint_t>(ref result)); 290return nint_t.TryParse(s, provider, out Unsafe.As<nint, nint_t>(ref result)); 296return nint_t.TryParse(s, style, provider, out Unsafe.As<nint, nint_t>(ref result)); 1376return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nint, nint_t>(ref result), out charsConsumed) == Number.ParsingStatus.OK; 1384return Number.TryParseBinaryInteger(s, style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nint, nint_t>(ref result), out charsConsumed) == Number.ParsingStatus.OK; 1392return Number.TryParseBinaryInteger(utf8Text, style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nint, nint_t>(ref result), out bytesConsumed) == Number.ParsingStatus.OK; 1453return nint_t.TryParse(utf8Text, style, provider, out Unsafe.As<nint, nint_t>(ref result)); 1463return nint_t.TryParse(utf8Text, provider, out Unsafe.As<nint, nint_t>(ref result));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Marvin.OrdinalIgnoreCase.cs (2)
29tempValue = Unsafe.ReadUnaligned<uint>(ref Unsafe.As<char, byte>(ref Unsafe.AddByteOffset(ref data, byteOffset))); 94int hash = ComputeHash32(ref Unsafe.As<char, byte>(ref MemoryMarshal.GetReference(scratch)), (uint)charsWritten * 2, p0, p1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Memory.cs (1)
287refToReturn = ref Unsafe.As<char, T>(ref ((string)tmpObject).GetRawStringData());
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (174)
335ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 342ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 349ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 356ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)), 818ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 825ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 832ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 839ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)), 867ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 874ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 881ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 888ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)), 945ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 953ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 983ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 991ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1052ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1061ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1093ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1102ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1155ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1165ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1212ref byte valuesRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values)); 1215ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1225ref short valuesRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values)); 1228ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1241ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 1243ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(values)), 1396ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1403ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1410ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 1417ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)), 1445ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1452ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1459ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 1466ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)), 1523ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1531ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1561ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1569ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1630ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1639ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1671ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1680ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1734ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1744ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1792ref byte valuesRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values)); 1795ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1805ref short valuesRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values)); 1808ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 1821ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 1823ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(values)), 1930ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 1939ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)), 1948ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)), 1957ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)), 2001ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2010ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)), 2019ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)), 2028ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)), 2072ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2081ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)), 2090ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)), 2099ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)), 2143ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2152ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)), 2161ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)), 2170ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)), 2216ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2222ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 2228ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 2234ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)), 2257ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2263ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 2269ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 2275ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)), 2325ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2327ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), 2332ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 2334ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(value)), 2354ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2356ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), 2361ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 2363ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(value)), 2412ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2419ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 2426ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 2433ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)), 2458ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2465ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 2472ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 2479ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)), 2532ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2534ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), 2540ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 2542ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(value)), 2564ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2566ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), 2572ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 2574ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(value)), 2675ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2683ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 2710ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2718ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 2775ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2784ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 2813ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 2822ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 2879ref byte spanRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)); 2880ref byte valueRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values)); 2927ref short spanRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)); 2928ref short valueRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values)); 2959_ => ProbabilisticMap.IndexOfAny(ref Unsafe.As<short, char>(ref spanRef), span.Length, ref Unsafe.As<short, char>(ref valueRef), values.Length), 3095ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 3103ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 3130ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 3138ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 3196ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 3205ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 3234ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 3243ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 3301ref byte spanRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)); 3302ref byte valueRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values)); 3349ref short spanRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)); 3350ref short valueRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values)); 3381_ => ProbabilisticMap.LastIndexOfAny(ref Unsafe.As<short, char>(ref spanRef), span.Length, ref Unsafe.As<short, char>(ref valueRef), values.Length), 3456ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 3457ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)), 3498ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 3499ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)), 3540ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 3542ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)), 3547ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 3549ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(other)), 3596ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 3597ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), 3639ref Unsafe.As<T, byte>(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), (nint)(uint)(spanLength - valueLength) /* force zero-extension */)), 3640ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), 4479ref byte src = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)); 4491ref ushort src = ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)); 4502ref int src = ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)); 4513ref long src = ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)); 4545ref byte src = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)); 4557ref ushort src = ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)); 4568ref int src = ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)); 4579ref long src = ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)); 4659ref Unsafe.As<T, byte>(ref src), 4660ref Unsafe.As<T, byte>(ref dst), 4670ref Unsafe.As<T, ushort>(ref src), 4671ref Unsafe.As<T, ushort>(ref dst), 4680ref Unsafe.As<T, int>(ref src), 4681ref Unsafe.As<T, int>(ref dst), 4690ref Unsafe.As<T, long>(ref src), 4691ref Unsafe.As<T, long>(ref dst), 4745ref Unsafe.As<T, byte>(ref src), 4746ref Unsafe.As<T, byte>(ref dst), 4756ref Unsafe.As<T, ushort>(ref src), 4757ref Unsafe.As<T, ushort>(ref dst), 4766ref Unsafe.As<T, int>(ref src), 4767ref Unsafe.As<T, int>(ref dst), 4776ref Unsafe.As<T, long>(ref src), 4777ref Unsafe.As<T, long>(ref dst), 4942ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 4943ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)), 5433ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 5440ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 5447ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 5454ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)), 5482ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), 5489ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)), 5496ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)), 5503ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.BigInteger.cs (1)
849return ref Unsafe.As<byte, BigInteger>(ref MemoryMarshal.GetReference(table.Slice(offset)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Matrix3x2.cs (3)
35internal ref Impl AsImpl() => ref Unsafe.As<Matrix3x2, Impl>(ref this); 39internal readonly ref readonly Impl AsROImpl() => ref Unsafe.As<Matrix3x2, Impl>(ref Unsafe.AsRef(in this)); 45public ref Matrix3x2 AsM3x2() => ref Unsafe.As<Impl, Matrix3x2>(ref this);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Matrix4x4.cs (6)
40internal ref Impl AsImpl() => ref Unsafe.As<Matrix4x4, Impl>(ref this); 44internal readonly ref readonly Impl AsROImpl() => ref Unsafe.As<Matrix4x4, Impl>(ref Unsafe.AsRef(in this)); 50public ref Matrix4x4 AsM4x4() => ref Unsafe.As<Impl, Matrix4x4>(ref this); 424return Unsafe.Add(ref Unsafe.As<Impl, float>(ref Unsafe.AsRef(in impl)), (row * ColumnCount) + column); 474Unsafe.Add(ref Unsafe.As<Impl, float>(ref Unsafe.AsRef(in impl)), (row * ColumnCount) + column) = value; 1976return Invert(in matrix.AsROImpl(), out Unsafe.As<Matrix4x4, Impl>(ref result));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector_1.cs (7)
61this = Unsafe.ReadUnaligned<Vector<T>>(ref Unsafe.As<T, byte>(ref values[0])); 80this = Unsafe.ReadUnaligned<Vector<T>>(ref Unsafe.As<T, byte>(ref values[index])); 97this = Unsafe.ReadUnaligned<Vector<T>>(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values))); 625Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination[0]), this); 649Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination[startIndex]), this); 679Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(destination)), this); 801Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(destination)), this);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector.cs (7)
829return Unsafe.ReadUnaligned<Vector<T>>(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values))); 2250ref readonly byte address = ref Unsafe.As<T, byte>(ref Unsafe.AsRef(in source)); 2266ref readonly byte address = ref Unsafe.As<T, byte>(ref Unsafe.Add(ref Unsafe.AsRef(in source), (nint)elementOffset)); 3288ref byte address = ref Unsafe.As<T, byte>(ref destination); 3305Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination), source); 3810ref T address = ref Unsafe.As<Vector<T>, T>(ref Unsafe.AsRef(in vector)); 3818ref T address = ref Unsafe.As<Vector<T>, T>(ref Unsafe.AsRef(in vector));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (7)
436return Unsafe.As<float, Vector2>(ref MemoryMarshal.GetReference(values)); 730public static Vector2 LoadUnsafe(ref readonly float source) => Unsafe.As<float, Vector2>(ref Unsafe.AsRef(in source)); 736public static Vector2 LoadUnsafe(ref readonly float source, nuint elementOffset) => Unsafe.As<float, Vector2>(ref Unsafe.Add(ref Unsafe.AsRef(in source), (nint)elementOffset)); 1026Unsafe.As<float, Vector2>(ref array[0]) = this; 1054Unsafe.As<float, Vector2>(ref array[index]) = this; 1067Unsafe.As<float, Vector2>(ref MemoryMarshal.GetReference(destination)) = this; 1081Unsafe.As<float, Vector2>(ref MemoryMarshal.GetReference(destination)) = this;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.Extensions.cs (2)
92Unsafe.As<float, Vector2>(ref destination) = source; 103Unsafe.As<float, Vector2>(ref Unsafe.Add(ref destination, (nint)elementOffset)) = source;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (7)
473return Unsafe.As<float, Vector3>(ref MemoryMarshal.GetReference(values)); 767public static Vector3 LoadUnsafe(ref readonly float source) => Unsafe.As<float, Vector3>(ref Unsafe.AsRef(in source)); 773public static Vector3 LoadUnsafe(ref readonly float source, nuint elementOffset) => Unsafe.As<float, Vector3>(ref Unsafe.Add(ref Unsafe.AsRef(in source), (nint)elementOffset)); 1036Unsafe.As<float, Vector3>(ref array[0]) = this; 1064Unsafe.As<float, Vector3>(ref array[index]) = this; 1077Unsafe.As<float, Vector3>(ref MemoryMarshal.GetReference(destination)) = this; 1091Unsafe.As<float, Vector3>(ref MemoryMarshal.GetReference(destination)) = this;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.Extensions.cs (2)
87Unsafe.As<float, Vector3>(ref destination) = source; 98Unsafe.As<float, Vector3>(ref Unsafe.Add(ref destination, (nint)elementOffset)) = source;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (5)
524return Unsafe.As<float, Vector4>(ref MemoryMarshal.GetReference(values)); 1106Unsafe.As<float, Vector4>(ref array[0]) = this; 1134Unsafe.As<float, Vector4>(ref array[index]) = this; 1147Unsafe.As<float, Vector4>(ref MemoryMarshal.GetReference(destination)) = this; 1161Unsafe.As<float, Vector4>(ref MemoryMarshal.GetReference(destination)) = this;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\VectorDebugView_1.cs (11)
33Unsafe.WriteUnaligned(ref Unsafe.As<double, byte>(ref items[0]), _value); 43Unsafe.WriteUnaligned(ref Unsafe.As<short, byte>(ref items[0]), _value); 53Unsafe.WriteUnaligned(ref Unsafe.As<int, byte>(ref items[0]), _value); 63Unsafe.WriteUnaligned(ref Unsafe.As<long, byte>(ref items[0]), _value); 73Unsafe.WriteUnaligned(ref Unsafe.As<nint, byte>(ref items[0]), _value); 83Unsafe.WriteUnaligned(ref Unsafe.As<nuint, byte>(ref items[0]), _value); 93Unsafe.WriteUnaligned(ref Unsafe.As<sbyte, byte>(ref items[0]), _value); 103Unsafe.WriteUnaligned(ref Unsafe.As<float, byte>(ref items[0]), _value); 113Unsafe.WriteUnaligned(ref Unsafe.As<ushort, byte>(ref items[0]), _value); 123Unsafe.WriteUnaligned(ref Unsafe.As<uint, byte>(ref items[0]), _value); 133Unsafe.WriteUnaligned(ref Unsafe.As<ulong, byte>(ref items[0]), _value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (1)
209refToReturn = ref Unsafe.As<char, T>(ref ((string)tmpObject).GetRawStringData());
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (2)
228return new ReadOnlySpan<T>(ref Unsafe.As<TDerived, T>(ref items._reference), items.Length); 359return new string(new ReadOnlySpan<char>(ref Unsafe.As<T, char>(ref _reference), _length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.cs (6)
58TAwaiter awaiter = Unsafe.As<byte, TAwaiter>(ref Unsafe.Add(ref data, offset)); 115TAwaiter awaiter = Unsafe.As<byte, TAwaiter>(ref Unsafe.Add(ref data, offset)); 190IValueTaskSource<T> vts = Unsafe.As<object, IValueTaskSource<T>>(ref obj); 230IValueTaskSource vts = Unsafe.As<object, IValueTaskSource>(ref obj); 314IValueTaskSource vts = Unsafe.As<object, IValueTaskSource>(ref obj); 381IValueTaskSource<T> vts = Unsafe.As<object, IValueTaskSource<T>>(ref obj);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (3)
117ref TaskAwaiter ta = ref Unsafe.As<TAwaiter, TaskAwaiter>(ref awaiter); // relies on TaskAwaiter/TaskAwaiter<T> having the same layout 122ref ConfiguredTaskAwaitable.ConfiguredTaskAwaiter ta = ref Unsafe.As<TAwaiter, ConfiguredTaskAwaitable.ConfiguredTaskAwaiter>(ref awaiter); 479return ref Unsafe.As<object?, ExecutionContext?>(ref m_stateObject);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\CastCache.cs (3)
109return ref Unsafe.As<byte, int>(ref Unsafe.AddByteOffset(ref table.GetRawData(), (nint)sizeof(nint))); 129return ref Unsafe.As<int, uint>(ref Unsafe.Add(ref tableData, 2)); 136return ref Unsafe.Add(ref Unsafe.As<int, CastCacheEntry>(ref tableData), index + 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\GenericCache.cs (2)
112return ref Unsafe.As<byte, Entry>(ref Unsafe.As<RawArrayData>(table).Data); 138return ref Unsafe.Add(ref Unsafe.As<byte, Entry>(ref Unsafe.As<RawArrayData>(table).Data), index + 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (1)
399return ref Unsafe.As<object?, StateMachineBox<TStateMachine>?>(ref s_perCoreCache[i].Object);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\Unsafe.cs (3)
275return ReadUnaligned<TTo>(ref As<TFrom, byte>(ref source)); 603return As<byte, T>(ref Unsafe.AsRef(in source)); 655As<byte, T>(ref destination) = value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (2)
451Interlocked.Or(ref Unsafe.As<CreateComInterfaceFlagsEx, int>(ref Flags), setMask); 459Interlocked.And(ref Unsafe.As<CreateComInterfaceFlagsEx, int>(ref Flags), resetMask);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (1)
577return ref Unsafe.As<UnionTypes, T>(ref _typeUnion._unionTypes);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (6)
39ref Unsafe.As<T, byte>(ref GetReference(span)), 62ref Unsafe.As<T, byte>(ref GetReference(span)), 194ref Unsafe.As<TFrom, TTo>(ref span._reference), 249ref Unsafe.As<TFrom, TTo>(ref GetReference(span)), 602return ref Unsafe.As<byte, T>(ref GetReference(span)); 624return ref Unsafe.As<byte, T>(ref GetReference(span));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (9)
697return NativeType.TryParse(s, out Unsafe.As<NFloat, NativeType>(ref result)); 707return NativeType.TryParse(s, out Unsafe.As<NFloat, NativeType>(ref result)); 717return NativeType.TryParse(utf8Text, out Unsafe.As<NFloat, NativeType>(ref result)); 734return NativeType.TryParse(s, style, provider, out Unsafe.As<NFloat, NativeType>(ref result)); 751return NativeType.TryParse(s, style, provider, out Unsafe.As<NFloat, NativeType>(ref result)); 1721return Number.TryParseFloat(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<NFloat, NativeType>(ref result), out charsConsumed); 1729return Number.TryParseFloat(s, style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<NFloat, NativeType>(ref result), out charsConsumed); 1737return Number.TryParseFloat(utf8Text, style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<NFloat, NativeType>(ref result), out bytesConsumed); 1874return NativeType.TryParse(utf8Text, style, provider, out Unsafe.As<NFloat, NativeType>(ref result));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (16)
756Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination[0]), vector); 783Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination[startIndex]), vector); 800Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(destination)), vector); 1031return Unsafe.ReadUnaligned<Vector128<T>>(ref Unsafe.As<T, byte>(ref values[0])); 1052return Unsafe.ReadUnaligned<Vector128<T>>(ref Unsafe.As<T, byte>(ref values[index])); 1069return Unsafe.ReadUnaligned<Vector128<T>>(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values))); 2548ref readonly byte address = ref Unsafe.As<T, byte>(ref Unsafe.AsRef(in source)); 2564ref readonly byte address = ref Unsafe.As<T, byte>(ref Unsafe.Add(ref Unsafe.AsRef(in source), (nint)elementOffset)); 2571internal static Vector128<ushort> LoadUnsafe(ref char source) => LoadUnsafe(ref Unsafe.As<char, ushort>(ref source)); 2577internal static Vector128<ushort> LoadUnsafe(ref char source, nuint elementOffset) => LoadUnsafe(ref Unsafe.As<char, ushort>(ref source), elementOffset); 3788ref byte address = ref Unsafe.As<T, byte>(ref Unsafe.Add(ref destination, elementOffset)); 3802ref byte address = ref Unsafe.As<T, byte>(ref destination); 3819Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination), source); 3959Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(destination)), vector); 4353ref T address = ref Unsafe.As<Vector128<T>, T>(ref Unsafe.AsRef(in vector)); 4389ref T address = ref Unsafe.As<Vector128<T>, T>(ref Unsafe.AsRef(in vector));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.Numerics.cs (6)
106ref byte address = ref Unsafe.As<Vector<T>, byte>(ref value); 120Unsafe.WriteUnaligned(ref Unsafe.As<Vector128<float>, byte>(ref result), value); 134Unsafe.WriteUnaligned(ref Unsafe.As<Vector128<float>, byte>(ref result), value); 145ref byte address = ref Unsafe.As<Vector128<float>, byte>(ref value); 156ref byte address = ref Unsafe.As<Vector128<float>, byte>(ref value); 179Unsafe.WriteUnaligned(ref Unsafe.As<Vector<T>, byte>(ref result), value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128DebugView_1.cs (11)
32Unsafe.WriteUnaligned(ref Unsafe.As<double, byte>(ref items[0]), _value); 42Unsafe.WriteUnaligned(ref Unsafe.As<short, byte>(ref items[0]), _value); 52Unsafe.WriteUnaligned(ref Unsafe.As<int, byte>(ref items[0]), _value); 62Unsafe.WriteUnaligned(ref Unsafe.As<long, byte>(ref items[0]), _value); 72Unsafe.WriteUnaligned(ref Unsafe.As<nint, byte>(ref items[0]), _value); 82Unsafe.WriteUnaligned(ref Unsafe.As<nuint, byte>(ref items[0]), _value); 92Unsafe.WriteUnaligned(ref Unsafe.As<sbyte, byte>(ref items[0]), _value); 102Unsafe.WriteUnaligned(ref Unsafe.As<float, byte>(ref items[0]), _value); 112Unsafe.WriteUnaligned(ref Unsafe.As<ushort, byte>(ref items[0]), _value); 122Unsafe.WriteUnaligned(ref Unsafe.As<uint, byte>(ref items[0]), _value); 132Unsafe.WriteUnaligned(ref Unsafe.As<ulong, byte>(ref items[0]), _value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (19)
374ref byte address = ref Unsafe.As<Vector<T>, byte>(ref value); 380Unsafe.WriteUnaligned(ref Unsafe.As<Vector256<T>, byte>(ref result), value); 398ref byte address = ref Unsafe.As<Vector256<T>, byte>(ref value); 404Unsafe.WriteUnaligned(ref Unsafe.As<Vector<T>, byte>(ref result), value); 762Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination[0]), vector); 789Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination[startIndex]), vector); 806Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(destination)), vector); 1031return Unsafe.ReadUnaligned<Vector256<T>>(ref Unsafe.As<T, byte>(ref values[0])); 1052return Unsafe.ReadUnaligned<Vector256<T>>(ref Unsafe.As<T, byte>(ref values[index])); 1069return Unsafe.ReadUnaligned<Vector256<T>>(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values))); 2640ref readonly byte address = ref Unsafe.As<T, byte>(ref Unsafe.AsRef(in source)); 2656ref readonly byte address = ref Unsafe.As<T, byte>(ref Unsafe.Add(ref Unsafe.AsRef(in source), (nint)elementOffset)); 2663internal static Vector256<ushort> LoadUnsafe(ref char source) => LoadUnsafe(ref Unsafe.As<char, ushort>(ref source)); 2669internal static Vector256<ushort> LoadUnsafe(ref char source, nuint elementOffset) => LoadUnsafe(ref Unsafe.As<char, ushort>(ref source), elementOffset); 3765ref byte address = ref Unsafe.As<T, byte>(ref destination); 3782Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination), source); 3910Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(destination)), vector); 4259ref T address = ref Unsafe.As<Vector256<T>, T>(ref Unsafe.AsRef(in vector)); 4308ref T address = ref Unsafe.As<Vector256<T>, T>(ref Unsafe.AsRef(in vector));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256DebugView_1.cs (11)
32Unsafe.WriteUnaligned(ref Unsafe.As<double, byte>(ref items[0]), _value); 42Unsafe.WriteUnaligned(ref Unsafe.As<short, byte>(ref items[0]), _value); 52Unsafe.WriteUnaligned(ref Unsafe.As<int, byte>(ref items[0]), _value); 62Unsafe.WriteUnaligned(ref Unsafe.As<long, byte>(ref items[0]), _value); 72Unsafe.WriteUnaligned(ref Unsafe.As<nint, byte>(ref items[0]), _value); 82Unsafe.WriteUnaligned(ref Unsafe.As<nuint, byte>(ref items[0]), _value); 92Unsafe.WriteUnaligned(ref Unsafe.As<sbyte, byte>(ref items[0]), _value); 102Unsafe.WriteUnaligned(ref Unsafe.As<float, byte>(ref items[0]), _value); 112Unsafe.WriteUnaligned(ref Unsafe.As<ushort, byte>(ref items[0]), _value); 122Unsafe.WriteUnaligned(ref Unsafe.As<uint, byte>(ref items[0]), _value); 132Unsafe.WriteUnaligned(ref Unsafe.As<ulong, byte>(ref items[0]), _value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (17)
374Unsafe.WriteUnaligned(ref Unsafe.As<Vector512<T>, byte>(ref result), value); 390ref byte address = ref Unsafe.As<Vector512<T>, byte>(ref value); 675Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination[0]), vector); 701Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination[startIndex]), vector); 717Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(destination)), vector); 927return Unsafe.ReadUnaligned<Vector512<T>>(ref Unsafe.As<T, byte>(ref values[0])); 947return Unsafe.ReadUnaligned<Vector512<T>>(ref Unsafe.As<T, byte>(ref values[index])); 964return Unsafe.ReadUnaligned<Vector512<T>>(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values))); 2675ref readonly byte address = ref Unsafe.As<T, byte>(ref Unsafe.AsRef(in source)); 2691ref readonly byte address = ref Unsafe.As<T, byte>(ref Unsafe.Add(ref Unsafe.AsRef(in source), (nint)elementOffset)); 2698internal static Vector512<ushort> LoadUnsafe(ref char source) => LoadUnsafe(ref Unsafe.As<char, ushort>(ref source)); 2704internal static Vector512<ushort> LoadUnsafe(ref char source, nuint elementOffset) => LoadUnsafe(ref Unsafe.As<char, ushort>(ref source), elementOffset); 3778ref byte address = ref Unsafe.As<T, byte>(ref destination); 3795Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination), source); 3889Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(destination)), vector); 4238ref T address = ref Unsafe.As<Vector512<T>, T>(ref Unsafe.AsRef(in vector)); 4287ref T address = ref Unsafe.As<Vector512<T>, T>(ref Unsafe.AsRef(in vector));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512DebugView_1.cs (11)
32Unsafe.WriteUnaligned(ref Unsafe.As<double, byte>(ref items[0]), _value); 42Unsafe.WriteUnaligned(ref Unsafe.As<short, byte>(ref items[0]), _value); 52Unsafe.WriteUnaligned(ref Unsafe.As<int, byte>(ref items[0]), _value); 62Unsafe.WriteUnaligned(ref Unsafe.As<long, byte>(ref items[0]), _value); 72Unsafe.WriteUnaligned(ref Unsafe.As<nint, byte>(ref items[0]), _value); 82Unsafe.WriteUnaligned(ref Unsafe.As<nuint, byte>(ref items[0]), _value); 92Unsafe.WriteUnaligned(ref Unsafe.As<sbyte, byte>(ref items[0]), _value); 102Unsafe.WriteUnaligned(ref Unsafe.As<float, byte>(ref items[0]), _value); 112Unsafe.WriteUnaligned(ref Unsafe.As<ushort, byte>(ref items[0]), _value); 122Unsafe.WriteUnaligned(ref Unsafe.As<uint, byte>(ref items[0]), _value); 132Unsafe.WriteUnaligned(ref Unsafe.As<ulong, byte>(ref items[0]), _value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (13)
713Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination[0]), vector); 740Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination[startIndex]), vector); 757Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(destination)), vector); 1005return Unsafe.ReadUnaligned<Vector64<T>>(ref Unsafe.As<T, byte>(ref values[0])); 1026return Unsafe.ReadUnaligned<Vector64<T>>(ref Unsafe.As<T, byte>(ref values[index])); 1043return Unsafe.ReadUnaligned<Vector64<T>>(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values))); 2645ref readonly byte address = ref Unsafe.As<T, byte>(ref Unsafe.AsRef(in source)); 2661ref readonly byte address = ref Unsafe.As<T, byte>(ref Unsafe.Add(ref Unsafe.AsRef(in source), (nint)elementOffset)); 3916ref byte address = ref Unsafe.As<T, byte>(ref destination); 3933Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref destination), source); 4074Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(destination)), vector); 4476ref T address = ref Unsafe.As<Vector64<T>, T>(ref Unsafe.AsRef(in vector)); 4512ref T address = ref Unsafe.As<Vector64<T>, T>(ref Unsafe.AsRef(in vector));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64DebugView_1.cs (11)
32Unsafe.WriteUnaligned(ref Unsafe.As<double, byte>(ref items[0]), _value); 42Unsafe.WriteUnaligned(ref Unsafe.As<short, byte>(ref items[0]), _value); 52Unsafe.WriteUnaligned(ref Unsafe.As<int, byte>(ref items[0]), _value); 62Unsafe.WriteUnaligned(ref Unsafe.As<long, byte>(ref items[0]), _value); 72Unsafe.WriteUnaligned(ref Unsafe.As<nint, byte>(ref items[0]), _value); 82Unsafe.WriteUnaligned(ref Unsafe.As<nuint, byte>(ref items[0]), _value); 92Unsafe.WriteUnaligned(ref Unsafe.As<sbyte, byte>(ref items[0]), _value); 102Unsafe.WriteUnaligned(ref Unsafe.As<float, byte>(ref items[0]), _value); 112Unsafe.WriteUnaligned(ref Unsafe.As<ushort, byte>(ref items[0]), _value); 122Unsafe.WriteUnaligned(ref Unsafe.As<uint, byte>(ref items[0]), _value); 132Unsafe.WriteUnaligned(ref Unsafe.As<ulong, byte>(ref items[0]), _value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1SearchValues.cs (4)
36SpanHelpers.NonPackedIndexOfValueType<TImpl, SpanHelpers.DontNegate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length); 40SpanHelpers.NonPackedIndexOfValueType<TImpl, SpanHelpers.Negate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length); 44SpanHelpers.LastIndexOfValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length); 48SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2CharPackedIgnoreCaseSearchValues.cs (2)
57ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state); 65ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2SearchValues.cs (4)
36SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.DontNegate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length); 40SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.Negate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length); 44SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length); 48SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any3SearchValues.cs (4)
36SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.DontNegate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length); 40SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.Negate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length); 44SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length); 48SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any4SearchValues.cs (4)
39SpanHelpers.IndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length); 43SpanHelpers.IndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length); 47SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length); 51SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any5SearchValues.cs (4)
40SpanHelpers.IndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length); 44SpanHelpers.IndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length); 48SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length); 52SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiCharSearchValues.cs (6)
50ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state); 58ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state); 66ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state); 74ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state); 82ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state); 90ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (4)
194TryIndexOfAny<DontNegate>(ref Unsafe.As<char, short>(ref searchSpace), searchSpaceLength, asciiValues, out index); 198TryIndexOfAny<Negate>(ref Unsafe.As<char, short>(ref searchSpace), searchSpaceLength, asciiValues, out index); 202TryLastIndexOfAny<DontNegate>(ref Unsafe.As<char, short>(ref searchSpace), searchSpaceLength, asciiValues, out index); 206TryLastIndexOfAny<Negate>(ref Unsafe.As<char, short>(ref searchSpace), searchSpaceLength, asciiValues, out index);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMap.cs (9)
85Unsafe.Add(ref Unsafe.As<uint, byte>(ref charMap), value & VectorizedIndexMask) |= (byte)(1u << (value >> VectorizedIndexShift)); 96? (Unsafe.Add(ref Unsafe.As<uint, byte>(ref charMap), value & VectorizedIndexMask) & (1u << (value >> VectorizedIndexShift))) != 0 108ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(values)), 434Vector256<byte> charMap256 = Vector256.LoadUnsafe(ref Unsafe.As<ProbabilisticMap, byte>(ref state.Map)); 520Vector128<byte> charMapLower = Vector128.LoadUnsafe(ref Unsafe.As<ProbabilisticMap, byte>(ref state.Map)); 521Vector128<byte> charMapUpper = Vector128.LoadUnsafe(ref Unsafe.As<ProbabilisticMap, byte>(ref state.Map), (nuint)Vector128<byte>.Count); 610Vector256<byte> charMap256 = Vector256.LoadUnsafe(ref Unsafe.As<ProbabilisticMap, byte>(ref state.Map)); 698Vector128<byte> charMapLower = Vector128.LoadUnsafe(ref Unsafe.As<ProbabilisticMap, byte>(ref state.Map)); 699Vector128<byte> charMapUpper = Vector128.LoadUnsafe(ref Unsafe.As<ProbabilisticMap, byte>(ref state.Map), (nuint)Vector128<byte>.Count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (1)
98ref Unsafe.As<ProbabilisticMap, uint>(ref Map),
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticWithAsciiCharSearchValues.cs (6)
60ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), 70ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), 109ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), 159ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), 169ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), 198ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)),
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\RangeCharSearchValues.cs (2)
45ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(span)), 55ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(span)),
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.T.cs (1)
59"\"" + new string(Unsafe.As<T[], char[]>(ref values)) + "\"" :
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasick.cs (2)
100ref Unsafe.As<char, short>(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), i)), 209ref Unsafe.As<char, short>(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), i)),
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\StringSearchValuesHelper.cs (7)
76ref Unsafe.As<char, byte>(ref matchStart), 266ref byte matchByteStart = ref Unsafe.As<char, byte>(ref matchStart); 275ref byte matchByteStart = ref Unsafe.As<char, byte>(ref matchStart); 334ref byte matchByteStart = ref Unsafe.As<char, byte>(ref matchStart); 344ref byte matchByteStart = ref Unsafe.As<char, byte>(ref matchStart); 426ref byte matchByteStart = ref Unsafe.As<char, byte>(ref matchStart); 435ref byte matchByteStart = ref Unsafe.As<char, byte>(ref matchStart);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesThreeChars.cs (12)
259Vector128<ushort> cmpCh2 = Vector128.Equals(ch2, Vector128.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch2ByteOffset).AsUInt16()); 260Vector128<ushort> cmpCh3 = Vector128.Equals(ch3, Vector128.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch3ByteOffset).AsUInt16()); 272Vector128<ushort> cmpCh2 = Vector128.Equals(ch2, Vector128.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch2ByteOffset).AsUInt16() & caseConversion); 273Vector128<ushort> cmpCh3 = Vector128.Equals(ch3, Vector128.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch3ByteOffset).AsUInt16() & caseConversion); 287Vector256<ushort> cmpCh2 = Vector256.Equals(ch2, Vector256.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch2ByteOffset).AsUInt16()); 288Vector256<ushort> cmpCh3 = Vector256.Equals(ch3, Vector256.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch3ByteOffset).AsUInt16()); 296Vector256<ushort> cmpCh2 = Vector256.Equals(ch2, Vector256.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch2ByteOffset).AsUInt16() & caseConversion); 297Vector256<ushort> cmpCh3 = Vector256.Equals(ch3, Vector256.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch3ByteOffset).AsUInt16() & caseConversion); 310Vector512<ushort> cmpCh2 = Vector512.Equals(ch2, Vector512.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch2ByteOffset).AsUInt16()); 311Vector512<ushort> cmpCh3 = Vector512.Equals(ch3, Vector512.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch3ByteOffset).AsUInt16()); 319Vector512<ushort> cmpCh2 = Vector512.Equals(ch2, Vector512.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch2ByteOffset).AsUInt16() & caseConversion); 320Vector512<ushort> cmpCh3 = Vector512.Equals(ch3, Vector512.LoadUnsafe(ref Unsafe.As<char, byte>(ref searchSpace), ch3ByteOffset).AsUInt16() & caseConversion);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Span.cs (3)
299SpanHelpers.ClearWithReferences(ref Unsafe.As<T, IntPtr>(ref _reference), (uint)_length * (nuint)(sizeof(T) / sizeof(nuint))); 303SpanHelpers.ClearWithoutReferences(ref Unsafe.As<T, byte>(ref _reference), (uint)_length * (nuint)sizeof(T)); 383return new string(new ReadOnlySpan<char>(ref Unsafe.As<T, char>(ref _reference), _length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Char.cs (30)
38ref byte valueTail = ref Unsafe.As<char, byte>(ref Unsafe.Add(ref value, 1)); 57ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, offset + 1)), 123ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, offset + charPos)), 124ref Unsafe.As<char, byte>(ref value), (nuint)(uint)valueLength * 2)) 188ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, offset + charPos)), 189ref Unsafe.As<char, byte>(ref value), (nuint)(uint)valueLength * 2)) 250ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, offset + charPos)), 251ref Unsafe.As<char, byte>(ref value), (nuint)(uint)valueLength * 2)) 275return LastIndexOfValueType(ref Unsafe.As<char, short>(ref searchSpace), (short)value, searchSpaceLength); // for single-char values use plain LastIndexOf 285ref byte valueTail = ref Unsafe.As<char, byte>(ref Unsafe.Add(ref value, 1)); 295int relativeIndex = LastIndexOfValueType(ref Unsafe.As<char, short>(ref searchSpace), (short)valueHead, remainingSearchSpaceLength); 301ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, relativeIndex + 1)), 347ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, offset + charPos)), 348ref Unsafe.As<char, byte>(ref value), (nuint)(uint)valueLength * 2)) 397ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, offset + charPos)), 398ref Unsafe.As<char, byte>(ref value), (nuint)(uint)valueLength * 2)) 447ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, offset + charPos)), 448ref Unsafe.As<char, byte>(ref value), (nuint)(uint)valueLength * 2)) 486if (Unsafe.ReadUnaligned<Vector<ushort>>(ref Unsafe.As<char, byte>(ref Unsafe.Add(ref first, (nint)i))) != 487Unsafe.ReadUnaligned<Vector<ushort>>(ref Unsafe.As<char, byte>(ref Unsafe.Add(ref second, (nint)i)))) 498if (Unsafe.ReadUnaligned<nuint>(ref Unsafe.As<char, byte>(ref Unsafe.Add(ref first, (nint)i))) != 499Unsafe.ReadUnaligned<nuint>(ref Unsafe.As<char, byte>(ref Unsafe.Add(ref second, (nint)i)))) 510if (Unsafe.ReadUnaligned<int>(ref Unsafe.As<char, byte>(ref Unsafe.Add(ref first, (nint)i))) == 511Unsafe.ReadUnaligned<int>(ref Unsafe.As<char, byte>(ref Unsafe.Add(ref second, (nint)i)))) 900ref ushort first = ref Unsafe.As<char, ushort>(ref Unsafe.Add(ref buf, offset)); 901ref ushort last = ref Unsafe.As<char, ushort>(ref Unsafe.Add(ref buf, lastOffset)); 939ref byte first = ref Unsafe.As<char, byte>(ref Unsafe.Add(ref buf, offset)); 940ref byte last = ref Unsafe.As<char, byte>(ref Unsafe.Add(ref buf, lastOffset)); 978ref ushort first = ref Unsafe.As<char, ushort>(ref Unsafe.Add(ref buf, offset)); 979ref ushort last = ref Unsafe.As<char, ushort>(ref Unsafe.Add(ref buf, lastOffset));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.cs (4)
307Reverse(ref Unsafe.As<T, byte>(ref elements), length); 312Reverse(ref Unsafe.As<T, char>(ref elements), length); 317Reverse(ref Unsafe.As<T, int>(ref elements), length); 322Reverse(ref Unsafe.As<T, long>(ref elements), length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Packed.cs (12)
34IndexOf<SpanHelpers.DontNegate<short>, NopTransform>(ref Unsafe.As<char, short>(ref searchSpace), (short)value, length); 39IndexOf<SpanHelpers.Negate<short>, NopTransform>(ref Unsafe.As<char, short>(ref searchSpace), (short)value, length); 44IndexOfAny<SpanHelpers.DontNegate<short>, NopTransform>(ref Unsafe.As<char, short>(ref searchSpace), (short)value0, (short)value1, length); 49IndexOfAny<SpanHelpers.Negate<short>, NopTransform>(ref Unsafe.As<char, short>(ref searchSpace), (short)value0, (short)value1, length); 54IndexOfAny<SpanHelpers.DontNegate<short>>(ref Unsafe.As<char, short>(ref searchSpace), (short)value0, (short)value1, (short)value2, length); 59IndexOfAny<SpanHelpers.Negate<short>>(ref Unsafe.As<char, short>(ref searchSpace), (short)value0, (short)value1, (short)value2, length); 67return IndexOf<SpanHelpers.DontNegate<short>, Or20Transform>(ref Unsafe.As<char, short>(ref searchSpace), (short)value, length); 76return IndexOf<SpanHelpers.Negate<short>, Or20Transform>(ref Unsafe.As<char, short>(ref searchSpace), (short)value, length); 86return IndexOfAny<SpanHelpers.DontNegate<short>, Or20Transform>(ref Unsafe.As<char, short>(ref searchSpace), (short)value0, (short)value1, length); 96return IndexOfAny<SpanHelpers.Negate<short>, Or20Transform>(ref Unsafe.As<char, short>(ref searchSpace), (short)value0, (short)value1, length); 102IndexOfAnyInRange<SpanHelpers.DontNegate<short>>(ref Unsafe.As<char, short>(ref searchSpace), (short)lowInclusive, (short)rangeInclusive, length); 107IndexOfAnyInRange<SpanHelpers.Negate<short>>(ref Unsafe.As<char, short>(ref searchSpace), (short)lowInclusive, (short)rangeInclusive, length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (16)
108ref byte refDataAsBytes = ref Unsafe.As<T, byte>(ref refData); 1466return PackedSpanHelpers.Contains(ref Unsafe.As<T, short>(ref searchSpace), Unsafe.BitCast<T, short>(value), length); 1624=> IndexOfValueType(ref Unsafe.As<char, short>(ref searchSpace), (short)value, length); 1628=> LastIndexOfValueType(ref Unsafe.As<char, short>(ref searchSpace), (short)value, length); 1632NonPackedIndexOfValueType<short, DontNegate<short>>(ref Unsafe.As<char, short>(ref searchSpace), (short)value, length); 1650? PackedSpanHelpers.IndexOf(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.BitCast<TValue, char>(value), length) 1651: PackedSpanHelpers.IndexOfAnyExcept(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.BitCast<TValue, char>(value), length); 1843=> IndexOfAnyValueType(ref Unsafe.As<char, short>(ref searchSpace), (short)value0, (short)value1, length); 1847=> LastIndexOfAnyValueType(ref Unsafe.As<char, short>(ref searchSpace), (short)value0, (short)value1, length); 1877? PackedSpanHelpers.IndexOfAnyIgnoreCase(ref Unsafe.As<TValue, char>(ref searchSpace), lowerCase, length) 1878: PackedSpanHelpers.IndexOfAnyExceptIgnoreCase(ref Unsafe.As<TValue, char>(ref searchSpace), lowerCase, length); 1883? PackedSpanHelpers.IndexOfAny(ref Unsafe.As<TValue, char>(ref searchSpace), char0, char1, length) 1884: PackedSpanHelpers.IndexOfAnyExcept(ref Unsafe.As<TValue, char>(ref searchSpace), char0, char1, length); 2125? PackedSpanHelpers.IndexOfAny(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.BitCast<TValue, char>(value0), Unsafe.BitCast<TValue, char>(value1), Unsafe.BitCast<TValue, char>(value2), length) 2126: PackedSpanHelpers.IndexOfAnyExcept(ref Unsafe.As<TValue, char>(ref searchSpace), Unsafe.BitCast<TValue, char>(value0), Unsafe.BitCast<TValue, char>(value1), Unsafe.BitCast<TValue, char>(value2), length); 3871ref char charSearchSpace = ref Unsafe.As<T, char>(ref searchSpace);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (2)
696return Marvin.ComputeHash32(ref Unsafe.As<char, byte>(ref _firstChar), (uint)_stringLength * 2 /* in bytes, not chars */, (uint)seed, (uint)(seed >> 32)); 717return Marvin.ComputeHash32(ref Unsafe.As<char, byte>(ref MemoryMarshal.GetReference(value)), (uint)value.Length * 2 /* in bytes, not chars */, (uint)seed, (uint)(seed >> 32));
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.cs (2)
532internal ref byte GetRawStringDataAsUInt8() => ref Unsafe.As<char, byte>(ref _firstChar); 533internal ref ushort GetRawStringDataAsUInt16() => ref Unsafe.As<char, ushort>(ref _firstChar);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (1)
2102ref uint charMap = ref Unsafe.As<ProbabilisticMap, uint>(ref map);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Searching.cs (3)
39=> SpanHelpers.ContainsValueType(ref Unsafe.As<char, short>(ref _firstChar), (short)value, Length); 452=> SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref _firstChar), (short)value, Length); 477int result = SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref Unsafe.Add(ref _firstChar, startSearchAt)), (short)value, count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.cs (7)
32IsValidCore(ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(value)), value.Length); 62Unsafe.ReadUnaligned<uint>(ref Unsafe.As<T, byte>(ref searchSpace)) | 63Unsafe.ReadUnaligned<uint>(ref Unsafe.As<T, byte>(ref Unsafe.Add(ref searchSpace, length - sizeof(uint))))); 90Unsafe.ReadUnaligned<ulong>(ref Unsafe.As<T, byte>(ref Unsafe.Add(ref searchSpace, i))) | 91Unsafe.ReadUnaligned<ulong>(ref Unsafe.As<T, byte>(ref Unsafe.Add(ref searchSpace, i + elementsPerUlong))))) 102Unsafe.ReadUnaligned<ulong>(ref Unsafe.As<T, byte>(ref Unsafe.Add(ref searchSpace, i))) | 103Unsafe.ReadUnaligned<ulong>(ref Unsafe.Subtract(ref Unsafe.As<T, byte>(ref Unsafe.Add(ref searchSpace, length)), sizeof(ulong))));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Equality.cs (8)
31&& Equals<byte, ushort, WideningLoader>(ref MemoryMarshal.GetReference(left), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length); 40&& Equals<ushort, ushort, PlainLoader<ushort>>(ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(left)), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length); 182&& EqualsIgnoreCase<byte, ushort, WideningLoader>(ref MemoryMarshal.GetReference(left), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length); 191&& EqualsIgnoreCase<ushort, ushort, PlainLoader<ushort>>(ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(left)), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length); 194EqualsIgnoreCase<ushort, ushort, PlainLoader<ushort>>(ref Unsafe.As<char, ushort>(ref left), ref Unsafe.As<char, ushort>(ref right), length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (2)
2287Unsafe.WriteUnaligned(ref Unsafe.As<char, byte>(ref outputBuffer), vecWide.ToScalar()); 2293Unsafe.WriteUnaligned(ref Unsafe.As<char, byte>(ref outputBuffer), vecWide.ToScalar());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs (44)
42(uint)Add(ref Unsafe.As<uint, int>(ref location), -1); 51(ulong)Add(ref Unsafe.As<ulong, long>(ref location), -1); 64(sbyte)Exchange(ref Unsafe.As<sbyte, byte>(ref location1), (byte)value); 74(short)Exchange(ref Unsafe.As<short, ushort>(ref location1), (ushort)value); 162(uint)Exchange(ref Unsafe.As<uint, int>(ref location1), (int)value); 173(ulong)Exchange(ref Unsafe.As<ulong, long>(ref location1), (long)value); 182=> Unsafe.BitCast<int, float>(Exchange(ref Unsafe.As<float, int>(ref location1), Unsafe.BitCast<float, int>(value))); 191=> Unsafe.BitCast<long, double>(Exchange(ref Unsafe.As<double, long>(ref location1), Unsafe.BitCast<double, long>(value))); 203return (nint)Exchange(ref Unsafe.As<nint, long>(ref location1), (long)value); 220return (nuint)Exchange(ref Unsafe.As<nuint, long>(ref location1), (long)value); 244object? result = Exchange(ref Unsafe.As<T, object?>(ref location1), value); 245return Unsafe.As<object?, T>(ref result); 259ref Unsafe.As<T, byte>(ref location1), 267ref Unsafe.As<T, ushort>(ref location1), 275ref Unsafe.As<T, int>(ref location1), 282ref Unsafe.As<T, long>(ref location1), 298(sbyte)CompareExchange(ref Unsafe.As<sbyte, byte>(ref location1), (byte)value, (byte)comparand); 309(short)CompareExchange(ref Unsafe.As<short, ushort>(ref location1), (ushort)value, (ushort)comparand); 406(uint)CompareExchange(ref Unsafe.As<uint, int>(ref location1), (int)value, (int)comparand); 418(ulong)CompareExchange(ref Unsafe.As<ulong, long>(ref location1), (long)value, (long)comparand); 428=> Unsafe.BitCast<int, float>(CompareExchange(ref Unsafe.As<float, int>(ref location1), Unsafe.BitCast<float, int>(value), Unsafe.BitCast<float, int>(comparand))); 438=> Unsafe.BitCast<long, double>(CompareExchange(ref Unsafe.As<double, long>(ref location1), Unsafe.BitCast<double, long>(value), Unsafe.BitCast<double, long>(comparand))); 451return (nint)CompareExchange(ref Unsafe.As<nint, long>(ref location1), (long)value, (long)comparand); 469return (nuint)CompareExchange(ref Unsafe.As<nuint, long>(ref location1), (long)value, (long)comparand); 494object? result = CompareExchange(ref Unsafe.As<T, object?>(ref location1), value, comparand); 495return Unsafe.As<object?, T>(ref result); 509ref Unsafe.As<T, byte>(ref location1), 518ref Unsafe.As<T, ushort>(ref location1), 527ref Unsafe.As<T, int>(ref location1), 535ref Unsafe.As<T, long>(ref location1), 550(uint)Add(ref Unsafe.As<uint, int>(ref location1), (int)value); 560(ulong)Add(ref Unsafe.As<ulong, long>(ref location1), (long)value); 604(uint)And(ref Unsafe.As<uint, int>(ref location1), (int)value); 636(ulong)And(ref Unsafe.As<ulong, long>(ref location1), (long)value); 671ref Unsafe.As<T, byte>(ref location1), 689ref Unsafe.As<T, ushort>(ref location1), 704ref Unsafe.As<T, int>(ref location1), 711ref Unsafe.As<T, long>(ref location1), 747(uint)Or(ref Unsafe.As<uint, int>(ref location1), (int)value); 779(ulong)Or(ref Unsafe.As<ulong, long>(ref location1), (long)value); 814ref Unsafe.As<T, byte>(ref location1), 832ref Unsafe.As<T, ushort>(ref location1), 847ref Unsafe.As<T, int>(ref location1), 854ref Unsafe.As<T, long>(ref location1),
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Volatile.cs (28)
22Unsafe.As<bool, VolatileBoolean>(ref Unsafe.AsRef(in location)).Value; 27Unsafe.As<bool, VolatileBoolean>(ref location).Value = value; 36Unsafe.As<byte, VolatileByte>(ref Unsafe.AsRef(in location)).Value; 41Unsafe.As<byte, VolatileByte>(ref location).Value = value; 49long result = Read(ref Unsafe.As<double, long>(ref Unsafe.AsRef(in location))); 56Write(ref Unsafe.As<double, long>(ref location), BitConverter.DoubleToInt64Bits(value)); 65Unsafe.As<short, VolatileInt16>(ref Unsafe.AsRef(in location)).Value; 70Unsafe.As<short, VolatileInt16>(ref location).Value = value; 79Unsafe.As<int, VolatileInt32>(ref Unsafe.AsRef(in location)).Value; 84Unsafe.As<int, VolatileInt32>(ref location).Value = value; 92(long)Unsafe.As<long, VolatileIntPtr>(ref Unsafe.AsRef(in location)).Value; 102Unsafe.As<long, VolatileIntPtr>(ref location).Value = (nint)value; 115Unsafe.As<nint, VolatileIntPtr>(ref Unsafe.AsRef(in location)).Value; 120Unsafe.As<nint, VolatileIntPtr>(ref location).Value = value; 130Unsafe.As<sbyte, VolatileSByte>(ref Unsafe.AsRef(in location)).Value; 136Unsafe.As<sbyte, VolatileSByte>(ref location).Value = value; 145Unsafe.As<float, VolatileSingle>(ref Unsafe.AsRef(in location)).Value; 150Unsafe.As<float, VolatileSingle>(ref location).Value = value; 160Unsafe.As<ushort, VolatileUInt16>(ref Unsafe.AsRef(in location)).Value; 166Unsafe.As<ushort, VolatileUInt16>(ref location).Value = value; 176Unsafe.As<uint, VolatileUInt32>(ref Unsafe.AsRef(in location)).Value; 182Unsafe.As<uint, VolatileUInt32>(ref location).Value = value; 190(ulong)Read(ref Unsafe.As<ulong, long>(ref Unsafe.AsRef(in location))); 196Write(ref Unsafe.As<ulong, long>(ref location), (long)value); 206Unsafe.As<nuint, VolatileUIntPtr>(ref Unsafe.AsRef(in location)).Value; 212Unsafe.As<nuint, VolatileUIntPtr>(ref location).Value = value; 222Unsafe.As<T>(Unsafe.As<T, VolatileObject>(ref Unsafe.AsRef(in location)).Value)!; 227Unsafe.As<T, VolatileObject>(ref location).Value = value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (12)
246return nuint_t.TryParse(s, out Unsafe.As<nuint, nuint_t>(ref result)); 257return nuint_t.TryParse(s, provider, out Unsafe.As<nuint, nuint_t>(ref result)); 263return nuint_t.TryParse(s, style, provider, out Unsafe.As<nuint, nuint_t>(ref result)); 269return nuint_t.TryParse(s, out Unsafe.As<nuint, nuint_t>(ref result)); 279return nuint_t.TryParse(utf8Text, out Unsafe.As<nuint, nuint_t>(ref result)); 286return nuint_t.TryParse(s, provider, out Unsafe.As<nuint, nuint_t>(ref result)); 292return nuint_t.TryParse(s, style, provider, out Unsafe.As<nuint, nuint_t>(ref result)); 1182return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nuint, nuint_t>(ref result), out charsConsumed) == Number.ParsingStatus.OK; 1190return Number.TryParseBinaryInteger(s, style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nuint, nuint_t>(ref result), out charsConsumed) == Number.ParsingStatus.OK; 1198return Number.TryParseBinaryInteger(utf8Text, style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out Unsafe.As<nuint, nuint_t>(ref result), out bytesConsumed) == Number.ParsingStatus.OK; 1252return nuint_t.TryParse(utf8Text, style, provider, out Unsafe.As<nuint, nuint_t>(ref result)); 1262return nuint_t.TryParse(utf8Text, provider, out Unsafe.As<nuint, nuint_t>(ref result));
System\Activator.NativeAot.cs (1)
66RawCalliHelper.CallDefaultStructConstructor(defaultConstructor, ref Unsafe.As<T, byte>(ref t));
System\Array.NativeAot.cs (3)
282return ref Unsafe.As<byte, int>(ref Unsafe.As<RawArrayData>(this).Data); 396return Unsafe.As<byte, object>(ref element); 432Unsafe.As<byte, object?>(ref element) = value;
System\CrashInfo.cs (1)
173ulong address = Unsafe.As<Exception, nuint>(ref exception);
System\Enum.NativeAot.cs (9)
91result = (ulong)(long)Unsafe.As<byte, char>(ref pValue); 95result = (ulong)(long)Unsafe.As<byte, sbyte>(ref pValue); 99result = (ulong)(long)Unsafe.As<byte, byte>(ref pValue); 103result = (ulong)(long)Unsafe.As<byte, short>(ref pValue); 107result = (ulong)(long)Unsafe.As<byte, ushort>(ref pValue); 111result = (ulong)(long)Unsafe.As<byte, int>(ref pValue); 115result = (ulong)(long)Unsafe.As<byte, uint>(ref pValue); 119result = (ulong)(long)Unsafe.As<byte, long>(ref pValue); 123result = (ulong)(long)Unsafe.As<byte, ulong>(ref pValue);
System\GC.NativeAot.cs (1)
668ref GCConfigurationContext context = ref Unsafe.As<byte, GCConfigurationContext>(ref *(byte*)configurationContext);
System\InvokeUtils.cs (55)
182Unsafe.As<byte, float>(ref dstValue) = srcValue; 185Unsafe.As<byte, double>(ref dstValue) = srcValue; 190Unsafe.As<byte, short>(ref dstValue) = srcValue; 194Unsafe.As<byte, int>(ref dstValue) = srcValue; 198Unsafe.As<byte, long>(ref dstValue) = srcValue; 210Unsafe.As<byte, short>(ref dstValue) = Unsafe.As<byte, sbyte>(ref srcValue); 213Unsafe.As<byte, int>(ref dstValue) = Unsafe.As<byte, sbyte>(ref srcValue); 216Unsafe.As<byte, long>(ref dstValue) = Unsafe.As<byte, sbyte>(ref srcValue); 219Unsafe.As<byte, float>(ref dstValue) = Unsafe.As<byte, sbyte>(ref srcValue); 222Unsafe.As<byte, double>(ref dstValue) = Unsafe.As<byte, sbyte>(ref srcValue); 235Unsafe.As<byte, float>(ref dstValue) = Unsafe.As<byte, ushort>(ref srcValue); 238Unsafe.As<byte, double>(ref dstValue) = Unsafe.As<byte, ushort>(ref srcValue); 242Unsafe.As<byte, ushort>(ref dstValue) = Unsafe.As<byte, ushort>(ref srcValue); 246Unsafe.As<byte, uint>(ref dstValue) = Unsafe.As<byte, ushort>(ref srcValue); 250Unsafe.As<byte, ulong>(ref dstValue) = Unsafe.As<byte, ushort>(ref srcValue); 262Unsafe.As<byte, int>(ref dstValue) = Unsafe.As<byte, short>(ref srcValue); 265Unsafe.As<byte, long>(ref dstValue) = Unsafe.As<byte, short>(ref srcValue); 268Unsafe.As<byte, float>(ref dstValue) = Unsafe.As<byte, short>(ref srcValue); 271Unsafe.As<byte, double>(ref dstValue) = Unsafe.As<byte, short>(ref srcValue); 283Unsafe.As<byte, long>(ref dstValue) = Unsafe.As<byte, int>(ref srcValue); 286Unsafe.As<byte, float>(ref dstValue) = (float)Unsafe.As<byte, int>(ref srcValue); 289Unsafe.As<byte, double>(ref dstValue) = Unsafe.As<byte, int>(ref srcValue); 302Unsafe.As<byte, long>(ref dstValue) = Unsafe.As<byte, uint>(ref srcValue); 305Unsafe.As<byte, float>(ref dstValue) = (float)Unsafe.As<byte, uint>(ref srcValue); 308Unsafe.As<byte, double>(ref dstValue) = Unsafe.As<byte, uint>(ref srcValue); 320Unsafe.As<byte, float>(ref dstValue) = (float)Unsafe.As<byte, long>(ref srcValue); 323Unsafe.As<byte, double>(ref dstValue) = (double)Unsafe.As<byte, long>(ref srcValue); 335Unsafe.As<byte, float>(ref dstValue) = (float)Unsafe.As<byte, ulong>(ref srcValue); 338Unsafe.As<byte, double>(ref dstValue) = (double)Unsafe.As<byte, ulong>(ref srcValue); 350Unsafe.As<byte, double>(ref dstValue) = Unsafe.As<byte, float>(ref srcValue);
System\Reflection\DynamicInvokeInfo.cs (15)
211thisArg = ref Unsafe.As<object?, byte>(ref thisPtr); 215scoped ref byte ret = ref Unsafe.As<object?, byte>(ref returnObject); 279thisArg = ref Unsafe.As<object?, byte>(ref thisPtr); 283scoped ref byte ret = ref Unsafe.As<object?, byte>(ref returnObject); 345thisArg = ref Unsafe.As<object?, byte>(ref thisPtr); 349scoped ref byte ret = ref Unsafe.As<object?, byte>(ref returnObject); 419Span<object?> copyOfParameters = new(ref Unsafe.As<IntPtr, object?>(ref *pStorage), argCount); 435CopyBackToArray(ref Unsafe.As<IntPtr, object?>(ref *pStorage), parameters, shouldCopyBack); 468Span<object?> copyOfParameters = new(ref Unsafe.As<IntPtr, object?>(ref *pStorage), argCount); 676ref Unsafe.As<object?, byte>(ref copyOfParameters[i]) : ref arg.GetRawData()); 766ref Unsafe.As<object?, byte>(ref copyOfParameters[i]) : ref arg.GetRawData()); 792obj = Pointer.Box((void*)Unsafe.As<byte, IntPtr>(ref obj.GetRawData()), type); 826obj = Pointer.Box((void*)Unsafe.As<byte, IntPtr>(ref obj.GetRawData()), type); 857obj = Pointer.Box((void*)Unsafe.As<byte, IntPtr>(ref byref), type); 867obj = Unsafe.As<byte, object>(ref byref);
System\Runtime\CompilerServices\RuntimeHelpers.NativeAot.cs (1)
390return Unsafe.As<byte, object>(ref target);
System\ValueType.cs (3)
143hashCode.Add(Unsafe.As<byte, float>(ref fieldData)); 147hashCode.Add(Unsafe.As<byte, double>(ref fieldData)); 175object fieldValue = Unsafe.As<byte, object>(ref fieldData);
System.Private.TypeLoader (2)
src\runtime\src\coreclr\nativeaot\Common\src\Internal\Runtime\MethodTable.cs (2)
1280return ref Unsafe.As<byte, T>(ref *((byte*)Unsafe.AsPointer(ref this) + GetFieldOffset(eField))); 1286return ref Unsafe.As<byte, T>(ref *((byte*)Unsafe.AsPointer(ref this) + offset));
System.Private.Windows.Core (116)
_generated\124\Windows.Win32.IAdviseSink.g.cs (1)
269 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\125\Windows.Win32.IBindCtx.g.cs (1)
485 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\128\Windows.Win32.IDataObject.g.cs (1)
541 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\129\Windows.Win32.IDataObjectAsyncCapability.g.cs (1)
323 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\130\Windows.Win32.IDispatch.g.cs (1)
246 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\131\Windows.Win32.IDispatchEx.g.cs (1)
488 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\134\Windows.Win32.IDragSourceHelper.g.cs (1)
208 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\135\Windows.Win32.IDragSourceHelper2.g.cs (1)
217 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\136\Windows.Win32.IDropSource.g.cs (1)
177 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\137\Windows.Win32.IDropSourceNotify.g.cs (1)
169 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\138\Windows.Win32.IDropTarget.g.cs (1)
298 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\139\Windows.Win32.IDropTargetHelper.g.cs (1)
340 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\140\Windows.Win32.IEnumFORMATETC.g.cs (1)
266 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\141\Windows.Win32.IEnumMoniker.g.cs (1)
261 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\142\Windows.Win32.IEnumSTATDATA.g.cs (1)
266 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\143\Windows.Win32.IEnumSTATSTG.g.cs (1)
276 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\144\Windows.Win32.IEnumString.g.cs (1)
263 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\145\Windows.Win32.IEnumUnknown.g.cs (1)
258 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\146\Windows.Win32.IGlobalInterfaceTable.g.cs (1)
245 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\147\Windows.Win32.IInspectable.g.cs (1)
265 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\150\Windows.Win32.IMoniker.g.cs (1)
953 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\154\Windows.Win32.IPersist.g.cs (1)
149 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\155\Windows.Win32.IPersistStream.g.cs (1)
300 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\156\Windows.Win32.IPicture.g.cs (1)
748 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\157\Windows.Win32.IPictureDisp.g.cs (1)
194 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\158\Windows.Win32.IRecordInfo.g.cs (1)
818 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\159\Windows.Win32.IRunningObjectTable.g.cs (1)
404 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\160\Windows.Win32.ISequentialStream.g.cs (1)
229 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\161\Windows.Win32.IServiceProvider.g.cs (1)
152 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\162\Windows.Win32.IStorage.g.cs (1)
876 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\163\Windows.Win32.IStream.g.cs (1)
608 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\164\Windows.Win32.ITypeComp.g.cs (1)
201 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\165\Windows.Win32.ITypeInfo.g.cs (1)
1059 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\166\Windows.Win32.ITypeLib.g.cs (1)
579 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\167\Windows.Win32.IUnknown.g.cs (1)
122 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
System\IO\BinaryReaderExtensions.cs (1)
45return Unsafe.As<long, DateTime>(ref data);
System\IO\BinaryWriterExtensions.cs (1)
23long dateData = Unsafe.As<DateTime, long>(ref value);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
91Unsafe.As<DateTime, ulong>(ref value)).Write(writer);
System\Private\Windows\Ole\Composition.NativeToRuntimeAdapter.cs (7)
30fixed (Com.FORMATETC* nativeFormat = &Unsafe.As<FORMATETC, Com.FORMATETC>(ref pFormatetc)) 68HRESULT result = nativeDataObject.Value->GetCanonicalFormatEtc(Unsafe.As<FORMATETC, Com.FORMATETC>(ref formatIn), out Com.FORMATETC nativeFormat); 69formatOut = Unsafe.As<Com.FORMATETC, FORMATETC>(ref nativeFormat); 75Com.FORMATETC nativeFormat = Unsafe.As<FORMATETC, Com.FORMATETC>(ref format); 85Com.FORMATETC nativeFormat = Unsafe.As<FORMATETC, Com.FORMATETC>(ref format); 96return nativeDataObject.Value->QueryGetData(Unsafe.As<FORMATETC, Com.FORMATETC>(ref format)); 102Com.FORMATETC nativeFormat = Unsafe.As<FORMATETC, Com.FORMATETC>(ref formatIn);
System\Private\Windows\Ole\FormatEnumerator.cs (1)
121rgelt[i] = Unsafe.As<ComTypes.FORMATETC, FORMATETC>(ref elt[i]);
System\SpanReader.cs (2)
144value = Unsafe.ReadUnaligned<TValue>(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(_unread))); 182value = MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As<T, TValue>(ref MemoryMarshal.GetReference(_unread)), count);
System\Value.cs (59)
604return new(Unsafe.As<T, bool>(ref Unsafe.AsRef(in value))); 606return new(Unsafe.As<T, byte>(ref Unsafe.AsRef(in value))); 608return new(Unsafe.As<T, sbyte>(ref Unsafe.AsRef(in value))); 610return new(Unsafe.As<T, char>(ref Unsafe.AsRef(in value))); 612return new(Unsafe.As<T, short>(ref Unsafe.AsRef(in value))); 614return new(Unsafe.As<T, int>(ref Unsafe.AsRef(in value))); 616return new(Unsafe.As<T, long>(ref Unsafe.AsRef(in value))); 618return new(Unsafe.As<T, ushort>(ref Unsafe.AsRef(in value))); 620return new(Unsafe.As<T, uint>(ref Unsafe.AsRef(in value))); 622return new(Unsafe.As<T, ulong>(ref Unsafe.AsRef(in value))); 624return new(Unsafe.As<T, float>(ref Unsafe.AsRef(in value))); 626return new(Unsafe.As<T, double>(ref Unsafe.AsRef(in value))); 628return new(Unsafe.As<T, DateTime>(ref Unsafe.AsRef(in value))); 630return new(Unsafe.As<T, DateTimeOffset>(ref Unsafe.AsRef(in value))); 632return new(Unsafe.As<T, Color>(ref Unsafe.AsRef(in value))); 635return new(Unsafe.As<T, bool?>(ref Unsafe.AsRef(in value))); 637return new(Unsafe.As<T, byte?>(ref Unsafe.AsRef(in value))); 639return new(Unsafe.As<T, sbyte?>(ref Unsafe.AsRef(in value))); 641return new(Unsafe.As<T, char?>(ref Unsafe.AsRef(in value))); 643return new(Unsafe.As<T, short?>(ref Unsafe.AsRef(in value))); 645return new(Unsafe.As<T, int?>(ref Unsafe.AsRef(in value))); 647return new(Unsafe.As<T, long?>(ref Unsafe.AsRef(in value))); 649return new(Unsafe.As<T, ushort?>(ref Unsafe.AsRef(in value))); 651return new(Unsafe.As<T, uint?>(ref Unsafe.AsRef(in value))); 653return new(Unsafe.As<T, ulong?>(ref Unsafe.AsRef(in value))); 655return new(Unsafe.As<T, float?>(ref Unsafe.AsRef(in value))); 657return new(Unsafe.As<T, double?>(ref Unsafe.AsRef(in value))); 659return new(Unsafe.As<T, DateTime?>(ref Unsafe.AsRef(in value))); 661return new(Unsafe.As<T, DateTimeOffset?>(ref Unsafe.AsRef(in value))); 664return new(Unsafe.As<T, ArraySegment<byte>>(ref Unsafe.AsRef(in value))); 666return new(Unsafe.As<T, ArraySegment<char>>(ref Unsafe.AsRef(in value))); 671return new Value(StraightCastFlag<T>.Instance, Unsafe.As<T, ulong>(ref value)); 716value = Unsafe.As<Union, T>(ref Unsafe.AsRef(in _union)); 722value = Unsafe.As<Color, T>(ref Unsafe.AsRef(in color)); 727value = Unsafe.As<DateTime, T>(ref Unsafe.AsRef(in _union.DateTime)); 733value = Unsafe.As<DateTimeOffset, T>(ref Unsafe.AsRef(in dto)); 739value = Unsafe.As<DateTimeOffset, T>(ref Unsafe.AsRef(in dto)); 784value = Unsafe.As<ArraySegment<byte>, T>(ref segment); 800value = Unsafe.As<ArraySegment<char>, T>(ref segment); 811value = Unsafe.As<int?, T>(ref Unsafe.AsRef(in @int)); 817value = Unsafe.As<long?, T>(ref Unsafe.AsRef(in @long)); 823value = Unsafe.As<bool?, T>(ref Unsafe.AsRef(in @bool)); 829value = Unsafe.As<float?, T>(ref Unsafe.AsRef(in single)); 835value = Unsafe.As<double?, T>(ref Unsafe.AsRef(in @double)); 841value = Unsafe.As<uint?, T>(ref Unsafe.AsRef(in @uint)); 847value = Unsafe.As<ulong?, T>(ref Unsafe.AsRef(in @ulong)); 853value = Unsafe.As<char?, T>(ref Unsafe.AsRef(in @char)); 859value = Unsafe.As<short?, T>(ref Unsafe.AsRef(in @short)); 865value = Unsafe.As<ushort?, T>(ref Unsafe.AsRef(in @ushort)); 871value = Unsafe.As<byte?, T>(ref Unsafe.AsRef(in @byte)); 877value = Unsafe.As<sbyte?, T>(ref Unsafe.AsRef(in @sbyte)); 883value = Unsafe.As<Color?, T>(ref Unsafe.AsRef(in color)); 889value = Unsafe.As<DateTime?, T>(ref Unsafe.AsRef(in dateTime)); 895value = Unsafe.As<DateTimeOffset?, T>(ref Unsafe.AsRef(in dto)); 901value = Unsafe.As<DateTimeOffset?, T>(ref Unsafe.AsRef(in dto)); 920value = Unsafe.As<NullableTemplate<byte>, T>(ref Unsafe.AsRef(in byteTemplate)); 925value = Unsafe.As<NullableTemplate<ushort>, T>(ref Unsafe.AsRef(in ushortTemplate)); 930value = Unsafe.As<NullableTemplate<uint>, T>(ref Unsafe.AsRef(in uintTemplate)); 935value = Unsafe.As<NullableTemplate<ulong>, T>(ref Unsafe.AsRef(in ulongTemplate));
System\Value.PackedColor.cs (1)
35CastColor castColor = Unsafe.As<Color, CastColor>(ref Unsafe.AsRef(in color));
System\Value.StraightCastFlag.cs (1)
16public override T To(in Value value) => Unsafe.As<Union, T>(ref Unsafe.AsRef(in value._union));
Windows\Win32\Foundation\HandleRef.cs (2)
57return new(handle.Wrapper, Unsafe.As<THandle, nint>(ref local)); 68return new(handle.Wrapper, Unsafe.As<nint, THandle>(ref local));
Windows\Win32\Graphics\Gdi\ArgbBuffer.cs (1)
38ref Unsafe.As<ARGB, uint>(ref _bufferScope.GetPinnableReference());
Windows\Win32\Graphics\Gdi\HDC.cs (1)
24return Unsafe.As<XFORM, Matrix3x2>(ref matrix);
Windows\Win32\System\Com\IComCallableWrapper.cs (1)
25return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
Windows\Win32\System\Com\IID.cs (1)
18return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
Windows\Win32\UI\ViewManagement\IUISettings3.cs (1)
34return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
System.Private.Windows.Core.TestUtilities (3)
XUnit\InvalidEnumDataAttribute.cs (3)
34currentValue = Unsafe.As<ulong, TEnum>(ref currentFlagValue); 54currentValue = Unsafe.As<ulong, TEnum>(ref minValue); 64currentValue = Unsafe.As<ulong, TEnum>(ref maxValue);
System.Private.Windows.GdiPlus (4)
Windows\Win32\Graphics\GdiPlus\Rect.cs (2)
11public static implicit operator Rectangle(Rect rect) => Unsafe.As<Rect, Rectangle>(ref rect); 12public static implicit operator Rect(Rectangle rectangle) => Unsafe.As<Rectangle, Rect>(ref rectangle);
Windows\Win32\Graphics\GdiPlus\RectF.cs (2)
11public static implicit operator RectangleF(RectF rect) => Unsafe.As<RectF, RectangleF>(ref rect); 12public static implicit operator RectF(RectangleF rectangle) => Unsafe.As<RectangleF, RectF>(ref rectangle);
System.Runtime.Numerics (5)
System\Numerics\Complex.cs (5)
807return Complex<double>.TryParse(MemoryMarshal.Cast<char, Utf16Char>(s), style, provider, out Unsafe.As<Complex, Complex<double>>(ref result), out _); 814return Complex<double>.TryParse(MemoryMarshal.Cast<byte, Utf8Char>(utf8Text), style, provider, out Unsafe.As<Complex, Complex<double>>(ref result), out _); 821return Complex<double>.TryParsePartial(MemoryMarshal.Cast<char, Utf16Char>(s.AsSpan()), style, provider, out Unsafe.As<Complex, Complex<double>>(ref result), out charsConsumed); 828return Complex<double>.TryParsePartial(MemoryMarshal.Cast<byte, Utf8Char>(utf8Text), style, provider, out Unsafe.As<Complex, Complex<double>>(ref result), out bytesConsumed); 835return Complex<double>.TryParsePartial(MemoryMarshal.Cast<char, Utf16Char>(s), style, provider, out Unsafe.As<Complex, Complex<double>>(ref result), out charsConsumed);
System.ServiceModel.NetTcp (2)
System\ServiceModel\Channels\TcpChannelFactory.cs (2)
74return Unsafe.As<TimeSpan, T>(ref temp); 91return Unsafe.As<int, T>(ref temp);
System.ServiceModel.UnixDomainSocket (2)
System\ServiceModel\Channels\UnixDomainSocketChannelFactory.cs (2)
87return Unsafe.As<TimeSpan, T>(ref temp); 104return Unsafe.As<int, T>(ref temp);
System.Text.RegularExpressions.Generator (1)
Stubs.cs (1)
93uint oldValue = (uint)Interlocked.CompareExchange(ref Unsafe.As<uint, int>(ref location1), (int)newValue, (int)current);
System.Threading.Tasks.Parallel (2)
System\Threading\Tasks\ParallelLoopState.cs (2)
362return Unsafe.BitCast<int, TInt>(Volatile.Read(ref Unsafe.As<TInt, int>(ref _lowestBreakIteration))); 366return Unsafe.BitCast<long, TInt>(Volatile.Read(ref Unsafe.As<TInt, long>(ref _lowestBreakIteration)));
System.Windows.Extensions (2)
System\Security\Cryptography\X509Certificates\X509Certificate2UI.cs (2)
130csc.dwSize = (uint)Unsafe.ByteOffset(ref Unsafe.As<Interop.CryptUI.CRYPTUI_SELECTCERTIFICATE_STRUCTW.Marshaller.Native, byte>(ref native), ref Unsafe.As<IntPtr, byte>(ref native.hSelectedCertStore));
System.Windows.Forms (3)
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (1)
425UpdateFont(ref Unsafe.As<LOGFONTW, LOGFONT>(ref logFont));
System\Windows\Forms\PropertyStore.cs (2)
203AddOrUpdate(key, Unsafe.As<T, Padding>(ref value)); 207AddOrUpdate(key, Unsafe.As<T, Rectangle>(ref value));
System.Windows.Forms.Primitives (179)
_generated\107\Windows.Win32.IAccessible.g.cs (1)
1353 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\108\Windows.Win32.IAccessibleEx.g.cs (1)
276 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\109\Windows.Win32.IAdviseSinkEx.g.cs (1)
275 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\110\Windows.Win32.IAutoComplete.g.cs (1)
203 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\111\Windows.Win32.IAutoComplete2.g.cs (1)
257 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\112\Windows.Win32.IBindHost.g.cs (1)
211 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\113\Windows.Win32.IBinding.g.cs (1)
298 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\114\Windows.Win32.IBindStatusCallback.g.cs (1)
391 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\115\Windows.Win32.IClassFactory.g.cs (1)
191 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\116\Windows.Win32.IClassFactory2.g.cs (1)
326 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\118\Windows.Win32.IConnectionPoint.g.cs (1)
309 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\119\Windows.Win32.IConnectionPointContainer.g.cs (1)
190 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\120\Windows.Win32.IEnumConnectionPoints.g.cs (1)
251 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\121\Windows.Win32.IEnumConnections.g.cs (1)
254 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\122\Windows.Win32.IEnumIDList.g.cs (1)
281 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\123\Windows.Win32.IEnumOleUndoUnits.g.cs (1)
256 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\124\Windows.Win32.IEnumOLEVERB.g.cs (1)
266 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\125\Windows.Win32.IEnumShellItems.g.cs (1)
279 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\126\Windows.Win32.IEnumVARIANT.g.cs (1)
260 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\127\Windows.Win32.IErrorInfo.g.cs (1)
316 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\128\Windows.Win32.IErrorLog.g.cs (1)
147 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\129\Windows.Win32.IExpandCollapseProvider.g.cs (1)
211 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\130\Windows.Win32.IFileDialog.g.cs (1)
1138 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\131\Windows.Win32.IFileDialogCustomize.g.cs (1)
1392 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\132\Windows.Win32.IFileDialogEvents.g.cs (1)
412 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\133\Windows.Win32.IFileOpenDialog.g.cs (1)
961 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\134\Windows.Win32.IFileOperationProgressSink.g.cs (1)
925 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\135\Windows.Win32.IFileSaveDialog.g.cs (1)
1096 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\136\Windows.Win32.IFont.g.cs (1)
984 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\137\Windows.Win32.IFontDisp.g.cs (1)
190 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\138\Windows.Win32.IGetOleObject.g.cs (1)
155 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\139\Windows.Win32.IGetVBAObject.g.cs (1)
155 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\140\Windows.Win32.IGridItemProvider.g.cs (1)
306 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\141\Windows.Win32.IGridProvider.g.cs (1)
238 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\142\Windows.Win32.IHTMLCurrentStyle.g.cs (1)
3279 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\143\Windows.Win32.IHTMLDataTransfer.g.cs (1)
414 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\144\Windows.Win32.IHTMLDocument.g.cs (1)
217 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\145\Windows.Win32.IHTMLDocument2.g.cs (1)
3631 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\146\Windows.Win32.IHTMLDocument3.g.cs (1)
1467 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\147\Windows.Win32.IHTMLDocument4.g.cs (1)
653 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\148\Windows.Win32.IHTMLDOMNode.g.cs (1)
813 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\149\Windows.Win32.IHTMLElement.g.cs (1)
2938 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\150\Windows.Win32.IHTMLElement2.g.cs (1)
3285 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\151\Windows.Win32.IHTMLElement3.g.cs (1)
1556 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\152\Windows.Win32.IHTMLElementCollection.g.cs (1)
382 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\153\Windows.Win32.IHTMLEventObj.g.cs (1)
1021 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\154\Windows.Win32.IHTMLFiltersCollection.g.cs (1)
298 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\155\Windows.Win32.IHTMLFormElement.g.cs (1)
931 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\156\Windows.Win32.IHTMLFrameBase.g.cs (1)
747 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\157\Windows.Win32.IHTMLFramesCollection2.g.cs (1)
270 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\158\Windows.Win32.IHTMLImageElementFactory.g.cs (1)
219 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\159\Windows.Win32.IHTMLImgElement.g.cs (1)
1707 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\160\Windows.Win32.IHTMLLocation.g.cs (1)
808 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\161\Windows.Win32.IHTMLMimeTypesCollection.g.cs (1)
223 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\162\Windows.Win32.IHTMLOpsProfile.g.cs (1)
453 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\163\Windows.Win32.IHTMLOptionElement.g.cs (1)
533 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\164\Windows.Win32.IHTMLOptionElementFactory.g.cs (1)
219 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\165\Windows.Win32.IHTMLPluginsCollection.g.cs (1)
251 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\166\Windows.Win32.IHTMLRect.g.cs (1)
437 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\167\Windows.Win32.IHTMLRectCollection.g.cs (1)
298 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\168\Windows.Win32.IHTMLRenderStyle.g.cs (1)
747 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\169\Windows.Win32.IHTMLRuleStyle.g.cs (1)
5209 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\170\Windows.Win32.IHTMLScreen.g.cs (1)
517 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\171\Windows.Win32.IHTMLSelectionObject.g.cs (1)
309 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\172\Windows.Win32.IHTMLStyle.g.cs (1)
5740 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\173\Windows.Win32.IHTMLStyleSheet.g.cs (1)
853 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\174\Windows.Win32.IHTMLStyleSheetRule.g.cs (1)
319 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\175\Windows.Win32.IHTMLStyleSheetRulesCollection.g.cs (1)
253 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\176\Windows.Win32.IHTMLStyleSheetsCollection.g.cs (1)
298 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\177\Windows.Win32.IHTMLWindow2.g.cs (1)
2421 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\178\Windows.Win32.IHTMLWindow3.g.cs (1)
652 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\179\Windows.Win32.IHTMLWindow4.g.cs (1)
258 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\180\Windows.Win32.IInvokeProvider.g.cs (1)
142 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\181\Windows.Win32.ILegacyIAccessibleProvider.g.cs (1)
686 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\182\Windows.Win32.ILockBytes.g.cs (1)
435 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\187\Windows.Win32.IMessageFilter.g.cs (1)
227 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\191\Windows.Win32.IModalWindow.g.cs (1)
142 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\192\Windows.Win32.IMultipleViewProvider.g.cs (1)
268 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\199\Windows.Win32.IOleAdviseHolder.g.cs (1)
325 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\200\Windows.Win32.IOleClientSite.g.cs (1)
320 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\201\Windows.Win32.IOleCommandTarget.g.cs (1)
213 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\202\Windows.Win32.IOleContainer.g.cs (1)
211 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\203\Windows.Win32.IOleControl.g.cs (1)
270 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\204\Windows.Win32.IOleControlSite.g.cs (1)
373 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\205\Windows.Win32.IOleInPlaceActiveObject.g.cs (1)
369 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\206\Windows.Win32.IOleInPlaceFrame.g.cs (1)
588 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\207\Windows.Win32.IOleInPlaceObject.g.cs (1)
331 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\208\Windows.Win32.IOleInPlaceObjectWindowless.g.cs (1)
384 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\209\Windows.Win32.IOleInPlaceSite.g.cs (1)
576 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\210\Windows.Win32.IOleInPlaceUIWindow.g.cs (1)
369 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\211\Windows.Win32.IOleObject.g.cs (1)
998 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\212\Windows.Win32.IOleParentUndoUnit.g.cs (1)
420 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\213\Windows.Win32.IOleUndoManager.g.cs (1)
576 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\214\Windows.Win32.IOleUndoUnit.g.cs (1)
265 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\215\Windows.Win32.IOleWindow.g.cs (1)
191 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\216\Windows.Win32.IOmHistory.g.cs (1)
338 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\217\Windows.Win32.IOmNavigator.g.cs (1)
857 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\218\Windows.Win32.IParseDisplayName.g.cs (1)
153 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\219\Windows.Win32.IPerPropertyBrowsing.g.cs (1)
305 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\220\Windows.Win32.IPersistPropertyBag.g.cs (1)
243 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\221\Windows.Win32.IPersistStorage.g.cs (1)
367 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\222\Windows.Win32.IPersistStreamInit.g.cs (1)
330 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\223\Windows.Win32.IPropertyBag.g.cs (1)
201 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\224\Windows.Win32.IPropertyDescriptionList.g.cs (1)
209 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\225\Windows.Win32.IPropertyNotifySink.g.cs (1)
173 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\226\Windows.Win32.IPropertyStore.g.cs (1)
326 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\227\Windows.Win32.IProvideClassInfo.g.cs (1)
140 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\228\Windows.Win32.IProvideClassInfo2.g.cs (1)
175 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\229\Windows.Win32.IProvideMultipleClassInfo.g.cs (1)
273 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\230\Windows.Win32.IQuickActivate.g.cs (1)
245 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\231\Windows.Win32.IRangeValueProvider.g.cs (1)
399 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\232\Windows.Win32.IRawElementProviderFragment.g.cs (1)
357 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\233\Windows.Win32.IRawElementProviderFragmentRoot.g.cs (1)
189 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\234\Windows.Win32.IRawElementProviderHwndOverride.g.cs (1)
146 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\235\Windows.Win32.IRawElementProviderSimple.g.cs (1)
279 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\236\Windows.Win32.IRichEditOle.g.cs (1)
828 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\237\Windows.Win32.IRichEditOleCallback.g.cs (1)
622 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\238\Windows.Win32.IScrollItemProvider.g.cs (1)
138 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\239\Windows.Win32.IScrollProvider.g.cs (1)
407 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\240\Windows.Win32.ISelectionItemProvider.g.cs (1)
282 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\241\Windows.Win32.ISelectionProvider.g.cs (1)
227 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\242\Windows.Win32.IShellFolder.g.cs (1)
771 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\243\Windows.Win32.IShellItem.g.cs (1)
369 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\244\Windows.Win32.IShellItemArray.g.cs (1)
478 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\245\Windows.Win32.IShellItemFilter.g.cs (1)
192 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\246\Windows.Win32.ISimpleFrameSite.g.cs (1)
207 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\247\Windows.Win32.ISpecifyPropertyPages.g.cs (1)
151 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\248\Windows.Win32.ISupportErrorInfo.g.cs (1)
153 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\249\Windows.Win32.ITableItemProvider.g.cs (1)
176 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\250\Windows.Win32.ITableProvider.g.cs (1)
219 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\252\Windows.Win32.ITextDocument.g.cs (1)
1069 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\253\Windows.Win32.ITextFont.g.cs (1)
2638 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\254\Windows.Win32.ITextPara.g.cs (1)
2336 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\255\Windows.Win32.ITextProvider.g.cs (1)
337 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\256\Windows.Win32.ITextProvider2.g.cs (1)
384 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\257\Windows.Win32.ITextRange.g.cs (1)
2775 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\258\Windows.Win32.ITextRangeProvider.g.cs (1)
816 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\259\Windows.Win32.ITextSelection.g.cs (1)
2522 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\260\Windows.Win32.ITextStoryRanges.g.cs (1)
326 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\261\Windows.Win32.IToggleProvider.g.cs (1)
182 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\262\Windows.Win32.IUIAutomation.g.cs (1)
2461 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\263\Windows.Win32.IUIAutomationCacheRequest.g.cs (1)
412 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\264\Windows.Win32.IUIAutomationCondition.g.cs (1)
102 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\265\Windows.Win32.IUIAutomationElement.g.cs (1)
3284 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\266\Windows.Win32.IUIAutomationElementArray.g.cs (1)
181 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\267\Windows.Win32.IUIAutomationEventHandler.g.cs (1)
147 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\268\Windows.Win32.IUIAutomationFocusChangedEventHandler.g.cs (1)
143 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\269\Windows.Win32.IUIAutomationPropertyChangedEventHandler.g.cs (1)
151 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\270\Windows.Win32.IUIAutomationProxyFactory.g.cs (1)
187 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\271\Windows.Win32.IUIAutomationProxyFactoryEntry.g.cs (1)
574 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\272\Windows.Win32.IUIAutomationProxyFactoryMapping.g.cs (1)
452 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\273\Windows.Win32.IUIAutomationStructureChangedEventHandler.g.cs (1)
147 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\274\Windows.Win32.IUIAutomationTreeWalker.g.cs (1)
663 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\275\Windows.Win32.IValueProvider.g.cs (1)
243 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\276\Windows.Win32.IVBFormat.g.cs (1)
166 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\277\Windows.Win32.IVBGetControl.g.cs (1)
144 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\278\Windows.Win32.IViewObject.g.cs (1)
402 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\279\Windows.Win32.IViewObject2.g.cs (1)
370 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\280\Windows.Win32.IWebBrowser.g.cs (1)
995 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\281\Windows.Win32.IWebBrowser2.g.cs (1)
2308 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\282\Windows.Win32.IWebBrowserApp.g.cs (1)
1637 return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
_generated\624\Windows.Win32.VariableLengthInlineArray.g.cs (1)
28 internal ref T e0 => ref Unsafe.As<TBlittable, T>(ref this._e0);
Microsoft\Office\IMsoComponent.cs (1)
118return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
Microsoft\Office\IMsoComponentManager.cs (1)
30return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
Microsoft\VisualStudio\Shell\ICategorizeProperties.cs (1)
28return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
Microsoft\VisualStudio\Shell\IProvidePropertyBuilder.cs (1)
28return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
Microsoft\VisualStudio\Shell\IVSMDPerPropertyBrowsing.cs (1)
29return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
Microsoft\VisualStudio\Shell\IVsPerPropertyBrowsing.cs (1)
28return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
System\Drawing\FontExtensions.cs (2)
14return Unsafe.As<LOGFONT, LOGFONTW>(ref logFont); 20return Unsafe.As<LOGFONT, LOGFONTW>(ref logFont);
System\EnumExtensions.cs (8)
26Unsafe.As<T, byte>(ref value) |= *(byte*)&flags; 30Unsafe.As<T, byte>(ref value) &= (byte)~*(byte*)&flags; 37Unsafe.As<T, ushort>(ref value) |= *(ushort*)&flags; 41Unsafe.As<T, ushort>(ref value) &= (ushort)~*(ushort*)&flags; 48Unsafe.As<T, uint>(ref value) |= *(uint*)&flags; 52Unsafe.As<T, uint>(ref value) &= ~*(uint*)&flags; 59Unsafe.As<T, ulong>(ref value) |= *(ulong*)&flags; 63Unsafe.As<T, ulong>(ref value) &= ~*(ulong*)&flags;
System\Windows\Forms\IExtender.cs (1)
99return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));