diff options
author | Jan Kotas <jkotas@microsoft.com> | 2016-01-13 09:36:00 -0800 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-01-13 09:36:00 -0800 |
commit | 986e347fc85508becb7615c96c1661264d6b4756 (patch) | |
tree | 720fd13c712b8e5aaa4ecf07ae718e789adbe3db /src | |
parent | 64f6a0c643fa12a27419e943dbdfa8ec2c3acf88 (diff) | |
parent | c72bec545194f3be2cdac4f6e99fa47f26b6d820 (diff) | |
download | coreclr-986e347fc85508becb7615c96c1661264d6b4756.tar.gz coreclr-986e347fc85508becb7615c96c1661264d6b4756.tar.bz2 coreclr-986e347fc85508becb7615c96c1661264d6b4756.zip |
Merge pull request #2636 from bbowyersmyth/FixedString
Port https://github.com/dotnet/corert/pull/629 to CoreCLR
Diffstat (limited to 'src')
-rw-r--r-- | src/mscorlib/src/System/String.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mscorlib/src/System/String.cs b/src/mscorlib/src/System/String.cs index 45c40231dc..24795050ef 100644 --- a/src/mscorlib/src/System/String.cs +++ b/src/mscorlib/src/System/String.cs @@ -799,7 +799,7 @@ namespace System { #endif // FEATURE_RANDOMIZED_STRING_HASHING unsafe { - fixed (char *src = this) { + fixed (char* src = &m_firstChar) { Contract.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'"); Contract.Assert( ((int)src)%4 == 0, "Managed string should start at 4 bytes boundary"); @@ -856,7 +856,7 @@ namespace System { [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] internal int GetLegacyNonRandomizedHashCode() { unsafe { - fixed (char *src = this) { + fixed (char* src = &m_firstChar) { Contract.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'"); Contract.Assert( ((int)src)%4 == 0, "Managed string should start at 4 bytes boundary"); @@ -1537,7 +1537,7 @@ namespace System { String result = FastAllocateString(value.Length); unsafe { - fixed (char * dest = result, source = value) { + fixed (char* dest = &result.m_firstChar, source = value) { wstrcpy(dest, source, value.Length); } } @@ -1567,7 +1567,7 @@ namespace System { String result = FastAllocateString(length); unsafe { - fixed (char * dest = result, source = value) { + fixed (char* dest = &result.m_firstChar, source = value) { wstrcpy(dest, source + startIndex, length); } } @@ -1585,7 +1585,7 @@ namespace System { if (c != 0) { unsafe { - fixed (char *dest = result) { + fixed (char* dest = &result.m_firstChar) { char *dmem = dest; while (((uint)dmem & 3) != 0 && count > 0) { *dmem++ = c; @@ -1670,7 +1670,7 @@ namespace System { return String.Empty; String result = FastAllocateString(count); - fixed (char *dest = result) + fixed (char* dest = &result.m_firstChar) wstrcpy(dest, ptr, count); return result; } @@ -1704,7 +1704,7 @@ namespace System { String result = FastAllocateString(length); try { - fixed(char *dest = result) + fixed (char* dest = &result.m_firstChar) wstrcpy(dest, pFrom, length); return result; } |