diff --git a/src/libraries/System.Memory/ref/System.Memory.Forwards.cs b/src/libraries/System.Memory/ref/System.Memory.Forwards.cs index e79102cfcd350..88d911fa08d8b 100644 --- a/src/libraries/System.Memory/ref/System.Memory.Forwards.cs +++ b/src/libraries/System.Memory/ref/System.Memory.Forwards.cs @@ -11,3 +11,4 @@ [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.MemoryManager<>))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.OperationStatus))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Base64))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.MemoryMarshal))] diff --git a/src/libraries/System.Memory/ref/System.Memory.cs b/src/libraries/System.Memory/ref/System.Memory.cs index bc4e19712a310..f7b1f5f48d0f7 100644 --- a/src/libraries/System.Memory/ref/System.Memory.cs +++ b/src/libraries/System.Memory/ref/System.Memory.cs @@ -700,39 +700,6 @@ public static partial class Utf8Parser public static bool TryParse(System.ReadOnlySpan source, out ulong value, out int bytesConsumed, char standardFormat = '\0') { throw null; } } } -namespace System.Runtime.InteropServices -{ - public static partial class MemoryMarshal - { - public static System.ReadOnlySpan AsBytes(System.ReadOnlySpan span) where T : struct { throw null; } - public static System.Span AsBytes(System.Span span) where T : struct { throw null; } - public static System.Memory AsMemory(System.ReadOnlyMemory memory) { throw null; } - public static ref readonly T AsRef(System.ReadOnlySpan span) where T : struct { throw null; } - public static ref T AsRef(System.Span span) where T : struct { throw null; } - public static System.ReadOnlySpan Cast(System.ReadOnlySpan span) where TFrom : struct where TTo : struct { throw null; } - public static System.Span Cast(System.Span span) where TFrom : struct where TTo : struct { throw null; } - public static System.Memory CreateFromPinnedArray(T[]? array, int start, int length) { throw null; } - public static System.ReadOnlySpan CreateReadOnlySpan(scoped ref readonly T reference, int length) { throw null; } - [System.CLSCompliant(false)] - public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(byte* value) { throw null; } - [System.CLSCompliant(false)] - public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(char* value) { throw null; } - public static System.Span CreateSpan(scoped ref T reference, int length) { throw null; } - public static ref T GetArrayDataReference(T[] array) { throw null; } - public static ref byte GetArrayDataReference(System.Array array) { throw null; } - public static ref T GetReference(System.ReadOnlySpan span) { throw null; } - public static ref T GetReference(System.Span span) { throw null; } - public static T Read(System.ReadOnlySpan source) where T : struct { throw null; } - public static System.Collections.Generic.IEnumerable ToEnumerable(System.ReadOnlyMemory memory) { throw null; } - public static bool TryGetArray(System.ReadOnlyMemory memory, out System.ArraySegment segment) { throw null; } - public static bool TryGetMemoryManager(System.ReadOnlyMemory memory, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out TManager? manager) where TManager : System.Buffers.MemoryManager { throw null; } - public static bool TryGetMemoryManager(System.ReadOnlyMemory memory, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out TManager? manager, out int start, out int length) where TManager : System.Buffers.MemoryManager { throw null; } - public static bool TryGetString(System.ReadOnlyMemory memory, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out string? text, out int start, out int length) { throw null; } - public static bool TryRead(System.ReadOnlySpan source, out T value) where T : struct { throw null; } - public static bool TryWrite(System.Span destination, in T value) where T : struct { throw null; } - public static void Write(System.Span destination, in T value) where T : struct { } - } -} namespace System.Text { public ref partial struct SpanLineEnumerator diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index db49bbfb30de2..b5ecc14826bfa 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -14034,6 +14034,36 @@ public enum LayoutKind Explicit = 2, Auto = 3, } + public static partial class MemoryMarshal + { + public static System.ReadOnlySpan AsBytes(System.ReadOnlySpan span) where T : struct { throw null; } + public static System.Span AsBytes(System.Span span) where T : struct { throw null; } + public static System.Memory AsMemory(System.ReadOnlyMemory memory) { throw null; } + public static ref readonly T AsRef(System.ReadOnlySpan span) where T : struct { throw null; } + public static ref T AsRef(System.Span span) where T : struct { throw null; } + public static System.ReadOnlySpan Cast(System.ReadOnlySpan span) where TFrom : struct where TTo : struct { throw null; } + public static System.Span Cast(System.Span span) where TFrom : struct where TTo : struct { throw null; } + public static System.Memory CreateFromPinnedArray(T[]? array, int start, int length) { throw null; } + public static System.ReadOnlySpan CreateReadOnlySpan(scoped ref readonly T reference, int length) { throw null; } + [System.CLSCompliant(false)] + public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(byte* value) { throw null; } + [System.CLSCompliant(false)] + public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(char* value) { throw null; } + public static System.Span CreateSpan(scoped ref T reference, int length) { throw null; } + public static ref T GetArrayDataReference(T[] array) { throw null; } + public static ref byte GetArrayDataReference(System.Array array) { throw null; } + public static ref T GetReference(System.ReadOnlySpan span) { throw null; } + public static ref T GetReference(System.Span span) { throw null; } + public static T Read(System.ReadOnlySpan source) where T : struct { throw null; } + public static System.Collections.Generic.IEnumerable ToEnumerable(System.ReadOnlyMemory memory) { throw null; } + public static bool TryGetArray(System.ReadOnlyMemory memory, out System.ArraySegment segment) { throw null; } + public static bool TryGetMemoryManager(System.ReadOnlyMemory memory, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out TManager? manager) where TManager : System.Buffers.MemoryManager { throw null; } + public static bool TryGetMemoryManager(System.ReadOnlyMemory memory, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out TManager? manager, out int start, out int length) where TManager : System.Buffers.MemoryManager { throw null; } + public static bool TryGetString(System.ReadOnlyMemory memory, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out string? text, out int start, out int length) { throw null; } + public static bool TryRead(System.ReadOnlySpan source, out T value) where T : struct { throw null; } + public static bool TryWrite(System.Span destination, in T value) where T : struct { throw null; } + public static void Write(System.Span destination, in T value) where T : struct { } + } public readonly partial struct OSPlatform : System.IEquatable { private readonly object _dummy;