Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ad8b5c7

Browse files
committed
Update System.Memory ref based on the netstandard implementation
generated by running the following from src/System.Memory/src dir. msbuild /p:TargetGroup=netstandard /t:GenerateReferenceSource
1 parent 4ba7514 commit ad8b5c7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/System.Memory/ref/System.Memory.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public static void CopyTo<T>(this T[] array, System.Span<T> destination) { }
6565
}
6666
public readonly partial struct Memory<T>
6767
{
68+
private readonly object _dummy;
6869
public Memory(T[] array) { throw null; }
6970
public Memory(T[] array, int start, int length) { throw null; }
7071
public static System.Memory<T> Empty { get { throw null; } }
@@ -89,6 +90,7 @@ public void CopyTo(System.Memory<T> destination) { }
8990
}
9091
public readonly partial struct ReadOnlyMemory<T>
9192
{
93+
private readonly object _dummy;
9294
public ReadOnlyMemory(T[] array) { throw null; }
9395
public ReadOnlyMemory(T[] array, int start, int length) { throw null; }
9496
public static System.ReadOnlyMemory<T> Empty { get { throw null; } }
@@ -111,6 +113,7 @@ public void CopyTo(System.Memory<T> destination) { }
111113
}
112114
public readonly ref partial struct ReadOnlySpan<T>
113115
{
116+
private readonly object _dummy;
114117
[System.CLSCompliantAttribute(false)]
115118
public unsafe ReadOnlySpan(void* pointer, int length) { throw null; }
116119
public ReadOnlySpan(T[] array) { throw null; }
@@ -139,12 +142,14 @@ public void CopyTo(System.Span<T> destination) { }
139142
public bool TryCopyTo(System.Span<T> destination) { throw null; }
140143
public ref partial struct Enumerator
141144
{
145+
private object _dummy;
142146
public ref readonly T Current { get { throw null; } }
143147
public bool MoveNext() { throw null; }
144148
}
145149
}
146150
public readonly ref partial struct Span<T>
147151
{
152+
private readonly object _dummy;
148153
[System.CLSCompliantAttribute(false)]
149154
public unsafe Span(void* pointer, int length) { throw null; }
150155
public Span(T[] array) { throw null; }
@@ -176,6 +181,7 @@ public void Fill(T value) { }
176181
public bool TryCopyTo(System.Span<T> destination) { throw null; }
177182
public ref partial struct Enumerator
178183
{
184+
private object _dummy;
179185
public ref T Current { get { throw null; } }
180186
public bool MoveNext() { throw null; }
181187
}
@@ -190,8 +196,9 @@ public partial interface IRetainable
190196
}
191197
public partial struct MemoryHandle : System.IDisposable
192198
{
199+
private object _dummy;
193200
[System.CLSCompliantAttribute(false)]
194-
public unsafe MemoryHandle(System.Buffers.IRetainable owner, void* pointer=null, System.Runtime.InteropServices.GCHandle handle=default(System.Runtime.InteropServices.GCHandle)) { throw null; }
201+
public unsafe MemoryHandle(System.Buffers.IRetainable retainable, void* pointer=null, System.Runtime.InteropServices.GCHandle handle=default(System.Runtime.InteropServices.GCHandle)) { throw null; }
195202
public bool HasPointer { get { throw null; } }
196203
[System.CLSCompliantAttribute(false)]
197204
public unsafe void* Pointer { get { throw null; } }
@@ -221,6 +228,7 @@ public void Dispose() { }
221228
}
222229
public readonly partial struct StandardFormat : System.IEquatable<System.Buffers.StandardFormat>
223230
{
231+
private readonly int _dummy;
224232
public const byte MaxPrecision = (byte)99;
225233
public const byte NoPrecision = (byte)255;
226234
public StandardFormat(char symbol, byte precision=(byte)255) { throw null; }
@@ -236,6 +244,7 @@ public void Dispose() { }
236244
public static bool operator !=(System.Buffers.StandardFormat left, System.Buffers.StandardFormat right) { throw null; }
237245
public static System.Buffers.StandardFormat Parse(System.ReadOnlySpan<char> format) { throw null; }
238246
public static System.Buffers.StandardFormat Parse(string format) { throw null; }
247+
public override string ToString() { throw null; }
239248
}
240249
}
241250
namespace System.Buffers.Binary

src/System.Memory/src/System/ReadOnlySpan.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public bool TryCopyTo(Span<T> destination)
219219
/// Always thrown by this method.
220220
/// </exception>
221221
/// </summary>
222-
[Obsolete("Equals() on Span will always throw an exception. Use == instead.")]
222+
[Obsolete("Equals() on ReadOnlySpan will always throw an exception. Use == instead.")]
223223
[EditorBrowsable(EditorBrowsableState.Never)]
224224
public override bool Equals(object obj)
225225
{
@@ -232,7 +232,7 @@ public override bool Equals(object obj)
232232
/// Always thrown by this method.
233233
/// </exception>
234234
/// </summary>
235-
[Obsolete("GetHashCode() on Span will always throw an exception.")]
235+
[Obsolete("GetHashCode() on ReadOnlySpan will always throw an exception.")]
236236
[EditorBrowsable(EditorBrowsableState.Never)]
237237
public override int GetHashCode()
238238
{

0 commit comments

Comments
 (0)