Skip to content

Commit

Permalink
Making Memory and ReadOnly readonly, fixing issue #23809
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsonkhan committed Sep 26, 2017
1 parent d235612 commit 35bd795
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/System.Memory/ref/System.Memory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static class SpanExtensions
public static ReadOnlySpan<TTo> NonPortableCast<TFrom, TTo>(this ReadOnlySpan<TFrom> source) where TFrom : struct where TTo : struct { throw null; }
}

public struct ReadOnlyMemory<T>
public readonly struct ReadOnlyMemory<T>
{
public static ReadOnlyMemory<T> Empty { get { throw null; } }
public ReadOnlyMemory(T[] array) { throw null;}
Expand All @@ -147,7 +147,7 @@ public struct ReadOnlyMemory<T>
public bool DangerousTryGetArray(out ArraySegment<T> arraySegment) { throw null; }
}

public struct Memory<T>
public readonly struct Memory<T>
{
public static Memory<T> Empty { get { throw null; } }
public Memory(T[] array) { throw null;}
Expand Down
2 changes: 1 addition & 1 deletion src/System.Memory/src/System/Memory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace System
/// Memory represents a contiguous region of arbitrary memory similar to Span.
/// Unlike Span, it is not a byref-like type.
/// </summary>
public struct Memory<T>
public readonly struct Memory<T>
{
// The highest order bit of _index is used to discern whether _arrayOrOwnedMemory is an array or an owned memory
// if (_index >> 31) == 1, object _arrayOrOwnedMemory is an OwnedMemory<T>
Expand Down
2 changes: 1 addition & 1 deletion src/System.Memory/src/System/ReadOnlyMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace System
/// ReadOnlyMemory represents a contiguous region of arbitrary similar to ReadOnlySpan.
/// Unlike ReadOnlySpan, it is not a byref-like type.
/// </summary>
public struct ReadOnlyMemory<T>
public readonly struct ReadOnlyMemory<T>
{
// The highest order bit of _index is used to discern whether _arrayOrOwnedMemory is an array or an owned memory
// if (_index >> 31) == 1, object _arrayOrOwnedMemory is an OwnedMemory<T>
Expand Down
4 changes: 2 additions & 2 deletions src/System.Runtime/ref/System.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,7 @@ public MemberAccessException(string message) { }
public MemberAccessException(string message, System.Exception inner) { }
protected MemberAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
}
public struct Memory<T>
public readonly struct Memory<T>
{
public static Memory<T> Empty { get { throw null; } }
public Memory(T[] array) { throw null;}
Expand Down Expand Up @@ -1861,7 +1861,7 @@ public RankException(string message) { }
public RankException(string message, System.Exception innerException) { }
protected RankException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
}
public struct ReadOnlyMemory<T>
public readonly struct ReadOnlyMemory<T>
{
public static ReadOnlyMemory<T> Empty { get { throw null; } }
public ReadOnlyMemory(T[] array) { throw null;}
Expand Down

0 comments on commit 35bd795

Please sign in to comment.