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 (153)
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);
334ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
341ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
348ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
355ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
361return SpanHelpers.Contains(ref MemoryMarshal.GetReference(span), value, span.Length);
710ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
717ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
724ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
731ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
737return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value, span.Length);
757ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
765ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
772return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
793ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
802ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
810return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
821ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
831ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
840return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, value3, span.Length);
878ref byte valuesRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values));
881ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
891ref short valuesRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values));
894ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
907ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
909ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(values)),
1024ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1031ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1038ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
1045ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
1051return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value, span.Length);
1071ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1079ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1086return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
1107ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1116ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1124return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
1135ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1145ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1154return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, value3, span.Length);
1193ref byte valuesRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values));
1196ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1206ref short valuesRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values));
1209ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1222ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
1224ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(values)),
1287ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1296ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)),
1305ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)),
1314ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)),
1321return SpanHelpers.IndexOfAnyInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
1352ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1361ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)),
1370ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)),
1379ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)),
1386return SpanHelpers.IndexOfAnyExceptInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
1417ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1426ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)),
1435ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)),
1444ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)),
1451return SpanHelpers.LastIndexOfAnyInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
1482ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1491ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span)),
1500ref Unsafe.As<T, uint>(ref MemoryMarshal.GetReference(span)),
1509ref Unsafe.As<T, ulong>(ref MemoryMarshal.GetReference(span)),
1516return SpanHelpers.LastIndexOfAnyExceptInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
1555ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1561ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1567ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
1573ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
1578return SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
1593ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1595ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
1600ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
1602ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(value)),
1606return SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
1622ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1629ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1636ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
1643ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
1649return SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
1665ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1667ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
1673ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
1675ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(value)),
1680return SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
1750ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1758ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1765return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
1783ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
1792ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
1800return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
1815ref byte spanRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span));
1816ref byte valueRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values));
1863ref short spanRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span));
1864ref short valueRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values));
1900return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(values), values.Length);
1994ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2002ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
2009return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
2027ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2036ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
2044return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
2059ref byte spanRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span));
2060ref byte valueRef = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values));
2107ref short spanRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span));
2108ref short valueRef = ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(values));
2144return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(values), values.Length);
2177ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2178ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)),
2182return length == otherLength && SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other), length);
2219ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2220ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)),
2261ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2263ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)),
2268ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)),
2270ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(other)),
2273return SpanHelpers.SequenceCompareTo(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(other), other.Length);
2297ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
2298ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
2302return valueLength <= span.Length && SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(value), valueLength);
2327ref Unsafe.As<T, byte>(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), (nint)(uint)(spanLength - valueLength) /* force zero-extension */)),
2328ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)),
2334ref Unsafe.Add(ref MemoryMarshal.GetReference(span), (nint)(uint)(spanLength - valueLength) /* force zero-extension */),
2335ref MemoryMarshal.GetReference(value),
2368SpanHelpers.Reverse(ref MemoryMarshal.GetReference(span), (nuint)span.Length);
2779ref MemoryMarshal.GetReference(span),
2780ref MemoryMarshal.GetReference(other));
2798ref MemoryMarshal.GetReference(span),
2799ref MemoryMarshal.GetReference(other));
3110ref byte src = ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span));
3122ref ushort src = ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(span));
3133ref int src = ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span));
3144ref long src = ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span));
3155ref T src2 = ref MemoryMarshal.GetReference(span);
3183ref T src = ref MemoryMarshal.GetReference(source);
3184ref T dst = ref MemoryMarshal.GetReference(destination);
3273ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
3274ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)),
3767ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)),
3774ref Unsafe.As<T, short>(ref MemoryMarshal.GetReference(span)),
3781ref Unsafe.As<T, int>(ref MemoryMarshal.GetReference(span)),
3788ref Unsafe.As<T, long>(ref MemoryMarshal.GetReference(span)),
3795ref 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);
689ref 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));