src\libraries\System.Private.CoreLib\src\System\Array.cs (19)
63ref MemoryMarshal.GetArrayDataReference(newArray),
64ref MemoryMarshal.GetArrayDataReference(larray),
1125ref T first = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)startIndex);
1515ref Unsafe.Add(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1523ref Unsafe.Add(ref Unsafe.As<T, short>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1531ref Unsafe.Add(ref Unsafe.As<T, int>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1539ref Unsafe.Add(ref Unsafe.As<T, long>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1760ref Unsafe.Add(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
1770ref Unsafe.Add(ref Unsafe.As<T, short>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
1780ref Unsafe.Add(ref Unsafe.As<T, int>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
1790ref Unsafe.Add(ref Unsafe.As<T, long>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
1893SpanHelpers.Reverse(ref MemoryMarshal.GetArrayDataReference(array), (nuint)array.Length);
1910SpanHelpers.Reverse(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), (nuint)length);
2111var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length);
2160var span = new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), length);
2184var spanKeys = new Span<TKey>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(keys), index), length);
2185var spanItems = new Span<TValue>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(items), index), length);
2202var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length);
2673new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (26)
45Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value ? (byte)1 : (byte)0);
72Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
99Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
126Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
153Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
180Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
209Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
238Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
267Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
296Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
323Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
350Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
377Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), value);
403return Unsafe.ReadUnaligned<char>(ref MemoryMarshal.GetReference(value));
438return Unsafe.ReadUnaligned<short>(ref MemoryMarshal.GetReference(value));
476return Unsafe.ReadUnaligned<int>(ref MemoryMarshal.GetReference(value));
514return Unsafe.ReadUnaligned<long>(ref MemoryMarshal.GetReference(value));
552return Unsafe.ReadUnaligned<Int128>(ref MemoryMarshal.GetReference(value));
579return Unsafe.ReadUnaligned<ushort>(ref MemoryMarshal.GetReference(value));
609return Unsafe.ReadUnaligned<uint>(ref MemoryMarshal.GetReference(value));
639return Unsafe.ReadUnaligned<ulong>(ref MemoryMarshal.GetReference(value));
679return Unsafe.ReadUnaligned<UInt128>(ref MemoryMarshal.GetReference(value));
704return Unsafe.ReadUnaligned<Half>(ref MemoryMarshal.GetReference(value));
732return Unsafe.ReadUnaligned<float>(ref MemoryMarshal.GetReference(value));
760return Unsafe.ReadUnaligned<double>(ref MemoryMarshal.GetReference(value));
886return Unsafe.ReadUnaligned<byte>(ref MemoryMarshal.GetReference(value)) != 0;
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReadBigEndian.cs (52)
24BitConverter.Int64BitsToDouble(ReverseEndianness(MemoryMarshal.Read<long>(source))) :
25MemoryMarshal.Read<double>(source);
41BitConverter.Int16BitsToHalf(ReverseEndianness(MemoryMarshal.Read<short>(source))) :
42MemoryMarshal.Read<Half>(source);
58ReverseEndianness(MemoryMarshal.Read<short>(source)) :
59MemoryMarshal.Read<short>(source);
75ReverseEndianness(MemoryMarshal.Read<int>(source)) :
76MemoryMarshal.Read<int>(source);
92ReverseEndianness(MemoryMarshal.Read<long>(source)) :
93MemoryMarshal.Read<long>(source);
109ReverseEndianness(MemoryMarshal.Read<Int128>(source)) :
110MemoryMarshal.Read<Int128>(source);
126ReverseEndianness(MemoryMarshal.Read<nint>(source)) :
127MemoryMarshal.Read<nint>(source);
143BitConverter.Int32BitsToSingle(ReverseEndianness(MemoryMarshal.Read<int>(source))) :
144MemoryMarshal.Read<float>(source);
161ReverseEndianness(MemoryMarshal.Read<ushort>(source)) :
162MemoryMarshal.Read<ushort>(source);
179ReverseEndianness(MemoryMarshal.Read<uint>(source)) :
180MemoryMarshal.Read<uint>(source);
197ReverseEndianness(MemoryMarshal.Read<ulong>(source)) :
198MemoryMarshal.Read<ulong>(source);
215ReverseEndianness(MemoryMarshal.Read<UInt128>(source)) :
216MemoryMarshal.Read<UInt128>(source);
233ReverseEndianness(MemoryMarshal.Read<nuint>(source)) :
234MemoryMarshal.Read<nuint>(source);
251bool success = MemoryMarshal.TryRead(source, out long tmp);
256return MemoryMarshal.TryRead(source, out value);
273bool success = MemoryMarshal.TryRead(source, out short tmp);
278return MemoryMarshal.TryRead(source, out value);
295bool success = MemoryMarshal.TryRead(source, out short tmp);
300return MemoryMarshal.TryRead(source, out value);
317bool success = MemoryMarshal.TryRead(source, out int tmp);
322return MemoryMarshal.TryRead(source, out value);
339bool success = MemoryMarshal.TryRead(source, out long tmp);
344return MemoryMarshal.TryRead(source, out value);
361bool success = MemoryMarshal.TryRead(source, out Int128 tmp);
366return MemoryMarshal.TryRead(source, out value);
383bool success = MemoryMarshal.TryRead(source, out nint tmp);
388return MemoryMarshal.TryRead(source, out value);
404bool success = MemoryMarshal.TryRead(source, out int tmp);
409return MemoryMarshal.TryRead(source, out value);
427bool success = MemoryMarshal.TryRead(source, out ushort tmp);
432return MemoryMarshal.TryRead(source, out value);
450bool success = MemoryMarshal.TryRead(source, out uint tmp);
455return MemoryMarshal.TryRead(source, out value);
473bool success = MemoryMarshal.TryRead(source, out ulong tmp);
478return MemoryMarshal.TryRead(source, out value);
496bool success = MemoryMarshal.TryRead(source, out UInt128 tmp);
501return MemoryMarshal.TryRead(source, out value);
520bool success = MemoryMarshal.TryRead(source, out nuint tmp);
525return MemoryMarshal.TryRead(source, out value);
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReadLittleEndian.cs (52)
24BitConverter.Int64BitsToDouble(ReverseEndianness(MemoryMarshal.Read<long>(source))) :
25MemoryMarshal.Read<double>(source);
41BitConverter.Int16BitsToHalf(ReverseEndianness(MemoryMarshal.Read<short>(source))) :
42MemoryMarshal.Read<Half>(source);
58ReverseEndianness(MemoryMarshal.Read<short>(source)) :
59MemoryMarshal.Read<short>(source);
75ReverseEndianness(MemoryMarshal.Read<int>(source)) :
76MemoryMarshal.Read<int>(source);
92ReverseEndianness(MemoryMarshal.Read<long>(source)) :
93MemoryMarshal.Read<long>(source);
109ReverseEndianness(MemoryMarshal.Read<Int128>(source)) :
110MemoryMarshal.Read<Int128>(source);
126ReverseEndianness(MemoryMarshal.Read<nint>(source)) :
127MemoryMarshal.Read<nint>(source);
143BitConverter.Int32BitsToSingle(ReverseEndianness(MemoryMarshal.Read<int>(source))) :
144MemoryMarshal.Read<float>(source);
161ReverseEndianness(MemoryMarshal.Read<ushort>(source)) :
162MemoryMarshal.Read<ushort>(source);
179ReverseEndianness(MemoryMarshal.Read<uint>(source)) :
180MemoryMarshal.Read<uint>(source);
197ReverseEndianness(MemoryMarshal.Read<ulong>(source)) :
198MemoryMarshal.Read<ulong>(source);
215ReverseEndianness(MemoryMarshal.Read<UInt128>(source)) :
216MemoryMarshal.Read<UInt128>(source);
233ReverseEndianness(MemoryMarshal.Read<nuint>(source)) :
234MemoryMarshal.Read<nuint>(source);
251bool success = MemoryMarshal.TryRead(source, out long tmp);
256return MemoryMarshal.TryRead(source, out value);
273bool success = MemoryMarshal.TryRead(source, out short tmp);
278return MemoryMarshal.TryRead(source, out value);
295return MemoryMarshal.TryRead(source, out value);
298bool success = MemoryMarshal.TryRead(source, out short tmp);
317return MemoryMarshal.TryRead(source, out value);
320bool success = MemoryMarshal.TryRead(source, out int tmp);
339return MemoryMarshal.TryRead(source, out value);
342bool success = MemoryMarshal.TryRead(source, out long tmp);
361return MemoryMarshal.TryRead(source, out value);
364bool success = MemoryMarshal.TryRead(source, out Int128 tmp);
383return MemoryMarshal.TryRead(source, out value);
386bool success = MemoryMarshal.TryRead(source, out nint tmp);
404bool success = MemoryMarshal.TryRead(source, out int tmp);
409return MemoryMarshal.TryRead(source, out value);
427return MemoryMarshal.TryRead(source, out value);
430bool success = MemoryMarshal.TryRead(source, out ushort tmp);
450return MemoryMarshal.TryRead(source, out value);
453bool success = MemoryMarshal.TryRead(source, out uint tmp);
473return MemoryMarshal.TryRead(source, out value);
476bool success = MemoryMarshal.TryRead(source, out ulong tmp);
496return MemoryMarshal.TryRead(source, out value);
499bool success = MemoryMarshal.TryRead(source, out UInt128 tmp);
519return MemoryMarshal.TryRead(source, out value);
522bool success = MemoryMarshal.TryRead(source, out nuint tmp);
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (16)
202ReverseEndianness<short, Int16EndiannessReverser>(MemoryMarshal.Cast<ushort, short>(source), MemoryMarshal.Cast<ushort, short>(destination));
211ReverseEndianness<int, Int32EndiannessReverser>(MemoryMarshal.Cast<uint, int>(source), MemoryMarshal.Cast<uint, int>(destination));
220ReverseEndianness<long, Int64EndiannessReverser>(MemoryMarshal.Cast<ulong, long>(source), MemoryMarshal.Cast<ulong, long>(destination));
230ReverseEndianness<long, Int64EndiannessReverser>(MemoryMarshal.Cast<nuint, long>(source), MemoryMarshal.Cast<nuint, long>(destination));
238ReverseEndianness<long, Int64EndiannessReverser>(MemoryMarshal.Cast<nint, long>(source), MemoryMarshal.Cast<nint, long>(destination));
294ref T sourceRef = ref MemoryMarshal.GetReference(source);
295ref T destRef = ref MemoryMarshal.GetReference(destination);
376ReverseEndianness(MemoryMarshal.Cast<UInt128, Int128>(source), MemoryMarshal.Cast<UInt128, Int128>(destination));
386if (Unsafe.AreSame(ref MemoryMarshal.GetReference(source), ref MemoryMarshal.GetReference(destination)) ||
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteBigEndian.cs (52)
26MemoryMarshal.Write(destination, in tmp);
30MemoryMarshal.Write(destination, in value);
49MemoryMarshal.Write(destination, in tmp);
53MemoryMarshal.Write(destination, in value);
72MemoryMarshal.Write(destination, in tmp);
76MemoryMarshal.Write(destination, in value);
95MemoryMarshal.Write(destination, in tmp);
99MemoryMarshal.Write(destination, in value);
118MemoryMarshal.Write(destination, in tmp);
122MemoryMarshal.Write(destination, in value);
141MemoryMarshal.Write(destination, in tmp);
145MemoryMarshal.Write(destination, in value);
164MemoryMarshal.Write(destination, in tmp);
168MemoryMarshal.Write(destination, in value);
187MemoryMarshal.Write(destination, in tmp);
191MemoryMarshal.Write(destination, in value);
211MemoryMarshal.Write(destination, in tmp);
215MemoryMarshal.Write(destination, in value);
235MemoryMarshal.Write(destination, in tmp);
239MemoryMarshal.Write(destination, in value);
259MemoryMarshal.Write(destination, in tmp);
263MemoryMarshal.Write(destination, in value);
283MemoryMarshal.Write(destination, in tmp);
287MemoryMarshal.Write(destination, in value);
307MemoryMarshal.Write(destination, in tmp);
311MemoryMarshal.Write(destination, in value);
330return MemoryMarshal.TryWrite(destination, in tmp);
333return MemoryMarshal.TryWrite(destination, in value);
351return MemoryMarshal.TryWrite(destination, in tmp);
354return MemoryMarshal.TryWrite(destination, in value);
372return MemoryMarshal.TryWrite(destination, in tmp);
375return MemoryMarshal.TryWrite(destination, in value);
393return MemoryMarshal.TryWrite(destination, in tmp);
396return MemoryMarshal.TryWrite(destination, in value);
414return MemoryMarshal.TryWrite(destination, in tmp);
417return MemoryMarshal.TryWrite(destination, in value);
435return MemoryMarshal.TryWrite(destination, in tmp);
438return MemoryMarshal.TryWrite(destination, in value);
456return MemoryMarshal.TryWrite(destination, in tmp);
459return MemoryMarshal.TryWrite(destination, in value);
477return MemoryMarshal.TryWrite(destination, in tmp);
480return MemoryMarshal.TryWrite(destination, in value);
499return MemoryMarshal.TryWrite(destination, in tmp);
502return MemoryMarshal.TryWrite(destination, in value);
521return MemoryMarshal.TryWrite(destination, in tmp);
524return MemoryMarshal.TryWrite(destination, in value);
543return MemoryMarshal.TryWrite(destination, in tmp);
546return MemoryMarshal.TryWrite(destination, in value);
565return MemoryMarshal.TryWrite(destination, in tmp);
568return MemoryMarshal.TryWrite(destination, in value);
587return MemoryMarshal.TryWrite(destination, in tmp);
590return MemoryMarshal.TryWrite(destination, in value);
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteLittleEndian.cs (52)
26MemoryMarshal.Write(destination, in tmp);
30MemoryMarshal.Write(destination, in value);
49MemoryMarshal.Write(destination, in tmp);
53MemoryMarshal.Write(destination, in value);
72MemoryMarshal.Write(destination, in tmp);
76MemoryMarshal.Write(destination, in value);
95MemoryMarshal.Write(destination, in tmp);
99MemoryMarshal.Write(destination, in value);
118MemoryMarshal.Write(destination, in tmp);
122MemoryMarshal.Write(destination, in value);
141MemoryMarshal.Write(destination, in tmp);
145MemoryMarshal.Write(destination, in value);
164MemoryMarshal.Write(destination, in tmp);
168MemoryMarshal.Write(destination, in value);
187MemoryMarshal.Write(destination, in tmp);
191MemoryMarshal.Write(destination, in value);
211MemoryMarshal.Write(destination, in tmp);
215MemoryMarshal.Write(destination, in value);
235MemoryMarshal.Write(destination, in tmp);
239MemoryMarshal.Write(destination, in value);
259MemoryMarshal.Write(destination, in tmp);
263MemoryMarshal.Write(destination, in value);
283MemoryMarshal.Write(destination, in tmp);
287MemoryMarshal.Write(destination, in value);
307MemoryMarshal.Write(destination, in tmp);
311MemoryMarshal.Write(destination, in value);
330return MemoryMarshal.TryWrite(destination, in tmp);
333return MemoryMarshal.TryWrite(destination, in value);
351return MemoryMarshal.TryWrite(destination, in tmp);
354return MemoryMarshal.TryWrite(destination, in value);
372return MemoryMarshal.TryWrite(destination, in tmp);
375return MemoryMarshal.TryWrite(destination, in value);
393return MemoryMarshal.TryWrite(destination, in tmp);
396return MemoryMarshal.TryWrite(destination, in value);
414return MemoryMarshal.TryWrite(destination, in tmp);
417return MemoryMarshal.TryWrite(destination, in value);
435return MemoryMarshal.TryWrite(destination, in tmp);
438return MemoryMarshal.TryWrite(destination, in value);
456return MemoryMarshal.TryWrite(destination, in tmp);
459return MemoryMarshal.TryWrite(destination, in value);
477return MemoryMarshal.TryWrite(destination, in tmp);
480return MemoryMarshal.TryWrite(destination, in value);
499return MemoryMarshal.TryWrite(destination, in tmp);
502return MemoryMarshal.TryWrite(destination, in value);
521return MemoryMarshal.TryWrite(destination, in tmp);
524return MemoryMarshal.TryWrite(destination, in value);
543return MemoryMarshal.TryWrite(destination, in tmp);
546return MemoryMarshal.TryWrite(destination, in value);
565return MemoryMarshal.TryWrite(destination, in tmp);
568return MemoryMarshal.TryWrite(destination, in value);
587return MemoryMarshal.TryWrite(destination, in tmp);
590return MemoryMarshal.TryWrite(destination, in value);
src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfo.cs (17)
88StrongBidiCategory bidiCategory = (StrongBidiCategory)(Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(CategoriesValues), offset) & 0b_0110_0000);
124uint rawValue = Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(DigitValues), offset);
158int rawValue = Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(DigitValues), offset);
172return (GraphemeClusterBreakType)Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(GraphemeSegmentationValues), offset);
190return (sbyte)Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(CategoriesValues), offset) < 0;
236ref byte refToValue = ref Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(NumericValues), offset * 8 /* sizeof(double) */);
260ref short rsStart = ref Unsafe.As<byte, short>(ref MemoryMarshal.GetReference(UppercaseValues));
279ref ushort rsStart = ref Unsafe.As<byte, ushort>(ref MemoryMarshal.GetReference(UppercaseValues));
295ref short rsStart = ref Unsafe.As<byte, short>(ref MemoryMarshal.GetReference(LowercaseValues));
314ref ushort rsStart = ref Unsafe.As<byte, ushort>(ref MemoryMarshal.GetReference(LowercaseValues));
394return (UnicodeCategory)(Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(CategoriesValues), offset) & 0x1F);
455uint index = Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(CategoryCasingLevel1Index), codePoint >> 9);
461ref byte level2Ref = ref Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(CategoryCasingLevel2Index), (index << 6) + ((codePoint >> 3) & 0b_0011_1110));
475return Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(CategoryCasingLevel3Index), (index << 4) + (codePoint & 0x0F));
492uint index = Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(NumericGraphemeLevel1Index), codePoint >> 9);
498ref byte level2Ref = ref Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(NumericGraphemeLevel2Index), (index << 6) + ((codePoint >> 3) & 0b_0011_1110));
512return Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(NumericGraphemeLevel3Index), (index << 4) + (codePoint & 0x0F));
src\libraries\System.Private.CoreLib\src\System\Guid.cs (18)
70this = MemoryMarshal.Read<Guid>(b);
87this = MemoryMarshal.Read<Guid>(b);
507Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result));
593Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result));
917MemoryMarshal.TryWrite(g, in this);
922Guid guid = new Guid(MemoryMarshal.AsBytes(new ReadOnlySpan<Guid>(in this)), false);
923MemoryMarshal.TryWrite(g, in guid);
935MemoryMarshal.TryWrite(g, in this);
940Guid guid = new Guid(MemoryMarshal.AsBytes(new ReadOnlySpan<Guid>(in this)), bigEndian);
941MemoryMarshal.TryWrite(g, in guid);
954MemoryMarshal.TryWrite(destination, in this);
959Guid guid = new Guid(MemoryMarshal.AsBytes(new ReadOnlySpan<Guid>(in this)), false);
960MemoryMarshal.TryWrite(destination, in guid);
976MemoryMarshal.TryWrite(destination, in this);
981Guid guid = new Guid(MemoryMarshal.AsBytes(new ReadOnlySpan<Guid>(in this)), bigEndian);
982MemoryMarshal.TryWrite(destination, in guid);
1269fixed (TChar* guidChars = &MemoryMarshal.GetReference(destination))
1391fixed (TChar* guidChars = &MemoryMarshal.GetReference(destination))
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (6)
393SpanHelpers.Memmove(ref MemoryMarshal.GetReference(buffer), ref *(pointer + pos + _offset), (nuint)nInt);
405SpanHelpers.Memmove(ref MemoryMarshal.GetReference(buffer), ref *(_mem + pos), (nuint)nInt);
467MemoryMarshal.TryGetArray(buffer, out ArraySegment<byte> destinationArray) ?
672SpanHelpers.Memmove(ref *(pointer + pos + _offset), ref MemoryMarshal.GetReference(buffer), (nuint)buffer.Length);
684SpanHelpers.Memmove(ref *(_mem + pos), ref MemoryMarshal.GetReference(buffer), (nuint)buffer.Length);
733if (MemoryMarshal.TryGetArray(buffer, out ArraySegment<byte> sourceArray))
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (210)
38return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)start /* force zero-extension */), array.Length - start);
62return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)actualIndex /* force zero-extension */), array.Length - actualIndex);
86return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)start /* force zero-extension */), length);
323ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
330ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
337ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
344ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
350return SpanHelpers.Contains(ref MemoryMarshal.GetReference(span), value, span.Length);
367ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
374ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
381ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
388ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
394return SpanHelpers.Contains(ref MemoryMarshal.GetReference(span), value, span.Length);
623ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
629ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
635ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
641ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
646return SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
661ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
663ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
668ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
670ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(value)),
674return SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
690ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
697ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
704ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
711ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
717return SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
733ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
735ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
741ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
743ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(value)),
748return SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
826ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
833ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
840ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
847ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
853return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value, span.Length);
873ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
881ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
888return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
909ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
918ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
926return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
937ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
947ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
956return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, value3, span.Length);
994ref byte valuesRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values));
997ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1007ref short valuesRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values));
1010ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1023ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
1025ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(values)),
1135ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1142ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1149ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
1156ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
1162return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value, span.Length);
1182ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1190ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1197return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
1218ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1227ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1235return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
1246ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1256ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1265return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, value3, span.Length);
1304ref byte valuesRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values));
1307ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1317ref short valuesRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values));
1320ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1333ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
1335ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(values)),
1399ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1408ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)),
1417ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)),
1426ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)),
1433return SpanHelpers.IndexOfAnyInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
1465ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1474ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)),
1483ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)),
1492ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)),
1499return SpanHelpers.IndexOfAnyExceptInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
1531ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1540ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)),
1549ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)),
1558ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)),
1565return SpanHelpers.LastIndexOfAnyInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
1597ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1606ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)),
1615ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)),
1624ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)),
1631return SpanHelpers.LastIndexOfAnyExceptInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
1656ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1657ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)),
1661return length == otherLength && SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other), length);
1675ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1677ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)),
1682ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
1684ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(other)),
1687return SpanHelpers.SequenceCompareTo(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(other), other.Length);
1702ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1708ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1714ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
1720ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
1725return SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
1740ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1742ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
1747ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
1749ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(value)),
1753return SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
1769ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1776ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1783ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
1790ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
1796return SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
1812ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1814ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
1820ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
1822ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(value)),
1827return SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
1844ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1852ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1859return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
1877ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1886ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1894return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
1938ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1946ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1953return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
1971ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1980ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1988return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
2003ref byte spanRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span));
2004ref byte valueRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values));
2051ref short spanRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span));
2052ref short valueRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values));
2088return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(values), values.Length);
2139ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2147ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
2154return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
2172ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2181ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
2189return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
2224ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2232ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
2239return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
2257ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2266ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
2274return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
2289ref byte spanRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span));
2290ref byte valueRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values));
2337ref short spanRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span));
2338ref short valueRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values));
2374return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(values), values.Length);
2407ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2408ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)),
2412return length == otherLength && SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other), length);
2448ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2449ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)),
2491ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2493ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)),
2498ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
2500ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(other)),
2503return SpanHelpers.SequenceCompareTo(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(other), other.Length);
2518ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2519ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
2523return valueLength <= span.Length && SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(value), valueLength);
2538ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2539ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
2543return valueLength <= span.Length && SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(value), valueLength);
2559ref Unsafe.As<T, byte>(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), (nint)(uint)(spanLength - valueLength) /* force zero-extension */)),
2560ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
2566ref Unsafe.Add(ref MemoryMarshal.GetReference(span), (nint)(uint)(spanLength - valueLength) /* force zero-extension */),
2567ref MemoryMarshal.GetReference(value),
2584ref Unsafe.As<T, byte>(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), (nint)(uint)(spanLength - valueLength) /* force zero-extension */)),
2585ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
2591ref Unsafe.Add(ref MemoryMarshal.GetReference(span), (nint)(uint)(spanLength - valueLength) /* force zero-extension */),
2592ref MemoryMarshal.GetReference(value),
2625SpanHelpers.Reverse(ref MemoryMarshal.GetReference(span), (nuint)span.Length);
3038ref MemoryMarshal.GetReference(span),
3039ref MemoryMarshal.GetReference(other));
3057ref MemoryMarshal.GetReference(span),
3058ref MemoryMarshal.GetReference(other));
3377ref byte src = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span));
3389ref ushort src = ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span));
3400ref int src = ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span));
3411ref long src = ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span));
3422ref T src2 = ref MemoryMarshal.GetReference(span);
3450ref T src = ref MemoryMarshal.GetReference(source);
3451ref T dst = ref MemoryMarshal.GetReference(destination);
3538ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
3539ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)),
4031ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
4038ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
4045ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
4052ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
4059ref MemoryMarshal.GetReference(span),
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (12)
86return Ordinal.EqualsIgnoreCase(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(value), span.Length);
117return Ordinal.CompareStringIgnoreCase(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(other), other.Length);
133return SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
165ref MemoryMarshal.GetReference(span),
167ref MemoryMarshal.GetReference(value),
325ref Unsafe.Add(ref MemoryMarshal.GetReference(span), span.Length - value.Length),
326ref MemoryMarshal.GetReference(value),
362&& Ordinal.EqualsIgnoreCase(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(value), value.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1SearchValues.cs (4)
36SpanHelpers.NonPackedIndexOfValueType<TImpl, SpanHelpers.DontNegate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length);
40SpanHelpers.NonPackedIndexOfValueType<TImpl, SpanHelpers.Negate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length);
44SpanHelpers.LastIndexOfValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length);
48SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2CharPackedIgnoreCaseSearchValues.cs (4)
44PackedSpanHelpers.IndexOfAnyIgnoreCase(ref MemoryMarshal.GetReference(span), _e0, _e1, span.Length);
49PackedSpanHelpers.IndexOfAnyExceptIgnoreCase(ref MemoryMarshal.GetReference(span), _e0, _e1, span.Length);
57ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
65ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2SearchValues.cs (4)
36SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.DontNegate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length);
40SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.Negate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length);
44SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length);
48SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any3SearchValues.cs (4)
36SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.DontNegate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length);
40SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.Negate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length);
44SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length);
48SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any4SearchValues.cs (4)
39SpanHelpers.IndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length);
43SpanHelpers.IndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length);
47SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length);
51SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any5SearchValues.cs (4)
40SpanHelpers.IndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length);
44SpanHelpers.IndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length);
48SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length);
52SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\AnyByteSearchValues.cs (6)
32ref MemoryMarshal.GetReference(span), span.Length, ref _state);
40ref MemoryMarshal.GetReference(span), span.Length, ref _state);
48ref MemoryMarshal.GetReference(span), span.Length, ref _state);
56ref MemoryMarshal.GetReference(span), span.Length, ref _state);
64ref MemoryMarshal.GetReference(span), span.Length, ref _state);
72ref MemoryMarshal.GetReference(span), span.Length, ref _state);
src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiByteSearchValues.cs (6)
48ref MemoryMarshal.GetReference(span), span.Length, ref _state);
56ref MemoryMarshal.GetReference(span), span.Length, ref _state);
64ref MemoryMarshal.GetReference(span), span.Length, ref _state);
72ref MemoryMarshal.GetReference(span), span.Length, ref _state);
80ref MemoryMarshal.GetReference(span), span.Length, ref _state);
88ref MemoryMarshal.GetReference(span), span.Length, ref _state);
src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiCharSearchValues.cs (6)
49ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
57ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
65ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
73ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
81ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
89ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticCharSearchValues.cs (4)
26ProbabilisticMap.IndexOfAny<SearchValues.TrueConst>(ref MemoryMarshal.GetReference(span), span.Length, ref _map);
29ProbabilisticMapState.IndexOfAnySimpleLoop<SearchValues.TrueConst, IndexOfAnyAsciiSearcher.Negate>(ref MemoryMarshal.GetReference(span), span.Length, ref _map);
32ProbabilisticMap.LastIndexOfAny<SearchValues.TrueConst>(ref MemoryMarshal.GetReference(span), span.Length, ref _map);
35ProbabilisticMapState.LastIndexOfAnySimpleLoop<SearchValues.TrueConst, IndexOfAnyAsciiSearcher.Negate>(ref MemoryMarshal.GetReference(span), span.Length, ref _map);
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticWithAsciiCharSearchValues.cs (10)
60ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)),
70ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)),
86ref MemoryMarshal.GetReference(span),
109ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)),
124ref MemoryMarshal.GetReference(span),
159ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)),
169ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)),
185ref MemoryMarshal.GetReference(span),
198ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)),
213ref MemoryMarshal.GetReference(span),
src\libraries\System.Private.CoreLib\src\System\SearchValues\RangeCharSearchValues.cs (4)
43? PackedSpanHelpers.IndexOfAnyInRange(ref MemoryMarshal.GetReference(span), _lowInclusive, _rangeInclusive, span.Length)
45ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(span)),
53? PackedSpanHelpers.IndexOfAnyExceptInRange(ref MemoryMarshal.GetReference(span), _lowInclusive, _rangeInclusive, span.Length)
55ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(span)),
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (6)
456=> SpanHelpers.SequenceCompareTo(ref MemoryMarshal.GetReference(strA), strA.Length, ref MemoryMarshal.GetReference(strB), strB.Length);
779return Marvin.ComputeHash32(ref Unsafe.As<char, byte>(ref MemoryMarshal.GetReference(value)), (uint)value.Length * 2 /* in bytes, not chars */, (uint)seed, (uint)(seed >> 32));
812return Marvin.ComputeHash32OrdinalIgnoreCase(ref MemoryMarshal.GetReference(value), value.Length /* in chars, not bytes */, (uint)seed, (uint)(seed >> 32));
866fixed (char* src = &MemoryMarshal.GetReference(span))
977fixed (char* src = &MemoryMarshal.GetReference(span))
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (15)
41=> ChangeCase<ushort, ushort, ToUpperConversion>(MemoryMarshal.Cast<char, ushort>(source), MemoryMarshal.Cast<char, ushort>(destination), out charsWritten);
53=> ChangeCase<byte, ushort, ToUpperConversion>(source, MemoryMarshal.Cast<char, ushort>(destination), out charsWritten);
65=> ChangeCase<ushort, byte, ToUpperConversion>(MemoryMarshal.Cast<char, ushort>(source), destination, out bytesWritten);
91=> ChangeCase<ushort, ushort, ToLowerConversion>(MemoryMarshal.Cast<char, ushort>(source), MemoryMarshal.Cast<char, ushort>(destination), out charsWritten);
103=> ChangeCase<byte, ushort, ToLowerConversion>(source, MemoryMarshal.Cast<char, ushort>(destination), out charsWritten);
115=> ChangeCase<ushort, byte, ToLowerConversion>(MemoryMarshal.Cast<char, ushort>(source), destination, out bytesWritten);
135=> ChangeCase<ushort, ToLowerConversion>(MemoryMarshal.Cast<char, ushort>(value), out charsWritten);
155=> ChangeCase<ushort, ToUpperConversion>(MemoryMarshal.Cast<char, ushort>(value), out charsWritten);
162if (MemoryMarshal.AsBytes(source).Overlaps(MemoryMarshal.AsBytes(destination)))
181fixed (TFrom* pSource = &MemoryMarshal.GetReference(source))
182fixed (TTo* pDestination = &MemoryMarshal.GetReference(destination))
196fixed (T* pBuffer = &MemoryMarshal.GetReference(buffer))
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Equality.cs (12)
25&& Equals<byte, byte, PlainLoader<byte>>(ref MemoryMarshal.GetReference(left), ref MemoryMarshal.GetReference(right), (uint)right.Length);
30&& Equals<byte, ushort, WideningLoader>(ref MemoryMarshal.GetReference(left), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length);
39&& Equals<ushort, ushort, PlainLoader<ushort>>(ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(left)), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length);
176&& EqualsIgnoreCase<byte, byte, PlainLoader<byte>>(ref MemoryMarshal.GetReference(left), ref MemoryMarshal.GetReference(right), (uint)right.Length);
181&& EqualsIgnoreCase<byte, ushort, WideningLoader>(ref MemoryMarshal.GetReference(left), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length);
190&& EqualsIgnoreCase<ushort, ushort, PlainLoader<ushort>>(ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(left)), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length);
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (18)
272pChars: (char*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(chars)),
317fixed (char* _pChars_Unused = &MemoryMarshal.GetReference(chars))
365pChars: (char*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(chars)),
549pChars: (char*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(chars)),
551pBytes: (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(bytes)),
594fixed (char* _pChars_Unused = &MemoryMarshal.GetReference(chars))
595fixed (byte* _pBytes_Unused = &MemoryMarshal.GetReference(bytes))
652pChars: (char*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(chars)),
654pBytes: (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(bytes)),
872pBytes: (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(bytes)),
917fixed (byte* _pBytes_Unused = &MemoryMarshal.GetReference(bytes))
961pBytes: (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(bytes)),
1152pBytes: (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(bytes)),
1154pChars: (char*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(chars)),
1195fixed (byte* _pBytes_Unused = &MemoryMarshal.GetReference(bytes))
1196fixed (char* _pChars_Unused = &MemoryMarshal.GetReference(chars))
1252pBytes: (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(bytes)),
1254pChars: (char*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(chars)),
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (8)
341ref MemoryMarshal.GetArrayDataReference(sourceArray),
963ReplaceInPlaceAtChunk(ref chunk!, ref indexInChunk, ref MemoryMarshal.GetReference(value), value.Length);
1088Append(ref MemoryMarshal.GetArrayDataReference(value), value.Length);
1096Append(ref MemoryMarshal.GetReference(value), value.Length);
1339Insert(index, ref MemoryMarshal.GetArrayDataReference(value), value.Length);
1406Insert(index, ref MemoryMarshal.GetReference(value), value.Length);
2277ref char destination = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(chunkChars), chunkLength);
2383ReplaceInPlaceAtChunk(ref targetChunk!, ref targetIndexInChunk, ref MemoryMarshal.GetReference<char>(value), value.Length);
src\System\Array.CoreCLR.cs (14)
74ref byte src = ref Unsafe.AddByteOffset(ref MemoryMarshal.GetArrayDataReference(sourceArray), (uint)sourceIndex * elementSize);
75ref byte dst = ref Unsafe.AddByteOffset(ref MemoryMarshal.GetArrayDataReference(destinationArray), (uint)destinationIndex * elementSize);
242ref object? srcData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(sourceArray)), sourceIndex);
243ref byte data = ref Unsafe.AddByteOffset(ref MemoryMarshal.GetArrayDataReference(destinationArray), (nuint)destinationIndex * destSize);
285ref byte data = ref Unsafe.AddByteOffset(ref MemoryMarshal.GetArrayDataReference(sourceArray), (nuint)sourceIndex * srcSize);
286ref object? destData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(destinationArray)), destinationIndex);
300ref object? srcData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(sourceArray)), sourceIndex);
301ref object? destData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(destinationArray)), destinationIndex);
325ref byte srcData = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(sourceArray), (nuint)sourceIndex * srcElSize);
326ref byte data = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(destinationArray), (nuint)destinationIndex * destElSize);
358ref byte pStart = ref MemoryMarshal.GetArrayDataReference(array);
470ref byte arrayDataRef = ref MemoryMarshal.GetArrayDataReference(this);
511ref byte arrayDataRef = ref MemoryMarshal.GetArrayDataReference(this);
683ref byte arrayRef = ref MemoryMarshal.GetArrayDataReference(this);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.Cipher.cs (12)
41ref MemoryMarshal.GetReference(key),
42ref MemoryMarshal.GetReference(iv),
84fixed (byte* pIv = &MemoryMarshal.GetReference(iv))
111ref MemoryMarshal.GetReference(output),
113ref MemoryMarshal.GetReference(input),
142return EvpCipherFinalEx(ctx, ref MemoryMarshal.GetReference(output), out bytesWritten);
154if (!EvpCipherGetGcmTag(ctx, ref MemoryMarshal.GetReference(tag), tag.Length))
169if (!EvpCipherGetAeadTag(ctx, ref MemoryMarshal.GetReference(tag), tag.Length))
184if (!EvpCipherSetGcmTag(ctx, ref MemoryMarshal.GetReference(tag), tag.Length))
199if (!EvpCipherSetAeadTag(ctx, ref MemoryMarshal.GetReference(tag), tag.Length))
214if (!EvpCipherGetCcmTag(ctx, ref MemoryMarshal.GetReference(tag), tag.Length))
229if (!EvpCipherSetCcmTag(ctx, ref MemoryMarshal.GetReference(tag), tag.Length))
System\Security\Cryptography\LiteHash.Unix.cs (5)
162Check(Interop.Crypto.EvpDigestFinalEx(_ctx, ref MemoryMarshal.GetReference(destination), ref length));
176Check(Interop.Crypto.EvpDigestCurrent(_ctx, ref MemoryMarshal.GetReference(destination), ref length));
223_ctx = Interop.Crypto.HmacCreate(ref MemoryMarshal.GetReference(key), key.Length, algorithm);
248Check(Interop.Crypto.HmacCurrent(_ctx, ref MemoryMarshal.GetReference(destination), ref length));
258Check(Interop.Crypto.HmacFinal(_ctx, ref MemoryMarshal.GetReference(destination), ref length));