diff options
author | Marek Safar <marek.safar@gmail.com> | 2018-03-20 13:23:57 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-03-20 13:23:57 +0300 |
commit | 9e38c16f94ff801a9f7c2b678a1db44c9c9caccd (patch) | |
tree | 877962140837c0374344a851a4eca6ae4d4cefc6 | |
parent | 9e9ac9e00d6033417b267618714e336a79538c39 (diff) |
FastCompareStringHelper has alignment issues on arm64
-rw-r--r-- | src/System.Private.CoreLib/src/System/String.Comparison.cs | 14 |
1 files changed, 2 insertions, 12 deletions
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 |