diff options
author | Ahson Khan <ahkha@microsoft.com> | 2017-10-25 09:44:00 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-10-25 09:44:00 -0700 |
commit | 66b3785b718ed3291b5c50078a39a5727158d519 (patch) | |
tree | 3159463ab2ca60f50d520a177b13db92d713fc6f /src | |
parent | 33a5f24d349c327cc508d0136845fd3bf8cac631 (diff) | |
download | coreclr-66b3785b718ed3291b5c50078a39a5727158d519.tar.gz coreclr-66b3785b718ed3291b5c50078a39a5727158d519.tar.bz2 coreclr-66b3785b718ed3291b5c50078a39a5727158d519.zip |
Marking Memory struct as readonly, fixing corefx#23809 (#14684)
Diffstat (limited to 'src')
-rw-r--r-- | src/mscorlib/shared/System/Memory.cs | 2 | ||||
-rw-r--r-- | src/mscorlib/shared/System/ReadOnlyMemory.cs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mscorlib/shared/System/Memory.cs b/src/mscorlib/shared/System/Memory.cs index 5011510bca..ecb33e8918 100644 --- a/src/mscorlib/shared/System/Memory.cs +++ b/src/mscorlib/shared/System/Memory.cs @@ -14,7 +14,7 @@ namespace System { [DebuggerDisplay("{DebuggerDisplay,nq}")] [DebuggerTypeProxy(typeof(MemoryDebugView<>))] - public struct Memory<T> + public readonly struct Memory<T> { // NOTE: With the current implementation, Memory<T> and ReadOnlyMemory<T> must have the same layout, // as code uses Unsafe.As to cast between them. diff --git a/src/mscorlib/shared/System/ReadOnlyMemory.cs b/src/mscorlib/shared/System/ReadOnlyMemory.cs index 2216902f66..c2ba4ab41d 100644 --- a/src/mscorlib/shared/System/ReadOnlyMemory.cs +++ b/src/mscorlib/shared/System/ReadOnlyMemory.cs @@ -14,7 +14,7 @@ namespace System { [DebuggerDisplay("{DebuggerDisplay,nq}")] [DebuggerTypeProxy(typeof(MemoryDebugView<>))] - public struct ReadOnlyMemory<T> + public readonly struct ReadOnlyMemory<T> { // NOTE: With the current implementation, Memory<T> and ReadOnlyMemory<T> must have the same layout, // as code uses Unsafe.As to cast between them. |