diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/IntPtr.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/IntPtr.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/System.Private.CoreLib/shared/System/IntPtr.cs b/src/System.Private.CoreLib/shared/System/IntPtr.cs index 45c2ded16..d23742fa7 100644 --- a/src/System.Private.CoreLib/shared/System/IntPtr.cs +++ b/src/System.Private.CoreLib/shared/System/IntPtr.cs @@ -17,13 +17,13 @@ namespace System { [Serializable] [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] - public struct IntPtr : IEquatable<IntPtr>, ISerializable + public readonly struct IntPtr : IEquatable<IntPtr>, ISerializable { // WARNING: We allow diagnostic tools to directly inspect this member (_value). // See https://github.com/dotnet/corert/blob/master/Documentation/design-docs/diagnostics/diagnostics-tools-contract.md for more details. // Please do not change the type, the name, or the semantic usage of this member without understanding the implication for tools. // Get in touch with the diagnostics team if you have questions. - unsafe private void* _value; // Do not rename (binary serialization) + private readonly unsafe void* _value; // Do not rename (binary serialization) [Intrinsic] public static readonly IntPtr Zero; @@ -72,7 +72,7 @@ namespace System info.AddValue("value", ToInt64()); } - public unsafe override bool Equals(Object obj) + public unsafe override bool Equals(object obj) { if (obj is IntPtr) { @@ -81,9 +81,9 @@ namespace System return false; } - unsafe bool IEquatable<IntPtr>.Equals(IntPtr value) + unsafe bool IEquatable<IntPtr>.Equals(IntPtr other) { - return _value == value._value; + return _value == other._value; } public unsafe override int GetHashCode() @@ -217,6 +217,9 @@ namespace System [CLSCompliant(false)] [Intrinsic] [NonVersionable] +#if PROJECTN + [System.Runtime.CompilerServices.DependencyReductionRootAttribute] +#endif public unsafe void* ToPointer() { return _value; |