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

Commit f5cb4dd

Browse files
ahsonkhansafern
authored andcommitted
Marking Memory struct as readonly, fixing corefx#23809 (#14684)
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
1 parent 4aee110 commit f5cb4dd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Common/src/CoreLib/System/Memory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace System
1414
{
1515
[DebuggerDisplay("{DebuggerDisplay,nq}")]
1616
[DebuggerTypeProxy(typeof(MemoryDebugView<>))]
17-
public struct Memory<T>
17+
public readonly struct Memory<T>
1818
{
1919
// NOTE: With the current implementation, Memory<T> and ReadOnlyMemory<T> must have the same layout,
2020
// as code uses Unsafe.As to cast between them.

src/Common/src/CoreLib/System/ReadOnlyMemory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace System
1414
{
1515
[DebuggerDisplay("{DebuggerDisplay,nq}")]
1616
[DebuggerTypeProxy(typeof(MemoryDebugView<>))]
17-
public struct ReadOnlyMemory<T>
17+
public readonly struct ReadOnlyMemory<T>
1818
{
1919
// NOTE: With the current implementation, Memory<T> and ReadOnlyMemory<T> must have the same layout,
2020
// as code uses Unsafe.As to cast between them.

0 commit comments

Comments
 (0)