77 writes to _firstChar
System.Private.CoreLib (77)
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (7)
89fixed (char* ap = &strA._firstChar) fixed (char* bp = &strB._firstChar) 605return Unsafe.Add(ref _firstChar, (nint)localLength - 1) == value; 758return Marvin.ComputeHash32(ref Unsafe.As<char, byte>(ref _firstChar), (uint)_stringLength * 2 /* in bytes, not chars */, (uint)seed, (uint)(seed >> 32)); 769return Marvin.ComputeHash32OrdinalIgnoreCase(ref _firstChar, _stringLength /* in chars, not bytes */, (uint)seed, (uint)(seed >> 32)); 832fixed (char* src = &_firstChar) 929fixed (char* src = &_firstChar)
src\libraries\System.Private.CoreLib\src\System\String.cs (23)
85destination: ref result._firstChar, 111destination: ref result._firstChar, 137destination: ref result._firstChar, 171destination: ref result._firstChar, 300SpanHelpers.Fill(ref result._firstChar, (uint)count, c); 317Buffer.Memmove(ref result._firstChar, ref MemoryMarshal.GetReference(value), (uint)value.Length); 386slice = new ReadOnlySpan<char>(ref Unsafe.Add(ref _firstChar, (nint)(uint)startIndex /* force zero-extension */), count); 405destination: ref result._firstChar, 406source: ref str._firstChar); 428source: ref Unsafe.Add(ref _firstChar, sourceIndex), 440Buffer.Memmove(ref destination._reference, ref _firstChar, (uint)Length); 457Buffer.Memmove(ref destination._reference, ref _firstChar, (uint)Length); 473source: ref _firstChar, 497source: ref Unsafe.Add(ref _firstChar, startIndex), 525public ref readonly char GetPinnableReference() => ref _firstChar; 527internal ref char GetRawStringData() => ref _firstChar; 528internal ref byte GetRawStringDataAsUInt8() => ref Unsafe.As<char, byte>(ref _firstChar); 529internal ref ushort GetRawStringDataAsUInt16() => ref Unsafe.As<char, ushort>(ref _firstChar); 549fixed (char* pTempChars = &s._firstChar) 565result._firstChar = c; 572result._firstChar = c1; 573Unsafe.Add(ref result._firstChar, 1) = c2; 735return Unsafe.Add(ref _firstChar, (nint)(uint)index /* force zero-extension */);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (32)
63destination: ref Unsafe.Add(ref dest._firstChar, destPos), 64source: ref src._firstChar, 296Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 313Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 335Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 360Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 712Buffer.Memmove(ref result._firstChar, ref _firstChar, (nuint)startIndex); 713Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref value._firstChar, (nuint)insertLength); 714Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex + insertLength), ref Unsafe.Add(ref _firstChar, startIndex), (nuint)(oldLength - startIndex)); 1101ref char dest = ref Unsafe.Add(ref result._firstChar, copiedLength); 1137new Span<char>(ref result._firstChar, count).Fill(paddingChar); 1138Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, count), ref _firstChar, (nuint)oldLength); 1155Buffer.Memmove(ref result._firstChar, ref _firstChar, (nuint)oldLength); 1156new Span<char>(ref Unsafe.Add(ref result._firstChar, oldLength), count).Fill(paddingChar); 1176Buffer.Memmove(ref result._firstChar, ref _firstChar, (nuint)startIndex); 1177Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref Unsafe.Add(ref _firstChar, startIndex + count), (nuint)(newLength - startIndex)); 1289Buffer.Memmove(ref result._firstChar, ref _firstChar, (uint)copyLength); 1357int pos = PackedSpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), c, Length - i); 1370int pos = SpanHelpers.NonPackedIndexOfChar(ref Unsafe.Add(ref _firstChar, i), c, Length - i); 1386int pos = SpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), Length - i, ref oldValue._firstChar, oldValue.Length); 1420Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length); 2288destination: ref result._firstChar, 2289source: ref Unsafe.Add(ref _firstChar, (nint)(uint)startIndex /* force zero-extension */));
src\libraries\System.Private.CoreLib\src\System\String.Searching.cs (14)
23ref _firstChar, 25ref value._firstChar, 37=> SpanHelpers.ContainsValueType(ref Unsafe.As<char, short>(ref _firstChar), (short)value, Length); 48public int IndexOf(char value) => SpanHelpers.IndexOfChar(ref _firstChar, value, Length); 79? PackedSpanHelpers.IndexOfAnyIgnoreCase(ref _firstChar, valueLc, Length) 80: SpanHelpers.IndexOfAnyChar(ref _firstChar, valueLc, valueUc, Length); 83return SpanHelpers.IndexOfChar(ref _firstChar, value, Length); 98int result = SpanHelpers.IndexOfChar(ref Unsafe.Add(ref _firstChar, startIndex), value, count); 113return new ReadOnlySpan<char>(ref _firstChar, Length).IndexOfAny(anyOf); 138int result = new ReadOnlySpan<char>(ref Unsafe.Add(ref _firstChar, startIndex), count).IndexOfAny(anyOf); 270=> SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref _firstChar), (short)value, Length); 295int result = SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref Unsafe.Add(ref _firstChar, startSearchAt)), (short)value, count); 312return new ReadOnlySpan<char>(ref _firstChar, Length).LastIndexOfAny(anyOf); 343int result = new ReadOnlySpan<char>(ref Unsafe.Add(ref _firstChar, startSearchAt), count).LastIndexOfAny(anyOf);
src\System\String.CoreCLR.cs (1)
69fixed (char* pwzChar = &_firstChar)
16 references to _firstChar
System.Private.CoreLib (16)
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (14)
83Debug.Assert(strA._firstChar == strB._firstChar, 250if (strA._firstChar != strB._firstChar) 252return strA._firstChar - strB._firstChar; 446if (strA._firstChar != strB._firstChar) 448return strA._firstChar - strB._firstChar; 1134if (this.Length < value.Length || _firstChar != value._firstChar) 1179return _firstChar == value; 1182return Length != 0 && _firstChar == value;
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (2)
2330if (Length == 0 || (!char.IsWhiteSpace(_firstChar) && !char.IsWhiteSpace(this[^1]))) 2340if (Length == 0 || (_firstChar != trimChar && this[^1] != trimChar))