summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAhson Khan <ahkha@microsoft.com>2017-10-25 09:44:00 -0700
committerJan Kotas <jkotas@microsoft.com>2017-10-25 09:44:00 -0700
commit66b3785b718ed3291b5c50078a39a5727158d519 (patch)
tree3159463ab2ca60f50d520a177b13db92d713fc6f /src
parent33a5f24d349c327cc508d0136845fd3bf8cac631 (diff)
downloadcoreclr-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.cs2
-rw-r--r--src/mscorlib/shared/System/ReadOnlyMemory.cs2
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.