80 writes to _firstChar
System.Private.CoreLib (80)
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (11)
77
if (Unsafe.Add(ref strA.
_firstChar
, 1) != Unsafe.Add(ref strB.
_firstChar
, 1)) goto DiffOffset1;
87
ref Unsafe.Add(ref strA.
_firstChar
, 2), strA.Length - 2,
88
ref Unsafe.Add(ref strB.
_firstChar
, 2), strB.Length - 2);
99
return Unsafe.Add(ref strA.
_firstChar
, 1) - Unsafe.Add(ref strB.
_firstChar
, 1);
498
return Unsafe.Add(ref
_firstChar
, (nint)localLength - 1) == value;
689
return Marvin.ComputeHash32(ref Unsafe.As<char, byte>(ref
_firstChar
), (uint)_stringLength * 2 /* in bytes, not chars */, (uint)seed, (uint)(seed >> 32));
700
return Marvin.ComputeHash32OrdinalIgnoreCase(ref
_firstChar
, _stringLength /* in chars, not bytes */, (uint)seed, (uint)(seed >> 32));
763
fixed (char* src = &
_firstChar
)
860
fixed (char* src = &
_firstChar
)
src\libraries\System.Private.CoreLib\src\System\String.cs (23)
85
destination: ref result.
_firstChar
,
111
destination: ref result.
_firstChar
,
137
destination: ref result.
_firstChar
,
171
destination: ref result.
_firstChar
,
300
SpanHelpers.Fill(ref result.
_firstChar
, (uint)count, c);
317
Buffer.Memmove(ref result.
_firstChar
, ref MemoryMarshal.GetReference(value), (uint)value.Length);
386
slice = new ReadOnlySpan<char>(ref Unsafe.Add(ref
_firstChar
, (nint)(uint)startIndex /* force zero-extension */), count);
405
destination: ref result.
_firstChar
,
406
source: ref str.
_firstChar
);
428
source: ref Unsafe.Add(ref
_firstChar
, sourceIndex),
440
Buffer.Memmove(ref destination._reference, ref
_firstChar
, (uint)Length);
457
Buffer.Memmove(ref destination._reference, ref
_firstChar
, (uint)Length);
473
source: ref
_firstChar
,
497
source: ref Unsafe.Add(ref
_firstChar
, startIndex),
525
public ref readonly char GetPinnableReference() => ref
_firstChar
;
527
internal ref char GetRawStringData() => ref
_firstChar
;
528
internal ref byte GetRawStringDataAsUInt8() => ref Unsafe.As<char, byte>(ref
_firstChar
);
529
internal ref ushort GetRawStringDataAsUInt16() => ref Unsafe.As<char, ushort>(ref
_firstChar
);
549
fixed (char* pTempChars = &s.
_firstChar
)
565
result.
_firstChar
= c;
572
result.
_firstChar
= c1;
573
Unsafe.Add(ref result.
_firstChar
, 1) = c2;
735
return Unsafe.Add(ref
_firstChar
, (nint)(uint)index /* force zero-extension */);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (32)
63
destination: ref Unsafe.Add(ref dest.
_firstChar
, destPos),
64
source: ref src.
_firstChar
,
296
Span<char> resultSpan = new Span<char>(ref result.
_firstChar
, result.Length);
313
Span<char> resultSpan = new Span<char>(ref result.
_firstChar
, result.Length);
335
Span<char> resultSpan = new Span<char>(ref result.
_firstChar
, result.Length);
360
Span<char> resultSpan = new Span<char>(ref result.
_firstChar
, result.Length);
708
Buffer.Memmove(ref result.
_firstChar
, ref
_firstChar
, (nuint)startIndex);
709
Buffer.Memmove(ref Unsafe.Add(ref result.
_firstChar
, startIndex), ref value.
_firstChar
, (nuint)insertLength);
710
Buffer.Memmove(ref Unsafe.Add(ref result.
_firstChar
, startIndex + insertLength), ref Unsafe.Add(ref
_firstChar
, startIndex), (nuint)(oldLength - startIndex));
1097
ref char dest = ref Unsafe.Add(ref result.
_firstChar
, copiedLength);
1133
new Span<char>(ref result.
_firstChar
, count).Fill(paddingChar);
1134
Buffer.Memmove(ref Unsafe.Add(ref result.
_firstChar
, count), ref
_firstChar
, (nuint)oldLength);
1151
Buffer.Memmove(ref result.
_firstChar
, ref
_firstChar
, (nuint)oldLength);
1152
new Span<char>(ref Unsafe.Add(ref result.
_firstChar
, oldLength), count).Fill(paddingChar);
1172
Buffer.Memmove(ref result.
_firstChar
, ref
_firstChar
, (nuint)startIndex);
1173
Buffer.Memmove(ref Unsafe.Add(ref result.
_firstChar
, startIndex), ref Unsafe.Add(ref
_firstChar
, startIndex + count), (nuint)(newLength - startIndex));
1285
Buffer.Memmove(ref result.
_firstChar
, ref
_firstChar
, (uint)copyLength);
1353
int pos = PackedSpanHelpers.IndexOf(ref Unsafe.Add(ref
_firstChar
, i), c, Length - i);
1366
int pos = SpanHelpers.NonPackedIndexOfChar(ref Unsafe.Add(ref
_firstChar
, i), c, Length - i);
1382
int pos = SpanHelpers.IndexOf(ref Unsafe.Add(ref
_firstChar
, i), Length - i, ref oldValue.
_firstChar
, oldValue.Length);
1416
Span<char> dstSpan = new Span<char>(ref dst.
_firstChar
, dst.Length);
2345
destination: ref result.
_firstChar
,
2346
source: ref Unsafe.Add(ref
_firstChar
, (nint)(uint)startIndex /* force zero-extension */));
src\libraries\System.Private.CoreLib\src\System\String.Searching.cs (13)
25
ref
_firstChar
,
27
ref value.
_firstChar
,
39
=> SpanHelpers.ContainsValueType(ref Unsafe.As<char, short>(ref
_firstChar
), (short)value, Length);
71
public int IndexOf(char value) => SpanHelpers.IndexOfChar(ref
_firstChar
, value, Length);
136
ref char startChar = ref Unsafe.Add(ref
_firstChar
, startIndex);
171
int result = SpanHelpers.IndexOfChar(ref Unsafe.Add(ref
_firstChar
, startIndex), value, count);
186
return new ReadOnlySpan<char>(ref
_firstChar
, Length).IndexOfAny(anyOf);
211
int result = new ReadOnlySpan<char>(ref Unsafe.Add(ref
_firstChar
, startIndex), count).IndexOfAny(anyOf);
446
=> SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref
_firstChar
), (short)value, Length);
471
int result = SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref Unsafe.Add(ref
_firstChar
, startSearchAt)), (short)value, count);
551
ref char startChar = ref Unsafe.Add(ref
_firstChar
, startSearchAt);
589
return new ReadOnlySpan<char>(ref
_firstChar
, Length).LastIndexOfAny(anyOf);
620
int result = new ReadOnlySpan<char>(ref Unsafe.Add(ref
_firstChar
, startSearchAt), count).LastIndexOfAny(anyOf);
src\System\String.CoreCLR.cs (1)
55
fixed (char* pwzChar = &
_firstChar
)
10 references to _firstChar
System.Private.CoreLib (10)
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (8)
62
if (strA.
_firstChar
!= strB.
_firstChar
) goto DiffOffset0;
96
return strA.
_firstChar
- strB.
_firstChar
;
1065
if (this.Length < value.Length ||
_firstChar
!= value.
_firstChar
)
1110
return
_firstChar
== value;
1113
return Length != 0 &&
_firstChar
== value;
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (2)
2387
if (Length == 0 || (!char.IsWhiteSpace(
_firstChar
) && !char.IsWhiteSpace(this[^1])))
2397
if (Length == 0 || (
_firstChar
!= trimChar && this[^1] != trimChar))