Improve GetHashCode for IntPtr/UIntPtr on 64-bit.
authorKevin Jones <kevin@vcsjones.com>
Fri, 4 Mar 2016 17:22:36 +0000 (12:22 -0500)
committerKevin Jones <kevin@vcsjones.com>
Fri, 4 Mar 2016 21:43:41 +0000 (16:43 -0500)
commitc0800cc015d5b7c9096bd778f58024c31f36abeb
tree557b71da785cd46c904d74aed8d2b12b701a2f36
parent17005b51ba4c9019da73f5f601796346b3991959
Improve GetHashCode for IntPtr/UIntPtr on 64-bit.

The GetHashCode behavior on IntPtr and UIntPtr truncated the upper 32 bits.
This change uses the behavior of long and ulong, respectively, to generate
the hash code.

UIntPtr no longer strips off the top-most bit for GetHashCode purposes.

Fix dotnet/coreclr#3506

Commit migrated from https://github.com/dotnet/coreclr/commit/7688c54a9a9938e45625937270e9d29deab62824
src/coreclr/src/mscorlib/src/System/IntPtr.cs
src/coreclr/src/mscorlib/src/System/UIntPtr.cs
src/coreclr/tests/src/CoreMangLib/cti/system/intptr/intptrgethashcode.cs
src/coreclr/tests/src/CoreMangLib/cti/system/uintptr/uintptrgethashcode.cs