From: Ben Adams Date: Wed, 21 Feb 2018 23:30:17 +0000 (+0000) Subject: Remove OwnedFlagBit from TryGetOwnedMemory index X-Git-Tag: accepted/tizen/unified/20190422.045933~2908 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d72c2319a946e7363675b66bb49e0c9755169f8;p=platform%2Fupstream%2Fcoreclr.git Remove OwnedFlagBit from TryGetOwnedMemory index --- diff --git a/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.cs b/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.cs index 633f56d..7fabf1e 100644 --- a/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.cs +++ b/src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.cs @@ -40,7 +40,7 @@ namespace System.Runtime.InteropServices } /// - /// Gets a from the underlying readOnlyMemory. + /// Gets an from the underlying readOnlyMemory. /// If unable to get the type, returns false. /// /// The element type of the . @@ -57,7 +57,7 @@ namespace System.Runtime.InteropServices } /// - /// Gets a and , from the underlying memory. + /// Gets an and , from the underlying memory. /// If unable to get the type, returns false. /// /// The element type of the . @@ -72,6 +72,7 @@ namespace System.Runtime.InteropServices { TOwner owner; // Use register for null comparison rather than byref ownedMemory = owner = readOnlyMemory.GetObjectStartLength(out index, out length) as TOwner; + index &= ReadOnlyMemory.RemoveOwnedFlagBitMask; return !ReferenceEquals(owner, null); }