From 9e38c16f94ff801a9f7c2b678a1db44c9c9caccd Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 20 Mar 2018 11:23:57 +0100 Subject: FastCompareStringHelper has alignment issues on arm64 --- src/System.Private.CoreLib/src/System/String.Comparison.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/System.Private.CoreLib/src/System/String.Comparison.cs b/src/System.Private.CoreLib/src/System/String.Comparison.cs index a33b7fcd1..5086ea0ae 100644 --- a/src/System.Private.CoreLib/src/System/String.Comparison.cs +++ b/src/System.Private.CoreLib/src/System/String.Comparison.cs @@ -22,7 +22,7 @@ namespace System // //Native Static Methods // - +#if !MONO private static unsafe int FastCompareStringHelper(uint* strAChars, int countA, uint* strBChars, int countB) { int count = (countA < countB) ? countA : countB; @@ -129,15 +129,6 @@ namespace System } #endif // BIT64 -#if MONO - char* ptr2 = (char*)strBChars; - while ((count -= 1) >= 0) - { - if ((*((char*)((byte*)ptr2 + diff)) - *ptr2) != 0) - return ((int)*((char*)((byte*)ptr2 + diff)) - (int)*ptr2); - ++ptr2; - } -#else // Loop comparing a DWORD at a time. // Reads are potentially unaligned while ((count -= 2) >= 0) @@ -157,12 +148,11 @@ namespace System if (count == -1) if ((c = *((char*)((byte*)strBChars + diff)) - *((char*)strBChars)) != 0) return c; -#endif } return countA - countB; } - +#endif // // // NATIVE INSTANCE METHODS -- cgit v1.2.3