584 instantiations of Span
GenerateDocumentationAndConfigFiles (9)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (9)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 173DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 260source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 390new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 391new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
ILCompiler.Compiler (6)
Compiler\SubstitutedILProvider.cs (2)
560BinaryPrimitives.WriteUInt32LittleEndian(new Span<byte>(newBody, dstPos, sizeof(uint)), (uint)(dest - dstJmpBase)); 582BinaryPrimitives.WriteUInt32LittleEndian(new Span<byte>(newBody, dstPos, sizeof(uint)), (uint)(dest - (dstPos + sizeof(uint))));
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Relocation.cs (2)
675DwarfHelper.WritePaddedULEB128(new Span<byte>((byte*)location, WASM_PADDED_RELOC_SIZE_32), checked((ulong)value)); 681DwarfHelper.WritePaddedSLEB128(new Span<byte>((byte*)location, WASM_PADDED_RELOC_SIZE_32), value);
src\runtime\src\coreclr\tools\Common\Compiler\NativeAotNameMangler.cs (1)
230bool b = iter.TryFormat(new Span<byte>(buffer).Slice(origName.Length + 1), out _);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (1)
975stream.Write(new Span<byte>(data, Relocation.GetSize(reloc.Type)));
ILCompiler.ReadyToRun (11)
Compiler\DependencyAnalysis\ReadyToRun\ManifestMetadataTableNode.cs (1)
331_manifestAssemblyMvids[i].TryWriteBytes(new Span<byte>(manifestAssemblyMvidTable, GuidByteSize * i, GuidByteSize));
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Relocation.cs (2)
675DwarfHelper.WritePaddedULEB128(new Span<byte>((byte*)location, WASM_PADDED_RELOC_SIZE_32), checked((ulong)value)); 681DwarfHelper.WritePaddedSLEB128(new Span<byte>((byte*)location, WASM_PADDED_RELOC_SIZE_32), value);
src\runtime\src\coreclr\tools\Common\Compiler\NativeAotNameMangler.cs (1)
230bool b = iter.TryFormat(new Span<byte>(buffer).Slice(origName.Length + 1), out _);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (1)
975stream.Write(new Span<byte>(data, Relocation.GetSize(reloc.Type)));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmObjectWriter.cs (1)
1006sectionStream.Write(new Span<byte>(pData, Relocation.GetSize(reloc.Type)));
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (5)
2039str.AsSpan(startIndex, Math.Min(size, result)).CopyTo(new Span<char>(buffer, size)); 2056OperationStatus status = Utf8.FromUtf16(utf16, new Span<byte>(buffer, checked((int)(bufferSize - 1))), out _, out written); 2493new Span<byte>(gcPtrs, (int)((size + PointerSize - 1) / PointerSize)).Clear(); 3927Span<AllocMemChunk> chunks = new Span<AllocMemChunk>(args.chunks, checked((int)args.chunksCount)); 4751rvaData.Slice(valueOffset, bufferSize).CopyTo(new Span<byte>(buffer, bufferSize));
ILCompiler.RyuJit (12)
JitInterface\CorInfoImpl.RyuJit.cs (7)
2360new Span<byte>(buffer, targetPtrSize).Clear(); 2376bytes.AsSpan(valueOffset, bufferSize).CopyTo(new Span<byte>(buffer, bufferSize)); 2386new Span<byte>(&handle, targetPtrSize).CopyTo(new Span<byte>(buffer, targetPtrSize)); 2399new Span<byte>(buffer, bufferSize).Clear(); 2424new Span<byte>((byte*)pStr + offset, bufferSize).CopyTo( 2425new Span<byte>(buffer, bufferSize));
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (5)
2039str.AsSpan(startIndex, Math.Min(size, result)).CopyTo(new Span<char>(buffer, size)); 2056OperationStatus status = Utf8.FromUtf16(utf16, new Span<byte>(buffer, checked((int)(bufferSize - 1))), out _, out written); 2493new Span<byte>(gcPtrs, (int)((size + PointerSize - 1) / PointerSize)).Clear(); 3927Span<AllocMemChunk> chunks = new Span<AllocMemChunk>(args.chunks, checked((int)args.chunksCount)); 4751rvaData.Slice(valueOffset, bufferSize).CopyTo(new Span<byte>(buffer, bufferSize));
Microsoft.AspNetCore.Components.Server (1)
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReaderExtensions.cs (1)
76Span<byte> tempSpan = new Span<byte>(&buffer, sizeof(T));
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\KeyRingBasedDataProtector.cs (1)
305var span = new Span<byte>(ptr, sizeof(Guid));
Microsoft.AspNetCore.Http.Connections.Common (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
124_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.Razor.Utilities.Shared (9)
Utilities\Hashing\XxHashShared.cs (9)
121Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 172DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 259source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 274source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 313source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 326source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 330Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 389new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 390new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Internal\Http3\QPack\EncoderStreamReader.cs (2)
257var headerNameSpan = new Span<byte>(_headerName, 0, _headerNameLength); 258var headerValueSpan = new Span<byte>(_headerValueOctets, 0, _headerValueLength);
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (3)
73return new Span<T>(AllocAsPointer<T>(count), count); 128return new Span<byte>(Alloc(sizeHint), sizeHint); 138return new Span<byte>(_currentBlock, _currentBlockCount);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (3)
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (3)
73return new Span<T>(AllocAsPointer<T>(count), count); 128return new Span<byte>(Alloc(sizeHint), sizeHint); 138return new Span<byte>(_currentBlock, _currentBlockCount);
Microsoft.AspNetCore.SignalR.Common (2)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
124_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
124_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.WebUtilities (3)
HttpRequestStreamReader.cs (2)
163var span = new Span<char>(buffer, index, count); 396var span = new Span<char>(_charBuffer, _charBufferIndex, _charsRead - _charBufferIndex);
HttpResponseStreamWriter.cs (1)
663var destination = new Span<char>(_charBuffer, _charBufferCount, remaining);
Microsoft.Build (2)
BackEnd\Client\MSBuildClientPacketPump.cs (1)
270int packetLength = BinaryPrimitives.ReadInt32LittleEndian(new Span<byte>(headerByte, 1, 4));
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
1109int packetLength = BinaryPrimitives.ReadInt32LittleEndian(new Span<byte>(_headerByte, 1, 4));
Microsoft.Build.Tasks.Core (2)
src\msbuild\src\Shared\NodePipeBase.cs (2)
124int packetLength = BinaryPrimitives.ReadInt32LittleEndian(new Span<byte>(_headerData, 1, 4)); 174int packetLength = BinaryPrimitives.ReadInt32LittleEndian(new Span<byte>(_headerData, 1, 4));
Microsoft.CodeAnalysis (9)
Hashing\XxHashShared.cs (9)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 173DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 260source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 390new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 391new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
Microsoft.CodeAnalysis.Analyzers (9)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (9)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 173DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 260source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 390new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 391new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
Microsoft.CodeAnalysis.AnalyzerUtilities (9)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (9)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 173DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 260source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 390new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 391new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
Microsoft.CodeAnalysis.CodeStyle (9)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (9)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 173DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 260source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 390new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 391new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
Microsoft.CodeAnalysis.ResxSourceGenerator (9)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (9)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 173DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 260source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 390new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 391new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
Microsoft.CodeAnalysis.Workspaces (10)
Serialization\SerializerService_Reference.cs (1)
494var unmanagedSpan = new Span<byte>((void*)unmanagedMemory, length);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (9)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 173DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 260source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 390new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 391new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
Microsoft.CSharp (2)
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\ComEventsSink.cs (2)
164var vars = new Span<ComVariant>(pDispParams.rgvarg.ToPointer(), totalCount); 165var namedArgs = new Span<int>(pDispParams.rgdispidNamedArgs.ToPointer(), totalCount);
Microsoft.Diagnostics.DataContractReader (1)
ContractDescriptorTarget.cs (1)
913=> readFromTarget(address, new Span<byte>(buffer, checked((int)bytesToRead)));
Microsoft.Diagnostics.DataContractReader.Contracts (2)
Contracts\StackWalk\Context\ContextHolder.cs (1)
35Span<T> structSpan = new(ref Context);
Contracts\Thread_1.cs (1)
314Span<byte> buffer = new Span<byte>(bytes);
Microsoft.Diagnostics.DataContractReader.Legacy (11)
ClrDataValue.cs (1)
176Span<byte> memBytes = new(dst, (int)loc.Size);
Dbi\DacDbiImpl.cs (4)
1210ctx.FillFromBuffer(new Span<byte>((void*)pContext, (int)ctx.Size)); 1431givenCtx.FillFromBuffer(new Span<byte>(pContext, leafContext.Length)); 1462context.AsSpan().CopyTo(new Span<byte>(pContextBuffer, context.Length)); 1482contextStruct.FillFromBuffer(new Span<byte>(pContextBuffer, (int)contextSize));
MetaDataImportImpl.cs (1)
1432new ReadOnlySpan<char>(dataPtr, copyChars).CopyTo(new Span<char>(szString, copyChars));
OutputBufferHelpers.cs (2)
25Span<char> target = new Span<char>(stringBuf, checked((int)bufferSize)); 43Span<byte> target = new Span<byte>(stringBuf, checked(maxBytes));
SOSDacImpl.cs (3)
754var dest = new Span<byte>(pGenericModeBlock, buckets.Length); 780Debug.Assert(new ReadOnlySpan<byte>(genericModeBlockLocal, 0, sizeOfGenericModeBlock).SequenceEqual(new Span<byte>(pGenericModeBlock, sizeOfGenericModeBlock))); 2230context.FillFromBuffer(new Span<byte>(ctx, (int)context.Size));
Microsoft.Extensions.Caching.Hybrid.Tests (1)
DistributedCacheTests.cs (1)
378public override Span<byte> GetSpan() => new(_data, 5, _data.Length - 10);
Microsoft.Extensions.Logging.Console (1)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
Microsoft.ML.CpuMath.PerformanceTests (22)
AvxPerformanceTests.cs (10)
18=> AvxIntrinsics.AddScalarU(DefaultScale, new Span<float>(dst, 0, Length)); 22=> AvxIntrinsics.Scale(DefaultScale, new Span<float>(dst, 0, Length)); 30=> AvxIntrinsics.ScaleAddU(DefaultScale, DefaultScale, new Span<float>(dst, 0, Length)); 61=> AvxIntrinsics.Sum(new Span<float>(src, 0, Length)); 66=> AvxIntrinsics.SumSqU(new Span<float>(src, 0, Length)); 71=> AvxIntrinsics.SumSqDiffU(DefaultScale, new Span<float>(src, 0, Length)); 75=> AvxIntrinsics.SumAbsU(new Span<float>(src, 0, Length)); 79=> AvxIntrinsics.SumAbsDiffU(DefaultScale, new Span<float>(src, 0, Length)); 83=> AvxIntrinsics.MaxAbsU(new Span<float>(src, 0, Length)); 87=> AvxIntrinsics.MaxAbsDiffU(DefaultScale, new Span<float>(src, 0, Length));
SmallInputCpuMathPerformanceTests.cs (2)
57=> CpuMathUtils.Sum(new Span<float>(src, 0, arrayLength)); 61=> CpuMathUtils.SumSq(new Span<float>(src, 0, arrayLength));
SsePerformanceTests.cs (10)
15=> SseIntrinsics.AddScalarU(DefaultScale, new Span<float>(dst, 0, Length)); 19=> SseIntrinsics.Scale(DefaultScale, new Span<float>(dst, 0, Length)); 27=> SseIntrinsics.ScaleAddU(DefaultScale, DefaultScale, new Span<float>(dst, 0, Length)); 55=> SseIntrinsics.Sum(new Span<float>(src, 0, Length)); 59=> SseIntrinsics.SumSqU(new Span<float>(src, 0, Length)); 63=> SseIntrinsics.SumSqDiffU(DefaultScale, new Span<float>(src, 0, Length)); 67=> SseIntrinsics.SumAbsU(new Span<float>(src, 0, Length)); 71=> SseIntrinsics.SumAbsDiffU(DefaultScale, new Span<float>(src, 0, Length)); 75=> SseIntrinsics.MaxAbsU(new Span<float>(src, 0, Length)); 79=> SseIntrinsics.MaxAbsDiffU(DefaultScale, new Span<float>(src, 0, Length));
Microsoft.ML.ImageAnalytics (1)
MLImage.cs (1)
108imagePixelData.CopyTo(new Span<byte>(image.GetPixels().ToPointer(), image.Width * image.Height * 4));
Microsoft.ML.TensorFlow (2)
TensorTypeExtensions.cs (2)
47var span = new Span<T>(src, len); 55var span = new Span<T>(array);
Microsoft.ML.Tokenizers (1)
Normalizer\SentencePieceNormalizer.cs (1)
529trieBlob = new Span<DoubleArrayUnit>((DoubleArrayUnit*)pBlob, (int)trieBlobSize / 4).ToArray();
Microsoft.ML.Transforms (3)
Expression\BuiltinFunctions.cs (3)
742b.Span.CopyTo(new Span<char>(dst, a.Length, b.Length)); 751b.Span.CopyTo(new Span<char>(dst, a.Length, b.Length)); 752c.Span.CopyTo(new Span<char>(dst, a.Length + b.Length, c.Length));
Microsoft.Private.Windows.Core (14)
_generated\203\Windows.Win32.PSTR.g.cs (1)
63 internal Span<byte> AsSpan() => this.Value is null ? default(Span<byte>) : new Span<byte>(this.Value, this.Length);
_generated\204\Windows.Win32.PWSTR.g.cs (1)
63 internal Span<char> AsSpan() => this.Value is null ? default(Span<char>) : new Span<char>(this.Value, this.Length);
_generated\266\Windows.Win32.VariableLengthInlineArray.g.cs (1)
45 return new Span<T>(p, length);
Framework\Windows\Win32\__char_32.cs (1)
13return new(p, SpanLength);
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\StringExtensions.cs (3)
49Span<char> resultSpan = new(firstChar, result.Length); 69Span<char> resultSpan = new(firstChar, result.Length); 103Span<char> resultSpan = new(firstChar, result.Length);
System\IO\BinaryReaderExtensions.cs (1)
122Span<byte> arrayData = new(a, array.Length * sizeof(T));
System\IO\StreamExtensions.cs (1)
62Span<byte> span = new(buffer, size);
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (1)
359Span<char> fileBuffer = new(
Windows\Win32\Foundation\GlobalBuffer.cs (1)
42_buffer = new((byte*)_pointer, (int)length);
Windows\Win32\Graphics\Gdi\ArgbBuffer.cs (1)
25_bufferScope = new BufferScope<ARGB>(new Span<ARGB>(s, StackSpace), length);
Windows\Win32\Graphics\Gdi\RGNDATAHEADER.cs (1)
16return new Span<RECT>((byte*)regionData + regionData->dwSize, (int)regionData->nCount).ToArray();
Windows\Win32\System\Com\ComManagedStream.cs (1)
124Span<byte> buffer = new(pv, checked((int)cb));
PresentationCore (1)
System\Windows\Media\StreamAsIStream.cs (1)
536var span = new Span<byte>(buffer.ToPointer(), (int) cb);
PresentationFramework (4)
System\windows\Documents\SelectionWordBreaker.cs (2)
230SafeNativeMethods.GetStringTypeEx(0 /* ignored */, SafeNativeMethods.CT_CTYPE1, [ch], new Span<UInt16>(ref charType1)); 264SafeNativeMethods.GetStringTypeEx(0 /* ignored */, SafeNativeMethods.CT_CTYPE3, [ch], new Span<UInt16>(ref charType3));
System\Windows\Documents\TextFindEngine.cs (2)
110SafeNativeMethods.GetStringTypeEx(0 /* ignored */, SafeNativeMethods.CT_CTYPE1, [findPattern[0]], new Span<UInt16>(ref startCharType1)); 111SafeNativeMethods.GetStringTypeEx(0 /* ignored */, SafeNativeMethods.CT_CTYPE1, [findPattern[findPattern.Length - 1]], new Span<UInt16>(ref endCharType1));
Roslyn.Diagnostics.Analyzers (9)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (9)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 173DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 260source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 390new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 391new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
sdk-tasks (2)
ReplaceFilesWithSymbolicLinks.cs (2)
106Span<byte> span1 = new Span<byte>(ptr1, checked((int)accessor1.SafeMemoryMappedViewHandle.ByteLength)); 109Span<byte> span2 = new Span<byte>(ptr2, checked((int)accessor2.SafeMemoryMappedViewHandle.ByteLength));
Shared (1)
ServerSentEvents\ArrayBuffer.cs (1)
90public readonly Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System.Collections.Immutable (4)
System\Collections\Frozen\Int32\Int32FrozenSet.cs (1)
28_hashTable = FrozenHashTable.Create(new Span<int>(entries, 0, count), hashCodesAreUnique: true);
System\Collections\Immutable\ImmutableArray_1.Builder.cs (2)
438items.CopyTo(new Span<T>(_elements, offset, items.Length)); 451var elements = new Span<T>(_elements, offset, items.Length);
System\Collections\Immutable\ImmutableArray_1.cs (1)
1519items.CopyTo(new Span<T>(tmp, index, items.Length));
System.ComponentModel.TypeConverter (1)
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (1)
90Read(new Span<byte>(buffer, offset, count));
System.Console (3)
System\IO\ConsoleStream.cs (2)
34return Read(new Span<byte>(buffer, offset, count)); 40int result = Read(new Span<byte>(ref b));
System\TermInfo.DatabaseFactory.cs (1)
132int bytesRead = RandomAccess.Read(fd, new Span<byte>(data, (int)fileOffset, (int)(termInfoLength - fileOffset)), fileOffset);
System.Data.Common (1)
System\Data\SQLTypes\SQLBytes.cs (1)
199Read(offset, new Span<byte>(ref b));
System.Data.OleDb (2)
SafeHandles.cs (2)
279var dstSpan = new System.Span<byte>(dst.ToPointer(), count); 280var srcSpan = new System.Span<byte>(src.ToPointer(), count);
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Activity.cs (1)
2133ActivityTraceId.SetToRandomBytes(new Span<byte>(&id, sizeof(ulong)));
System.Diagnostics.Process (5)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (4)
132Span<nint> pointers = new Span<nint>(block, count + 1); 133Span<byte> data = new Span<byte>(dataPtr, dataByteLength); 175Span<nint> pointers = new Span<nint>(block, count + 1); 176Span<byte> data = new Span<byte>(dataPtr, dataByteLength);
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (1)
47buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount);
System.Drawing.Common (6)
System\Drawing\BufferedGraphicsContext.cs (1)
269Span<RGBQUAD> rgbQuads = new((RGBQUAD*)&bitmapInfo->bmiColors, colorCount);
System\Drawing\Imaging\ColorMatrix.cs (1)
344newColorMatrix.CopyTo(new Span<float>(f, 25));
System\Drawing\Imaging\EncoderParameter.cs (2)
312new ReadOnlySpan<byte>((void*)Value, bytes).CopyTo(new Span<byte>((void*)_parameterValue, bytes)); 338new ReadOnlySpan<byte>((void*)value, bytes).CopyTo(new Span<byte>((void*)_parameterValue, bytes));
System\Drawing\Imaging\PropertyItem.cs (1)
47Value = new Span<byte>(native->value, (int)native->length).ToArray()
System\Drawing\Printing\PrinterSettings.cs (1)
740Span<char> names = new((char*)devnames, sizeInChars);
System.Formats.Asn1 (5)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
89Span = new Span<byte>(rented, 0, length)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (4)
72new Span<byte>(bytes, byteIndex, bytes.Length - byteIndex), 80new Span<byte>(bytes, byteCount), 107new Span<char>(chars, charIndex, chars.Length - charIndex), 115new Span<char>(chars, charCount),
System.Formats.Cbor (1)
src\runtime\src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
23return new Span<T>(_pointer, _length);
System.Formats.Tar (1)
System\Formats\Tar\SubReadStream.cs (1)
129return Read(new Span<byte>(ref b)) == 1 ? b : -1;
System.IO.Compression (10)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (2)
98return Read(new Span<byte>(buffer, offset, count)); 146return Read(new Span<byte>(ref b)) == 1 ? b : -1;
System\IO\Compression\DeflateZLib\DeflateStream.cs (3)
287return ReadCore(new Span<byte>(buffer, offset, count)); 1061int bytesRead = _deflateStream._inflater.Inflate(new Span<byte>(_arrayPoolBuffer)); 1097int bytesRead = _deflateStream._inflater.Inflate(new Span<byte>(_arrayPoolBuffer));
System\IO\Compression\ZipCustomStreams.cs (3)
378return Read(new Span<byte>(ref b)) == 1 ? b : -1; 785return Read(new Span<byte>(buffer, offset, count)); 806return Read(new Span<byte>(ref b)) == 1 ? b : -1;
System\IO\Compression\Zstandard\ZstandardStream.Decompress.cs (1)
94return Read(new Span<byte>(buffer, offset, count));
System.IO.Compression.Brotli (4)
System\IO\Compression\dec\BrotliStream.Decompress.cs (2)
35return Read(new Span<byte>(buffer, offset, count)); 48int bytesRead = Read(new Span<byte>(ref b));
System\IO\Compression\enc\BrotliStream.Compress.cs (2)
86Span<byte> output = new Span<byte>(_buffer); 194Span<byte> output = new Span<byte>(_buffer);
System.IO.Hashing (9)
System\IO\Hashing\XxHashShared.cs (9)
117Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 168DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 251source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 266source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 305source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 318source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 322Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 381new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 382new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
System.IO.Packaging (1)
System\IO\Packaging\InterleavedZipPackagePartStream.cs (1)
74=> ReadCore(new Span<byte>(buffer, offset, count));
System.IO.Pipelines (1)
System\IO\Pipelines\PipeReaderStream.cs (1)
55return ReadInternal(new Span<byte>(buffer, offset, count));
System.IO.Pipes (2)
System\IO\Pipes\PipeStream.cs (1)
116return Read(new Span<byte>(ref b)) > 0 ? b : -1;
System\IO\Pipes\PipeStream.Unix.cs (1)
44return ReadCore(new Span<byte>(buffer, offset, count));
System.Linq (1)
System\Linq\OrderedEnumerable.cs (1)
500new Span<int>(keys, lo, hi - lo + 1).Sort(comparison);
System.Linq.AsyncEnumerable (2)
System\Linq\OrderBy.cs (2)
383new Span<int>(keys, lo, hi - lo + 1).Sort(!_descending ? 423new Span<int>(keys, lo, hi - lo + 1).Sort(Compare);
System.Memory (1)
System\Buffers\SequenceReaderExtensions.Binary.cs (1)
43Span<byte> tempSpan = new Span<byte>(&buffer, sizeof(T));
System.Memory.Data (2)
src\runtime\src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (2)
95return ReadBuffer(new Span<byte>(buffer, offset, count)); 132Task.FromResult(ReadBuffer(new Span<byte>(buffer, offset, count)));
System.Net.Http (6)
src\runtime\src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (2)
95return ReadBuffer(new Span<byte>(buffer, offset, count)); 132Task.FromResult(ReadBuffer(new Span<byte>(buffer, offset, count)));
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System\Net\Http\Headers\HttpHeaders.cs (1)
1243values = new Span<string?>(ref singleValue);
System\Net\Http\HttpBaseStream.cs (1)
42return Read(new Span<byte>(ref b)) == 1 ? b : -1;
System\Net\Http\MultipartContent.cs (1)
477return Read(new Span<byte>(ref b)) == 1 ? b : -1;
System.Net.Http.WinHttpHandler (1)
src\runtime\src\libraries\Common\src\Interop\Windows\WinHttp\Interop.winhttp.cs (1)
66Span<char> buffer = new(value, length);
System.Net.Mail (1)
System\Net\DelegatedStream.cs (1)
153return ReadInternal(new Span<byte>(ref b)) != 0 ? b : -1;
System.Net.NameResolution (2)
src\runtime\src\libraries\Common\src\System\Net\InteropIPAddressExtensions.Unix.cs (1)
15ipAddress.TryWriteBytes(new Span<byte>(nativeIPAddress.Address, Interop.Sys.IPv6AddressBytes), out int bytesWritten);
System\Net\NameResolutionPal.Unix.cs (1)
175addr.TryWriteBytes(new Span<byte>(rawAddress, rawAddressLength), out int bytesWritten);
System.Net.Ping (2)
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (1)
47buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount);
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
465new Span<byte>(&ipHeader, sizeof(IpHeader)).CopyTo(result);
System.Net.Primitives (4)
System\Net\IPNetwork.cs (4)
96BaseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref baseAddressValue)), out int bytesWritten); 98address.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref otherAddressValue)), out bytesWritten); 263baseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref value)), out int bytesWritten); 275: new IPAddress(MemoryMarshal.AsBytes(new Span<UInt128>(ref newAddress)));
System.Net.Quic (10)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System\Net\Quic\Internal\MsQuicHelpers.cs (1)
41Span<byte> addressBytes = new Span<byte>(quicAddress, SocketAddressPal.IPv6AddressSize);
System\Net\Quic\Internal\MsQuicTlsSecret.cs (5)
59? new Span<byte>(_tlsSecrets->ClientHandshakeTrafficSecret, _tlsSecrets->SecretLength) 63? new Span<byte>(_tlsSecrets->ServerHandshakeTrafficSecret, _tlsSecrets->SecretLength) 67? new Span<byte>(_tlsSecrets->ClientTrafficSecret0, _tlsSecrets->SecretLength) 71? new Span<byte>(_tlsSecrets->ServerTrafficSecret0, _tlsSecrets->SecretLength) 75? new Span<byte>(_tlsSecrets->ClientEarlyTrafficSecret, _tlsSecrets->SecretLength)
System\Net\Quic\Interop\msquic.cs (1)
23public readonly Span<byte> Span => new(Buffer, (int)Length);
System\Net\Quic\QuicConnection.cs (1)
625_negotiatedApplicationProtocol = new SslApplicationProtocol(new Span<byte>(data.NegotiatedAlpn, data.NegotiatedAlpnLength).ToArray());
System\Net\Quic\QuicStream.Stream.cs (1)
110return Read(new Span<byte>(ref b)) != 0 ? b : -1;
System.Net.Requests (1)
System\Net\HttpWebResponse.cs (1)
398return Read(new Span<byte>(buffer, offset, count));
System.Net.Security (10)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (1)
1043var clientList = new Span<byte>(inp, (int)inlen);
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
89Span = new Span<byte>(rented, 0, length)
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (2)
500md5.AppendData(new Span<byte>((void*)cbtData, cbtDataSize)); 674Span<byte> responseAsSpan = new Span<byte>(responseBytes);
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (1)
41cbtPrefix.CopyTo(new Span<byte>((byte*)cbtPrefixPtr, cbtPrefix.Length));
System\Net\Security\SslStream.cs (2)
778int bytesRead = Read(new Span<byte>(ref oneByte)); 994return new Span<byte>(_pointer, _length);
System\Net\Security\SslStream.Protocol.cs (2)
1406payload.CopyTo(new Span<byte>(Payload, 0, Size)); 1431internal Span<byte> AvailableSpan => Payload == null ? Span<byte>.Empty : new Span<byte>(Payload, Size, Available);
System.Net.ServerSentEvents (1)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System.Net.Sockets (9)
src\runtime\src\libraries\Common\src\System\Net\InteropIPAddressExtensions.Unix.cs (1)
15ipAddress.TryWriteBytes(new Span<byte>(nativeIPAddress.Address, Interop.Sys.IPv6AddressBytes), out int bytesWritten);
System\Net\Sockets\NetworkStream.cs (1)
278return Read(new Span<byte>(&b, 1)) == 0 ? -1 : b;
System\Net\Sockets\SocketAsyncContext.Unix.cs (2)
547bool completed = SocketPal.TryCompleteReceiveFrom(context._socket, new Span<byte>(BufferPtr, Length), null, Flags, SocketAddress.Span, out int socketAddressLen, out BytesTransferred, out ReceivedFlags, out ErrorCode); 604bool completed = SocketPal.TryCompleteReceiveMessageFrom(context._socket, new Span<byte>(BufferPtr, Length), null, Flags, SocketAddress!, out int socketAddressLen, IsIPv4, IsIPv6, out BytesTransferred, out ReceivedFlags, out IPPacketInformation, out ErrorCode);
System\Net\Sockets\SocketPal.Unix.cs (5)
792received = SysReceive(socket, flags | SocketFlags.Peek, new Span<byte>(&oneBytePeekBuffer, 1), out errno); 860received = SysReceive(socket, flags | SocketFlags.Peek, new Span<byte>(&oneBytePeekBuffer, 1), socketAddress, out receivedSocketAddressLength, out receivedFlags, out errno); 1288bool completed = TryCompleteReceive(handle, new Span<byte>(buffer, offset, count), socketFlags, out bytesTransferred, out errorCode); 1318if (!TryCompleteReceiveMessageFrom(handle, new Span<byte>(buffer, offset, count), null, socketFlags, socketAddress.Buffer, out socketAddressLen, isIPv4, isIPv6, out bytesTransferred, out socketFlags, out ipPacketInformation, out errorCode)) 1363bool completed = TryCompleteReceiveFrom(handle, new Span<byte>(buffer, offset, count), socketFlags, socketAddress.Span, out socketAddressLen, out bytesTransferred, out socketFlags, out errorCode);
System.Net.WebClient (1)
src\runtime\src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (1)
51buffer.Slice(0, toCopy).CopyTo(new Span<byte>(_currentChunk._buffer, _currentChunk._freeOffset, toCopy));
System.Net.WebSockets (4)
System\Net\WebSockets\Compression\WebSocketInflater.cs (1)
218if (Inflate(stream, new Span<byte>(ref b), FlushCode.SyncFlush) == 0)
System\Net\WebSockets\ManagedWebSocket.cs (2)
675payloadBuffer.CopyTo(new Span<byte>(_sendBuffer, headerLength, payloadLength)); 684ApplyMask(new Span<byte>(_sendBuffer, headerLength, payloadLength), _sendBuffer, maskOffset.Value, 0);
System\Net\WebSockets\WebSocket.cs (1)
47new Span<byte>(array, 0, r.Count).CopyTo(buffer.Span);
System.Private.CoreLib (152)
Internal\Runtime\CompilerHelpers\InteropHelpers.cs (1)
71Span<char> native = new Span<char>((char*)buffer, length);
src\runtime\src\libraries\Common\src\System\Number.NumberBuffer.cs (1)
35public NumberBuffer(NumberBufferKind kind, byte* digits, int digitsLength) : this(kind, new Span<byte>(digits, digitsLength))
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (1)
47buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.cs (8)
1487new Span<T>(array).Fill(value); 1518new Span<T>(ref first, count).Fill(value); 2515var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2564var span = new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), length); 2588var spanKeys = new Span<TKey>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(keys), index), length); 2589var spanItems = new Span<TValue>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(items), index), length); 2606var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 3073new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (1)
870var dst = new Span<char>(ref result.GetRawStringData(), result.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (1)
1131ArraySortHelper<T>.Sort(new Span<T>(_items, 0, _size), comparison);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.cs (1)
121Span<EventPipeProviderConfigurationNative> providersNative = new Span<EventPipeProviderConfigurationNative>((void*)Marshal.AllocCoTaskMem(sizeof(EventPipeProviderConfigurationNative) * providers.Length), providers.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
1950WriteMultipleFoundFlagsNames(names, foundItems, new Span<char>(ref result.GetRawStringData(), result.Length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Exception.cs (1)
152Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (6)
933TryFormatS(dateTime, new Span<char>(ref str.GetRawStringData(), str.Length), out int charsWritten); 940TryFormatInvariantG(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out int charsWritten); 959TryFormatInvariantG(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out int charsWritten); 985TryFormatR(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out charsWritten); 992TryFormatS(dateTime, new Span<char>(ref str.GetRawStringData(), str.Length), out charsWritten); 999TryFormatu(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out charsWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IcuLocaleData.cs (1)
3864var s = new Span<char>(ref result.GetRawStringData(), buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (2)
57var destination = new Span<char>(ref result.GetRawStringData(), result.Length); 103var destination = new Span<char>(ref result.GetRawStringData(), result.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (3)
345Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 369Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 404s.AsSpan(0, i).CopyTo(new Span<char>(pResult, result.Length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (1)
281decimalSeparator.CopyTo(new Span<TChar>(p, decimalSeparator.Length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (3)
529Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 617Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 1249bool result = TryFormatCore(new Span<char>(ref guidString.GetRawStringData(), guidString.Length), out int bytesWritten, format);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (3)
163charsRead = _decoder.GetChars(charBytes[..numBytes], new Span<char>(ref singleChar), flush: false); 306return InternalReadChars(new Span<char>(buffer, index, count)); 404int n = InternalReadChars(new Span<char>(chars));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (3)
787buffer.Slice(0, bytesToWrite).CopyTo(new Span<byte>(_buffer, _writePos, bytesToWrite)); 982buffer.CopyTo(new Span<byte>(_buffer, _writePos, buffer.Length)); 1120buffer.Span.CopyTo(new Span<byte>(_buffer, _writePos, buffer.Length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (1)
122ref entry, _entry, _currentPath, _rootDirectory, _originalRootDirectory, new Span<char>(_pathBuffer));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (2)
362new Span<byte>(_buffer, _position, n).CopyTo(buffer); 659buffer.CopyTo(new Span<byte>(_buffer, _position, buffer.Length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (2)
150return ReadSpan(new Span<byte>(buffer, offset, count), new ArraySegment<byte>(buffer, offset, count)); 374new Span<byte>(_buffer!, _readPos, n).CopyTo(destination.Span);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (2)
203return Read(new Span<byte>(ref b)) != 0 ? b : -1; 207Read(new Span<byte>(buffer, offset, count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (3)
360return ReadSpan(new Span<char>(buffer, index, count)); 394new Span<char>(_charBuffer, _charPos, n).CopyTo(buffer.Slice(charsRead)); 1242new Span<char>(_charBuffer, _charPos, n).CopyTo(buffer.Span.Slice(charsRead));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
791source.Span.Slice(copied, n).CopyTo(new Span<char>(_charBuffer, _charPos, n));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (2)
107new Span<char>(array, 0, numRead).CopyTo(buffer); 157new Span<char>(array, 0, numRead).CopyTo(buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (2)
196buffer.CopyTo(new Span<char>(array)); 420buffer.CopyTo(new Span<char>(array));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (1)
340return ReadCore(new Span<byte>(buffer, offset, count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Memory.cs (1)
349return new Span<T>(ref refToReturn, lengthOfUnderlyingSpan);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (9)
39return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)start /* force zero-extension */), array.Length - start); 63return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)actualIndex /* force zero-extension */), array.Length - actualIndex); 87return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)start /* force zero-extension */), length); 3729return new Span<T>(array); 3747return new Span<T>(array, start, length); 3756return new Span<T>(segment.Array, segment.Offset, segment.Count); 3776return new Span<T>(segment.Array, segment.Offset + start, segment.Count - start); 3812return new Span<T>(segment.Array, segment.Offset + start, length); 3824return new Span<T>(segment.Array, segment.Offset + start, length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (14)
344var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 372var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 941var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1000var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1055var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1112var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1171var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1232var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1287var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1344var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1405var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1466var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1523var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1580var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (2)
646Shuffle(new Span<T>(ref MemoryMarshal.GetArrayDataReference(values), values.Length)); 694GetItems(choices, new Span<char>(ref destination.GetRawStringData(), destination.Length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (1)
39span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(items), size);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (1)
879Span<InternalComInterfaceDispatch> dispatches = new Span<InternalComInterfaceDispatch>(pDispatches, numSections);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (9)
231new Span<T>(source, startIndex, length).CopyTo(new Span<T>((void*)destination, length)); 284new Span<T>((void*)source, length).CopyTo(new Span<T>(destination, startIndex, length)); 1059s.CopyTo(new Span<char>((char*)ptr, s.Length)); 1077int nbWritten = Encoding.UTF8.GetBytes(s, new Span<byte>(pbMem, nb)); 1100s.CopyTo(new Span<char>((char*)ptr, s.Length)); 1118int nbWritten = Encoding.UTF8.GetBytes(s, new Span<byte>(pbMem, nb)); 1331s.CopyTo(new Span<char>((char*)bstr, s.Length)); // AllocBSTR already included the null terminator
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
40int convertedBytes = Encoding.UTF8.GetBytes(s, new Span<byte>(buffer, bufferLength));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\AnsiStringMarshaller.cs (2)
29Span<byte> buffer = new(mem, exactByteCount); 86buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (2)
66return new Span<TUnmanagedElement>(unmanaged, numElements); 161_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
100managed.CopyTo(new Span<char>(ptrToFirstChar, managed.Length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (1)
84public Span<T> AsSpan() => new(_data, _numElements);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (2)
67return new Span<TUnmanagedElement>(unmanaged, numElements); 162_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (2)
77return new Span<TUnmanagedElement>(unmanaged, numElements); 128_span = new Span<TUnmanagedElement>(_allocatedMemory, managed.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (2)
71return new Span<TUnmanagedElement>(unmanaged, numElements); 160_span = new Span<TUnmanagedElement>(_allocatedMemory, managed.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (2)
30Span<byte> buffer = new(mem, exactByteCount); 90buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (3)
37return new Span<byte>( 154return new Span<TTo>( 229new Span<T>(ref Unsafe.AsRef(in reference), length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (1)
222ReadSpan(byteOffset, new Span<T>(array, index, count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
91int charsWritten = Ordinal.ToUpperOrdinal(value, new Span<char>(ref upperCase.GetRawStringData(), upperCase.Length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (7)
291return new Span<char>((byte*)buffer.DangerousGetHandle(), (int)(buffer.ByteLength / 2)); 324span.Slice(0, length).CopyTo(new Span<char>((void*)ptr, length)); 335new Span<char>((void*)ptr, length).Clear(); 380Span<char> resultSpan = new Span<char>((void*)ptr, byteLength / sizeof(char)); 386Marshal.GetAnsiStringBytes(span, new Span<byte>((void*)ptr, byteLength)); 398new Span<byte>((void*)ptr, byteLength).Clear(); 467new Span<byte>((void*)handle, _byteLength).Clear();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Span.cs (4)
211public static implicit operator Span<T>(T[]? array) => new Span<T>(array); 217new Span<T>(segment.Array, segment.Offset, segment.Count); 401return new Span<T>(ref Unsafe.Add(ref _reference, (nint)(uint)start /* force zero-extension */), _length - start); 429return new Span<T>(ref Unsafe.Add(ref _reference, (nint)(uint)start /* force zero-extension */), length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.cs (1)
344action(new Span<char>(ref result.GetRawStringData(), length), state);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (8)
296Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 313Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 335Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 360Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 1107separator.CopyTo(new Span<char>(ref dest, separator.Length)); 1135new Span<char>(ref result._firstChar, count).Fill(paddingChar); 1154new Span<char>(ref Unsafe.Add(ref result._firstChar, oldLength), count).Fill(paddingChar); 1418Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (1)
211bytes.CopyTo(MemoryMarshal.AsBytes(new Span<int>(ref _leftoverBytes)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (2)
722new ReadOnlySpan<byte>(arrByte, 0, byteCount).CopyTo(new Span<byte>(bytes, byteCount)); 871new ReadOnlySpan<char>(arrChar, 0, charCount).CopyTo(new Span<char>(chars, charCount));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (4)
501bytes: new Span<byte>(pOriginalBytes, originalByteCount).Slice(bytesWrittenSoFar), 533Span<byte> bytes = new Span<byte>(pOriginalBytes, originalByteCount).Slice(bytesWrittenSoFar); 1097chars: new Span<char>(pOriginalChars, originalCharCount).Slice(charsWrittenSoFar), 1135Span<char> chars = new Span<char>(pOriginalChars, originalCharCount).Slice(charsWrittenSoFar);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (4)
374CopyTo(startIndex, new Span<char>(ref result.GetRawStringData(), result.Length), result.Length); 900value.CopyTo(startIndex, new Span<char>(m_ChunkChars, m_ChunkLength, length), length); 929CopyTo(sourceIndex, new Span<char>(destination).Slice(destinationIndex), count); 2630get => new Span<char>(m_ChunkChars, m_ChunkLength, m_ChunkChars.Length - m_ChunkLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
293return Read(new Span<byte>(buffer, offset, count)); 443return Read(new Span<byte>(ref b)) != 0 ? b : -1;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (1)
71return new Span<byte>(ref *pDestination, bytesWritten).ToArray(); // this overload of Span ctor doesn't validate length
System\CrashInfo.cs (1)
410return new Span<byte>(ptr, size);
System\Reflection\ConstructorInvoker.cs (1)
56object result = _methodBaseInvoker.CreateInstanceWithFewArgs(new Span<object?>(ref arg1));
System\Reflection\DynamicInvokeInfo.cs (2)
421Span<object?> copyOfParameters = new(ref Unsafe.As<IntPtr, object?>(ref *pStorage), argCount); 470Span<object?> copyOfParameters = new(ref Unsafe.As<IntPtr, object?>(ref *pStorage), argCount);
System\Reflection\MethodInvoker.cs (1)
70object? result = _methodBaseInvoker.InvokeDirectWithFewArgs(obj, new Span<object?>(ref arg1, _parameterCount));
System\Runtime\InteropServices\PInvokeMarshal.cs (2)
308stringBuilder.CopyTo(0, new Span<char>((char*)destination, length), length); 523OperationStatus conversionStatus = Ascii.FromUtf16(new ReadOnlySpan<char>(pManaged, length), new Span<byte>(pNative, length), out _);
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (2)
168Read(new Span<byte>(buffer, offset, count)); 227if (Read(new Span<byte>(ref b)) == 0)
System\Xml\EncodingStreamWrapper.cs (1)
585Read(new Span<byte>(buffer, offset, count));
System.Private.Windows.Core (45)
_generated\206\Windows.Win32.PSTR.g.cs (1)
63 internal Span<byte> AsSpan() => this.Value is null ? default(Span<byte>) : new Span<byte>(this.Value, this.Length);
_generated\207\Windows.Win32.PWSTR.g.cs (1)
63 internal Span<char> AsSpan() => this.Value is null ? default(Span<char>) : new Span<char>(this.Value, this.Length);
System\IO\BinaryReaderExtensions.cs (1)
122Span<byte> arrayData = new(a, array.Length * sizeof(T));
System\IO\StreamExtensions.cs (1)
62Span<byte> span = new(buffer, size);
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (1)
359Span<char> fileBuffer = new(
Windows\Win32\Foundation\GlobalBuffer.cs (1)
42_buffer = new((byte*)_pointer, (int)length);
Windows\Win32\Graphics\Gdi\ArgbBuffer.cs (1)
25_bufferScope = new BufferScope<ARGB>(new Span<ARGB>(s, StackSpace), length);
Windows\Win32\Graphics\Gdi\RGNDATAHEADER.cs (1)
16return new Span<RECT>((byte*)regionData + regionData->dwSize, (int)regionData->nCount).ToArray();
Windows\Win32\System\Com\ComInterfaceTable.cs (1)
246Span<ComInterfaceEntry> entries = new(
Windows\Win32\System\Com\ComManagedStream.cs (1)
124Span<byte> buffer = new(pv, checked((int)cb));
Windows\Win32\System\Variant\VARIANT.cs (35)
292new Span<sbyte>(psa->pvData, array.Length) 296new Span<byte>(psa->pvData, array.Length) 300new Span<short>(psa->pvData, array.Length) 304new Span<ushort>(psa->pvData, array.Length) 309new Span<int>(psa->pvData, array.Length) 315new Span<uint>(psa->pvData, array.Length) 319new Span<long>(psa->pvData, array.Length) 323new Span<ulong>(psa->pvData, array.Length) 327new Span<float>(psa->pvData, array.Length) 331new Span<double>(psa->pvData, array.Length) 336Span<VARIANT_BOOL> data = new(psa->pvData, array.Length); 348Span<DECIMAL> data = new(psa->pvData, array.Length); 360Span<long> data = new(psa->pvData, array.Length); 372Span<double> data = new(psa->pvData, array.Length); 384Span<IntPtr> data = new(psa->pvData, array.Length); 397Span<IntPtr> data = new(psa->pvData, array.Length); 409Span<VARIANT> data = new(psa->pvData, array.Length); 759return new Span<sbyte>(ca.pElems, (int)ca.cElems).ToArray(); 761return new Span<byte>(ca.pElems, (int)ca.cElems).ToArray(); 763return new Span<short>(ca.pElems, (int)ca.cElems).ToArray(); 765return new Span<ushort>(ca.pElems, (int)ca.cElems).ToArray(); 768Span<VARIANT_BOOL> data = new(ca.pElems, (int)ca.cElems); 780return new Span<int>(ca.pElems, (int)ca.cElems).ToArray(); 784return new Span<uint>(ca.pElems, (int)ca.cElems).ToArray(); 786return new Span<long>(ca.pElems, (int)ca.cElems).ToArray(); 788return new Span<ulong>(ca.pElems, (int)ca.cElems).ToArray(); 790return new Span<float>(ca.pElems, (int)ca.cElems).ToArray(); 792return new Span<double>(ca.pElems, (int)ca.cElems).ToArray(); 795Span<long> data = new(ca.pElems, (int)ca.cElems); 807Span<double> data = new(ca.pElems, (int)ca.cElems); 819var data = new Span<FILETIME>(ca.pElems, (int)ca.cElems); 830return new Span<Guid>(ca.pElems, (int)ca.cElems).ToArray(); 834Span<IntPtr> data = new(ca.pElems, (int)ca.cElems); 846Span<IntPtr> data = new(ca.pElems, (int)ca.cElems); 858Span<VARIANT> data = new(ca.pElems, (int)ca.cElems);
System.Private.Xml (1)
System\Xml\Core\XmlUtf8RawTextWriter.cs (1)
117bom.CopyTo(new Span<byte>(_bufBytes).Slice(1));
System.Reflection.Metadata (3)
System\Reflection\Internal\Utilities\BlobUtilities.cs (1)
16new Span<byte>(buffer, start, byteCount).Fill(value);
System\Reflection\Internal\Utilities\StreamExtensions.netcoreapp.cs (1)
11=> stream.ReadExactly(new Span<byte>(buffer, size));
System\Reflection\PortableExecutable\PEReader.EmbeddedPortablePdb.cs (1)
102actualLength = deflate.ReadAtLeast(new Span<byte>(decompressed.Pointer, decompressed.Size), decompressed.Size, throwOnEndOfStream: false);
System.Runtime.InteropServices.JavaScript (4)
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Byte.cs (1)
158value = new Span<byte>((void*)slot.IntPtrValue, slot.Length);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Double.cs (1)
164value = new Span<double>((void*)slot.IntPtrValue, slot.Length);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Int32.cs (1)
158value = new Span<int>((void*)slot.IntPtrValue, slot.Length);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Single.cs (1)
164value = new Span<float>((void*)slot.IntPtrValue, slot.Length);
System.Runtime.Numerics (1)
src\runtime\src\libraries\Common\src\System\Number.NumberBuffer.cs (1)
35public NumberBuffer(NumberBufferKind kind, byte* digits, int digitsLength) : this(kind, new Span<byte>(digits, digitsLength))
System.Security.Cryptography (26)
Microsoft\Win32\SafeHandles\SafePasswordHandle.cs (1)
52Span<char> dest = new Span<char>((void*)handle, spanLen);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeUnicodeStringHandle.cs (1)
38Span<char> dest = new Span<char>(handle.ToPointer(), cch);
src\runtime\src\libraries\Common\src\System\IO\MemoryMappedFiles\MemoryMappedFileMemoryManager.cs (1)
81return new Span<byte>(_pointer, _length);
src\runtime\src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
23return new Span<T>(_pointer, _length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (1)
244Span<byte> salt = new Span<byte>(pbeParams.rgbSalt, Interop.NCrypt.PBE_PARAMS.RgbSaltSize);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
89Span = new Span<byte>(rented, 0, length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (2)
61Span<byte> paddedMessage = new Span<byte>(rented, 0, modulusSizeInBytes); 143Span<byte> paddedMessage = new Span<byte>(rented, 0, modulusSizeInBytes);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (3)
350dbMaskSpan = new Span<byte>(dbMask, 0, db.Length); 422Span<byte> dbMask = new Span<byte>(dbMaskRented, 0, dbLen); 520Span<byte> dbMask = new Span<byte>(dbMaskRented, 0, maskedDb.Length);
System\Security\Cryptography\CryptoStream.cs (5)
362CryptographicOperations.ZeroMemory(new Span<byte>(_inputBuffer, 0, _inputBufferIndex)); 396CryptographicOperations.ZeroMemory(new Span<byte>(tempOutputBuffer, 0, numOutputBytes)); 417CryptographicOperations.ZeroMemory(new Span<byte>(tempInputBuffer, 0, numWholeBlocksInBytes)); 611CryptographicOperations.ZeroMemory(new Span<byte>(tempOutputBuffer, 0, numOutputBytes)); 617CryptographicOperations.ZeroMemory(new Span<byte>(tempOutputBuffer, 0, numOutputBytes));
System\Security\Cryptography\FixedMemoryKeyBox.cs (2)
15key.CopyTo(new Span<byte>(memory, key.Length)); 24CryptographicOperations.ZeroMemory(new Span<byte>((void*)handle, _length));
System\Security\Cryptography\HKDFManagedImplementation.cs (1)
23var counterSpan = new Span<byte>(ref counter);
System\Security\Cryptography\PemKeyHelpers.cs (2)
43Span<byte> writtenSpan = new Span<byte>(buffer, 0, bytesWritten); 79Span<byte> writtenSpan = new Span<byte>(buffer, 0, bytesWritten);
System\Security\Cryptography\RandomNumberGenerator.cs (1)
129Span<byte> oneUintBytes = MemoryMarshal.AsBytes(new Span<uint>(ref oneUint));
System\Security\Cryptography\RandomNumberGeneratorImplementation.cs (2)
31GetBytes(new Span<byte>(data)); 37GetBytes(new Span<byte>(data, offset, count));
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.cs (1)
250return new Span<byte>(pCertContext->pbCertEncoded, pCertContext->cbCertEncoded).ToArray();
System\Security\Cryptography\X509Certificates\WindowsHelpers.cs (1)
60int bytesWritten = Encoding.ASCII.GetBytes(oidString, new Span<byte>(pOidContents, oidString.Length));
System.Security.Cryptography.Cose (1)
src\runtime\src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
23return new Span<T>(_pointer, _length);
System.Security.Cryptography.Pkcs (6)
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyTrans.cs (1)
209return new Span<byte>(cek, 0, cekLength).ToArray();
Internal\Cryptography\Pal\Windows\HeapBlockRetainer.cs (1)
51var ascii = new Span<byte>((byte*)pb, length);
src\runtime\src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
23return new Span<T>(_pointer, _length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
89Span = new Span<byte>(rented, 0, length)
System\Security\Cryptography\Pkcs\CmsSignature.DSA.cs (1)
81Span<byte> ieee = new Span<byte>(rented, 0, bufSize);
System\Security\Cryptography\Pkcs\CmsSignature.ECDsa.cs (1)
86Span<byte> ieee = new Span<byte>(rented, 0, bufSize);
System.Security.Cryptography.ProtectedData (1)
System\Security\Cryptography\ProtectedData.cs (1)
379interopSpan = new Span<byte>(outputBlob.pbData.ToPointer(), length);
System.Security.Principal.Windows (2)
System\Security\Principal\WindowsIdentity.cs (2)
149sourceName.CopyTo(new Span<byte>(sourceContext.SourceName, TOKEN_SOURCE.TOKEN_SOURCE_LENGTH)); 188sourceName.CopyTo(new Span<byte>((void*)sourceNameBuffer.DangerousGetHandle(), sourceName.Length));
System.ServiceProcess.ServiceController (1)
System\ServiceProcess\ServiceBase.cs (1)
585Span<SERVICE_TABLE_ENTRY> entries = new Span<SERVICE_TABLE_ENTRY>((void*)entriesPointer, services.Length + 1);
System.Text.Encoding.CodePages (1)
System\Text\BaseCodePageEncoding.netcoreapp.cs (1)
53Span<byte> pCodePageIndex = new Span<byte>(&codePageIndex, sizeof(CodePageIndex));
System.Text.Encodings.Web (2)
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (1)
69Span<uint> thisAllowedCharactersBitmap = new Span<uint>(pBitmap, BitmapLengthInDWords);
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (1)
102Span<char> destination = new Span<char>(buffer, bufferLength);
System.Text.Json (6)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (1)
87new Span<byte>(pooledName, 0, written).Clear();
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (2)
188new Span<byte>(rentedBuffer, 0, unescapedSource.Length).Clear(); 224new Span<byte>(rentedBuffer, 0, source.Length).Clear();
System\Text\Json\Serialization\StreamReadBufferState.cs (2)
147new Span<byte>(oldBuffer, 0, oldMaxCount).Clear(); 192new Span<byte>(_buffer, 0, _maxCount).Clear();
System.Windows.Forms (5)
System\Windows\Forms\ActiveX\AxHost.VBFormat.cs (1)
51Span<char> buffer = new(lpBuffer, cb / sizeof(char));
System\Windows\Forms\ActiveX\DataStreamFromComStream.cs (2)
59Span<byte> span = new(buffer, index, count); 88int r = Read(new Span<byte>(ref data));
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
2120Span<int> boldDates = new((int*)nmmcds->prgDayState, nmmcds->cDayState);
System\Windows\Forms\Rendering\ControlPaint.cs (1)
203Span<RGBQUAD> colors = new(bi + sizeof(BITMAPINFOHEADER), (int)entryCount);
System.Windows.Forms.Design (1)
System\ComponentModel\Design\ByteViewer.cs (1)
343Encoding.Unicode.GetChars(_dataBuf.AsSpan(i, 2), new Span<char>(ref unicodeChar));
System.Windows.Forms.Primitives (6)
Interop\Richedit\Interop.CHARFORMAT2W.cs (1)
41get { fixed (char* c = _szFaceName) { return new Span<char>(c, (int)PInvokeCore.LF_FACESIZE); } }
Windows\Win32\System\Ole\CADWORD.cs (1)
16: new Span<uint>(pElems, (int)cElems).ToArray();
Windows\Win32\UI\Controls\LVITEMW.cs (1)
25Span<char> targetSpan = new(pszText, cchTextMax);
Windows\Win32\UI\Shell\NOTIFYICONDATAW.cs (3)
27get { fixed (char* c = _szTip) { return new Span<char>(c, 128); } } 38get { fixed (char* c = _szInfo) { return new Span<char>(c, 256); } } 49get { fixed (char* c = _szInfoTitle) { return new Span<char>(c, 64); } }
8028 references to Span
aspire (2)
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
src\Shared\Otlp\OtlpHelpers.cs (1)
106Span<char> chars = stackalloc char[32];
Aspire.Dashboard (4)
Otlp\Model\OtlpHelpers.cs (1)
158private static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0)
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
src\Shared\CompareHelpers.cs (1)
23var requestBytesSpan = (requestByteCount <= StackAllocThreshold ?
src\Shared\Otlp\OtlpHelpers.cs (1)
106Span<char> chars = stackalloc char[32];
Aspire.Hosting (6)
Orchestrator\ApplicationOrchestrator.cs (1)
311Span<char> suffixSpan = stackalloc char[suffix.Length + 1];
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
src\Shared\CompareHelpers.cs (1)
23var requestBytesSpan = (requestByteCount <= StackAllocThreshold ?
src\Shared\PasswordGenerator.cs (3)
41Span<char> chars = length <= 128 ? stackalloc char[length] : new char[length]; 44var currentChars = chars; 78private static void GenerateRequiredValues(ref Span<char> destination, int minValues, string choices)
Aspire.Hosting.Docker (1)
EnvVarEscaper.cs (1)
225var strippedSpan = stripped.AsSpan(0, strippedLength);
Aspire.Playground.Tests (3)
src\Shared\PasswordGenerator.cs (3)
41Span<char> chars = length <= 128 ? stackalloc char[length] : new char[length]; 44var currentChars = chars; 78private static void GenerateRequiredValues(ref Span<char> destination, int minValues, string choices)
cdac-build-tool (1)
ObjectFileScraper.cs (1)
141public void ReadBytes(Span<byte> buffer)
dotnet (12)
Commands\Test\MTP\IPC\Serializers\BaseSerializer.cs (12)
12Span<byte> len = stackalloc byte[sizeof(int)]; 47Span<byte> len = stackalloc byte[sizeof(int)]; 78Span<byte> len = stackalloc byte[sizeof(int)]; 89Span<byte> len = stackalloc byte[sizeof(int)]; 99Span<byte> bytes = stackalloc byte[sizeof(int)]; 107Span<byte> bytes = stackalloc byte[sizeof(long)]; 115Span<byte> bytes = stackalloc byte[sizeof(ushort)]; 123Span<byte> bytes = stackalloc byte[sizeof(bool)]; 131Span<byte> bytes = stackalloc byte[sizeof(int)]; 138Span<byte> bytes = stackalloc byte[sizeof(long)]; 145Span<byte> bytes = stackalloc byte[sizeof(ushort)]; 152Span<byte> bytes = stackalloc byte[sizeof(bool)];
GenerateDocumentationAndConfigFiles (48)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (6)
79protected abstract void GetCurrentHashCore(Span<byte> destination); 206public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 231public int GetCurrentHash(Span<byte> destination) 268public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 293public int GetHashAndReset(Span<byte> destination) 327protected virtual void GetHashAndResetCore(Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (4)
90public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 106public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 172protected override void GetCurrentHashCore(Span<byte> destination) 219private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (19)
315int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 711private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 944private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 962private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 975private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1020private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1079private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1096private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n) 1121private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1233public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1179Span<int> span = stackalloc int[StackAllocThreshold]; 1247Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1252Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1334Span<int> span = stackalloc int[StackAllocThreshold];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
79public static bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 83Span<char> tempBuffer = stackalloc char[4]; // Note: The tempBuffer size could be made larger than 4 but the size must be a multiple of 4. 173private static void CopyToTempBufferWithoutWhiteSpace(ReadOnlySpan<char> chars, Span<char> tempBuffer, out int consumed, out int charsWritten) 194private static bool TryDecodeFromUtf16(ReadOnlySpan<char> utf16, Span<byte> bytes, out int consumed, out int written)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74var lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89var targetLowerCaseCharacters = target.Length < 512
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
298=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
786Name: nameof(Span<>),
ILAssembler (1)
GrammarVisitor.cs (1)
3129Span<byte> utf8Bytes = new byte[byteCount];
ILCompiler.Compiler (96)
Compiler\ObjectWriter\CodeView\CodeViewFileTableBuilder.cs (1)
49Span<byte> fileTableEntry = stackalloc byte[sizeof(uint) + sizeof(uint)];
Compiler\ObjectWriter\CodeView\CodeViewSymbolsBuilder.cs (2)
53Span<byte> versionBuffer = stackalloc byte[sizeof(uint)]; 313Span<byte> subsectionHeader = stackalloc byte[sizeof(uint) + sizeof(uint)];
Compiler\ObjectWriter\CodeView\CodeViewTypesBuilder.cs (3)
61Span<byte> versionBuffer = stackalloc byte[sizeof(uint)]; 416Span<byte> lengthBuffer = stackalloc byte[sizeof(ushort)]; 490Span<byte> padding = _bufferWriter.GetSpan(paddingLength);
Compiler\ObjectWriter\CoffObjectWriter.Aot.cs (1)
81Span<byte> i_str = stackalloc byte[16];
Compiler\ObjectWriter\Dwarf\DwarfExpressionBuilder.cs (1)
65var b = _writer.GetSpan(1);
Compiler\ObjectWriter\ElfObjectWriter.Aot.cs (5)
93Span<byte> unwindWord = stackalloc byte[4]; 94Span<byte> i_str = stackalloc byte[16]; 111Span<byte> armUnwindInfo = EabiUnwindConverter.ConvertCFIToEabi(blob); 121armUnwindInfo = Span<byte>.Empty; 153armUnwindInfo = armUnwindInfo.Length > 3 ? armUnwindInfo.Slice(4) : Span<byte>.Empty;
Compiler\ObjectWriter\MachObjectWriter.Aot.cs (3)
83Span<byte> tempBuffer = stackalloc byte[8]; 96Span<byte> tempBuffer = stackalloc byte[8]; 145Span<int> registerOffset = stackalloc int[20];
Compiler\ObjectWriter\UnixObjectWriter.Aot.cs (1)
197Span<byte> i_str = stackalloc byte[16];
Compiler\ReachabilityInstrumentationFilter.cs (1)
38Span<byte> guidBytes = stackalloc byte[16];
Compiler\TypePreinit.cs (1)
3478value.CopyTo(MemoryMarshal.Cast<byte, char>(((Span<byte>)bytes).Slice(firstCharField.Offset.AsInt)));
Compiler\UnixNodeMangler.cs (1)
27Span<byte> typeNameLengthStr = stackalloc byte[16];
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\ISymbolNode.cs (1)
100void EmitChecksum(ReadOnlySpan<byte> outputBlob, Span<byte> checksumLocation);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_Wasm\WasmTypes.cs (3)
104public int Encode(Span<byte> buffer) 107Span<byte> rest = buffer.Slice(sizeLength); 241public readonly int Encode(Span<byte> buffer)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\CoffObjectWriter.cs (10)
190Span<byte> data, 540Span<byte> buffer = stackalloc byte[RegularSize]; 554Span<byte> buffer = stackalloc byte[BigObjSize]; 603Span<byte> buffer = stackalloc byte[Size]; 621Span<char> charBuffer = stackalloc char[16]; 716Span<byte> buffer = stackalloc byte[Size]; 767Span<byte> buffer = stackalloc byte[isBigObj ? BigObjSize : RegularSize]; 836Span<byte> buffer = stackalloc byte[isBigObj ? BigObjSize : RegularSize]; 865Span<byte> stringTableSize = stackalloc byte[4]; 931Span<byte> buffer = stackalloc byte[4096];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (6)
29public static int WriteULEB128(Span<byte> buffer, ulong value) 51Span<byte> buffer = writer.GetSpan((int)SizeOfULEB128(value)); 55public static int WriteSLEB128(Span<byte> buffer, long value) 79Span<byte> buffer = writer.GetSpan((int)SizeOfSLEB128(value)); 83public static void WritePaddedULEB128(Span<byte> bytes, ulong value) 94public static void WritePaddedSLEB128(Span<byte> bytes, long value)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (15)
126Span<byte> tempBuffer = stackalloc byte[sizeof(uint)]; 194Span<byte> data, 342Span<byte> relocationEntry = stackalloc byte[8]; 402Span<byte> relocationEntry = stackalloc byte[8]; 429Span<byte> relocationEntry = stackalloc byte[24]; 458Span<byte> relocationEntry = stackalloc byte[8]; 496Span<byte> relocationEntry = stackalloc byte[24]; 532Span<byte> relocationEntry = stackalloc byte[24]; 568Span<byte> relocationEntry = stackalloc byte[24]; 661Span<byte> tempBuffer = stackalloc byte[sizeof(uint)]; 969Span<byte> buffer = stackalloc byte[GetSize<TSize>()]; 976var tempBuffer = buffer.Slice(16); 1027Span<byte> buffer = stackalloc byte[GetSize<TSize>()]; 1028var tempBuffer = buffer; 1063Span<byte> buffer = stackalloc byte[GetSize<TSize>()];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\MachObjectWriter.cs (9)
408Span<byte> data, 904Span<byte> buffer = stackalloc byte[HeaderSize]; 935Span<byte> buffer = stackalloc byte[HeaderSize]; 994Span<byte> buffer = stackalloc byte[HeaderSize]; 1024Span<byte> relocationBuffer = stackalloc byte[8]; 1046Span<byte> buffer = stackalloc byte[16]; 1070Span<byte> buffer = stackalloc byte[HeaderSize]; 1108Span<byte> buffer = stackalloc byte[HeaderSize]; 1145Span<byte> buffer = stackalloc byte[HeaderSize];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (3)
163Span<byte> data, 232Span<byte> data, 722protected static ReadOnlySpan<byte> FormatUtf8Int(Span<byte> buffer, int number)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (3)
964Span<byte> GetRelocDataSpan(SymbolicRelocation reloc) 967Span<byte> data = new byte[Relocation.GetSize(reloc.Type)]; 983Span<byte> buffer = stackalloc byte[sizeof(T)];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (1)
130public override int Read(Span<byte> buffer)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionWriter.cs (6)
48Span<byte> data, 83Span<byte> buffer = bufferWriter.GetSpan(size); 117Span<byte> buffer = bufferWriter.GetSpan(value.GetByteCount()); 125Span<byte> buffer = bufferWriter.GetSpan(size); 135Span<byte> buffer = bufferWriter.GetSpan(size); 145Span<byte> buffer = bufferWriter.GetSpan(size);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\StringTableBuilder.cs (3)
80static void MultiKeySort(Span<Utf8String> input, int pos) 88static void MultiKeySortLargeInput(Span<Utf8String> input, int pos) 127static bool MultiKeySortSmallInput(Span<Utf8String> input, int pos)
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8String.cs (1)
96Span<byte> resultSpan = result;
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8StringBuilder.cs (1)
90Span<byte> buffer = stackalloc byte[11];
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoTypes.cs (4)
1608public Span<CorInfoType> LoweredElements => _loweredElements; 1613public Span<uint> Offsets => _offsets; 1703public Span<CorInfoType> LoweredElements => _loweredElements; 1708public Span<uint> Offsets => _offsets;
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (3)
49public readonly Span<T> AsSpan() => _items.AsSpan(0, _count); 51public readonly Span<T> AsSpan(int start) => _items.AsSpan(start, _count - start); 53public Span<T> AppendSpan(int length)
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\Marshaller.Aot.cs (1)
907Span<byte> bytes = Guid.Parse(guidValue).ToByteArray();
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
ILCompiler.ReadyToRun (125)
Compiler\DependencyAnalysis\ReadyToRun\DebugDirectoryEntryNode.cs (1)
247public void EmitChecksum(ReadOnlySpan<byte> outputBlob, Span<byte> checksumLocation)
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\ISymbolNode.cs (1)
100void EmitChecksum(ReadOnlySpan<byte> outputBlob, Span<byte> checksumLocation);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_Wasm\WasmTypes.cs (3)
104public int Encode(Span<byte> buffer) 107Span<byte> rest = buffer.Slice(sizeLength); 241public readonly int Encode(Span<byte> buffer)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\CoffObjectWriter.cs (10)
190Span<byte> data, 540Span<byte> buffer = stackalloc byte[RegularSize]; 554Span<byte> buffer = stackalloc byte[BigObjSize]; 603Span<byte> buffer = stackalloc byte[Size]; 621Span<char> charBuffer = stackalloc char[16]; 716Span<byte> buffer = stackalloc byte[Size]; 767Span<byte> buffer = stackalloc byte[isBigObj ? BigObjSize : RegularSize]; 836Span<byte> buffer = stackalloc byte[isBigObj ? BigObjSize : RegularSize]; 865Span<byte> stringTableSize = stackalloc byte[4]; 931Span<byte> buffer = stackalloc byte[4096];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (6)
29public static int WriteULEB128(Span<byte> buffer, ulong value) 51Span<byte> buffer = writer.GetSpan((int)SizeOfULEB128(value)); 55public static int WriteSLEB128(Span<byte> buffer, long value) 79Span<byte> buffer = writer.GetSpan((int)SizeOfSLEB128(value)); 83public static void WritePaddedULEB128(Span<byte> bytes, ulong value) 94public static void WritePaddedSLEB128(Span<byte> bytes, long value)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (15)
126Span<byte> tempBuffer = stackalloc byte[sizeof(uint)]; 194Span<byte> data, 342Span<byte> relocationEntry = stackalloc byte[8]; 402Span<byte> relocationEntry = stackalloc byte[8]; 429Span<byte> relocationEntry = stackalloc byte[24]; 458Span<byte> relocationEntry = stackalloc byte[8]; 496Span<byte> relocationEntry = stackalloc byte[24]; 532Span<byte> relocationEntry = stackalloc byte[24]; 568Span<byte> relocationEntry = stackalloc byte[24]; 661Span<byte> tempBuffer = stackalloc byte[sizeof(uint)]; 969Span<byte> buffer = stackalloc byte[GetSize<TSize>()]; 976var tempBuffer = buffer.Slice(16); 1027Span<byte> buffer = stackalloc byte[GetSize<TSize>()]; 1028var tempBuffer = buffer; 1063Span<byte> buffer = stackalloc byte[GetSize<TSize>()];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\MachObjectWriter.cs (9)
408Span<byte> data, 904Span<byte> buffer = stackalloc byte[HeaderSize]; 935Span<byte> buffer = stackalloc byte[HeaderSize]; 994Span<byte> buffer = stackalloc byte[HeaderSize]; 1024Span<byte> relocationBuffer = stackalloc byte[8]; 1046Span<byte> buffer = stackalloc byte[16]; 1070Span<byte> buffer = stackalloc byte[HeaderSize]; 1108Span<byte> buffer = stackalloc byte[HeaderSize]; 1145Span<byte> buffer = stackalloc byte[HeaderSize];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (3)
163Span<byte> data, 232Span<byte> data, 722protected static ReadOnlySpan<byte> FormatUtf8Int(Span<byte> buffer, int number)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (3)
964Span<byte> GetRelocDataSpan(SymbolicRelocation reloc) 967Span<byte> data = new byte[Relocation.GetSize(reloc.Type)]; 983Span<byte> buffer = stackalloc byte[sizeof(T)];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (1)
130public override int Read(Span<byte> buffer)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionWriter.cs (6)
48Span<byte> data, 83Span<byte> buffer = bufferWriter.GetSpan(size); 117Span<byte> buffer = bufferWriter.GetSpan(value.GetByteCount()); 125Span<byte> buffer = bufferWriter.GetSpan(size); 135Span<byte> buffer = bufferWriter.GetSpan(size); 145Span<byte> buffer = bufferWriter.GetSpan(size);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\StringTableBuilder.cs (3)
80static void MultiKeySort(Span<Utf8String> input, int pos) 88static void MultiKeySortLargeInput(Span<Utf8String> input, int pos) 127static bool MultiKeySortSmallInput(Span<Utf8String> input, int pos)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmInstructions.cs (27)
93public int Encode(Span<byte> buffer) 109public int EncodeRelocations(Span<Relocation> buffer) 212public int Encode(Span<byte> buffer) 250public int EncodeRelocations(Span<Relocation> buffer) 276public virtual int Encode(Span<byte> buffer) 290public virtual int EncodeRelocations(Span<Relocation> buffer) 296public static void OffsetRelocationsByOffset(Span<Relocation> buffer, int offset) 317public int Encode(Span<byte> buffer) 322public int EncodeRelocations(Span<Relocation> buffer) => 0; 341public int Encode(Span<byte> buffer) 369public int EncodeRelocations(Span<Relocation> buffer) 402public override int Encode(Span<byte> buffer) 410public override int EncodeRelocations(Span<Relocation> buffer) 441public override int Encode(Span<byte> buffer) 467public override int Encode(Span<byte> buffer) 479public override int EncodeRelocations(Span<Relocation> buffer) 495public override int Encode(Span<byte> buffer) 503public override int EncodeRelocations(Span<Relocation> buffer) 523public override int Encode(Span<byte> buffer) 548public override int Encode(Span<byte> buffer) 596public override int Encode(Span<byte> buffer) 626public override int Encode(Span<byte> buffer) 655public override int Encode(Span<byte> buffer) 687public override int Encode(Span<byte> buffer) 713public override int Encode(Span<byte> buffer) 739public override int Encode(Span<byte> buffer) 767public override int Encode(Span<byte> buffer)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmNative.cs (14)
17int Encode(Span<byte> buffer); 19int EncodeRelocations(Span<Relocation> buffer); 55public abstract int Encode(Span<byte> buffer); 62public abstract int EncodeRelocations(Span<Relocation> buffer); 86public override int Encode(Span<byte> buffer) 95public override int EncodeRelocations(Span<Relocation> buffer) => 0; 104public override int Encode(Span<byte> buffer) 115public override int EncodeRelocations(Span<Relocation> buffer) => 0; 142public override int Encode(Span<byte> buffer) 165public override int EncodeRelocations(Span<Relocation> buffer) => 0; 184public int Encode(Span<byte> buffer) => Import.Encode(buffer); 187public int EncodeRelocations(Span<Relocation> buffer) => Import.EncodeRelocations(buffer); 207public int Encode(Span<byte> buffer) 215public int EncodeRelocations(Span<Relocation> buffer) => 0;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmObjectWriter.cs (11)
995Span<byte> ReadRelocToDataSpan(SymbolicRelocation reloc, byte[] buffer, long sectionStart) 997Span<byte> relocContents = buffer.AsSpan(0, Relocation.GetSize(reloc.Type)); 1125private int EncodePrependCount(Span<byte> dest) 1168public virtual int EncodeHeader(Span<byte> headerBuffer) 1184Span<byte> headerBuffer = stackalloc byte[HeaderSize]; 1191Span<byte> prependCount = stackalloc byte[PrependCountSize]; 1238public override int EncodeHeader(Span<byte> headerBuffer) 1262Span<byte> countBuffer = stackalloc byte[(int)DwarfHelper.SizeOfULEB128((ulong)_segments.Count)]; 1288Span<byte> headerBuffer = stackalloc byte[HeaderSize]; 1365public int EncodeHeader(Span<byte> headerBuffer) 1395Span<byte> headerBuffer = stackalloc byte[HeaderSize];
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WebcilEncoder.cs (2)
46Span<byte> headerBuffer = stackalloc byte[encodeSize]; 79Span<byte> header = stackalloc byte[encodeSize];
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8String.cs (1)
96Span<byte> resultSpan = result;
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8StringBuilder.cs (1)
90Span<byte> buffer = stackalloc byte[11];
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (1)
3927Span<AllocMemChunk> chunks = new Span<AllocMemChunk>(args.chunks, checked((int)args.chunksCount));
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoTypes.cs (4)
1608public Span<CorInfoType> LoweredElements => _loweredElements; 1613public Span<uint> Offsets => _offsets; 1703public Span<CorInfoType> LoweredElements => _loweredElements; 1708public Span<uint> Offsets => _offsets;
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (3)
49public readonly Span<T> AsSpan() => _items.AsSpan(0, _count); 51public readonly Span<T> AsSpan(int start) => _items.AsSpan(start, _count - start); 53public Span<T> AppendSpan(int length)
ILCompiler.RyuJit (45)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmInstructions.cs (27)
93public int Encode(Span<byte> buffer) 109public int EncodeRelocations(Span<Relocation> buffer) 212public int Encode(Span<byte> buffer) 250public int EncodeRelocations(Span<Relocation> buffer) 276public virtual int Encode(Span<byte> buffer) 290public virtual int EncodeRelocations(Span<Relocation> buffer) 296public static void OffsetRelocationsByOffset(Span<Relocation> buffer, int offset) 317public int Encode(Span<byte> buffer) 322public int EncodeRelocations(Span<Relocation> buffer) => 0; 341public int Encode(Span<byte> buffer) 369public int EncodeRelocations(Span<Relocation> buffer) 402public override int Encode(Span<byte> buffer) 410public override int EncodeRelocations(Span<Relocation> buffer) 441public override int Encode(Span<byte> buffer) 467public override int Encode(Span<byte> buffer) 479public override int EncodeRelocations(Span<Relocation> buffer) 495public override int Encode(Span<byte> buffer) 503public override int EncodeRelocations(Span<Relocation> buffer) 523public override int Encode(Span<byte> buffer) 548public override int Encode(Span<byte> buffer) 596public override int Encode(Span<byte> buffer) 626public override int Encode(Span<byte> buffer) 655public override int Encode(Span<byte> buffer) 687public override int Encode(Span<byte> buffer) 713public override int Encode(Span<byte> buffer) 739public override int Encode(Span<byte> buffer) 767public override int Encode(Span<byte> buffer)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmNative.cs (14)
17int Encode(Span<byte> buffer); 19int EncodeRelocations(Span<Relocation> buffer); 55public abstract int Encode(Span<byte> buffer); 62public abstract int EncodeRelocations(Span<Relocation> buffer); 86public override int Encode(Span<byte> buffer) 95public override int EncodeRelocations(Span<Relocation> buffer) => 0; 104public override int Encode(Span<byte> buffer) 115public override int EncodeRelocations(Span<Relocation> buffer) => 0; 142public override int Encode(Span<byte> buffer) 165public override int EncodeRelocations(Span<Relocation> buffer) => 0; 184public int Encode(Span<byte> buffer) => Import.Encode(buffer); 187public int EncodeRelocations(Span<Relocation> buffer) => Import.EncodeRelocations(buffer); 207public int Encode(Span<byte> buffer) 215public int EncodeRelocations(Span<Relocation> buffer) => 0;
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (1)
3927Span<AllocMemChunk> chunks = new Span<AllocMemChunk>(args.chunks, checked((int)args.chunksCount));
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (3)
49public readonly Span<T> AsSpan() => _items.AsSpan(0, _count); 51public readonly Span<T> AsSpan(int start) => _items.AsSpan(start, _count - start); 53public Span<T> AppendSpan(int length)
ILCompiler.TypeSystem (16)
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (3)
49public readonly Span<T> AsSpan() => _items.AsSpan(0, _count); 51public readonly Span<T> AsSpan(int start) => _items.AsSpan(start, _count - start); 53public Span<T> AppendSpan(int length)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeSystemHelpers.cs (4)
436Span<T> buffer = new T[s1.Length + s2.Length]; 446Span<T> buffer = new T[s1.Length + s2.Length + s3.Length]; 457Span<byte> s4 = stackalloc byte[16]; 460Span<byte> buffer = new byte[s1.Length + s2.Length + s3.Length + s4length];
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILStackHelper.cs (1)
34Span<int> stackHeights = ilReader.Size <= StackAllocThreshold ?
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILTokenReplacer.cs (1)
27var tokenSpan = ilStream.AsSpan(checked(offsetAfter - 4), 4);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\ILEmitter.cs (1)
482Span<byte> offsetSpan = _instructions.AsSpan(patch.Offset, sizeof(int));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
illink (6)
ILLink.RoslynAnalyzer (16)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (9)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 226Span<char> result = (bytes.Length > 16) ? 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
261Span<ushort> versionNumbers = [ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue];
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
Microsoft.AspNetCore.Antiforgery (22)
Internal\DefaultAntiforgeryTokenGenerator.cs (2)
146Span<byte> currentClaimUidBytes = stackalloc byte[32]; 192static bool AreIdenticalClaimUids(AntiforgeryToken token, bool claimUidBytesExtracted, Span<byte> claimUidBytes)
Internal\DefaultAntiforgeryTokenSerializer.cs (5)
37var rent = maxTokenDecodedSize <= 256 40var tokenBytes = rent[..maxTokenDecodedSize]; 43var tokenBytesDecoded = tokenBytes[..bytesWritten]; 218var rent = totalSize < 256 221var tokenBytes = rent[..totalSize];
Internal\DefaultClaimUidExtractor.cs (4)
17public bool TryExtractClaimUidBytes(ClaimsPrincipal claimsPrincipal, Span<byte> destination) 114private static void ComputeSha256(List<string> parameters, Span<byte> destination) 128var buffer = totalSize <= 256 134var span = buffer[..totalSize];
Internal\IClaimUidExtractor.cs (1)
16bool TryExtractClaimUidBytes(ClaimsPrincipal claimsPrincipal, Span<byte> destination);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (4)
18private Span<T> _buffer; 27public RefPooledArrayBufferWriter(Span<T> initialBuffer) 82public Span<T> GetSpan(int sizeHint = 0) 160var previousBuffer = oldBuffer.AsSpan(0, _index);
src\aspnetcore\src\Shared\Encoding\Int7BitEncodingUtils.cs (3)
28public static int Write7BitEncodedInt(this Span<byte> target, int value) 31public static int Write7BitEncodedInt(this Span<byte> target, uint uValue) 99internal static int Write7BitEncodedString(this Span<byte> target, string value)
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (3)
172Span<char> bufferSpan = buffer.AsSpan(i, count); 218internal static int Base64UrlDecode(string input, Span<byte> output) 437public static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
Microsoft.AspNetCore.App.Analyzers (1)
Infrastructure\VirtualChars\VirtualChar.cs (1)
150Span<char> chars = stackalloc char[2];
Microsoft.AspNetCore.Components (24)
CascadingValueSource.cs (1)
102var subscribersCopy = subscribersCount <= ComponentStateBuffer.Capacity
ParameterView.cs (3)
216var oldDirectParameterFrames = GetDirectParameterFrames(oldParameters); 223var newDirectParameterFrames = GetDirectParameterFrames(this); 252static Span<RenderTreeFrame> GetDirectParameterFrames(in ParameterView parameterView)
PersistentState\PersistentStateValueProviderKeyResolver.cs (4)
61Span<byte> keyHash = stackalloc byte[SHA256.HashSizeInBytes]; 67Span<byte> keyBuffer = stackalloc byte[1024]; 68var currentBuffer = keyBuffer; 142private static void GrowBuffer(ref byte[]? pool, ref Span<byte> keyBuffer, int? size = null)
Routing\RouteContext.cs (3)
27var utf8Span = uriBuffer.Buffer; 57public Span<byte> Buffer { get; } 65public UriBuffer(Span<byte> buffer) => Buffer = buffer;
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (2)
162public Span<T> GetSpan(int sizeHint = 0) 199var previousBuffer = oldBuffer.AsSpan(0, _index);
src\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (11)
18public static int DecodeRequestLine(ReadOnlySpan<byte> source, Span<byte> destination, bool isFormEncoding) 42public static int DecodeInPlace(Span<byte> buffer, bool isFormEncoding) 96private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<byte> buffer, bool isFormEncoding) 234private static void Copy<T>(int begin, int end, ref int writer, Span<T> buffer) 262private static int UnescapePercentEncoding(ref int scan, Span<byte> buffer, bool isFormEncoding) 301private static int ReadHex(ref int scan, Span<byte> buffer) 355/// Form Encoding is not supported compared to the <see cref="DecodeRequestLine(ReadOnlySpan{byte}, Span{byte}, bool)" /> 358public static int DecodeRequestLine(ReadOnlySpan<char> source, Span<char> destination) 374/// Form Encoding is not supported compared to the <see cref="DecodeInPlace(Span{byte}, bool)" /> 377public static int DecodeInPlace(Span<char> buffer) 434private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<char> buffer)
Microsoft.AspNetCore.Components.Endpoints (18)
Builder\ResourceCollectionUrlEndpoint.cs (6)
77Span<byte> hash = stackalloc byte[32]; 116Span<byte> buffer = stackalloc byte[1024]; 118Span<byte> result = stackalloc byte[incrementalHash.HashLengthInBytes]; 133Span<char> fingerprintSpan = stackalloc char[(incrementalHash.HashLengthInBytes * 4 / 3) + 3]; 170private static void AppendToHash(IncrementalHash incrementalHash, Span<byte> buffer, ref byte[]? rented, string value) 216Span<byte> data = stackalloc byte[32];
FormMapping\Converters\CollectionConverter.cs (1)
160Span<char> computedPrefix = stackalloc char[16];
Rendering\Buffering\TextChunk.cs (1)
45charArraySegmentScope.Append((Span<char>)value);
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
132var componentIdsInDepthOrder = bufSizeRequired < 1024
Rendering\TypeNameHash.cs (2)
21Span<byte> typeNameBytes = stackalloc byte[MaxStackBufferSize]; 29Span<byte> typeNameHashBytes = stackalloc byte[SHA256.HashSizeInBytes];
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (4)
18private Span<T> _buffer; 27public RefPooledArrayBufferWriter(Span<T> initialBuffer) 82public Span<T> GetSpan(int sizeHint = 0) 160var previousBuffer = oldBuffer.AsSpan(0, _index);
src\aspnetcore\src\Shared\Components\ServerComponentInvocationSequence.cs (1)
15Span<byte> bytes = stackalloc byte[16];
TempData\CookieTempDataProvider.cs (2)
61var decodeBuffer = maxDecodedSize <= 256 68var protectedBytes = decodeBuffer[..bytesWritten];
Microsoft.AspNetCore.Components.Forms (3)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (3)
16private Span<char> _currentBuffer; 30public ReverseStringBuilder(Span<char> initialBuffer) 95Span<char> result = stackalloc char[11];
Microsoft.AspNetCore.Components.Server (83)
BlazorPack\SequenceOfT.cs (2)
184public Span<T> GetSpan(int sizeHint) => this.GetSegment(sizeHint).RemainingSpan; 325internal Span<T> RemainingSpan => this.AvailableMemory.Span.Slice(this.End);
Circuits\ServerComponentDeserializer.cs (1)
307Span<int> seenSsrComponentIds = operations.Length <= 128
src\aspnetcore\src\Shared\Components\ServerComponentInvocationSequence.cs (1)
15Span<byte> bytes = stackalloc byte[16];
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (2)
162public Span<T> GetSpan(int sizeHint = 0) 199var previousBuffer = oldBuffer.AsSpan(0, _index);
src\aspnetcore\src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
372var span = array.AsSpan();
src\aspnetcore\src\SignalR\common\Shared\BinaryMessageFormatter.cs (2)
13Span<byte> lenBuffer = stackalloc byte[5]; 20public static int WriteLengthPrefix(long length, Span<byte> output)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\BufferWriter.cs (4)
28private Span<byte> _span; 90public Span<byte> Span => _span; 104public Span<byte> GetSpan(int sizeHint) 254var realSpan = _output.GetSpan(_buffered);
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackWriter.cs (65)
89Span<byte> span = this.writer.GetSpan(1); 133Span<byte> span = this.writer.GetSpan(1); 139Span<byte> span = this.writer.GetSpan(3); 146Span<byte> span = this.writer.GetSpan(5); 173Span<byte> span = this.writer.GetSpan(1); 179Span<byte> span = this.writer.GetSpan(3); 186Span<byte> span = this.writer.GetSpan(5); 201Span<byte> span = this.writer.GetSpan(1); 217Span<byte> span = this.writer.GetSpan(2); 235Span<byte> span = this.writer.GetSpan(1); 247Span<byte> span = this.writer.GetSpan(2); 261Span<byte> span = this.writer.GetSpan(1); 267Span<byte> span = this.writer.GetSpan(2); 284Span<byte> span = this.writer.GetSpan(3); 310Span<byte> span = this.writer.GetSpan(1); 316Span<byte> span = this.writer.GetSpan(2); 334Span<byte> span = this.writer.GetSpan(3); 353Span<byte> span = this.writer.GetSpan(1); 359Span<byte> span = this.writer.GetSpan(2); 366Span<byte> span = this.writer.GetSpan(3); 383Span<byte> span = this.writer.GetSpan(5); 412Span<byte> span = this.writer.GetSpan(1); 418Span<byte> span = this.writer.GetSpan(2); 425Span<byte> span = this.writer.GetSpan(3); 443Span<byte> span = this.writer.GetSpan(5); 464Span<byte> span = this.writer.GetSpan(1); 470Span<byte> span = this.writer.GetSpan(2); 477Span<byte> span = this.writer.GetSpan(3); 484Span<byte> span = this.writer.GetSpan(5); 501Span<byte> span = this.writer.GetSpan(9); 531Span<byte> span = this.writer.GetSpan(1); 537Span<byte> span = this.writer.GetSpan(2); 544Span<byte> span = this.writer.GetSpan(3); 551Span<byte> span = this.writer.GetSpan(5); 569Span<byte> span = this.writer.GetSpan(9); 581Span<byte> span = this.writer.GetSpan(1); 598Span<byte> span = this.writer.GetSpan(5); 610Span<byte> span = this.writer.GetSpan(9); 682Span<byte> span = this.writer.GetSpan(6); 691Span<byte> span = this.writer.GetSpan(10); 701Span<byte> span = this.writer.GetSpan(15); 746var span = this.writer.GetSpan(length); 765var span = this.writer.GetSpan(length); 800Span<byte> span = this.writer.GetSpan(size); 810Span<byte> span = this.writer.GetSpan(size); 820Span<byte> span = this.writer.GetSpan(size); 841Span<byte> span = this.writer.GetSpan(length); 858Span<byte> span = this.writer.GetSpan(length); 882Span<byte> span = this.writer.GetSpan(byteCount + 1); 888Span<byte> span = this.writer.GetSpan(byteCount + 2); 895Span<byte> span = this.writer.GetSpan(byteCount + 3); 902Span<byte> span = this.writer.GetSpan(byteCount + 5); 974Span<byte> span = this.writer.GetSpan(2); 1067public Span<byte> GetSpan(int length) => this.writer.GetSpan(length); 1082Span<byte> span = this.writer.GetSpan(2); 1093Span<byte> span = this.writer.GetSpan(4); 1104Span<byte> span = this.writer.GetSpan(8); 1129private static void WriteBigEndian(short value, Span<byte> span) => WriteBigEndian(unchecked((ushort)value), span); 1131private static void WriteBigEndian(int value, Span<byte> span) => WriteBigEndian(unchecked((uint)value), span); 1133private static void WriteBigEndian(long value, Span<byte> span) => WriteBigEndian(unchecked((ulong)value), span); 1135private static void WriteBigEndian(ushort value, Span<byte> span) 1154private static void WriteBigEndian(uint value, Span<byte> span) 1177private static void WriteBigEndian(ulong value, Span<byte> span) 1193private static unsafe void WriteBigEndian(float value, Span<byte> span) => WriteBigEndian(*(int*)&value, span); 1195private static unsafe void WriteBigEndian(double value, Span<byte> span) => WriteBigEndian(*(long*)&value, span);
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (2)
454public bool TryCopyTo(Span<T> destination) 466internal bool TryCopyMultisegment(Span<T> destination)
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReaderExtensions.cs (1)
76Span<byte> tempSpan = new Span<byte>(&buffer, sizeof(T));
Microsoft.AspNetCore.Components.Web (3)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (3)
16private Span<char> _currentBuffer; 30public ReverseStringBuilder(Span<char> initialBuffer) 95Span<char> result = stackalloc char[11];
Microsoft.AspNetCore.DataProtection (65)
Cng\CbcAuthenticatedEncryptor.cs (4)
138var buffer = destination.GetSpan(checked((int)dwRequiredSize)); 188var buffer = outputSize <= 256 316var buffer = destination.GetSpan(totalRequiredSize); 385var buffer = outputSize <= 256
Cng\CngGcmAuthenticatedEncryptor.cs (4)
96var buffer = destination.GetSpan(plaintextLength); 155var buffer = outputSize <= 256 230var buffer = destination.GetSpan(totalRequiredSize); 304var buffer = outputSize <= 256
KeyManagement\KeyRingBasedDataProtector.cs (3)
305var span = new Span<byte>(ptr, sizeof(Guid)); 378Span<int> purposeLengthsPool = targetLength <= 32 ? stackalloc int[targetLength] : (lease = ArrayPool<int>.Shared.Rent(targetLength)).AsSpan(0, targetLength); 391var targetSpan = targetArr.AsSpan();
KeyManagement\KeyRingBasedSpanDataProtector.cs (3)
51var span = destination.GetSpan(result.Length); 63var headerBuffer = destination.GetSpan(preBufferSize); 179var span = destination.GetSpan(result.Length);
Managed\AesGcmAuthenticatedEncryptor.cs (14)
94var buffer = destination.GetSpan(plaintextBytes); 97var plaintext = buffer.Slice(0, plaintextBytes); 101Span<byte> decryptedKdk = _keyDerivationKey.Length <= 256 105Span<byte> derivedKey = _derivedkeySizeInBytes <= 256 121validationSubkey: Span<byte>.Empty /* filling in derivedKey only */); 157var buffer = outputSize <= 256 189var buffer = outputSize <= 256 226var buffer = destination.GetSpan(totalRequiredSize); 240Span<byte> decryptedKdk = _keyDerivationKey.Length <= 256 244Span<byte> derivedKey = _derivedkeySizeInBytes <= 256 260validationSubkey: Span<byte>.Empty /* filling in derivedKey only */); 264var nonce = buffer.Slice(KEY_MODIFIER_SIZE_IN_BYTES, NONCE_SIZE_IN_BYTES); 265var encrypted = buffer.Slice(KEY_MODIFIER_SIZE_IN_BYTES + NONCE_SIZE_IN_BYTES, plaintext.Length); 266var tag = buffer.Slice(KEY_MODIFIER_SIZE_IN_BYTES + NONCE_SIZE_IN_BYTES + plaintext.Length, TAG_SIZE_IN_BYTES);
Managed\IManagedGenRandom.cs (1)
13void GenRandom(Span<byte> target);
Managed\ManagedAuthenticatedEncryptor.cs (17)
91var buffer = destination.GetSpan(estimatedDecryptedSize); 103Span<byte> decryptedKdk = _keyDerivationKey.Length <= 256 108var validationSubkey = _validationAlgorithmSubkeyLengthInBytes <= 128 112Span<byte> decryptionSubkey = _symmetricAlgorithmSubkeyLengthInBytes <= 128 184var buffer = destination.GetSpan(totalRequiredSize); 187Span<byte> keyModifier = keyModifierLength <= 128 197var iv = buffer.Slice(keyModifierLength, ivLength); 201Span<byte> decryptedKdk = _keyDerivationKey.Length <= 256 206Span<byte> validationSubkey = _validationAlgorithmSubkeyLengthInBytes <= 128 210Span<byte> encryptionSubkey = _symmetricAlgorithmSubkeyLengthInBytes <= 128 235var ciphertextDestination = buffer.Slice(keyModifierLength + ivLength, cipherTextLength); 239var ivAndCipherTextSpan = buffer.Slice(keyModifierLength, ivLength + cipherTextLength); 240var macDestinationSpan = buffer.Slice(keyModifierLength + ivLength + cipherTextLength, macLength); 284var plainTextSpan = plaintext.AsSpan(); 292var buffer = outputSize <= 256 400Span<byte> correctHash = hashSize <= 128 475var buffer = outputSize <= 256
Managed\ManagedGenRandomImpl.cs (1)
21public void GenRandom(Span<byte> target) => RandomNumberGenerator.Fill(target);
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (9)
46public static void DeriveKeys(ReadOnlySpan<byte> kdk, ReadOnlySpan<byte> label, ReadOnlySpan<byte> contextHeader, ReadOnlySpan<byte> contextData, Span<byte> operationSubkey, Span<byte> validationSubkey) 52Span<byte> zeroExtended = stackalloc byte[FipsMinimumKeyLengthInBytes]; 74Span<byte> operationSubkey, 75Span<byte> validationSubkey, 90Span<byte> prfOutput = prfOutputSizeInBytes <= 128 100Span<byte> prfInput = prfInputLength <= 128 156var destination = operationSubkey.Slice(operationSubKeyIndex, bytesToWrite); 163var destination = validationSubkey.Slice(validationSubKeyIndex, leftOverBytes);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (4)
18private Span<T> _buffer; 27public RefPooledArrayBufferWriter(Span<T> initialBuffer) 82public Span<T> GetSpan(int sizeHint = 0) 160var previousBuffer = oldBuffer.AsSpan(0, _index);
src\aspnetcore\src\Shared\Encoding\Int7BitEncodingUtils.cs (3)
28public static int Write7BitEncodedInt(this Span<byte> target, int value) 31public static int Write7BitEncodedInt(this Span<byte> target, uint uValue) 99internal static int Write7BitEncodedString(this Span<byte> target, string value)
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (2)
162public Span<T> GetSpan(int sizeHint = 0) 199var previousBuffer = oldBuffer.AsSpan(0, _index);
Microsoft.AspNetCore.DataProtection.Abstractions (3)
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (3)
172Span<char> bufferSpan = buffer.AsSpan(i, count); 218internal static int Base64UrlDecode(string input, Span<byte> output) 437public static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
Microsoft.AspNetCore.Diagnostics.Middleware (4)
src\Shared\BufferWriterPool\BufferWriter.cs (4)
110/// Notifies <see cref="IBufferWriter{T}"/> that <paramref name="count"/> amount of data was written to the output <see cref="Span{T}"/>/<see cref="Memory{T}"/>. 146/// Returns a <see cref="Span{T}"/> to write to that is at least the requested length (specified by <paramref name="sizeHint"/>). 152/// This will never return an empty <see cref="Span{T}"/>. 158public Span<T> GetSpan(int sizeHint = 0)
Microsoft.AspNetCore.Http (1)
src\aspnetcore\src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
540private Span<KeyValuePair<TKey, TValue>> ArrayStorageSpan
Microsoft.AspNetCore.Http.Abstractions (18)
Extensions\HttpResponseWritingExtensions.cs (2)
76var destination = pipeWriter.GetSpan(minimumByteSize); 100private static void WriteMultiSegmentEncoded(PipeWriter writer, string text, Encoding encoding, Span<byte> destination, int encodedLength, int minimumByteSize)
PathString.cs (2)
187Span<char> pathBuffer = uriComponent.Length <= StackAllocThreshold ? stackalloc char[StackAllocThreshold] : new char[uriComponent.Length]; 203Span<char> pathBuffer = uriComponent.Length < StackAllocThreshold ? stackalloc char[StackAllocThreshold] : new char[uriComponent.Length + 1];
src\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (11)
18public static int DecodeRequestLine(ReadOnlySpan<byte> source, Span<byte> destination, bool isFormEncoding) 42public static int DecodeInPlace(Span<byte> buffer, bool isFormEncoding) 96private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<byte> buffer, bool isFormEncoding) 234private static void Copy<T>(int begin, int end, ref int writer, Span<T> buffer) 262private static int UnescapePercentEncoding(ref int scan, Span<byte> buffer, bool isFormEncoding) 301private static int ReadHex(ref int scan, Span<byte> buffer) 355/// Form Encoding is not supported compared to the <see cref="DecodeRequestLine(ReadOnlySpan{byte}, Span{byte}, bool)" /> 358public static int DecodeRequestLine(ReadOnlySpan<char> source, Span<char> destination) 374/// Form Encoding is not supported compared to the <see cref="DecodeInPlace(Span{byte}, bool)" /> 377public static int DecodeInPlace(Span<char> buffer) 434private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<char> buffer)
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
Microsoft.AspNetCore.Http.Connections (6)
Internal\HttpConnectionManager.cs (1)
111Span<byte> buffer = stackalloc byte[16];
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (3)
172Span<char> bufferSpan = buffer.AsSpan(i, count); 218internal static int Base64UrlDecode(string input, Span<byte> output) 437public static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
Microsoft.AspNetCore.Http.Connections.Common (3)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
117var destination = GetBuffer(); 146private Span<byte> GetBuffer() 178var destination = GetBuffer();
Microsoft.AspNetCore.Http.Extensions (13)
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Converters\CollectionConverter.cs (1)
160Span<char> computedPrefix = stackalloc char[16];
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (7)
15private Span<char> _chars; 18public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 119public bool TryCopyTo(Span<char> destination, out int charsWritten) 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 259public Span<char> AppendSpan(int length)
UriHelper.cs (2)
217private static int CopyTextToBuffer(Span<char> buffer, int index, ReadOnlySpan<char> text) 228private static void InitializeAbsoluteUriString(Span<char> buffer, (string scheme, string host, string pathBase, string path, string query, string fragment) uriParts)
Microsoft.AspNetCore.HttpLogging (15)
BufferingStream.cs (1)
124public Span<byte> GetSpan(int sizeHint = 0)
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (4)
18private Span<T> _buffer; 27public RefPooledArrayBufferWriter(Span<T> initialBuffer) 82public Span<T> GetSpan(int sizeHint = 0) 160var previousBuffer = oldBuffer.AsSpan(0, _index);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (7)
15private Span<char> _chars; 18public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 119public bool TryCopyTo(Span<char> destination, out int charsWritten) 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 259public Span<char> AppendSpan(int length)
Microsoft.AspNetCore.Identity (3)
Passkeys\BufferSourceJsonConverter.cs (3)
47Span<byte> byteSpan = utf8Unescaped.Length <= StackallocByteThreshold ? 80var byteSpan = encodedLength <= StackallocByteThreshold ? 88var base64UrlUtf8 = byteSpan[..bytesWritten];
Microsoft.AspNetCore.Localization (1)
CookieRequestCultureProvider.cs (1)
72Span<Range> parts = stackalloc Range[3];
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (2)
162public Span<T> GetSpan(int sizeHint = 0) 199var previousBuffer = oldBuffer.AsSpan(0, _index);
Microsoft.AspNetCore.OutputCaching (6)
FormatterBinaryWriter.cs (3)
33private Span<byte> AvailableBuffer 110var span = target.GetSpan(1024); // fairly arbitrary non-trivial buffer; we can explore larger if useful 199var available = AvailableBuffer;
RecyclableArrayBufferWriter.cs (1)
70public Span<T> GetSpan(int sizeHint = 0)
RecyclableSequenceBuilder.cs (2)
59private Span<byte> GetBuffer() 91var available = GetBuffer();
Microsoft.AspNetCore.Razor.Runtime (1)
Runtime\TagHelpers\TagHelperRunner.cs (1)
26var tagHelpers = CollectionsMarshal.AsSpan(executionContext.TagHelperList);
Microsoft.AspNetCore.Razor.Utilities.Shared (47)
ArgHelper.cs (1)
181Span<T> destination, int expectedLength, [CallerArgumentExpression(nameof(destination))] string? paramName = null)
ArrayExtensions.cs (2)
34public static Span<T> AsSpan<T>(this T[]? array, Index startIndex) 77public static Span<T> AsSpan<T>(this T[]? array, Range range)
BufferExtensions.cs (6)
92/// The rented array is provided as a <see cref="Span{T}"/> representing a portion of the rented array 102/// The <see cref="Span{T}"/> representing a portion of the rented array from its start to the minimum length. 104public static PooledArray<T> GetPooledArraySpan<T>(this ArrayPool<T> pool, int minimumLength, out Span<T> span) 109/// The rented array is provided as a <see cref="Span{T}"/> representing a portion of the rented array 122/// The <see cref="Span{T}"/> representing a portion of the rented array from its start to the minimum length. 124public static PooledArray<T> GetPooledArraySpan<T>(this ArrayPool<T> pool, int minimumLength, bool clearOnReturn, out Span<T> span)
EnumerableExtensions.cs (3)
191/// Copies the contents of the sequence to a destination <see cref="Span{T}"/>. 199public static void CopyTo<T>(this IEnumerable<T> sequence, Span<T> destination) 223static void CopySequence(IEnumerable<T> sequence, Span<T> destination)
HashSetExtensions.cs (2)
29/// Copies the contents of the set to a destination <see cref="Span{T}"/>. 40public static void CopyTo<T>(this HashSet<T> set, Span<T> destination)
ImmutableArrayExtensions_Unsafe.cs (1)
180var items = innerArray.AsSpan();
ListExtensions.cs (2)
39/// Copies the contents of the list to a destination <see cref="Span{T}"/>. 50public static void CopyTo<T>(this List<T> list, Span<T> destination)
PooledArrayBufferWriter`1.cs (2)
151public Span<T> GetSpan(int sizeHint = 0) 185var previousBuffer = oldBuffer.AsSpan(0, _index);
PooledObjects\PooledArray`1.cs (2)
25/// Returns a <see cref="Span{T}"/> representing a portion of the rented array 31public readonly Span<T> Span => _array!.AsSpan(0, _minimumLength);
ReadOnlyListExtensions.cs (2)
1152/// Copies the contents of the list to a destination <see cref="Span{T}"/>. 1160public static void CopyTo<T>(this IReadOnlyList<T> list, Span<T> destination)
SpanExtensions.cs (1)
84extension<T>(Span<T> span)
Utilities\Checksum.Builder.cs (6)
45static Span<byte> GetBuffer(int length = 8) 55Span<byte> hash = stackalloc byte[XxHash128SizeBytes]; 82var buffer = GetBuffer(length: sizeof(byte)); 89var buffer = GetBuffer(length: sizeof(char)); 96var buffer = GetBuffer(length: sizeof(int)); 103var buffer = GetBuffer(length: sizeof(long));
Utilities\Checksum.cs (2)
59Span<byte> bytes = stackalloc byte[HashSize]; 72public void WriteTo(Span<byte> destination)
Utilities\Hashing\NonCryptographicHashAlgorithm.cs (6)
78protected abstract void GetCurrentHashCore(Span<byte> destination); 205public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 230public int GetCurrentHash(Span<byte> destination) 267public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 292public int GetHashAndReset(Span<byte> destination) 326protected virtual void GetHashAndResetCore(Span<byte> destination)
Utilities\Hashing\XxHash128.cs (4)
88public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 104public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 170protected override void GetCurrentHashCore(Span<byte> destination) 217private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
Utilities\Hashing\XxHashShared.cs (1)
330Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
Utilities\SortHelper`1.cs (4)
71public bool ComputeKeys<TElement>(ReadOnlySpan<TElement> items, Func<TElement, T> keySelector, Span<SortKey<T>> keys) 104private bool ComputeIdentityKeys<TElement>(ReadOnlySpan<TElement> items, Span<SortKey<T>> keys) 144public bool ComputeKeys<TElement>(IReadOnlyList<TElement> items, Func<TElement, T> keySelector, Span<SortKey<T>> keys) 178private bool ComputeIdentityKeys<TElement>(IReadOnlyList<TElement> items, Span<SortKey<T>> keys)
Microsoft.AspNetCore.ResponseCaching (1)
CacheEntry\CachedResponseBody.cs (1)
36var span = destination.GetSpan(segment.Length);
Microsoft.AspNetCore.Rewrite (1)
ApacheModRewrite\FlagParser.cs (1)
70Span<Range> hasPayload = stackalloc Range[3];
Microsoft.AspNetCore.Routing (14)
Matching\DefaultEndpointSelector.cs (3)
22internal static void Select(HttpContext httpContext, Span<CandidateState> candidateState) 58Span<CandidateState> candidateState) 107private static void ReportAmbiguity(Span<CandidateState> candidateState)
Matching\DfaMatcher.cs (4)
45Span<PathSegment> buffer = stackalloc PathSegment[_maxSegmentCount]; 47var segments = buffer.Slice(0, count); 109var candidateState = useFastPath && candidateCount <= CandidateSetStackSize 110? ((Span<CandidateState>)candidateStateStackArray)[..candidateCount]
Matching\DfaMatcherBuilder.cs (1)
428var hasFailingPolicy = parent.Literals.Keys.Count < 32 ?
Matching\FastPathTokenizer.cs (1)
15public static int Tokenize(string path, Span<PathSegment> segments)
Matching\HostMatcherPolicy.cs (1)
162Span<Range> hostParts = stackalloc Range[3];
Matching\HttpMethodMatcherPolicy.cs (1)
398var methods = CollectionsMarshal.AsSpan(httpMethods);
Matching\ILEmitTrieFactory.cs (3)
126void EmitIfLadder(Span<IGrouping<int, (string text, int destination)>> groups) 344void EmitIfLadder(Span<IGrouping<ulong, (string test, int destination)>> groups) 469void EmitIfLadder(Span<IGrouping<ushort, (string test, int destination)>> groups)
Microsoft.AspNetCore.Server.HttpSys (1)
SourceBuildStubs.cs (1)
339bool TryGetTlsClientHello(Span<byte> tlsClientHelloBytesDestination, out int bytesReturned);
Microsoft.AspNetCore.Server.Kestrel.Core (154)
Internal\Http\ChunkWriter.cs (2)
11public static int BeginChunkBytes(int dataCount, Span<byte> span) 150var span = start.Span;
Internal\Http\Http1Connection.cs (12)
393public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine) 400var target = startLine[targetStart..]; 443private void OnOriginFormTarget(TargetOffsetPathLength targetPath, Span<byte> target) 484private void ParseTarget(TargetOffsetPathLength targetPath, Span<byte> target) 523var path = target[..pathLength]; 533private int ParseQuery(TargetOffsetPathLength targetPath, Span<byte> target) 536var query = target[targetPath.Length..]; 555private void OnAuthorityFormTarget(HttpMethod method, Span<byte> target) 626private void OnAbsoluteFormTarget(TargetOffsetPathLength targetPath, Span<byte> target) 628Span<byte> query = target[targetPath.Length..]; 678Span<byte> pathBuffer = absolutePath.Length <= MaxPathBufferStackAllocSize 681var pathBufferSliced = pathBuffer[..absolutePath.Length];
Internal\Http\Http1OutputProducer.cs (1)
217public Span<byte> GetSpan(int sizeHint = 0)
Internal\Http\Http1ParsingHandler.cs (1)
47public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine)
Internal\Http\HttpParser.cs (2)
203Span<byte> headerSpan = length <= 256 ? stackalloc byte[256] : array = ArrayPool<byte>.Shared.Rent(length); 516var startLine = MemoryMarshal.CreateSpan(ref MemoryMarshal.GetReference(requestLine), queryEnd);
Internal\Http\HttpProtocol.cs (2)
1417public void ThrowRequestTargetRejected(Span<byte> target) 1521public Span<byte> GetSpan(int sizeHint = 0)
Internal\Http\HttpRequestHeaders.cs (1)
121Span<char> decodedChars = stackalloc char[20];
Internal\Http\HttpResponsePipeWriter.cs (1)
58public override Span<byte> GetSpan(int sizeHint = 0)
Internal\Http\IHttpOutputProducer.cs (1)
24Span<byte> GetSpan(int sizeHint = 0);
Internal\Http\IHttpRequestLineHandler.cs (1)
21Span<byte> startLine);
Internal\Http\IHttpResponseControl.cs (1)
12Span<byte> GetSpan(int sizeHint = 0);
Internal\Http\IHttpResponsePipeWriterControl.cs (1)
12Span<byte> GetSpan(int sizeHint = 0);
Internal\Http\PathDecoder.cs (1)
12public static string DecodePath(Span<byte> path, bool pathEncoded, string rawTarget, int queryLength)
Internal\Http2\Http2FrameWriter.cs (7)
636Span<byte> buffer; 863var buffer = _outputWriter.GetSpan(4); 886var buffer = _outputWriter.GetSpan(4); 916var buffer = _outputWriter.GetSpan(settingsSize).Slice(0, settingsSize); // GetSpan isn't precise 924internal static void WriteSettings(List<Http2PeerSetting> settings, Span<byte> destination) 999var buffer = _outputWriter.GetSpan(8); 1031var buffer = output.GetSpan(Http2FrameReader.HeaderLength);
Internal\Http2\Http2OutputProducer.cs (1)
478public Span<byte> GetSpan(int sizeHint = 0)
Internal\Http2\Http2Stream.cs (1)
433Span<byte> pathBuffer = pathSegment.Length <= MaxPathBufferStackAllocSize
Internal\Http3\Http3FrameWriter.cs (8)
106var buffer = _outputWriter.GetSpan(settingsLength + VariableLengthIntegerHelper.MaximumEncodedLength + 1); 141internal static void WriteSettings(List<Http3PeerSetting> settings, Span<byte> destination) 155var buffer = _outputWriter.GetSpan(8); 247var buffer = _outputWriter.GetSpan(8); 282var buffer = output.GetSpan(16); 312var buffer = _headerEncodingBuffer.GetSpan(HeaderBufferSize); 367var buffer = _headerEncodingBuffer.GetSpan(HeaderBufferSize); 390var buffer = _headerEncodingBuffer.GetSpan(HeaderBufferSize);
Internal\Http3\Http3OutputProducer.cs (1)
211public Span<byte> GetSpan(int sizeHint = 0)
Internal\Http3\Http3Stream.cs (1)
1211Span<byte> pathBuffer = pathSegment.Length <= MaxPathBufferStackAllocSize
Internal\Http3\QPack\DynamicTable.cs (2)
30public static void Insert(Span<byte> name, Span<byte> value)
Internal\Http3\QPack\EncoderStreamReader.cs (2)
257var headerNameSpan = new Span<byte>(_headerName, 0, _headerNameLength); 258var headerValueSpan = new Span<byte>(_headerValueOctets, 0, _headerValueLength);
Internal\Http3\QPackHeaderWriter.cs (6)
12public static bool BeginEncodeHeaders(Http3HeadersEnumerator enumerator, Span<byte> buffer, ref int totalHeaderSize, out int length) 27public static bool BeginEncodeHeaders(int statusCode, Http3HeadersEnumerator headersEnumerator, Span<byte> buffer, ref int totalHeaderSize, out int length) 50public static bool Encode(Http3HeadersEnumerator headersEnumerator, Span<byte> buffer, ref int totalHeaderSize, out int length) 55private static bool Encode(Http3HeadersEnumerator headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, ref int totalHeaderSize, out int length) 104private static bool EncodeHeader(Span<byte> buffer, int staticTableId, string name, string value, Encoding? valueEncoding, out int headerLength) 111private static int EncodeStatusCode(int statusCode, Span<byte> buffer)
Internal\Infrastructure\HttpUtilities.cs (4)
56Span<byte> bytes = stackalloc byte[8]; 68Span<byte> bytes = stackalloc byte[4]; 109public static string GetAsciiString(this Span<byte> span) 432public static bool GetKnownHttpScheme(this Span<byte> span, out HttpScheme knownScheme)
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (1)
79public override Span<byte> GetSpan(int sizeHint = 0)
Internal\Infrastructure\StatusCheckPipeWriter.cs (1)
70public override Span<byte> GetSpan(int sizeHint = 0)
Internal\Infrastructure\ThrowingPipeWriter.cs (1)
27public override Span<byte> GetSpan(int sizeHint = 0) => throw new InvalidOperationException(_message);
Internal\Infrastructure\WrappingPipeWriter.cs (1)
51public override Span<byte> GetSpan(int sizeHint = 0)
Middleware\Internal\LoggingStream.cs (2)
86public override int Read(Span<byte> destination) 170Span<char> charBuilder = stackalloc char[17];
src\aspnetcore\src\Servers\Kestrel\shared\HPackHeaderWriter.cs (7)
32public static HeaderWriteResult BeginEncodeHeaders(int statusCode, DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 63public static HeaderWriteResult BeginEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) => 69public static HeaderWriteResult RetryBeginEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) => 75private static HeaderWriteResult BeginEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, bool iterateBeforeFirstElement, out int length) 98public static HeaderWriteResult ContinueEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 103private static bool EncodeStatusHeader(int statusCode, DynamicHPackEncoder hpackEncoder, Span<byte> buffer, out int length) 118private static HeaderWriteResult EncodeHeadersCore(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, bool canRequestLargerBuffer, out int length)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
100public override Span<byte> GetSpan()
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
53Span<byte> alloc = GetSpan(toAlloc, out bool mustCommit); 71public Span<T> AllocAsSpan<T>(int count) where T : unmanaged 89Span<byte> buffer = GetSpan(maxAlloc, out bool mustCommit); 117private Span<byte> GetSpan(int sizeHint, out bool mustCommit)
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (4)
18private Span<T> _buffer; 27public RefPooledArrayBufferWriter(Span<T> initialBuffer) 82public Span<T> GetSpan(int sizeHint = 0) 160var previousBuffer = oldBuffer.AsSpan(0, _index);
src\aspnetcore\src\Shared\Hpack\DynamicHPackEncoder.cs (3)
54public bool EnsureDynamicTableSizeUpdate(Span<byte> buffer, out int length) 68public bool EncodeHeader(Span<byte> buffer, int staticTableIndex, HeaderEncodingHint encodingHint, string name, string value, 117private bool EncodeDynamicHeader(Span<byte> buffer, int staticTableIndex, string name, string value,
src\aspnetcore\src\Shared\PathNormalizer\PathNormalizer.cs (2)
15public static int RemoveDotSegments(Span<byte> src) 26var currentSrc = src[readPointer..];
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\aspnetcore\src\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\aspnetcore\src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\aspnetcore\src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
41public static bool TryWriteFrameEnvelope(Http3FrameType frameType, long payloadLength, Span<byte> buffer, out int bytesWritten)
src\aspnetcore\src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (3)
114Span<byte> temp = (stackalloc byte[8])[..length]; 147public static bool TryWrite(Span<byte> buffer, long longToEncode, out int bytesWritten) 190public static int WriteInteger(Span<byte> buffer, long longToEncode)
src\aspnetcore\src\Shared\runtime\Http3\QPack\QPackEncoder.cs (18)
23public static bool EncodeStaticIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 39Span<byte> buffer = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; 61public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Span<byte> destination, out int bytesWritten) 66public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 89/// Encodes just the name part of a Literal Header Field With Static Name Reference. Must call <see cref="EncodeValueString(string, Encoding?, Span{byte}, out int)"/> after to encode the header's value. 93Span<byte> temp = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; 104Span<byte> temp = value.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; 125public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Span<byte> destination, out int bytesWritten) 130public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 147public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 160/// Encodes just the value part of a Literawl Header Field Without Static Name Reference. Must call <see cref="EncodeValueString(string, Encoding?, Span{byte}, out int)"/> after to encode the header's value. 164Span<byte> temp = name.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength] : new byte[name.Length + IntegerEncoder.MaxInt32EncodedLength]; 174Span<byte> temp = (name.Length + value.Length) < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[name.Length + value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; 182private static bool EncodeValueString(string s, Encoding? valueEncoding, Span<byte> buffer, out int length) 220public static bool EncodeValueString(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> buffer, out int length) 301private static void EncodeValueStringPart(string s, Span<byte> buffer) 316private static bool EncodeNameString(string s, Span<byte> buffer, out int length) 355private static bool EncodeHeaderBlockPrefix(Span<byte> destination, out int bytesWritten)
src\aspnetcore\src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\aspnetcore\src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\aspnetcore\src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (1)
128private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
src\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (11)
18public static int DecodeRequestLine(ReadOnlySpan<byte> source, Span<byte> destination, bool isFormEncoding) 42public static int DecodeInPlace(Span<byte> buffer, bool isFormEncoding) 96private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<byte> buffer, bool isFormEncoding) 234private static void Copy<T>(int begin, int end, ref int writer, Span<T> buffer) 262private static int UnescapePercentEncoding(ref int scan, Span<byte> buffer, bool isFormEncoding) 301private static int ReadHex(ref int scan, Span<byte> buffer) 355/// Form Encoding is not supported compared to the <see cref="DecodeRequestLine(ReadOnlySpan{byte}, Span{byte}, bool)" /> 358public static int DecodeRequestLine(ReadOnlySpan<char> source, Span<char> destination) 374/// Form Encoding is not supported compared to the <see cref="DecodeInPlace(Span{byte}, bool)" /> 377public static int DecodeInPlace(Span<char> buffer) 434private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<char> buffer)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (7)
src\aspnetcore\src\Servers\Kestrel\shared\CompletionPipeWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = 0)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
100public override Span<byte> GetSpan()
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
53Span<byte> alloc = GetSpan(toAlloc, out bool mustCommit); 71public Span<T> AllocAsSpan<T>(int count) where T : unmanaged 89Span<byte> buffer = GetSpan(maxAlloc, out bool mustCommit); 117private Span<byte> GetSpan(int sizeHint, out bool mustCommit)
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (1)
128private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
Microsoft.AspNetCore.Session (1)
SessionMiddleware.cs (1)
73Span<byte> guidBytes = stackalloc byte[16];
Microsoft.AspNetCore.SignalR.Common (7)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\aspnetcore\src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
117var destination = GetBuffer(); 146private Span<byte> GetBuffer() 178var destination = GetBuffer();
Microsoft.AspNetCore.SignalR.Core (1)
Internal\Utf8HashLookup.cs (1)
82var chars = count <= StackAllocThreshold ?
Microsoft.AspNetCore.SignalR.Protocols.Json (5)
src\aspnetcore\src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
117var destination = GetBuffer(); 146private Span<byte> GetBuffer() 178var destination = GetBuffer();
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
413Span<PreconditionState> states = [ifMatchState, ifNoneMatchState, ifModifiedSinceState, ifUnmodifiedSinceState];
Microsoft.AspNetCore.WebSockets (15)
HandshakeHelpers.cs (5)
46Span<byte> temp = stackalloc byte[16]; 60Span<byte> mergedBytes = stackalloc byte[60]; 64Span<byte> hashedBytes = stackalloc byte[20]; 173var span = builder.AppendSpan(len); 268var span = builder.AppendSpan(len);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (7)
15private Span<char> _chars; 18public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 119public bool TryCopyTo(Span<char> destination, out int charsWritten) 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 259public Span<char> AppendSpan(int length)
Microsoft.AspNetCore.WebUtilities (23)
FileBufferingReadStream.cs (1)
257public override int Read(Span<byte> buffer)
FormPipeReader.cs (3)
354Span<byte> buffer = stackalloc byte[StackAllocThreshold].Slice(0, (int)ros.Length); 364Span<byte> buffer = byteArray.AsSpan(0, (int)ros.Length); 398var span = MemoryMarshal.CreateSpan(ref MemoryMarshal.GetReference(readOnlySpan), readOnlySpan.Length);
HttpRequestStreamReader.cs (3)
163var span = new Span<char>(buffer, index, count); 168public override int Read(Span<char> buffer) 396var span = new Span<char>(_charBuffer, _charBufferIndex, _charsRead - _charBufferIndex);
HttpResponseStreamWriter.cs (1)
663var destination = new Span<char>(_charBuffer, _charBufferCount, remaining);
MultipartReaderStream.cs (1)
187var slice = buffer.AsSpan(offset, Math.Min(count, index));
src\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (11)
18public static int DecodeRequestLine(ReadOnlySpan<byte> source, Span<byte> destination, bool isFormEncoding) 42public static int DecodeInPlace(Span<byte> buffer, bool isFormEncoding) 96private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<byte> buffer, bool isFormEncoding) 234private static void Copy<T>(int begin, int end, ref int writer, Span<T> buffer) 262private static int UnescapePercentEncoding(ref int scan, Span<byte> buffer, bool isFormEncoding) 301private static int ReadHex(ref int scan, Span<byte> buffer) 355/// Form Encoding is not supported compared to the <see cref="DecodeRequestLine(ReadOnlySpan{byte}, Span{byte}, bool)" /> 358public static int DecodeRequestLine(ReadOnlySpan<char> source, Span<char> destination) 374/// Form Encoding is not supported compared to the <see cref="DecodeInPlace(Span{byte}, bool)" /> 377public static int DecodeInPlace(Span<char> buffer) 434private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<char> buffer)
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (3)
172Span<char> bufferSpan = buffer.AsSpan(i, count); 218internal static int Base64UrlDecode(string input, Span<byte> output) 437public static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
Microsoft.Build (35)
BuildCheck\Checks\ExecCliBuildCheck.cs (1)
116Span<char> normalizedBuildCommand = command.Length <= maxStackLimit ? stackalloc char[command.Length] : new char[command.Length];
Evaluation\IntrinsicFunctions.cs (1)
461Span<byte> hash = stackalloc byte[SHA256.HashSizeInBytes];
Logging\BinaryLogger\Postprocessing\SubStream.cs (1)
85public override int Read(Span<byte> buffer)
Logging\BinaryLogger\Postprocessing\TransparentReadStream.cs (1)
131public override int Read(Span<byte> buffer)
Logging\OptimizedStringIndenter.cs (4)
62Span<StringSegment> segments = GetStringSegments(s.AsSpan(), stackalloc StringSegment[128], out StringSegment[]? pooledArray); 75foreach (StringSegment segment in *(Span<StringSegment>*)state.Item2) 113private static Span<StringSegment> GetStringSegments(ReadOnlySpan<char> input, Span<StringSegment> segments, out StringSegment[]? pooledArray)
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Internal\ArraySortHelper.cs (19)
315int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 711private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 944private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 962private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 975private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1020private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1079private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1096private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n) 1121private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1233public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedHashSet`1.cs (4)
1179Span<int> span = stackalloc int[StackAllocThreshold]; 1247Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1252Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1334Span<int> span = stackalloc int[StackAllocThreshold];
Microsoft.Build.Framework (46)
_generated\0\LibraryImports.g.cs (1)
10private static partial int sysctl(global::System.ReadOnlySpan<int> name, uint namelen, global::System.Span<byte> oldp, ref nuint oldlenp, global::System.ReadOnlySpan<byte> newp, nuint newlen)
BackEnd\ServerNodeHandshake.cs (1)
46Span<byte> bytes = stackalloc byte[SHA256.HashSizeInBytes];
Collections\RefArrayBuilder.cs (11)
42public RefArrayBuilder(Span<T> scratchBuffer) 110public readonly Span<T> AsSpan() 121Span<T> span = _scope; 156Span<T> span = _scope; 173Span<T> span = _scope; 199Span<T> span = _scope; 241Span<T> span = _scope; 263Span<T> span = _scope; 284Span<T> span = _scope; 315Span<T> destination = newScope.AsSpan(); 340Span<T> span = _scope;
FileUtilities.cs (8)
780Span<char> newValue = ConvertToUnixSlashes(value.ToCharArray()); 812Span<char> newValue = ConvertToUnixSlashes(value.ToArray()); 819private static Span<char> ConvertToUnixSlashes(Span<char> path) 825private static Span<char> CollapseSlashes(Span<char> str) 845private static Span<char> RemoveQuotes(Span<char> path)
Utilities\BufferScope.cs (12)
12/// were a <see cref="Span{T}"/>. 17private Span<T> _span; 34public BufferScope(Span<T> initialBuffer) 58public BufferScope(Span<T> initialBuffer, int minimumLength) 127public readonly Span<T> Slice(int start, int length) 130/// <inheritdoc cref="Span{T}.GetPinnableReference"/> 143/// Returns the buffer as a <see cref="Span{T}"/>. 146public readonly Span<T> AsSpan() 150/// Implicitly converts a <see cref="BufferScope{T}"/> to a <see cref="Span{T}"/>. 154public static implicit operator Span<T>(BufferScope<T> scope) 166/// Returns an enumerator for the buffer's backing <see cref="Span{T}"/>. 168public readonly Span<T>.Enumerator GetEnumerator()
Utilities\ProcessExtensions.cs (4)
187Span<char> decodedChars = charBuffer.Slice(totalChars, charsWritten); 512Span<byte> oldp, 520private static int Sysctl(ReadOnlySpan<int> name, Span<byte> oldp, ref nuint oldlenp) 537if (Sysctl(mib, Span<byte>.Empty, ref size) != 0 || size == 0)
Utilities\ValueStringBuilder.cs (9)
36private Span<char> _chars; 43public ValueStringBuilder(Span<char> initialBuffer) 57_chars = MemoryMarshal.Cast<byte, char>((Span<byte>)_arrayToReturnToPool); 197public Span<char> AppendSpan(int length) 214public readonly bool TryCopyTo(Span<char> destination, out int charsWritten) 336Span<char> dst = _chars.Slice(_length, count); 356Span<char> dst = _chars.Slice(_length, length); 422_chars[.._length].CopyTo(MemoryMarshal.Cast<byte, char>((Span<byte>)poolArray)); 425_chars = MemoryMarshal.Cast<byte, char>((Span<byte>)poolArray);
Microsoft.Build.Tasks.Core (1)
ManifestUtil\mansign2.cs (1)
766Span<byte> nonce = stackalloc byte[32];
Microsoft.CodeAnalysis (50)
CodeAnalysisEventSource.Common.cs (4)
46Span<EventData> data = stackalloc EventData[] 75Span<EventData> data = stackalloc EventData[] 136Span<EventData> data = 163Span<EventData> data =
CodeGen\PrivateImplementationDetails.cs (2)
527Span<byte> hash = stackalloc byte[sizeof(ulong) * 2]; 549static void toHex(ReadOnlySpan<byte> source, Span<char> destination)
CommandLine\CommandLineParser.cs (1)
599Span<char> lineBuffer = stackalloc char[256];
CryptographicHashProvider.cs (1)
279Span<byte> span = bytes;
Hashing\NonCryptographicHashAlgorithm.cs (6)
79protected abstract void GetCurrentHashCore(Span<byte> destination); 206public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 231public int GetCurrentHash(Span<byte> destination) 268public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 293public int GetHashAndReset(Span<byte> destination) 327protected virtual void GetHashAndResetCore(Span<byte> destination)
Hashing\XxHash128.cs (4)
90public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 106public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 172protected override void GetCurrentHashCore(Span<byte> destination) 219private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (19)
315int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 711private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 944private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 962private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 975private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1020private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1079private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1096private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n) 1121private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1233public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1179Span<int> span = stackalloc int[StackAllocThreshold]; 1247Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1252Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1334Span<int> span = stackalloc int[StackAllocThreshold];
Symbols\ITypeSymbol.cs (1)
122/// <see cref="Span{T}" /> is a commonly used ref-like type.
Text\SourceText.cs (3)
647var charSpan = charBuffer.AsSpan(0, charsToCopy); 653var shortSpan = MemoryMarshal.Cast<char, short>(charSpan); 674internal static void ReverseEndianness(Span<short> shortSpan)
Microsoft.CodeAnalysis.Analyzers (48)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (6)
79protected abstract void GetCurrentHashCore(Span<byte> destination); 206public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 231public int GetCurrentHash(Span<byte> destination) 268public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 293public int GetHashAndReset(Span<byte> destination) 327protected virtual void GetHashAndResetCore(Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (4)
90public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 106public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 172protected override void GetCurrentHashCore(Span<byte> destination) 219private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (19)
315int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 711private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 944private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 962private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 975private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1020private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1079private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1096private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n) 1121private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1233public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1179Span<int> span = stackalloc int[StackAllocThreshold]; 1247Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1252Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1334Span<int> span = stackalloc int[StackAllocThreshold];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
79public static bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 83Span<char> tempBuffer = stackalloc char[4]; // Note: The tempBuffer size could be made larger than 4 but the size must be a multiple of 4. 173private static void CopyToTempBufferWithoutWhiteSpace(ReadOnlySpan<char> chars, Span<char> tempBuffer, out int consumed, out int charsWritten) 194private static bool TryDecodeFromUtf16(ReadOnlySpan<char> utf16, Span<byte> bytes, out int consumed, out int written)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74var lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89var targetLowerCaseCharacters = target.Length < 512
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
298=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
786Name: nameof(Span<>),
Microsoft.CodeAnalysis.AnalyzerUtilities (48)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (6)
79protected abstract void GetCurrentHashCore(Span<byte> destination); 206public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 231public int GetCurrentHash(Span<byte> destination) 268public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 293public int GetHashAndReset(Span<byte> destination) 327protected virtual void GetHashAndResetCore(Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (4)
90public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 106public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 172protected override void GetCurrentHashCore(Span<byte> destination) 219private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (19)
315int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 711private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 944private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 962private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 975private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1020private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1079private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1096private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n) 1121private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1233public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1179Span<int> span = stackalloc int[StackAllocThreshold]; 1247Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1252Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1334Span<int> span = stackalloc int[StackAllocThreshold];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
79public static bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 83Span<char> tempBuffer = stackalloc char[4]; // Note: The tempBuffer size could be made larger than 4 but the size must be a multiple of 4. 173private static void CopyToTempBufferWithoutWhiteSpace(ReadOnlySpan<char> chars, Span<char> tempBuffer, out int consumed, out int charsWritten) 194private static bool TryDecodeFromUtf16(ReadOnlySpan<char> utf16, Span<byte> bytes, out int consumed, out int written)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74var lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89var targetLowerCaseCharacters = target.Length < 512
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
298=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
786Name: nameof(Span<>),
Microsoft.CodeAnalysis.CodeStyle (48)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (6)
79protected abstract void GetCurrentHashCore(Span<byte> destination); 206public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 231public int GetCurrentHash(Span<byte> destination) 268public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 293public int GetHashAndReset(Span<byte> destination) 327protected virtual void GetHashAndResetCore(Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (4)
90public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 106public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 172protected override void GetCurrentHashCore(Span<byte> destination) 219private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (19)
315int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 711private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 944private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 962private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 975private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1020private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1079private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1096private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n) 1121private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1233public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1179Span<int> span = stackalloc int[StackAllocThreshold]; 1247Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1252Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1334Span<int> span = stackalloc int[StackAllocThreshold];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
79public static bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 83Span<char> tempBuffer = stackalloc char[4]; // Note: The tempBuffer size could be made larger than 4 but the size must be a multiple of 4. 173private static void CopyToTempBufferWithoutWhiteSpace(ReadOnlySpan<char> chars, Span<char> tempBuffer, out int consumed, out int charsWritten) 194private static bool TryDecodeFromUtf16(ReadOnlySpan<char> utf16, Span<byte> bytes, out int consumed, out int written)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74var lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89var targetLowerCaseCharacters = target.Length < 512
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
298=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
786Name: nameof(Span<>),
Microsoft.CodeAnalysis.CSharp (3)
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (1)
1114nameof(Span<>) => tryGetWellKnownSliceStartOverload(WellKnownMember.System_Span_T__Slice_Int_Int, WellKnownMember.System_Span_T__Slice_Int, originalDefinition, syntax),
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (2)
1146Span<byte> hash = stackalloc byte[16]; 1154Span<short> shortSpan = stackalloc short[charSpan.Length];
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
44nameof(Span<>),
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
203convertedType.Name == nameof(Span<>) && 212type.Name == nameof(Span<>) && 996Name: nameof(Span<>) or nameof(ReadOnlySpan<>),
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
161sliceLikeMethod.ContainingType.GetMembers(nameof(Span<>.Slice))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
200Span<byte> array = stackalloc byte[length];
Microsoft.CodeAnalysis.CSharp.Features (6)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
44nameof(Span<>),
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
203convertedType.Name == nameof(Span<>) && 212type.Name == nameof(Span<>) && 996Name: nameof(Span<>) or nameof(ReadOnlySpan<>),
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
161sliceLikeMethod.ContainingType.GetMembers(nameof(Span<>.Slice))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
200Span<byte> array = stackalloc byte[length];
Microsoft.CodeAnalysis.Extensions.Package (29)
Compilation\CompilationExtensions.cs (1)
298=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (19)
315int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 711private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 944private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 962private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 975private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1020private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1079private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1096private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n) 1121private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1233public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1179Span<int> span = stackalloc int[StackAllocThreshold]; 1247Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1252Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1334Span<int> span = stackalloc int[StackAllocThreshold];
Symbols\ITypeSymbolExtensions.cs (1)
786Name: nameof(Span<>),
Microsoft.CodeAnalysis.Razor.Compiler (14)
Language\CodeGeneration\CodeWriter.cs (4)
363var chunks = page.Value.AsSpan(chunkIndex); 404var destination = buffer.AsSpan(index, count); 416var chunks = page.Value.AsSpan(chunkIndex); 509var chunks = page.Value.AsSpan(chunkIndex);
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (1)
572using var _ = ArrayPool<SyntaxTokenList>.Shared.GetPooledArraySpan(5, out var tokenLists);
Language\TagHelperCollection.cs (2)
218/// The one-dimensional <see cref="Span{T}"/> that is the destination of the descriptors 224public abstract void CopyTo(Span<TagHelperDescriptor> destination);
Language\TagHelperCollection.EmptyCollection.cs (1)
31public override void CopyTo(Span<TagHelperDescriptor> destination)
Language\TagHelperCollection.SegmentBuilder.cs (1)
99var segments = _builder.AsMemory().Span;
Language\TagHelperCollection.SegmentCollectionBase.cs (1)
97public override void CopyTo(Span<TagHelperDescriptor> destination)
Language\TagHelperCollection_Factories.cs (3)
196minimumLength: collections.Length, clearOnReturn: true, out var destination); 279minimumLength: count, clearOnReturn: true, out var collections); 334minimumLength: 2, clearOnReturn: true, out var collections);
Language\TagHelperDiscoverer.cs (1)
80minimumLength: producers.Length, clearOnReturn: true, out var typeProducers);
Microsoft.CodeAnalysis.ResxSourceGenerator (48)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (6)
79protected abstract void GetCurrentHashCore(Span<byte> destination); 206public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 231public int GetCurrentHash(Span<byte> destination) 268public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 293public int GetHashAndReset(Span<byte> destination) 327protected virtual void GetHashAndResetCore(Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (4)
90public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 106public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 172protected override void GetCurrentHashCore(Span<byte> destination) 219private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (19)
315int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 711private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 944private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 962private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 975private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1020private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1079private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1096private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n) 1121private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1233public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1179Span<int> span = stackalloc int[StackAllocThreshold]; 1247Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1252Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1334Span<int> span = stackalloc int[StackAllocThreshold];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
79public static bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 83Span<char> tempBuffer = stackalloc char[4]; // Note: The tempBuffer size could be made larger than 4 but the size must be a multiple of 4. 173private static void CopyToTempBufferWithoutWhiteSpace(ReadOnlySpan<char> chars, Span<char> tempBuffer, out int consumed, out int charsWritten) 194private static bool TryDecodeFromUtf16(ReadOnlySpan<char> utf16, Span<byte> bytes, out int consumed, out int written)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74var lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89var targetLowerCaseCharacters = target.Length < 512
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
298=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
786Name: nameof(Span<>),
Microsoft.CodeAnalysis.Workspaces (72)
FindSymbols\TopLevelSyntaxTree\NavigateToSearchIndex.NavigateToSearchInfo.cs (2)
190var buffer = rentedCharArray ?? stackalloc char[maxNameLength]; 217void AddNameData(string name, Span<char> loweredName)
Serialization\SerializerService_Reference.cs (2)
494var unmanagedSpan = new Span<byte>((void*)unmanagedMemory, length); 509unsafe void CopyMemoryStreamToSpan(MemoryStream stream, Span<byte> span)
src\roslyn\src\Compilers\Core\Portable\CodeAnalysisEventSource.Common.cs (4)
46Span<EventData> data = stackalloc EventData[] 75Span<EventData> data = stackalloc EventData[] 136Span<EventData> data = 163Span<EventData> data =
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (6)
79protected abstract void GetCurrentHashCore(Span<byte> destination); 206public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 231public int GetCurrentHash(Span<byte> destination) 268public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 293public int GetHashAndReset(Span<byte> destination) 327protected virtual void GetHashAndResetCore(Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (4)
90public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 106public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 172protected override void GetCurrentHashCore(Span<byte> destination) 219private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (19)
315int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 711private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 944private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 962private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 975private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1020private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1079private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1096private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n) 1121private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1233public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1179Span<int> span = stackalloc int[StackAllocThreshold]; 1247Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1252Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1334Span<int> span = stackalloc int[StackAllocThreshold];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
79public static bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 83Span<char> tempBuffer = stackalloc char[4]; // Note: The tempBuffer size could be made larger than 4 but the size must be a multiple of 4. 173private static void CopyToTempBufferWithoutWhiteSpace(ReadOnlySpan<char> chars, Span<char> tempBuffer, out int consumed, out int charsWritten) 194private static bool TryDecodeFromUtf16(ReadOnlySpan<char> utf16, Span<byte> bytes, out int consumed, out int written)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74var lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89var targetLowerCaseCharacters = target.Length < 512
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
298=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
786Name: nameof(Span<>),
Workspace\Solution\Checksum.cs (3)
64Span<byte> bytes = stackalloc byte[HashSize]; 86public void WriteTo(Span<byte> span) 94var span = pipeWriter.GetSpan(HashSize);
Workspace\Solution\Checksum_Factory.cs (11)
41Span<byte> hash = stackalloc byte[XXHash128SizeBytes]; 59Span<byte> hash = stackalloc byte[XXHash128SizeBytes]; 66Span<byte> destination = stackalloc byte[XXHash128SizeBytes]; 76Span<byte> hash = stackalloc byte[XXHash128SizeBytes]; 115Span<byte> destination = stackalloc byte[XXHash128SizeBytes]; 128Span<Checksum> hashes = stackalloc Checksum[checksumsCount]; 137Span<Checksum> checksumsSpan = stackalloc Checksum[maxStackAllocCount]; 147var hashSpan = checksumsSpan.Slice(0, count); 151Span<byte> hash = stackalloc byte[XXHash128SizeBytes]; 159var hashes = ImmutableCollectionsMarshal.AsArray(checksums).AsSpan(); 169Span<byte> destination = stackalloc byte[XXHash128SizeBytes];
Workspace\Solution\SourceGeneratedDocumentIdentity.cs (2)
50Span<byte> bytesToChecksum = stackalloc byte[16]; 61Span<byte> checksumAsBytes = stackalloc byte[16];
Microsoft.CSharp (2)
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\ComEventsSink.cs (2)
164var vars = new Span<ComVariant>(pDispParams.rgvarg.ToPointer(), totalCount); 165var namedArgs = new Span<int>(pDispParams.rgdispidNamedArgs.ToPointer(), totalCount);
Microsoft.Data.Analysis (326)
Computations\Arithmetic.cs (44)
18public void HandleOperation(BinaryOperation operation, ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 49public void HandleOperation(BinaryOperation operation, ReadOnlySpan<T> x, T y, Span<T> destination) 80public void HandleOperation(BinaryOperation operation, T x, ReadOnlySpan<T> y, Span<T> destination) 125public void HandleOperation(BinaryIntOperation operation, ReadOnlySpan<T> x, int y, Span<T> destination) 141public void HandleOperation(ComparisonOperation operation, ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) 166public void HandleOperation(ComparisonOperation operation, ReadOnlySpan<T> x, T y, Span<bool> destination) 194protected virtual void Add(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 195protected virtual void Add(ReadOnlySpan<T> x, T y, Span<T> destination) => throw new NotSupportedException(); 196protected virtual void Add(T x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 197protected virtual void Subtract(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 198protected virtual void Subtract(ReadOnlySpan<T> x, T y, Span<T> destination) => throw new NotSupportedException(); 199protected virtual void Subtract(T x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 200protected virtual void Multiply(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 201protected virtual void Multiply(ReadOnlySpan<T> x, T y, Span<T> destination) => throw new NotSupportedException(); 202protected virtual void Multiply(T x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 203protected virtual void Divide(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 204protected virtual void Divide(ReadOnlySpan<T> x, T y, Span<T> destination) => throw new NotSupportedException(); 205protected virtual void Divide(T x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 206protected virtual void Modulo(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 207protected virtual void Modulo(ReadOnlySpan<T> x, T y, Span<T> destination) => throw new NotSupportedException(); 208protected virtual void Modulo(T x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 213protected virtual void And(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 214protected virtual void And(ReadOnlySpan<T> x, T y, Span<T> destination) => throw new NotSupportedException(); 215protected virtual void And(T x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 216protected virtual void Or(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 217protected virtual void Or(ReadOnlySpan<T> x, T y, Span<T> destination) => throw new NotSupportedException(); 218protected virtual void Or(T x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 219protected virtual void Xor(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 220protected virtual void Xor(ReadOnlySpan<T> x, T y, Span<T> destination) => throw new NotSupportedException(); 221protected virtual void Xor(T x, ReadOnlySpan<T> y, Span<T> destination) => throw new NotSupportedException(); 223protected virtual void LeftShift(ReadOnlySpan<T> x, int y, Span<T> destination) => throw new NotSupportedException(); 224protected virtual void RightShift(ReadOnlySpan<T> x, int y, Span<T> destination) => throw new NotSupportedException(); 226protected virtual void ElementwiseEquals(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) => throw new NotSupportedException(); 227protected virtual void ElementwiseEquals(ReadOnlySpan<T> x, T y, Span<bool> destination) => throw new NotSupportedException(); 228protected virtual void ElementwiseNotEquals(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) => throw new NotSupportedException(); 229protected virtual void ElementwiseNotEquals(ReadOnlySpan<T> x, T y, Span<bool> destination) => throw new NotSupportedException(); 230protected virtual void ElementwiseGreaterThanOrEqual(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) => throw new NotSupportedException(); 231protected virtual void ElementwiseGreaterThanOrEqual(ReadOnlySpan<T> x, T y, Span<bool> destination) => throw new NotSupportedException(); 232protected virtual void ElementwiseLessThanOrEqual(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) => throw new NotSupportedException(); 233protected virtual void ElementwiseLessThanOrEqual(ReadOnlySpan<T> x, T y, Span<bool> destination) => throw new NotSupportedException(); 234protected virtual void ElementwiseGreaterThan(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) => throw new NotSupportedException(); 235protected virtual void ElementwiseGreaterThan(ReadOnlySpan<T> x, T y, Span<bool> destination) => throw new NotSupportedException(); 236protected virtual void ElementwiseLessThan(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) => throw new NotSupportedException(); 237protected virtual void ElementwiseLessThan(ReadOnlySpan<T> x, T y, Span<bool> destination) => throw new NotSupportedException();
Computations\Arithmetic.net8.cs (111)
20static abstract void And(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination); 21static abstract void And(ReadOnlySpan<T> x, T y, Span<T> destination); 22static abstract void And(T x, ReadOnlySpan<T> y, Span<T> destination); 23static abstract void Or(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination); 24static abstract void Or(ReadOnlySpan<T> x, T y, Span<T> destination); 25static abstract void Or(T x, ReadOnlySpan<T> y, Span<T> destination); 26static abstract void Xor(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination); 27static abstract void Xor(ReadOnlySpan<T> x, T y, Span<T> destination); 28static abstract void Xor(T x, ReadOnlySpan<T> y, Span<T> destination); 34static abstract void LeftShift(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination); 35static abstract void RightShift(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination); 41static abstract void Add(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination); 42static abstract void Add(ReadOnlySpan<T> x, T y, Span<T> destination); 43static abstract void Add(T x, ReadOnlySpan<T> y, Span<T> destination); 44static abstract void Subtract(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination); 45static abstract void Subtract(ReadOnlySpan<T> x, T y, Span<T> destination); 46static abstract void Subtract(T x, ReadOnlySpan<T> y, Span<T> destination); 47static abstract void Multiply(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination); 48static abstract void Multiply(ReadOnlySpan<T> x, T y, Span<T> destination); 49static abstract void Multiply(T x, ReadOnlySpan<T> y, Span<T> destination); 50static abstract void Divide(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination); 51static abstract void Divide(ReadOnlySpan<T> x, T y, Span<T> destination); 52static abstract void Divide(T x, ReadOnlySpan<T> y, Span<T> destination); 54static abstract void Modulo(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination); 55static abstract void Modulo(ReadOnlySpan<T> x, T y, Span<T> destination); 56static abstract void Modulo(T x, ReadOnlySpan<T> y, Span<T> destination); 59static abstract void ElementwiseEquals(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination); 60static abstract void ElementwiseEquals(ReadOnlySpan<T> x, T y, Span<bool> destination); 61static abstract void ElementwiseNotEquals(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination); 62static abstract void ElementwiseNotEquals(ReadOnlySpan<T> x, T y, Span<bool> destination); 63static abstract void ElementwiseGreaterThanOrEqual(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination); 64static abstract void ElementwiseGreaterThanOrEqual(ReadOnlySpan<T> x, T y, Span<bool> destination); 65static abstract void ElementwiseLessThanOrEqual(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination); 66static abstract void ElementwiseLessThanOrEqual(ReadOnlySpan<T> x, T y, Span<bool> destination); 67static abstract void ElementwiseGreaterThan(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination); 68static abstract void ElementwiseGreaterThan(ReadOnlySpan<T> x, T y, Span<bool> destination); 69static abstract void ElementwiseLessThan(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination); 70static abstract void ElementwiseLessThan(ReadOnlySpan<T> x, T y, Span<bool> destination); 76public static void And(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.BitwiseAnd(x, y, destination); 77public static void And(ReadOnlySpan<T> x, T y, Span<T> destination) => TensorPrimitives.BitwiseAnd(x, y, destination); 78public static void And(T x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.BitwiseAnd(y, x, destination); 79public static void Or(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.BitwiseOr(x, y, destination); 80public static void Or(ReadOnlySpan<T> x, T y, Span<T> destination) => TensorPrimitives.BitwiseOr(x, y, destination); 81public static void Or(T x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.BitwiseOr(y, x, destination); 82public static void Xor(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.Xor(x, y, destination); 83public static void Xor(ReadOnlySpan<T> x, T y, Span<T> destination) => TensorPrimitives.Xor(x, y, destination); 84public static void Xor(T x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.Xor(y, x, destination); 90public static void LeftShift(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination) => TensorPrimitives.ShiftLeft(x, shiftAmount, destination); 91public static void RightShift(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination) => TensorPrimitives.ShiftRightArithmetic(x, shiftAmount, destination); 97public static void Add(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.Add(x, y, destination); 98public static void Add(ReadOnlySpan<T> x, T y, Span<T> destination) => TensorPrimitives.Add(x, y, destination); 99public static void Add(T x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.Add(y, x, destination); 100public static void Subtract(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.Subtract(x, y, destination); 101public static void Subtract(ReadOnlySpan<T> x, T y, Span<T> destination) => TensorPrimitives.Subtract(x, y, destination); 102public static void Subtract(T x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.Subtract(x, y, destination); 103public static void Multiply(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.Multiply(x, y, destination); 104public static void Multiply(ReadOnlySpan<T> x, T y, Span<T> destination) => TensorPrimitives.Multiply(x, y, destination); 105public static void Multiply(T x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.Multiply(y, x, destination); 106public static void Divide(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.Divide(x, y, destination); 107public static void Divide(ReadOnlySpan<T> x, T y, Span<T> destination) => TensorPrimitives.Divide(x, y, destination); 108public static void Divide(T x, ReadOnlySpan<T> y, Span<T> destination) => TensorPrimitives.Divide(x, y, destination); 111public static void Modulo(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 119public static void Modulo(ReadOnlySpan<T> x, T y, Span<T> destination) 127public static void Modulo(T x, ReadOnlySpan<T> y, Span<T> destination) 137public static void ElementwiseEquals(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) 145public static void ElementwiseEquals(ReadOnlySpan<T> x, T y, Span<bool> destination) 153public static void ElementwiseNotEquals(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) 161public static void ElementwiseNotEquals(ReadOnlySpan<T> x, T y, Span<bool> destination) 169public static void ElementwiseGreaterThanOrEqual(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) 177public static void ElementwiseGreaterThanOrEqual(ReadOnlySpan<T> x, T y, Span<bool> destination) 185public static void ElementwiseLessThanOrEqual(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) 193public static void ElementwiseLessThanOrEqual(ReadOnlySpan<T> x, T y, Span<bool> destination) 201public static void ElementwiseGreaterThan(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) 209public static void ElementwiseGreaterThan(ReadOnlySpan<T> x, T y, Span<bool> destination) 217public static void ElementwiseLessThan(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) 225public static void ElementwiseLessThan(ReadOnlySpan<T> x, T y, Span<bool> destination) 240public virtual void HandleOperation(BinaryOperation operation, ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 264public virtual void HandleOperation(BinaryOperation operation, ReadOnlySpan<T> x, T y, Span<T> destination) 288public virtual void HandleOperation(BinaryOperation operation, T x, ReadOnlySpan<T> y, Span<T> destination) 323public virtual void HandleOperation(BinaryIntOperation operation, ReadOnlySpan<T> x, int y, Span<T> destination) 328public void HandleOperation(ComparisonOperation operation, ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination) 355public void HandleOperation(ComparisonOperation operation, ReadOnlySpan<T> x, T y, Span<bool> destination) 388public override void HandleOperation(BinaryOperation operation, ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 406public override void HandleOperation(BinaryOperation operation, ReadOnlySpan<T> x, T y, Span<T> destination) 424public override void HandleOperation(BinaryOperation operation, T x, ReadOnlySpan<T> y, Span<T> destination) 450public override void HandleOperation(BinaryIntOperation operation, ReadOnlySpan<T> x, int y, Span<T> destination) 469protected override void ElementwiseEquals(ReadOnlySpan<DateTime> x, ReadOnlySpan<DateTime> y, Span<bool> destination) 477protected override void ElementwiseEquals(ReadOnlySpan<DateTime> x, DateTime y, Span<bool> destination) 485protected override void ElementwiseNotEquals(ReadOnlySpan<DateTime> x, ReadOnlySpan<DateTime> y, Span<bool> destination) 493protected override void ElementwiseNotEquals(ReadOnlySpan<DateTime> x, DateTime y, Span<bool> destination) 501protected override void ElementwiseGreaterThanOrEqual(ReadOnlySpan<DateTime> x, ReadOnlySpan<DateTime> y, Span<bool> destination) 509protected override void ElementwiseGreaterThanOrEqual(ReadOnlySpan<DateTime> x, DateTime y, Span<bool> destination) 517protected override void ElementwiseLessThanOrEqual(ReadOnlySpan<DateTime> x, ReadOnlySpan<DateTime> y, Span<bool> destination) 525protected override void ElementwiseLessThanOrEqual(ReadOnlySpan<DateTime> x, DateTime y, Span<bool> destination) 533protected override void ElementwiseGreaterThan(ReadOnlySpan<DateTime> x, ReadOnlySpan<DateTime> y, Span<bool> destination) 541protected override void ElementwiseGreaterThan(ReadOnlySpan<DateTime> x, DateTime y, Span<bool> destination) 549protected override void ElementwiseLessThan(ReadOnlySpan<DateTime> x, ReadOnlySpan<DateTime> y, Span<bool> destination) 557protected override void ElementwiseLessThan(ReadOnlySpan<DateTime> x, DateTime y, Span<bool> destination) 568protected override void And(ReadOnlySpan<bool> x, ReadOnlySpan<bool> y, Span<bool> destination) 579protected override void And(ReadOnlySpan<bool> x, bool y, Span<bool> destination) 590protected override void And(bool x, ReadOnlySpan<bool> y, Span<bool> destination) 601protected override void Or(ReadOnlySpan<bool> x, ReadOnlySpan<bool> y, Span<bool> destination) 612protected override void Or(ReadOnlySpan<bool> x, bool y, Span<bool> destination) 623protected override void Or(bool x, ReadOnlySpan<bool> y, Span<bool> destination) 634protected override void Xor(ReadOnlySpan<bool> x, ReadOnlySpan<bool> y, Span<bool> destination) 645protected override void Xor(ReadOnlySpan<bool> x, bool y, Span<bool> destination) 656protected override void Xor(bool x, ReadOnlySpan<bool> y, Span<bool> destination) 667protected override void ElementwiseEquals(ReadOnlySpan<bool> x, ReadOnlySpan<bool> y, Span<bool> destination) 675protected override void ElementwiseEquals(ReadOnlySpan<bool> x, bool y, Span<bool> destination) 683protected override void ElementwiseNotEquals(ReadOnlySpan<bool> x, ReadOnlySpan<bool> y, Span<bool> destination) 691protected override void ElementwiseNotEquals(ReadOnlySpan<bool> x, bool y, Span<bool> destination)
Computations\IArithmetic.cs (6)
15void HandleOperation(BinaryOperation operation, ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination); 16void HandleOperation(BinaryOperation operation, ReadOnlySpan<T> x, T y, Span<T> destination); 17void HandleOperation(BinaryOperation operation, T x, ReadOnlySpan<T> y, Span<T> destination); 22void HandleOperation(BinaryIntOperation operation, ReadOnlySpan<T> x, int y, Span<T> destination); 25void HandleOperation(ComparisonOperation operation, ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<bool> destination); 26void HandleOperation(ComparisonOperation operation, ReadOnlySpan<T> x, T y, Span<bool> destination);
DataFrame.cs (2)
426var span = buffers.GetOrCreateMutable(b).Span; 446var span = buffers.GetOrCreateMutable(b).Span;
DataFrameBuffer.cs (2)
29public Span<T> Span 35public Span<T> RawSpan
DataFrameColumn.cs (8)
541Span<int> sortIndices, 551Span<int> sortIndices, 598Span<int> sortIndices, 656Span<int> sortIndices, 678Span<int> sortIndices, 711Span<int> sortIndices, 739Span<int> sortIndices, 750Span<int> sortIndices,
DateTimeComputation.cs (4)
37var mutableSpan = mutableBuffer.Span; 58var span = mutableBuffer.Span; 109var mutableSpan = mutableBuffer.Span; 130var span = mutableBuffer.Span;
PrimitiveColumnContainer.BinaryOperations.cs (10)
23var leftSpan = mutableBuffer.Span; 26var leftValidity = this.NullBitMapBuffers.GetOrCreateMutable(i).Span; 63var leftSpan = this.Buffers.GetOrCreateMutable(i).Span; 76var rightSpan = this.Buffers.GetOrCreateMutable(i).Span; 100var leftSpan = this.Buffers.GetOrCreateMutable(i).Span; 122var retSpan = ret.Buffers.GetOrCreateMutable(retSpanIndex).Span; 138var nextRetSpan = ret.Buffers.GetOrCreateMutable(retSpanIndex + 1).Span; 163var retSpan = ret.Buffers.GetOrCreateMutable(retSpanIndex).Span; 180var nextRetSpan = ret.Buffers.GetOrCreateMutable(retSpanIndex + 1).Span; 192private static void ValidityElementwiseAnd(ReadOnlySpan<byte> left, ReadOnlySpan<byte> right, Span<byte> destination)
PrimitiveColumnContainer.cs (12)
76var span = bitMap.Span; 183Span<T> mutableBuffer = Buffers.GetOrCreateMutable(b).Span; 184Span<byte> mutableNullBitMapBuffer = NullBitMapBuffers.GetOrCreateMutable(b).Span; 201var span = Buffers.GetOrCreateMutable(b).Span; 202var validitySpan = NullBitMapBuffers.GetOrCreateMutable(b).Span; 223Span<TResult> mutableResultBuffer = resultContainer.Buffers.GetOrCreateMutable(b).Span; 224Span<byte> mutableResultNullBitMapBuffer = resultContainer.NullBitMapBuffers.GetOrCreateMutable(b).Span; 244var span = Buffers.GetOrCreateMutable(b).Span; 245var validitySpan = NullBitMapBuffers.GetOrCreateMutable(b).Span; 292private void SetValidityBit(Span<byte> bitMapBufferSpan, int index, bool value) 488Span<T> retSpan = mutableBuffer.Span; 491Span<byte> retNullBitMapSpan = mutableNullBuffer.Span;
PrimitiveDataFrameColumnComputations.cs (120)
252var mutableSpan = mutableBuffer.Span; 278var mutableSpan = mutableBuffer.Span; 298var span = mutableBuffer.Span; 342var mutableSpan = mutableBuffer.Span; 362var span = mutableBuffer.Span; 406var mutableSpan = mutableBuffer.Span; 426var span = mutableBuffer.Span; 470var mutableSpan = mutableBuffer.Span; 490var span = mutableBuffer.Span; 721var mutableSpan = mutableBuffer.Span; 739var mutableSpan = mutableBuffer.Span; 765var mutableSpan = mutableBuffer.Span; 785var span = mutableBuffer.Span; 829var mutableSpan = mutableBuffer.Span; 849var span = mutableBuffer.Span; 893var mutableSpan = mutableBuffer.Span; 913var span = mutableBuffer.Span; 957var mutableSpan = mutableBuffer.Span; 977var span = mutableBuffer.Span; 1208var mutableSpan = mutableBuffer.Span; 1226var mutableSpan = mutableBuffer.Span; 1252var mutableSpan = mutableBuffer.Span; 1272var span = mutableBuffer.Span; 1316var mutableSpan = mutableBuffer.Span; 1336var span = mutableBuffer.Span; 1380var mutableSpan = mutableBuffer.Span; 1400var span = mutableBuffer.Span; 1444var mutableSpan = mutableBuffer.Span; 1464var span = mutableBuffer.Span; 1695var mutableSpan = mutableBuffer.Span; 1713var mutableSpan = mutableBuffer.Span; 1739var mutableSpan = mutableBuffer.Span; 1759var span = mutableBuffer.Span; 1803var mutableSpan = mutableBuffer.Span; 1823var span = mutableBuffer.Span; 1867var mutableSpan = mutableBuffer.Span; 1887var span = mutableBuffer.Span; 1931var mutableSpan = mutableBuffer.Span; 1951var span = mutableBuffer.Span; 2182var mutableSpan = mutableBuffer.Span; 2200var mutableSpan = mutableBuffer.Span; 2226var mutableSpan = mutableBuffer.Span; 2246var span = mutableBuffer.Span; 2290var mutableSpan = mutableBuffer.Span; 2310var span = mutableBuffer.Span; 2354var mutableSpan = mutableBuffer.Span; 2374var span = mutableBuffer.Span; 2418var mutableSpan = mutableBuffer.Span; 2438var span = mutableBuffer.Span; 2669var mutableSpan = mutableBuffer.Span; 2687var mutableSpan = mutableBuffer.Span; 2713var mutableSpan = mutableBuffer.Span; 2733var span = mutableBuffer.Span; 2777var mutableSpan = mutableBuffer.Span; 2797var span = mutableBuffer.Span; 2841var mutableSpan = mutableBuffer.Span; 2861var span = mutableBuffer.Span; 2905var mutableSpan = mutableBuffer.Span; 2925var span = mutableBuffer.Span; 3156var mutableSpan = mutableBuffer.Span; 3174var mutableSpan = mutableBuffer.Span; 3200var mutableSpan = mutableBuffer.Span; 3220var span = mutableBuffer.Span; 3264var mutableSpan = mutableBuffer.Span; 3284var span = mutableBuffer.Span; 3328var mutableSpan = mutableBuffer.Span; 3348var span = mutableBuffer.Span; 3392var mutableSpan = mutableBuffer.Span; 3412var span = mutableBuffer.Span; 3643var mutableSpan = mutableBuffer.Span; 3661var mutableSpan = mutableBuffer.Span; 3687var mutableSpan = mutableBuffer.Span; 3707var span = mutableBuffer.Span; 3751var mutableSpan = mutableBuffer.Span; 3771var span = mutableBuffer.Span; 3815var mutableSpan = mutableBuffer.Span; 3835var span = mutableBuffer.Span; 3879var mutableSpan = mutableBuffer.Span; 3899var span = mutableBuffer.Span; 4130var mutableSpan = mutableBuffer.Span; 4148var mutableSpan = mutableBuffer.Span; 4174var mutableSpan = mutableBuffer.Span; 4194var span = mutableBuffer.Span; 4238var mutableSpan = mutableBuffer.Span; 4258var span = mutableBuffer.Span; 4302var mutableSpan = mutableBuffer.Span; 4322var span = mutableBuffer.Span; 4366var mutableSpan = mutableBuffer.Span; 4386var span = mutableBuffer.Span; 4617var mutableSpan = mutableBuffer.Span; 4635var mutableSpan = mutableBuffer.Span; 4661var mutableSpan = mutableBuffer.Span; 4681var span = mutableBuffer.Span; 4725var mutableSpan = mutableBuffer.Span; 4745var span = mutableBuffer.Span; 4789var mutableSpan = mutableBuffer.Span; 4809var span = mutableBuffer.Span; 4853var mutableSpan = mutableBuffer.Span; 4873var span = mutableBuffer.Span; 5104var mutableSpan = mutableBuffer.Span; 5122var mutableSpan = mutableBuffer.Span; 5148var mutableSpan = mutableBuffer.Span; 5168var span = mutableBuffer.Span; 5212var mutableSpan = mutableBuffer.Span; 5232var span = mutableBuffer.Span; 5276var mutableSpan = mutableBuffer.Span; 5296var span = mutableBuffer.Span; 5340var mutableSpan = mutableBuffer.Span; 5360var span = mutableBuffer.Span; 5591var mutableSpan = mutableBuffer.Span; 5609var mutableSpan = mutableBuffer.Span; 5635var mutableSpan = mutableBuffer.Span; 5655var span = mutableBuffer.Span; 5699var mutableSpan = mutableBuffer.Span; 5719var span = mutableBuffer.Span; 5763var mutableSpan = mutableBuffer.Span; 5783var span = mutableBuffer.Span; 5827var mutableSpan = mutableBuffer.Span; 5847var span = mutableBuffer.Span; 6078var mutableSpan = mutableBuffer.Span;
Utils\BitUtility.cs (7)
59public static void ClearBit(Span<byte> data, int index) 64public static void SetBit(Span<byte> data, int index) 69public static void SetBit(Span<byte> data, long index, bool value) 86public static void SetBits(Span<byte> data, long index, long length, bool value) 119var slice = data.Slice(startByteIndex, 1); 126var slice = data.Slice(fullByteStartIndex, fullByteEndIndex - fullByteStartIndex + 1); 134var slice = data.Slice(endByteIndex, 1);
Microsoft.Diagnostics.DataContractReader (18)
ContractDescriptorTarget.cs (18)
57public delegate int ReadFromTargetDelegate(ulong address, Span<byte> bufferToFill); 58public delegate int WriteToTargetDelegate(ulong address, Span<byte> bufferToWrite); 59public delegate int GetTargetThreadContextDelegate(uint threadId, uint contextFlags, Span<byte> bufferToFill); 332Span<byte> buffer = stackalloc byte[sizeof(ulong)]; 380Span<byte> descriptorBuffer = descriptorSize <= StackAllocByteThreshold 411public override bool TryGetThreadContext(ulong threadId, uint contextFlags, Span<byte> buffer) 466Span<byte> buffer = stackalloc byte[sizeof(T)]; 504Span<byte> buffer = stackalloc byte[sizeof(T)]; 532public override void ReadBuffer(ulong address, Span<byte> buffer) 538private bool TryReadBuffer(ulong address, Span<byte> buffer) 543public override void WriteBuffer(ulong address, Span<byte> buffer) 560private bool TryWriteBuffer(ulong address, Span<byte> buffer) 636public void ReadPointers(ulong address, Span<TargetPointer> buffer) 668Span<byte> span = length <= StackAllocByteThreshold 693Span<byte> span = length <= StackAllocByteThreshold 907public int ReadFromTarget(ulong address, Span<byte> buffer) 915public int GetThreadContext(uint threadId, uint contextFlags, Span<byte> buffer) 919public int WriteToTarget(ulong address, Span<byte> buffer)
Microsoft.Diagnostics.DataContractReader.Abstractions (3)
Target.cs (3)
37public abstract bool TryGetThreadContext(ulong threadId, uint contextFlags, Span<byte> buffer); 92public abstract void ReadBuffer(ulong address, Span<byte> buffer); 99public abstract void WriteBuffer(ulong address, Span<byte> buffer);
Microsoft.Diagnostics.DataContractReader.Contracts (17)
Contracts\Object_1.cs (1)
51Span<byte> span = stackalloc byte[(int)str.StringLength * sizeof(char)];
Contracts\StackWalk\Context\ContextHolder.cs (6)
29Span<byte> buffer = new byte[Size]; 33public unsafe void FillFromBuffer(Span<byte> buffer) 35Span<T> structSpan = new(ref Context); 36Span<byte> byteSpan = MemoryMarshal.Cast<T, byte>(structSpan); 48Span<T> structSpan = MemoryMarshal.CreateSpan(ref Context, 1); 49Span<byte> byteSpan = MemoryMarshal.AsBytes(structSpan);
Contracts\StackWalk\Context\IPlatformAgnosticContext.cs (1)
25public abstract void FillFromBuffer(Span<byte> buffer);
Contracts\Thread_1.cs (1)
314Span<byte> buffer = new Span<byte>(bytes);
src\runtime\src\coreclr\tools\aot\ILCompiler.Reflection.ReadyToRun\NativeReader.cs (6)
36public void ReadSpanAt(ref int start, Span<byte> buffer) 55Span<byte> bytes = stackalloc byte[sizeof(long)]; 69Span<byte> bytes = stackalloc byte[sizeof(int)]; 83Span<byte> bytes = stackalloc byte[sizeof(uint)]; 97Span<byte> bytes = stackalloc byte[sizeof(ushort)]; 111Span<byte> bytes = stackalloc byte[sizeof(byte)];
TargetStream.cs (2)
30Span<byte> span = buffer; 33public override unsafe int Read(Span<byte> buffer)
Microsoft.Diagnostics.DataContractReader.Legacy (48)
_generated\30\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface.cs (30)
304global::System.Span<ulong> __values_native__nativeSpan = __values_native__marshaller.GetUnmanagedValuesDestination(); 325global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __values_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __values_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __values_native__numElements); 326global::System.Span<ulong> __values_native__nativeSpan = __values_native__marshaller.GetUnmanagedValuesDestination(); 366global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __values_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(values); 378global::System.Span<ulong> __values_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetUnmanagedValuesSource(__values_native, __values_native__numElements).GetPinnableReference()), __values_native__numElements); 379global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __values_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(values); 543global::System.Span<ulong> __values_native__nativeSpan = __values_native__marshaller.GetUnmanagedValuesDestination(); 565global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __values_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __values_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __values_native__numElements); 566global::System.Span<ulong> __values_native__nativeSpan = __values_native__marshaller.GetUnmanagedValuesDestination(); 607global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __values_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(values); 620global::System.Span<ulong> __values_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetUnmanagedValuesSource(__values_native, __values_native__numElements).GetPinnableReference()), __values_native__numElements); 621global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __values_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(values); 900global::System.Span<ulong> __modules_native__nativeSpan = __modules_native__marshaller.GetUnmanagedValuesDestination(); 922global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __modules_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __modules_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __modules_native__numElements); 923global::System.Span<ulong> __modules_native__nativeSpan = __modules_native__marshaller.GetUnmanagedValuesDestination(); 964global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __modules_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(modules); 977global::System.Span<ulong> __modules_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetUnmanagedValuesSource(__modules_native, __modules_native__numElements).GetPinnableReference()), __modules_native__numElements); 978global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __modules_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(modules); 2296global::System.Span<ulong> __heaps_native__nativeSpan = __heaps_native__marshaller.GetUnmanagedValuesDestination(); 2317global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __heaps_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __heaps_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __heaps_native__numElements); 2318global::System.Span<ulong> __heaps_native__nativeSpan = __heaps_native__marshaller.GetUnmanagedValuesDestination(); 2358global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __heaps_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(heaps); 2370global::System.Span<ulong> __heaps_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetUnmanagedValuesSource(__heaps_native, __heaps_native__numElements).GetPinnableReference()), __heaps_native__numElements); 2371global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __heaps_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(heaps); 3962global::System.Span<ulong> __values_native__nativeSpan = __values_native__marshaller.GetUnmanagedValuesDestination(); 3984global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __values_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __values_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __values_native__numElements); 3985global::System.Span<ulong> __values_native__nativeSpan = __values_native__marshaller.GetUnmanagedValuesDestination(); 4026global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __values_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(values); 4039global::System.Span<ulong> __values_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetUnmanagedValuesSource(__values_native, __values_native__numElements).GetPinnableReference()), __values_native__numElements); 4040global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __values_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(values);
_generated\33\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface4.cs (6)
56global::System.Span<ulong> __arguments_native__nativeSpan = __arguments_native__marshaller.GetUnmanagedValuesDestination(); 77global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __arguments_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __arguments_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __arguments_native__numElements); 78global::System.Span<ulong> __arguments_native__nativeSpan = __arguments_native__marshaller.GetUnmanagedValuesDestination(); 118global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __arguments_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(arguments); 130global::System.Span<ulong> __arguments_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetUnmanagedValuesSource(__arguments_native, __arguments_native__numElements).GetPinnableReference()), __arguments_native__numElements); 131global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __arguments_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(arguments);
_generated\39\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface10.cs (6)
65global::System.Span<ulong> __mowList_native__nativeSpan = __mowList_native__marshaller.GetUnmanagedValuesDestination(); 87global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __mowList_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __mowList_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __mowList_native__numElements); 88global::System.Span<ulong> __mowList_native__nativeSpan = __mowList_native__marshaller.GetUnmanagedValuesDestination(); 129global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __mowList_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(mowList); 142global::System.Span<ulong> __mowList_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetUnmanagedValuesSource(__mowList_native, __mowList_native__numElements).GetPinnableReference()), __mowList_native__numElements); 143global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __mowList_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(mowList);
ClrDataValue.cs (1)
176Span<byte> memBytes = new(dst, (int)loc.Size);
Dbi\DacDbiImpl.cs (1)
3383Span<byte> destBytes = MemoryMarshal.AsBytes(MemoryMarshal.CreateSpan(ref dest, 1));
OutputBufferHelpers.cs (2)
25Span<char> target = new Span<char>(stringBuf, checked((int)bufferSize)); 43Span<byte> target = new Span<byte>(stringBuf, checked(maxBytes));
SOSDacImpl.cs (1)
754var dest = new Span<byte>(pGenericModeBlock, buckets.Length);
SOSDacImpl.IXCLRDataProcess.cs (1)
620Span<TargetPointer> exInfo = stackalloc TargetPointer[EXCEPTION_RECORD64.ExceptionMaximumParameters];
Microsoft.DiaSymReader (189)
_generated\18\Microsoft.DiaSymReader.ISymUnmanagedEncUpdate.cs (6)
169global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 193global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 194global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 245global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables); 259global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetUnmanagedValuesSource(__variables_native, __variables_native__numElements).GetPinnableReference()), __variables_native__numElements); 260global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables);
_generated\19\Microsoft.DiaSymReader.ISymUnmanagedMethod.cs (18)
406global::System.Span<global::System.IntPtr> __parameters_native__nativeSpan = __parameters_native__marshaller.GetUnmanagedValuesDestination(); 430global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __parameters_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __parameters_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __parameters_native__numElements); 431global::System.Span<global::System.IntPtr> __parameters_native__nativeSpan = __parameters_native__marshaller.GetUnmanagedValuesDestination(); 482global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __parameters_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(parameters); 495global::System.Span<global::System.IntPtr> __parameters_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetUnmanagedValuesSource(__parameters_native, __parameters_native__numElements).GetPinnableReference()), __parameters_native__numElements); 496global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __parameters_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(parameters); 599global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 625global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __documents_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __documents_native__numElements); 626global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 689global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents); 705global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetUnmanagedValuesSource(__documents_native, __documents_native__numElements).GetPinnableReference()), __documents_native__numElements); 706global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents); 747global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 776global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __documents_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __documents_native__numElements); 777global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 855global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents); 875global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetUnmanagedValuesSource(__documents_native, __documents_native__numElements).GetPinnableReference()), __documents_native__numElements); 876global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents);
_generated\20\Microsoft.DiaSymReader.ISymUnmanagedMethod2.cs (9)
292global::System.Span<global::System.IntPtr> __parameters_native__nativeSpan = __parameters_native__marshaller.GetUnmanagedValuesDestination(); 316global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __parameters_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __parameters_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __parameters_native__numElements); 317global::System.Span<global::System.IntPtr> __parameters_native__nativeSpan = __parameters_native__marshaller.GetUnmanagedValuesDestination(); 409global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 435global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __documents_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __documents_native__numElements); 436global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 491global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 520global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __documents_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __documents_native__numElements); 521global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination();
_generated\21\Microsoft.DiaSymReader.ISymUnmanagedNamespace.cs (12)
114global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 138global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __namespaces_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __namespaces_native__numElements); 139global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 190global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetManagedValuesDestination(namespaces); 203global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetUnmanagedValuesSource(__namespaces_native, __namespaces_native__numElements).GetPinnableReference()), __namespaces_native__numElements); 204global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetManagedValuesDestination(namespaces); 247global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 271global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 272global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 323global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables); 336global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetUnmanagedValuesSource(__variables_native, __variables_native__numElements).GetPinnableReference()), __variables_native__numElements); 337global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables);
_generated\22\Microsoft.DiaSymReader.ISymUnmanagedReader.cs (30)
152global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 176global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __documents_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __documents_native__numElements); 177global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 228global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents); 241global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetUnmanagedValuesSource(__documents_native, __documents_native__numElements).GetPinnableReference()), __documents_native__numElements); 242global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents); 447global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 471global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 472global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 523global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables); 536global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetUnmanagedValuesSource(__variables_native, __variables_native__numElements).GetPinnableReference()), __variables_native__numElements); 537global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables); 580global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 604global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 605global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 656global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables); 669global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetUnmanagedValuesSource(__variables_native, __variables_native__numElements).GetPinnableReference()), __variables_native__numElements); 670global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables); 836global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 860global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __namespaces_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __namespaces_native__numElements); 861global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 912global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetManagedValuesDestination(namespaces); 925global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetUnmanagedValuesSource(__namespaces_native, __namespaces_native__numElements).GetPinnableReference()), __namespaces_native__numElements); 926global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetManagedValuesDestination(namespaces); 1196global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 1221global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __methods_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __methods_native__numElements); 1222global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 1275global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedMethod, global::System.IntPtr>.GetManagedValuesDestination(methods); 1289global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedMethod, global::System.IntPtr>.GetUnmanagedValuesSource(__methods_native, __methods_native__numElements).GetPinnableReference()), __methods_native__numElements); 1290global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedMethod, global::System.IntPtr>.GetManagedValuesDestination(methods);
_generated\23\Microsoft.DiaSymReader.ISymUnmanagedReader2.cs (21)
194global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 219global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __methods_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __methods_native__numElements); 220global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 273global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedMethod, global::System.IntPtr>.GetManagedValuesDestination(methods); 287global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedMethod, global::System.IntPtr>.GetUnmanagedValuesSource(__methods_native, __methods_native__numElements).GetPinnableReference()), __methods_native__numElements); 288global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedMethod, global::System.IntPtr>.GetManagedValuesDestination(methods); 369global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 393global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __documents_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __documents_native__numElements); 394global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 542global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 566global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 567global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 622global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 646global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 647global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 767global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 791global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __namespaces_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __namespaces_native__numElements); 792global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 970global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 995global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __methods_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __methods_native__numElements); 996global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination();
_generated\24\Microsoft.DiaSymReader.ISymUnmanagedReader3.cs (18)
229global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 253global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __documents_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __documents_native__numElements); 254global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 402global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 426global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 427global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 482global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 506global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 507global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 627global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 651global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __namespaces_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __namespaces_native__numElements); 652global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 830global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 855global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __methods_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __methods_native__numElements); 856global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 1042global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 1067global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __methods_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __methods_native__numElements); 1068global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination();
_generated\25\Microsoft.DiaSymReader.ISymUnmanagedReader4.cs (18)
264global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 288global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __documents_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __documents_native__numElements); 289global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 437global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 461global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 462global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 517global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 541global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 542global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 662global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 686global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __namespaces_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __namespaces_native__numElements); 687global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 865global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 890global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __methods_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __methods_native__numElements); 891global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 1077global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 1102global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __methods_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __methods_native__numElements); 1103global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination();
_generated\26\Microsoft.DiaSymReader.ISymUnmanagedReader5.cs (18)
169global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 193global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __documents_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __documents_native__numElements); 194global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 342global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 366global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 367global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 422global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 446global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __variables_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __variables_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __variables_native__numElements); 447global::System.Span<global::System.IntPtr> __variables_native__nativeSpan = __variables_native__marshaller.GetUnmanagedValuesDestination(); 567global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 591global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __namespaces_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __namespaces_native__numElements); 592global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 770global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 795global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __methods_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __methods_native__numElements); 796global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 982global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination(); 1007global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedMethod> __methods_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __methods_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __methods_native__numElements); 1008global::System.Span<global::System.IntPtr> __methods_native__nativeSpan = __methods_native__marshaller.GetUnmanagedValuesDestination();
_generated\28\Microsoft.DiaSymReader.ISymUnmanagedScope.cs (18)
189global::System.Span<global::System.IntPtr> __children_native__nativeSpan = __children_native__marshaller.GetUnmanagedValuesDestination(); 213global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedScope> __children_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __children_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __children_native__numElements); 214global::System.Span<global::System.IntPtr> __children_native__nativeSpan = __children_native__marshaller.GetUnmanagedValuesDestination(); 265global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedScope> __children_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedScope, global::System.IntPtr>.GetManagedValuesDestination(children); 278global::System.Span<global::System.IntPtr> __children_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedScope, global::System.IntPtr>.GetUnmanagedValuesSource(__children_native, __children_native__numElements).GetPinnableReference()), __children_native__numElements); 279global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedScope> __children_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedScope, global::System.IntPtr>.GetManagedValuesDestination(children); 454global::System.Span<global::System.IntPtr> __locals_native__nativeSpan = __locals_native__marshaller.GetUnmanagedValuesDestination(); 478global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __locals_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __locals_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __locals_native__numElements); 479global::System.Span<global::System.IntPtr> __locals_native__nativeSpan = __locals_native__marshaller.GetUnmanagedValuesDestination(); 530global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __locals_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(locals); 543global::System.Span<global::System.IntPtr> __locals_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetUnmanagedValuesSource(__locals_native, __locals_native__numElements).GetPinnableReference()), __locals_native__numElements); 544global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __locals_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(locals); 587global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 611global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __namespaces_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __namespaces_native__numElements); 612global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 663global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetManagedValuesDestination(namespaces); 676global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetUnmanagedValuesSource(__namespaces_native, __namespaces_native__numElements).GetPinnableReference()), __namespaces_native__numElements); 677global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetManagedValuesDestination(namespaces);
_generated\29\Microsoft.DiaSymReader.ISymUnmanagedScope2.cs (15)
111global::System.Span<global::System.IntPtr> __constants_native__nativeSpan = __constants_native__marshaller.GetUnmanagedValuesDestination(); 135global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedConstant> __constants_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __constants_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __constants_native__numElements); 136global::System.Span<global::System.IntPtr> __constants_native__nativeSpan = __constants_native__marshaller.GetUnmanagedValuesDestination(); 187global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedConstant> __constants_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedConstant, global::System.IntPtr>.GetManagedValuesDestination(constants); 200global::System.Span<global::System.IntPtr> __constants_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedConstant, global::System.IntPtr>.GetUnmanagedValuesSource(__constants_native, __constants_native__numElements).GetPinnableReference()), __constants_native__numElements); 201global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedConstant> __constants_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedConstant, global::System.IntPtr>.GetManagedValuesDestination(constants); 316global::System.Span<global::System.IntPtr> __children_native__nativeSpan = __children_native__marshaller.GetUnmanagedValuesDestination(); 340global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedScope> __children_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __children_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __children_native__numElements); 341global::System.Span<global::System.IntPtr> __children_native__nativeSpan = __children_native__marshaller.GetUnmanagedValuesDestination(); 459global::System.Span<global::System.IntPtr> __locals_native__nativeSpan = __locals_native__marshaller.GetUnmanagedValuesDestination(); 483global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedVariable> __locals_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __locals_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __locals_native__numElements); 484global::System.Span<global::System.IntPtr> __locals_native__nativeSpan = __locals_native__marshaller.GetUnmanagedValuesDestination(); 539global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination(); 563global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace> __namespaces_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __namespaces_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __namespaces_native__numElements); 564global::System.Span<global::System.IntPtr> __namespaces_native__nativeSpan = __namespaces_native__marshaller.GetUnmanagedValuesDestination();
_generated\9\Microsoft.DiaSymReader.ISymEncUnmanagedMethod.cs (6)
226global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 250global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __documents_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __documents_native__numElements); 251global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = __documents_native__marshaller.GetUnmanagedValuesDestination(); 302global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents); 315global::System.Span<global::System.IntPtr> __documents_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetUnmanagedValuesSource(__documents_native, __documents_native__numElements).GetPinnableReference()), __documents_native__numElements); 316global::System.Span<global::Microsoft.DiaSymReader.ISymUnmanagedDocument> __documents_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents);
Microsoft.DotNet.Build.Tasks.Installers (3)
src\RpmHeader.cs (2)
85private static void WriteIndexEntry(Span<byte> bytes, IndexEntry entry) 117Span<byte> indexBytesSpan = indexBytes;
src\StreamHelpers.cs (1)
10public static Span<byte> ReadExactly(this Stream stream, int n)
Microsoft.DotNet.NativeWrapper (1)
_generated\0\LibraryImports.g.cs (1)
196global::System.Span<nint> __argv_native__nativeSpan = __argv_native__marshaller.GetUnmanagedValuesDestination();
Microsoft.DotNet.TemplateLocator (1)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (1)
47Span<byte> span;
Microsoft.Extensions.AI.Abstractions (3)
Embeddings\BinaryEmbedding.cs (1)
100Span<byte> utf8 = tmpArray.AsSpan(0, length);
Utilities\AIJsonUtilities.cs (2)
109Span<byte> hashData = stackalloc byte[SHA384.HashSizeInBytes]; 219public void GetHashAndReset(Span<byte> bytes) => _hash.GetHashAndReset(bytes);
Microsoft.Extensions.Caching.Hybrid (7)
Internal\DefaultHybridCache.StampedeStateT.cs (4)
549Span<byte> byteBuffer = maxBytes <= 128 ? stackalloc byte[128] : (leasedBytes = ArrayPool<byte>.Shared.Rent(maxBytes)); 550Span<char> charBuffer = maxChars <= 128 ? stackalloc char[128] : (leasedChars = ArrayPool<char>.Shared.Rent(maxChars)); 594static unsafe bool Test(string value, Span<byte> byteBuffer, Span<char> charBuffer)
Internal\RecyclableArrayBufferWriter.cs (1)
124public Span<T> GetSpan(int sizeHint = 0)
Internal\TagSet.cs (2)
46public Span<string> GetSpanPrechecked() => (string[])_tagOrTags!; // we expect this to fail if used on incorrect types 83public void CopyTo(Span<string> target)
Microsoft.Extensions.Caching.Hybrid.Tests (2)
DistributedCacheTests.cs (1)
378public override Span<byte> GetSpan() => new(_data, 5, _data.Length - 10);
TagSetTests.cs (1)
171Span<char> chars = stackalloc char[len];
Microsoft.Extensions.Compliance.Abstractions (6)
Redaction\NullRedactor.cs (1)
23public override int Redact(ReadOnlySpan<char> source, Span<char> destination)
Redaction\Redactor.cs (4)
71public abstract int Redact(ReadOnlySpan<char> source, Span<char> destination); 83public int Redact(string? source, Span<char> destination) => Redact(source.AsSpan(), destination); 171public int Redact<T>(T value, Span<char> destination, string? format = null, IFormatProvider? provider = null) 222public bool TryRedact<T>(T value, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider = null)
src\Shared\RentedSpan\RentedSpan.cs (1)
93public Span<T> Span => _rentedBuffer != null ? _rentedBuffer.AsSpan(0, _length) : default;
Microsoft.Extensions.Compliance.Abstractions.Tests (5)
Redaction\NullRedactorTest.cs (1)
30Span<char> input = stackalloc char[0];
Redaction\RedactorTest.cs (3)
60Span<char> extBuffer = stackalloc char[3]; 61Span<char> buffer = stackalloc char[3]; 333public override int Redact(ReadOnlySpan<char> source, Span<char> destination)
Redaction\TestSpanFormattable.cs (1)
24public bool TryFormat(System.Span<char> destination, out int charsWritten,
Microsoft.Extensions.Compliance.Redaction (3)
ErasingRedactor.cs (1)
19public override int Redact(ReadOnlySpan<char> source, Span<char> destination) => 0;
HmacRedactor.cs (2)
94public override int Redact(ReadOnlySpan<char> source, Span<char> destination) 125private static int ConvertBytesToBase64(byte[] hashToConvert, Span<char> destination, int remainingBytesToPad, int startOffset)
Microsoft.Extensions.Compliance.Redaction.Tests (2)
ErasingRedactorTests.cs (1)
42Span<char> buffer = stackalloc char[20];
FakePlaintextRedactor.cs (1)
12public override int Redact(ReadOnlySpan<char> source, Span<char> destination)
Microsoft.Extensions.Compliance.Testing (1)
FakeRedactor.cs (1)
74public override int Redact(ReadOnlySpan<char> source, Span<char> destination)
Microsoft.Extensions.DataIngestion (6)
Chunkers\ValueStringBuilder.cs (6)
21private Span<char> _chars; 24public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
Microsoft.Extensions.DependencyInjection.Abstractions (6)
ActivatorUtilities.cs (6)
74Span<object?> values = maxArgs <= StackAllocatedObjects.MaxStackAllocArgCount / 2 ? 78Span<object?> ctorArgs = values.Slice(0, maxArgs); 79Span<object?> bestCtorArgs = values.Slice(maxArgs, maxArgs); 208static void InitializeCtorArgValues(ref Span<object?> ctorArgs, int _) 801private readonly Span<object?> _parameterValues; 802public ConstructorMatcher(ConstructorInfoEx constructor, Span<object?> parameterValues)
Microsoft.Extensions.Diagnostics (2)
src\runtime\src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (2)
121private Span<ulong> _bitMap; 123public BitMapper(Span<ulong> bitMap)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (9)
Linux\IFileSystem.cs (1)
34int Read(FileInfo file, int length, Span<char> destination);
Linux\Network\LinuxNetworkUtilizationParser.cs (1)
63Span<Range> range = stackalloc Range[Target];
Linux\OSFileSystem.cs (2)
34public int Read(FileInfo file, int length, Span<char> destination) 120Span<byte> buffer = stackalloc byte[MaxStackalloc];
src\Shared\BufferWriterPool\BufferWriter.cs (4)
110/// Notifies <see cref="IBufferWriter{T}"/> that <paramref name="count"/> amount of data was written to the output <see cref="Span{T}"/>/<see cref="Memory{T}"/>. 146/// Returns a <see cref="Span{T}"/> to write to that is at least the requested length (specified by <paramref name="sizeHint"/>). 152/// This will never return an empty <see cref="Span{T}"/>. 158public Span<T> GetSpan(int sizeHint = 0)
src\Shared\RentedSpan\RentedSpan.cs (1)
93public Span<T> Span => _rentedBuffer != null ? _rentedBuffer.AsSpan(0, _length) : default;
Microsoft.Extensions.DotNetDeltaApplier (1)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\WebSocketTransport.cs (1)
140Span<byte> secret = stackalloc byte[32];
Microsoft.Extensions.FileProviders.Physical (1)
PollingWildCardChangeToken.cs (1)
136Span<byte> currentHash = stackalloc byte[256 / 8];
Microsoft.Extensions.Http.Diagnostics (5)
Logging\Internal\HttpHeadersRedactor.cs (1)
136Span<char> destinationMany = rental.Rented ? rental.Span : stackalloc char[redactedSize];
src\Shared\BufferWriterPool\BufferWriter.cs (4)
110/// Notifies <see cref="IBufferWriter{T}"/> that <paramref name="count"/> amount of data was written to the output <see cref="Span{T}"/>/<see cref="Memory{T}"/>. 146/// Returns a <see cref="Span{T}"/> to write to that is at least the requested length (specified by <paramref name="sizeHint"/>). 152/// This will never return an empty <see cref="Span{T}"/>. 158public Span<T> GetSpan(int sizeHint = 0)
Microsoft.Extensions.Identity.Core (7)
Base32.cs (2)
28Span<byte> bytes = stackalloc byte[length]; 118private static int GetNextGroup(Span<byte> input, ref int offset, out byte a, out byte b, out byte c, out byte d, out byte e, out byte f, out byte g, out byte h)
Rfc6238AuthenticationService.cs (4)
38Span<byte> timestepAsBytes = stackalloc byte[sizeof(long)]; 46Span<byte> modifierCombinedBytes = timestepAsBytes; 51Span<byte> hash = stackalloc byte[HMACSHA1.HashSizeInBytes]; 70private static byte[] ApplyModifier(Span<byte> input, byte[] modifierBytes)
UserManager.cs (1)
2531Span<uint> resultBuffer = stackalloc uint[1];
Microsoft.Extensions.Logging.Abstractions (6)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
Microsoft.Extensions.Logging.Console (4)
SimpleConsoleFormatter.cs (1)
101Span<char> span = stackalloc char[10];
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (2)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\runtime\src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = MinimumBufferSize)
Microsoft.Extensions.Logging.Generators (8)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T?> scratchBuffer) 52Span<T> span = _span; 68Span<T> span = _span; 107public Span<T> AppendSpan(int length) 112Span<T> span = _span; 125private Span<T> AppendSpanWithGrow(int length) 149public bool TryCopyTo(Span<T> destination, out int itemsWritten)
Microsoft.Extensions.ServiceDiscovery.Dns (4)
Resolver\DnsPrimitives.cs (4)
40internal static bool TryWriteMessageHeader(Span<byte> buffer, DnsMessageHeader header, out int bytesWritten) 66internal static bool TryWriteQName(Span<byte> destination, string name, out int written) 107Span<byte> nameBuffer = destination.Slice(0, 1 + length); 108Span<byte> label;
Microsoft.Extensions.Telemetry (5)
Logging\JustInTimeRedactor.cs (4)
61public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) 80private bool TryRedactWithDiscriminator(object? value, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? formatProvider, 83Span<char> workBuffer = stackalloc char[MaxStackAllocation]; 149var finalToBeRedacted = workBuffer.Slice(0, charsInWorkBuffer);
src\Shared\RentedSpan\RentedSpan.cs (1)
93public Span<T> Span => _rentedBuffer != null ? _rentedBuffer.AsSpan(0, _length) : default;
Microsoft.Extensions.Telemetry.Tests (2)
Logging\JustInTimeRedactorTests.cs (2)
45Span<char> d = new char[1024]; 121public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
Microsoft.Gen.Logging.Generated.Tests (1)
SimpleRedactors.cs (1)
26public override int Redact(ReadOnlySpan<char> source, Span<char> destination)
Microsoft.Maui.Graphics (4)
Color.cs (4)
362 Span<char> temp = stackalloc char[2]; 413 Span<char> temp = stackalloc char[2]; 426 Span<char> temp = stackalloc char[2]; 758 Span<char> loweredValue = value.Length <= 128 ? stackalloc char[value.Length] : new char[value.Length];
Microsoft.Maui.Resizetizer (2)
SkiaSharpTools.cs (2)
60 var span = (Span<SKPoint>)new SKPoint[1];
Microsoft.ML.Core (12)
Utilities\BigArray.cs (1)
384public void CopyTo(long idx, Span<T> dst, int length)
Utilities\Contracts.cs (1)
960public static void AssertNonEmpty<T>(Span<T> args)
Utilities\HashArray.cs (1)
235public void CopyTo(Span<TItem> destination)
Utilities\Stream.cs (1)
683private static unsafe void ReadBinaryDataIntoSpan<T>(BinaryReader reader, Span<T> destination) where T : unmanaged
Utilities\Utils.cs (3)
187public static void CopyTo<T>(this List<T> src, Span<T> dst, int? count = null) 461public static void FillIdentity(Span<int> a, int lim) 545public static void Shuffle<T>(Random rand, Span<T> rgv)
Utilities\VBufferUtils.cs (5)
750var indices = editor.Indices; 751var values = editor.Values; 1142Span<TDst> values = editor.Values; 1150Span<int> indices = editor.Indices; 1254Span<int> indices = editor.Indices;
Microsoft.ML.Core.Tests (3)
UnitTests\TestVBuffer.cs (3)
555var indices = editor.Indices; 1015var indices = editor.Indices; 1016var values = editor.Values;
Microsoft.ML.CpuMath (45)
AlignedArray.cs (2)
111public void CopyTo(Span<float> dst, int index, int count) 118public void CopyTo(int start, Span<float> dst, int index, int count)
AvxIntrinsics.cs (14)
420public static unsafe void AddScalarU(float scalar, Span<float> dst) 461public static unsafe void Scale(float scale, Span<float> dst) 568public static unsafe void ScaleSrcU(float scale, ReadOnlySpan<float> src, Span<float> dst, int count) 617public static unsafe void ScaleAddU(float a, float b, Span<float> dst) 663public static unsafe void AddScaleU(float scale, ReadOnlySpan<float> src, Span<float> dst, int count) 717public static unsafe void AddScaleCopyU(float scale, ReadOnlySpan<float> src, ReadOnlySpan<float> dst, Span<float> result, int count) 774public static unsafe void AddScaleSU(float scale, ReadOnlySpan<float> src, ReadOnlySpan<int> idx, Span<float> dst, int count) 825public static unsafe void AddU(ReadOnlySpan<float> src, Span<float> dst, int count) 874public static unsafe void AddSU(ReadOnlySpan<float> src, ReadOnlySpan<int> idx, Span<float> dst, int count) 922public static unsafe void MulElementWiseU(ReadOnlySpan<float> src1, ReadOnlySpan<float> src2, Span<float> dst, int count) 1505public static unsafe void SdcaL1UpdateU(float primalUpdate, int count, ReadOnlySpan<float> src, float threshold, Span<float> v, Span<float> w) 1565public static unsafe void SdcaL1UpdateSU(float primalUpdate, int count, ReadOnlySpan<float> src, ReadOnlySpan<int> indices, float threshold, Span<float> v, Span<float> w)
CpuMathUtils.cs (7)
21public static void Add(float value, Span<float> destination) 33public static void Scale(float value, Span<float> destination) 48public static void Scale(float value, ReadOnlySpan<float> source, Span<float> destination, int count) 67public static void AddScale(float scale, ReadOnlySpan<float> source, Span<float> destination, int count) 87public static void AddScaleCopy(float scale, ReadOnlySpan<float> source, ReadOnlySpan<float> destination, Span<float> result, int count) 107public static void Add(ReadOnlySpan<float> source, Span<float> destination, int count) 126public static void MulElementWise(ReadOnlySpan<float> left, ReadOnlySpan<float> right, Span<float> destination, int count)
CpuMathUtils.netcoreapp.cs (7)
167public static void ScaleAdd(float scale, float addend, Span<float> destination) 197public static void AddScale(float scale, ReadOnlySpan<float> source, ReadOnlySpan<int> indices, Span<float> destination, int count) 233public static void Add(ReadOnlySpan<float> source, ReadOnlySpan<int> indices, Span<float> destination, int count) 529public static void SdcaL1UpdateDense(float primalUpdate, int count, ReadOnlySpan<float> source, float threshold, Span<float> v, Span<float> w) 569public static void SdcaL1UpdateSparse(float primalUpdate, int count, ReadOnlySpan<float> source, ReadOnlySpan<int> indices, float threshold, Span<float> v, Span<float> w)
src\Microsoft.ML.Core\Utilities\Contracts.cs (1)
960public static void AssertNonEmpty<T>(Span<T> args)
SseIntrinsics.cs (14)
355public static unsafe void AddScalarU(float scalar, Span<float> dst) 385public static unsafe void Scale(float scale, Span<float> dst) 487public static unsafe void ScaleSrcU(float scale, ReadOnlySpan<float> src, Span<float> dst, int count) 524public static unsafe void ScaleAddU(float a, float b, Span<float> dst) 557public static unsafe void AddScaleU(float scale, ReadOnlySpan<float> src, Span<float> dst, int count) 598public static unsafe void AddScaleCopyU(float scale, ReadOnlySpan<float> src, ReadOnlySpan<float> dst, Span<float> result, int count) 642public static unsafe void AddScaleSU(float scale, ReadOnlySpan<float> src, ReadOnlySpan<int> idx, Span<float> dst, int count) 681public static unsafe void AddU(ReadOnlySpan<float> src, Span<float> dst, int count) 718public static unsafe void AddSU(ReadOnlySpan<float> src, ReadOnlySpan<int> idx, Span<float> dst, int count) 754public static unsafe void MulElementWiseU(ReadOnlySpan<float> src1, ReadOnlySpan<float> src2, Span<float> dst, int count) 1199public static unsafe void SdcaL1UpdateU(float primalUpdate, int count, ReadOnlySpan<float> src, float threshold, Span<float> v, Span<float> w) 1244public static unsafe void SdcaL1UpdateSU(float primalUpdate, int count, ReadOnlySpan<float> src, ReadOnlySpan<int> indices, float threshold, Span<float> v, Span<float> w)
Microsoft.ML.Data (24)
Deprecated\Vector\GenericSpanSortHelper.cs (19)
48public static void Sort<TValue>(Span<TKey> keys, Span<TValue> values, int index, int length) 55public static void Sort(Span<TKey> keys, int index, int length) 60private static void SwapIfGreaterWithItems<TValue>(Span<TKey> keys, Span<TValue> values, int a, int b) 76private static void Swap<TValue>(Span<TKey> keys, Span<TValue> values, int i, int j) 89internal static void IntrospectiveSort<TValue>(Span<TKey> keys, Span<TValue> values, int left, int length) 103private static void IntroSort<TValue>(Span<TKey> keys, Span<TValue> values, int lo, int hi, int depthLimit) 148private static int PickPivotAndPartition<TValue>(Span<TKey> keys, Span<TValue> values, int lo, int hi) 191private static void Heapsort<TValue>(Span<TKey> keys, Span<TValue> values, int lo, int hi) 209private static void DownHeap<TValue>(Span<TKey> keys, Span<TValue> values, int i, int n, int lo) 234private static void InsertionSort<TValue>(Span<TKey> keys, Span<TValue> values, int lo, int hi)
Deprecated\Vector\VBufferMathUtils.cs (2)
249Span<float> values; 301var indices = editor.Indices;
Deprecated\Vector\VectorUtils.cs (1)
442public static void AddMult(in VBuffer<float> src, Span<float> dst, float c)
Scorers\FeatureContributionCalculation.cs (2)
239var indices = contributions.IsDense ? Utils.GetIdentityPermutation(contributions.Length) : editor.Indices; 240var values = editor.Values;
Microsoft.ML.DataView (6)
VBuffer.cs (4)
270/// <param name="destination">The destination buffer. This <see cref="Span{T}.Length"/> must have least <see cref="Length"/>.</param> 271public void CopyTo(Span<T> destination) 279/// <param name="destination">The destination buffer. This <see cref="Span{T}.Length"/> must be at least <see cref="Length"/> 285public void CopyTo(Span<T> destination, int destinationIndex, T defaultValue = default(T))
VBufferEditor.cs (2)
91public readonly Span<T> Values; 96public readonly Span<int> Indices;
Microsoft.ML.ImageAnalytics (6)
ImageLoader.cs (4)
327private static int ReadToEnd(System.IO.Stream stream, Span<byte> bufferSpan) 338var readBufferSpan = readBuffer.AsSpan(); 339var srcSpan = readBufferSpan; 344var dstSpan = bufferSpan.Slice(totalBytesRead, bytesRead);
ImagePixelExtractor.cs (2)
357Span<float> vf = typeof(TValue) == typeof(float) ? MemoryMarshal.Cast<TValue, float>(editor.Values) : default; 358Span<byte> vb = typeof(TValue) == typeof(byte) ? MemoryMarshal.Cast<TValue, byte>(editor.Values) : default;
Microsoft.ML.KMeansClustering (1)
KMeansModelParameters.cs (1)
165private void Map(in VBuffer<float> src, Span<float> distances)
Microsoft.ML.Mkl.Components (3)
SymSgdClassificationTrainer.cs (2)
862ref float lr, float l2Const, float piw, Span<float> weightVector, ref float bias, int numFeatres, int numPasses, 917public static void MapBackWeightVector(Span<float> weightVector, GCHandle stateGCHandle)
VectorWhitening.cs (1)
523float[] a, int lda, ReadOnlySpan<float> x, int incx, float beta, Span<float> y, int incy)
Microsoft.ML.StandardTrainers (6)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (4)
828/// Then, <see cref="Calibrate(Span{float})"/> will be called to adjust those raw scores. 830private protected abstract void Calibrate(Span<float> dst); 1167private protected override void Calibrate(Span<float> dst) 1239private protected override void Calibrate(Span<float> dst)
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (1)
604Span<float> labelScores = editor.Values;
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (1)
372private void ComputeProbabilities(double[] buffer, Span<float> output)
Microsoft.ML.TensorFlow (4)
TensorflowUtils.cs (1)
412internal static unsafe void FetchStringData<T>(Tensor tensor, Span<T> result)
TensorTypeExtensions.cs (3)
38public static void CopyTo<T>(this Tensor tensor, Span<T> values) where T : unmanaged 47var span = new Span<T>(src, len); 55var span = new Span<T>(array);
Microsoft.ML.TestFrameworkCommon (1)
TestLogger.cs (1)
47var span = buffer.AsSpan(index, count);
Microsoft.ML.Tokenizers (131)
Model\BertTokenizer.cs (3)
339public OperationStatus BuildInputsWithSpecialTokens(IEnumerable<int> tokenIds, Span<int> destination, out int valuesWritten, IEnumerable<int>? additionalTokenIds = null) 466public OperationStatus GetSpecialTokensMask(IEnumerable<int> tokenIds, Span<int> destination, out int valuesWritten, IEnumerable<int>? additionalTokenIds = null, bool alreadyHasSpecialTokens = false) 602public OperationStatus CreateTokenTypeIdsFromSequences(IEnumerable<int> tokenIds, Span<int> destination, out int valuesWritten, IEnumerable<int>? additionalTokenIds = null)
Model\BPETokenizer.cs (18)
887public override OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, out int idsConsumed, out int charsWritten) 899public OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, bool considerSpecialTokens, out int idsConsumed, out int charsWritten) 914Span<char> buffer = destination; 980private OperationStatus DecodeByteLevel(IEnumerable<int> ids, Span<char> destination, bool considerSpecialTokens, out int idsConsumed, out int charsWritten) 986Span<char> vocabBuffer = stackalloc char[128]; 989Span<byte> utf8bytes = stackalloc byte[256]; 998Span<char> buffer = destination; 1044Span<byte> current = utf8bytes.Slice(incompleteUtf8BytesInBufferIndex + incompleteUtf8BytesInBuffer); 1196Span<char> buffer = stackalloc char[256]; 1316scoped Span<char> token; 1317scoped Span<int> mapping = Span<int>.Empty; 1429scoped Span<char> token; 1430scoped Span<int> mapping = Span<int>.Empty; 1509scoped Span<char> token; 1510scoped Span<int> mapping = Span<int>.Empty;
Model\CodeGenTokenizer.cs (22)
337Span<char> mutatedInputSpan = stackalloc char[BufferLength]; 445Span<char> token = stackalloc char[BufferLength]; 446Span<int> mapping = stackalloc int[BufferLength]; 596Span<char> mutatedInputSpan = stackalloc char[BufferLength]; 688=> CountTokens(text, Span<char>.Empty, addPrefixSpace, addBeginningOfSentence, addEndOfSentence, considerPreTokenization, considerNormalization, out _, out _); 750tokenCount = CountTokens(text, Span<char>.Empty, addPrefixSpace, addBeginningOfSentence, addEndOfSentence, considerPreTokenization, considerNormalization, out normalizedText, out int charsConsumed, maxTokenCount); 815Span<char> mutatedInputSpan = stackalloc char[BufferLength]; 900=> LastIndexOf(text, Span<char>.Empty, maxTokenCount, addPrefixSpace, addBeginningOfSentence, addEndOfSentence, considerPreTokenization, considerNormalization, out normalizedText, out tokenCount); 952Span<char> mutatedInputSpan = stackalloc char[BufferLength]; 1128Span<char> token = stackalloc char[BufferLength]; 1129Span<int> mapping = stackalloc int[BufferLength]; 1192Span<char> token = stackalloc char[100]; 1193Span<int> mapping = stackalloc int[100]; 1331public override OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, out int idsConsumed, out int charsWritten) 1344public OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, bool hasPrefixSpace, bool considerSpecialTokens, out int idsConsumed, out int charsWritten) 1355Span<char> vocabBuffer = stackalloc char[256]; 1357Span<byte> utf8bytes = stackalloc byte[256]; 1365Span<char> buffer = destination; 1470Span<byte> current = utf8bytes.Slice(incompleteUtf8BytesInBufferIndex + incompleteUtf8BytesInBuffer); 1598private List<EncodedToken> EncodeToTokens(Span<char> text, Span<int> mapping, ReadOnlySpan<char> originalText, PriorityQueue<SymbolPair> agenda) 1680static EncodedToken GetToken(int id, string token, int index, int length, ReadOnlySpan<char> originalText, Span<int> mapping)
Model\EnglishRobertaTokenizer.cs (5)
792public override OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, out int idsConsumed, out int charsWritten) 799Span<char> buffer = destination; 911private IReadOnlyList<EncodedToken> ModifyTokenListOffsets(IReadOnlyList<EncodedToken> tokens, Span<int> indexMapping) 948private List<EncodedToken> EncodeToTokens(Span<char> token, Span<int> indexMapping)
Model\SentencePieceBaseModel.cs (7)
368public virtual OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, bool considerSpecialTokens, out int idsConsumed, out int charsWritten) 384Span<char> buffer = destination; 576static OperationStatus TryDecodeAsSpecialToken(SentencePieceBaseModel model, int id, bool considerSpecialTokens, Span<char> buffer, ref int charsWritten, out bool isSpecialToken) 613static bool FlushBytes(ref int bytesCount, ref byte[]? bytesPoolArray, ref char[]? charPoolArray, Span<char> buffer, ref int charsWritten, ref int idsConsumed) 642static bool EncodeByte(int id, int oneByteUtf8EncodingMaxId, int byteCodeToIdOffset, ref int bytesCount, Span<char> buffer, ref int charsWritten, ref int idsConsumed, ref byte[]? bytesPoolArray) 665static bool AppendTokenWithCheckingPrefix(bool addDummyPrefix, bool treatWhitespaceAsSuffix, string token, char prefixSuffixChar, Span<char> destination, ref bool prefixRemoved, ref int suffixIndex, ref int idsConsumed, ref int charsConsumed) 672Span<char> buffer = destination.Slice(charsConsumed);
Model\SentencePieceBpeModel.cs (4)
225Span<byte> utf8Bytes = stackalloc byte[256]; 525Span<byte> utf8Bytes = stackalloc byte[100]; 788Span<byte> utf8Bytes = stackalloc byte[100]; 1064Span<byte> utf8Bytes = stackalloc byte[100];
Model\SentencePieceTokenizer.cs (5)
140=> _model.EncodeToTokens(text, Span<char>.Empty, out normalizedText, addBeginningOfSentence, addEndOfSentence, considerNormalization); 183=> _model.EncodeToIds(text, Span<char>.Empty, addBeginningOfSentence, addEndOfSentence, considerNormalization, out _, out _); 210=> _model.EncodeToIds(text, Span<char>.Empty, addBeginningOfSentence, addEndOfSentence, considerNormalization, out normalizedText, out charsConsumed, maxTokenCount); 419public override OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, out int idsConsumed, out int charsWritten) 431public OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, bool considerSpecialTokens, out int idsConsumed, out int charsWritten)
Model\SentencePieceUnigramModel.cs (11)
181Span<char> utf16NormalizedString = normalizedString.AsSpan().Slice(normalizedStringIndex); 195Span<char> normalizedUtf16Span = normalizedString.AsSpan().Slice(normalizedStringIndex); 292out Span<byte> normalizationSpan) 295Span<byte> byteSpan = MemoryMarshal.AsBytes(buffer.AsSpan()); 339NormalizeText(text, considerNormalization, buffer, out byte[]? normalizedArrayPool, out Span<byte> normalizationSpan); 414Span<byte> destination = stackalloc byte[4]; 471private void Encode(ReadOnlySpan<byte> normalized, Span<BestPathNode> bestPathEndsAt) 623NormalizeText(text, considerNormalization, buffer, out byte[]? normalizedArrayPool, out Span<byte> normalizationSpan); 779NormalizeText(text, considerNormalization, buffer, out byte[]? normalizedArrayPool, out Span<byte> normalizationSpan); 1110NormalizeText(text, considerNormalization, buffer, out byte[]? normalizedArrayPool, out Span<byte> normalizationSpan); 1361NormalizeText(text, considerNormalization, buffer, out byte[]? normalizedArrayPool, out Span<byte> normalizationSpan);
Model\TiktokenTokenizer.cs (10)
326Span<int> indexMappingSpan = utf8Length + 1 <= 128 ? stackalloc int[128] : (indexMappingArray = ArrayPool<int>.Shared.Rent(utf8Length + 1)); 443Span<int> indexMappingSpan = utf8Length + 1 <= 128 ? stackalloc int[128] : (indexMappingArray = ArrayPool<int>.Shared.Rent(utf8Length + 1)); 608Span<int> indexMappingSpan = utf8Length + 1 <= 128 ? stackalloc int[128] : (indexMappingArray = ArrayPool<int>.Shared.Rent(utf8Length + 1)); 734Span<int> indexMappingSpan = utf8Length + 1 <= 128 ? stackalloc int[128] : (indexMappingArray = ArrayPool<int>.Shared.Rent(utf8Length + 1)); 812Span<byte> utf8Bytes = stackalloc byte[256]; 839static void ArrayPoolGrow(ref Span<byte> utf8Bytes, ref byte[]? arrayPoolArray, int requiredCapacity) 860public override OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, out int idsConsumed, out int charsWritten) 878Span<byte> utf8Bytes = stackalloc byte[256]; 880Span<char> tempBuffer = stackalloc char[256]; 887Span<char> buffer = destination;
Model\WordPieceTokenizer.cs (5)
325Span<char> buffer = arrayPool is null ? stackalloc char[maxLength] : arrayPool; 465Span<char> buffer = arrayPool is null ? stackalloc char[maxLength] : arrayPool; 723public override OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, out int idsConsumed, out int charsWritten) => 735public OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, bool skipSpecialTokens, out int idsConsumed, out int charsWritten) 739Span<char> buffer = destination;
Normalizer\BertNormalizer.cs (2)
41Span<char> casingBuffer = stackalloc char[10]; 161private static void AddSpan(ref char[] buffer, ref int index, Span<char> chars)
Normalizer\SentencePieceNormalizer.cs (7)
129Span<char> span = stackalloc char[512]; 201private void InsertDummyPrefix(ReadOnlySpan<char> original, ref int startIndex, int endIndex, Span<char> span, ref int bufferIndex) 231private void InsertDummyPrefixAtEnd(Span<char> span, ref int bufferIndex) 285Span<DoubleArrayResultPair> trieResults = stackalloc DoubleArrayResultPair[MaxTrieResultsSize]; 335internal int Normalize(ReadOnlySpan<byte> input, ref Span<byte> normalized, ref byte[]? poolArray) 440Span<byte> space = EscapeWhiteSpaces ? _spaceSymbol : _space; 463static void AddWhiteSpace(SentencePieceNormalizer normalizer, Span<byte> normalized, ref int normalizedIndex, ref byte[]? poolArray)
Tokenizer.cs (2)
362/// By default, it uses <see cref="Decode(IEnumerable{int}, Span{char}, out int, out int)"/>. 425public abstract OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, out int idsConsumed, out int charsWritten);
Utils\BytePairEncoder.cs (4)
34Span<(int Index, int Rank)> byteIndicesAndRanks = requiredLength <= 64 ? 44int GetRank(Span<(int Index, int Rank)> byteIndicesAndRanks, int startIndex, int skip = 0) 160Span<State> state = statePoolArray.AsSpan(0, stateLength); 193void PotentialMerge(Span<State> stateSpan, PriorityQueue<MergeEntry> heapQueue, int start, int nextEndItem)
Utils\DoubleArrayTrie.cs (2)
741Span<byte> bytes = stackalloc byte[512]; 1065public int CommonPrefixSearch(ReadOnlySpan<byte> key, Span<DoubleArrayResultPair> results, int nodePos = 0)
Utils\Helpers.cs (7)
30internal static void ArrayPoolGrow<T>(ref Span<T> span, ref T[]? poolArray, int newSize) 67internal static int EncodeToUtf8(ReadOnlySpan<char> text, Span<byte> destination, Span<int> indexMapping) 121internal static int EncodeNextUtf8(ReadOnlySpan<char> text, Span<byte> destination) 159internal static int EncodeToUtf8AndTransform(ReadOnlySpan<char> text, Span<char> destination, Span<int> indexMapping) 235public static bool ConvertUtf8ToUtf16(ReadOnlySpan<byte> utf8Bytes, Span<char> utf16Chars, out int bytesConsumed, out int charsWritten)
Utils\Helpers.netcoreapp.cs (6)
55internal static unsafe int GetUtf8Bytes(ReadOnlySpan<char> source, Span<byte> destination) 58internal static unsafe bool TryGetUtf8Bytes(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 64internal static int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 67internal static void Replace(Span<char> span, char oldValue, char newValue) => span.Replace(oldValue, newValue); 69internal static void Replace(ReadOnlySpan<char> source, Span<char> destination, char oldValue, char newValue) => source.Replace(destination, oldValue, newValue); 85Span<byte> buffer = stackalloc byte[4]; // max number of bytes for a single code point utf-8 encoding.
Utils\OrdinalUtf8StringComparer.cs (2)
26Span<byte> buffer1 = stackalloc byte[520]; 27Span<byte> buffer2 = stackalloc byte[520];
Utils\ValueStringBuilder.cs (9)
18private Span<char> _chars; 21public ValueStringBuilder(Span<char> initialBuffer) 95Span<char> span = _chars.Slice(0, _pos); 110public Span<char> RawChars => _chars; 141public bool TryCopyTo(Span<char> destination, out int charsWritten) 270Span<char> chars = _chars; 325Span<char> dst = _chars.Slice(_pos, count); 341Span<char> dst = _chars.Slice(_pos, length); 362public Span<char> AppendSpan(int length)
Microsoft.ML.Tokenizers.Tests (30)
BertTokenizerTests.cs (3)
378Span<int> ids1Span = stackalloc int[1]; 478Span<int> ids1Span = stackalloc int[1]; 571Span<int> ids1Span = stackalloc int[1];
LlamaTests.cs (5)
339Assert.Equal([], llamaTokenizer.EncodeToTokens(Span<char>.Empty, out _)); 342Assert.Equal([], llamaTokenizer.EncodeToIds(Span<char>.Empty)); 345Assert.Equal(0, llamaTokenizer.CountTokens(Span<char>.Empty)); 387Span<char> destinationBuffer = stackalloc char[llamaTokenizer.EndOfSentenceToken.Length]; 903var sp = destinationBuffer.AsSpan().Slice(0, charactersWritten);
src\Microsoft.ML.Tokenizers\Utils\DoubleArrayTrie.cs (2)
741Span<byte> bytes = stackalloc byte[512]; 1065public int CommonPrefixSearch(ReadOnlySpan<byte> key, Span<DoubleArrayResultPair> results, int nodePos = 0)
src\Microsoft.ML.Tokenizers\Utils\Helpers.cs (7)
30internal static void ArrayPoolGrow<T>(ref Span<T> span, ref T[]? poolArray, int newSize) 67internal static int EncodeToUtf8(ReadOnlySpan<char> text, Span<byte> destination, Span<int> indexMapping) 121internal static int EncodeNextUtf8(ReadOnlySpan<char> text, Span<byte> destination) 159internal static int EncodeToUtf8AndTransform(ReadOnlySpan<char> text, Span<char> destination, Span<int> indexMapping) 235public static bool ConvertUtf8ToUtf16(ReadOnlySpan<byte> utf8Bytes, Span<char> utf16Chars, out int bytesConsumed, out int charsWritten)
src\Microsoft.ML.Tokenizers\Utils\Helpers.netcoreapp.cs (6)
55internal static unsafe int GetUtf8Bytes(ReadOnlySpan<char> source, Span<byte> destination) 58internal static unsafe bool TryGetUtf8Bytes(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 64internal static int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 67internal static void Replace(Span<char> span, char oldValue, char newValue) => span.Replace(oldValue, newValue); 69internal static void Replace(ReadOnlySpan<char> source, Span<char> destination, char oldValue, char newValue) => source.Replace(destination, oldValue, newValue); 85Span<byte> buffer = stackalloc byte[4]; // max number of bytes for a single code point utf-8 encoding.
src\Microsoft.ML.Tokenizers\Utils\OrdinalUtf8StringComparer.cs (2)
26Span<byte> buffer1 = stackalloc byte[520]; 27Span<byte> buffer2 = stackalloc byte[520];
TokenizerTests.cs (3)
81public override OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, out int idsConsumed, out int charsWritten) 218Assert.Equal(0, tokenizer.GetIndexByTokenCount(Span<char>.Empty, maxTokenCount: 10, out _, out _)); 219Assert.Equal(0, tokenizer.GetIndexByTokenCountFromEnd(Span<char>.Empty, maxTokenCount: 10, out _, out _));
WordPieceTests.cs (2)
98Span<char> buffer = stackalloc char[text.Length]; 101Span<char> bufferSlice = buffer.Slice(0, i);
Microsoft.ML.TorchSharp (2)
NasBert\NerTrainer.cs (2)
176var newValues = targetEditor.Values; 396var newValues = editor.Values;
Microsoft.ML.Transforms (11)
Dracula\CMCountTable.cs (1)
145public override void GetCounts(long key, Span<float> counts)
Dracula\CountTable.cs (2)
18void GetCounts(long key, Span<float> counts); 113public abstract void GetCounts(long key, Span<float> counts);
Dracula\DictCountTable.cs (1)
116public override void GetCounts(long key, Span<float> counts)
Dracula\Featurizer.cs (5)
138public void GetFeatures(int iCol, int iSlot, Random rand, long key, Span<float> features) 143var countsBuffer = features.Slice(0, _labelBinCount); 171private float AddLaplacianNoisePerLabel(int iCol, Random rand, Span<float> counts) 192private void GenerateLogOdds(int iCol, ICountTable countTable, Span<float> counts, Span<float> logOdds, float sum)
Dracula\MultiCountTable.cs (1)
387public void GetCounts(long key, Span<float> counts)
GcnTransform.cs (1)
500var dstValues = editor.Values;
Microsoft.ML.Vision (3)
ImageClassificationTrainer.cs (3)
878var labelsSpan = MemoryMarshal.Cast<long, byte>(labels); 890var featureSpan = MemoryMarshal.Cast<float, byte>(row.Item2); 1460public void Score(in VBuffer<byte> image, Span<float> classProbabilities)
Microsoft.NET.Build.Containers (4)
DigestUtils.cs (1)
98Span<byte> hash = stackalloc byte[SHA256.HashSizeInBytes];
Layer.cs (3)
58Span<byte> hash = stackalloc byte[SHA256.HashSizeInBytes]; 59Span<byte> uncompressedHash = stackalloc byte[SHA256.HashSizeInBytes]; 264internal int GetCurrentUncompressedHash(Span<byte> buffer) => sha256Hash.GetCurrentHash(buffer);
Microsoft.NET.Build.Tasks (1)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (1)
47Span<byte> span;
Microsoft.NET.HostModel (6)
MachO\FileUtils\StreamExtensions.cs (3)
16Span<byte> buffer = stackalloc byte[sizeof(uint)]; 32Span<byte> buffer = stackalloc byte[sizeof(uint)]; 48Span<byte> buffer = sizeof(T) < 256 ? stackalloc byte[sizeof(T)] : new byte[sizeof(T)];
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (3)
49public readonly Span<T> AsSpan() => _items.AsSpan(0, _count); 51public readonly Span<T> AsSpan(int start) => _items.AsSpan(start, _count - start); 53public Span<T> AppendSpan(int length)
Microsoft.Net.Http.Headers (4)
ContentDispositionHeaderValue.cs (2)
550Span<byte> buffer = requiredLength <= MaxStackAllocSizeBytes 556var bufferContent = buffer.Slice(MimePrefix.Length);
SetCookieHeaderValue.cs (2)
312private static void AppendSegment(ref Span<char> span, StringSegment name, StringSegment value) 323private static void Append(ref Span<char> span, ReadOnlySpan<char> other)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (2)
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (2)
327internal static void SortByRelatedAssetInPlace(Span<StaticWebAsset> assets) 376Span<StaticWebAsset> assets, HashSet<string> seen,
Microsoft.NET.Sdk.StaticWebAssets.Tasks (10)
Data\StaticWebAsset.cs (2)
327internal static void SortByRelatedAssetInPlace(Span<StaticWebAsset> assets) 376Span<StaticWebAsset> assets, HashSet<string> seen,
DefineStaticWebAssets.Cache.cs (2)
26Span<string> properties = [ 47Span<string> candidateAssetMetadata = [
Utils\Globbing\StaticWebAssetGlobMatcherBuilder.cs (2)
14public StaticWebAssetGlobMatcherBuilder AddIncludePatterns(params Span<string> patterns) 30public StaticWebAssetGlobMatcherBuilder AddExcludePatterns(params Span<string> patterns)
Utils\HashingUtils.cs (4)
12public static byte[] ComputeHash(MemoryStream memoryStream, Span<string> values) 29public static byte[] ComputeHash(MemoryStream memoryStream, Span<ITaskItem> items, params Span<string> properties) 54Span<string> metadata)
Microsoft.NET.Sdk.WorkloadManifestReader (1)
WorkloadManifestReader.SystemTextJson.cs (1)
47Span<byte> span;
Microsoft.Private.Windows.Core (79)
_generated\12\Windows.Win32.byte.InlineArrays.g.cs (1)
43 internal unsafe Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength);
_generated\127\Windows.Win32.IDispatch.g.cs (1)
93 internal unsafe winmdroot.Foundation.HRESULT GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\128\Windows.Win32.IDispatchEx.g.cs (1)
75 internal unsafe winmdroot.Foundation.HRESULT GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\137\Windows.Win32.IEnumFORMATETC.g.cs (1)
56 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.System.Com.FORMATETC> rgelt, uint* pceltFetched)
_generated\139\Windows.Win32.IEnumSTATDATA.g.cs (1)
56 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.System.Com.STATDATA> rgelt, uint* pceltFetched)
_generated\140\Windows.Win32.IEnumSTATSTG.g.cs (1)
56 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.System.Com.STATSTG> rgelt, uint* pceltFetched)
_generated\141\Windows.Win32.IEnumString.g.cs (1)
56 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.Foundation.PWSTR> rgelt, uint* pceltFetched)
_generated\153\Windows.Win32.IPictureDisp.g.cs (1)
76 internal unsafe winmdroot.Foundation.HRESULT GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\161\Windows.Win32.ITypeInfo.g.cs (1)
212 internal unsafe winmdroot.Foundation.HRESULT GetIDsOfNames(ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, Span<int> pMemId)
_generated\162\Windows.Win32.ITypeLib.g.cs (2)
192 internal unsafe winmdroot.Foundation.HRESULT IsName(ref Span<char>szNameBuf, uint lHashVal, out winmdroot.Foundation.BOOL pfName) 224 internal unsafe winmdroot.Foundation.HRESULT FindName(ref Span<char>szNameBuf, uint lHashVal, winmdroot.System.Com.ITypeInfo** ppTInfo, int* rgMemId, ref ushort pcFound)
_generated\192\Windows.Win32.PInvokeCore.GDI32.dll.g.cs (2)
438 internal static unsafe uint GetEnhMetaFileBits(winmdroot.Graphics.Gdi.HENHMETAFILE hEMF, Span<byte> lpData) 489 internal static unsafe uint GetPaletteEntries(winmdroot.Graphics.Gdi.HPALETTE hpal, uint iStart, Span<winmdroot.Graphics.Gdi.PALETTEENTRY> pPalEntries)
_generated\203\Windows.Win32.PSTR.g.cs (2)
63 internal Span<byte> AsSpan() => this.Value is null ? default(Span<byte>) : new Span<byte>(this.Value, this.Length);
_generated\204\Windows.Win32.PWSTR.g.cs (2)
63 internal Span<char> AsSpan() => this.Value is null ? default(Span<char>) : new Span<char>(this.Value, this.Length);
_generated\229\Windows.Win32.System_Com_IEnumFORMATETC_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Com.IEnumFORMATETC.Interface @this, Span<winmdroot.System.Com.FORMATETC> rgelt, uint* pceltFetched)
_generated\230\Windows.Win32.System_Com_IEnumSTATDATA_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Com.IEnumSTATDATA.Interface @this, Span<winmdroot.System.Com.STATDATA> rgelt, uint* pceltFetched)
_generated\231\Windows.Win32.System_Com_IEnumString_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Com.IEnumString.Interface @this, Span<winmdroot.Foundation.PWSTR> rgelt, uint* pceltFetched)
_generated\240\Windows.Win32.System_Com_ITypeInfo_Extensions.g.cs (1)
84 internal static unsafe winmdroot.Foundation.HRESULT GetIDsOfNames(this winmdroot.System.Com.ITypeInfo.Interface @this, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, Span<int> pMemId)
_generated\241\Windows.Win32.System_Com_ITypeLib_Extensions.g.cs (2)
64 internal static unsafe winmdroot.Foundation.HRESULT IsName(this winmdroot.System.Com.ITypeLib.Interface @this, ref Span<char>szNameBuf, uint lHashVal, out winmdroot.Foundation.BOOL pfName) 80 internal static unsafe winmdroot.Foundation.HRESULT FindName(this winmdroot.System.Com.ITypeLib.Interface @this, ref Span<char>szNameBuf, uint lHashVal, winmdroot.System.Com.ITypeInfo** ppTInfo, int* rgMemId, ref ushort pcFound)
_generated\242\Windows.Win32.System_Com_StructuredStorage_IEnumSTATSTG_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Com.StructuredStorage.IEnumSTATSTG.Interface @this, Span<winmdroot.System.Com.STATSTG> rgelt, uint* pceltFetched)
_generated\266\Windows.Win32.VariableLengthInlineArray.g.cs (1)
37 internal Span<T> AsSpan(int length)
_generated\37\Windows.Win32.char.InlineArrays.g.cs (2)
44 internal unsafe Span<char> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength); 108 internal unsafe Span<char> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength);
Framework\Windows\Win32\__char_32.cs (1)
9internal unsafe Span<char> AsSpan()
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\DecimalExtensions.cs (1)
17public static bool TryGetBits(decimal d, Span<int> destination, out int valuesWritten)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\BinaryReaderExtensions.cs (1)
24public int Read(Span<byte> buffer)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\StreamExtensions.cs (2)
29public int Read(Span<byte> buffer) 80public void ReadExactly(Span<byte> buffer)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\ISpanFormattable.cs (1)
24bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider);
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\StringExtensions.cs (4)
18public void CopyTo(Span<char> destination) 49Span<char> resultSpan = new(firstChar, result.Length); 69Span<char> resultSpan = new(firstChar, result.Length); 103Span<char> resultSpan = new(firstChar, result.Length);
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\Text\EncodingExtensions.cs (1)
16public unsafe int GetBytes(ReadOnlySpan<char> source, Span<byte> destination)
System\BufferScope.cs (8)
10/// were a <see cref="Span{T}"/>. 20private Span<T> _span; 32public BufferScope(Span<T> initialBuffer) 57public BufferScope(Span<T> initialBuffer, int minimumLength) 105public readonly Span<T> this[Range range] => _span[range]; 107public readonly Span<T> Slice(int start, int length) => _span.Slice(start, length); 113public readonly Span<T> AsSpan() => _span; 115public static implicit operator Span<T>(BufferScope<T> scope) => scope._span;
System\IO\BinaryReaderExtensions.cs (1)
122Span<byte> arrayData = new(a, array.Length * sizeof(T));
System\IO\Compression\RunLengthEncoder.cs (2)
58public static bool TryEncode(ReadOnlySpan<byte> data, Span<byte> encoded, out int written) 82public static bool TryDecode(ReadOnlySpan<byte> encoded, Span<byte> data, out int written)
System\IO\StreamExtensions.cs (1)
62Span<byte> span = new(buffer, size);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
53Span<int> ints = stackalloc int[4];
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (3)
359Span<char> fileBuffer = new( 404Span<char> span = buffer.AsCharSpan(); 423Span<byte> span = buffer.AsSpan();
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
317Span<char> fileName = stackalloc char[(int)PInvokeCore.MAX_PATH + 1];
System\Private\Windows\Ole\DataFormatsCore.cs (1)
102Span<char> buffer = stackalloc char[256];
System\SpanHelpers.cs (3)
13public static void CopyAndTerminate(this ReadOnlySpan<char> source, Span<char> destination) 40public static Span<char> SliceAtFirstNull(this Span<char> span)
System\SpanWriter.cs (5)
7/// Fast stack based <see cref="Span{T}"/> writer. 9internal ref struct SpanWriter<T>(Span<T> span) where T : unmanaged, IEquatable<T> 11private Span<T> _unwritten = span; 12public Span<T> Span { get; } = span; 97private static void UncheckedSlice(ref Span<T> span, int start, int length)
System\Text\ValueStringBuilder.cs (6)
21private Span<char> _chars; 32public ValueStringBuilder(Span<char> initialBuffer) 116public readonly Span<char> RawChars => _chars; 137public bool TryCopyTo(Span<char> destination, out int charsWritten) 265Span<char> dst = _chars.Slice(_pos, count); 282Span<char> dst = _chars.Slice(_pos, length);
Windows\Win32\Foundation\GlobalBuffer.cs (3)
14private Span<byte> _buffer; 48public readonly Span<byte> AsSpan() => _buffer; 50public readonly Span<char> AsCharSpan() => MemoryMarshal.Cast<byte, char>(_buffer);
Windows\Win32\Graphics\Gdi\ArgbBuffer.cs (1)
29public ArgbBuffer(Span<Color> colors) : this(colors.Length)
Windows\Win32\PInvokeCore.GetPaletteEntries.cs (1)
9public static unsafe uint GetPaletteEntries(HPALETTE hpal, Span<PALETTEENTRY> entries)
Windows\Win32\System\Com\ComManagedStream.cs (1)
124Span<byte> buffer = new(pv, checked((int)cb));
Windows\Win32\System\Com\SAFEARRAY.cs (1)
70public T GetValue<T>(Span<int> indices)
Windows\Win32\System\Com\SafeArrayScope.cs (2)
209Span<int> indices = [index]; 221Span<int> indices = [index];
Microsoft.TestPlatform.AdapterUtilities (1)
TestIdProvider.cs (1)
107var hashSlice = GetHash().AsSpan().Slice(0, 16);
Microsoft.Win32.Registry (3)
Microsoft\Win32\RegistryKey.cs (2)
768Span<char> nameSpan = stackalloc char[MaxKeyLength + 1]; 996Span<byte> span = stackalloc byte[512];
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
43Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit
mscorlib (1)
mscorlib.cs (1)
31[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
netstandard (1)
netstandard.cs (1)
2015[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
PresentationCore (16)
MS\Internal\TextFormatting\NumberSubstitution.cs (1)
498Span<char> twoChars = stackalloc char[2];
System\Windows\Input\TextCompositionManager.cs (2)
399Span<char> outputChars = stackalloc char[EncodingBufferLen]; // 4 855private static ReadOnlySpan<byte> ConvertCodeToByteArray(int codeEntry, Span<byte> destination)
System\Windows\Media\Color.cs (4)
422Span<float> sRGBValue = stackalloc float[3]; 539Span<float> sRGBValue = stackalloc float[3]; 1083Span<float> scRGBValue = stackalloc float[3]; 1098Span<float> sRGBValue = [this.sRgbColor.r / 255.0f, this.sRgbColor.g / 255.0f, this.sRgbColor.b / 255.0f];
System\Windows\Media\ColorTransform.cs (5)
86internal unsafe void Translate(Span<float> srcValue, Span<float> dstValue) 128private long ICM2Color(Span<float> srcValue) 139Span<UInt16> channel = stackalloc UInt16[4]; 161Span<byte> channel = stackalloc byte[8];
System\Windows\Media\PixelFormat.cs (2)
519Span<byte> guidBytes = stackalloc byte[16]; 566Span<byte> guidBytes = stackalloc byte[16];
System\Windows\Media\StreamAsIStream.cs (2)
263public int Read(Span<byte> buffer, out uint cbRead) 536var span = new Span<byte>(buffer.ToPointer(), (int) cb);
PresentationFramework (11)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (1)
500Span<Range> splitRegions = stackalloc Range[5];
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (1)
438Span<Range> splitRegions = stackalloc Range[3];
MS\Internal\AppModel\ResourceContainer.cs (2)
201Span<char> key = totalLength <= 256 ? stackalloc char[totalLength] : new char[totalLength]; 267Span<char> key = totalLength <= 256 ? stackalloc char[totalLength] : new char[totalLength];
MS\Internal\Ink\LassoSelectionBehavior.cs (1)
425return Span<Point>.Empty;
System\Windows\Annotations\Annotation.cs (1)
599Span<Range> segments = stackalloc Range[3];
System\Windows\Controls\VirtualizingStackPanel.cs (1)
11997Span<Range> splitRegions = stackalloc Range[4];
System\windows\Documents\SelectionWordBreaker.cs (1)
75Span<UInt16> charType3 = stackalloc UInt16[2];
System\Windows\Documents\TextStore.cs (1)
4662Span<Range> splitRegions = stackalloc Range[3];
System\Windows\ThemeDictionaryExtension.cs (1)
120Span<Range> splitRegions = stackalloc Range[3];
System\Windows\ThicknessConverter.cs (1)
189Span<double> lengths = stackalloc double[4];
ReachFramework (1)
Serialization\XpsFontSubsetter.cs (1)
680Span<byte> guidByteArray = stackalloc byte[16];
Roslyn.Diagnostics.Analyzers (48)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (6)
79protected abstract void GetCurrentHashCore(Span<byte> destination); 206public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 231public int GetCurrentHash(Span<byte> destination) 268public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 293public int GetHashAndReset(Span<byte> destination) 327protected virtual void GetHashAndResetCore(Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (4)
90public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 106public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 172protected override void GetCurrentHashCore(Span<byte> destination) 219private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (19)
315int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 711private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 944private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 962private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 975private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1020private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1079private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1096private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n) 1121private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1233public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1179Span<int> span = stackalloc int[StackAllocThreshold]; 1247Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1252Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1334Span<int> span = stackalloc int[StackAllocThreshold];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
79public static bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 83Span<char> tempBuffer = stackalloc char[4]; // Note: The tempBuffer size could be made larger than 4 but the size must be a multiple of 4. 173private static void CopyToTempBufferWithoutWhiteSpace(ReadOnlySpan<char> chars, Span<char> tempBuffer, out int consumed, out int charsWritten) 194private static bool TryDecodeFromUtf16(ReadOnlySpan<char> utf16, Span<byte> bytes, out int consumed, out int written)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74var lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89var targetLowerCaseCharacters = target.Length < 512
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
298=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
786Name: nameof(Span<>),
sdk-tasks (2)
ReplaceFilesWithSymbolicLinks.cs (2)
106Span<byte> span1 = new Span<byte>(ptr1, checked((int)accessor1.SafeMemoryMappedViewHandle.ByteLength)); 109Span<byte> span2 = new Span<byte>(ptr2, checked((int)accessor2.SafeMemoryMappedViewHandle.ByteLength));
Shared (10)
BufferWriterPool\BufferWriter.cs (4)
110/// Notifies <see cref="IBufferWriter{T}"/> that <paramref name="count"/> amount of data was written to the output <see cref="Span{T}"/>/<see cref="Memory{T}"/>. 146/// Returns a <see cref="Span{T}"/> to write to that is at least the requested length (specified by <paramref name="sizeHint"/>). 152/// This will never return an empty <see cref="Span{T}"/>. 158public Span<T> GetSpan(int sizeHint = 0)
RentedSpan\RentedSpan.cs (1)
93public Span<T> Span => _rentedBuffer != null ? _rentedBuffer.AsSpan(0, _length) : default;
ServerSentEvents\ArrayBuffer.cs (2)
90public readonly Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 95public readonly Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
ServerSentEvents\Helpers.cs (2)
52Span<byte> buffer = writer.GetSpan(value.Length); 66Span<byte> buffer = writer.GetSpan(maxByteCount);
ServerSentEvents\PooledByteBufferWriter.cs (1)
24public Span<byte> GetSpan(int sizeHint = 0)
System.Collections (4)
src\runtime\src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (3)
11private readonly Span<int> _span; 13internal BitHelper(Span<int> span, bool clear) 29Span<int> span = _span;
System\Collections\Generic\SortedSet.cs (1)
1388Span<int> span = stackalloc int[StackAllocThreshold];
System.Collections.Immutable (20)
System\Collections\Frozen\FrozenDictionary.cs (1)
383public void CopyTo(Span<KeyValuePair<TKey, TValue>> destination)
System\Collections\Frozen\FrozenHashTable.cs (3)
47public static FrozenHashTable Create(Span<int> hashCodes, bool hashCodesAreUnique = false) 66Span<int> bucketStarts = arrayPoolBuckets.AsSpan(0, numBuckets); 67Span<int> nexts = arrayPoolBuckets.AsSpan(numBuckets, hashCodes.Length);
System\Collections\Frozen\FrozenSet.cs (1)
280public void CopyTo(Span<T> destination) =>
System\Collections\Frozen\FrozenSetInternalBase.cs (1)
198Span<int> seenItems = intArrayLength <= 128 ?
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (1)
32Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length);
System\Collections\Frozen\ItemsFrozenSet.cs (1)
27Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length);
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (1)
29Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length);
System\Collections\Frozen\String\OrdinalStringFrozenDictionary.cs (1)
44Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, keys.Length);
System\Collections\Frozen\String\OrdinalStringFrozenSet.cs (1)
35Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length);
System\Collections\Immutable\ImmutableArray.cs (2)
109public static ImmutableArray<T> Create<T>(Span<T> items) 132public static ImmutableArray<T> ToImmutableArray<T>(this Span<T> items)
System\Collections\Immutable\ImmutableArray_1.Builder.cs (4)
451var elements = new Span<T>(_elements, offset, items.Length); 1015/// Copies the current contents to the specified <see cref="Span{T}"/>. 1017/// <param name="destination">The <see cref="Span{T}"/> to copy to.</param> 1018public void CopyTo(Span<T> destination)
System\Collections\Immutable\ImmutableArray_1.cs (3)
909/// Copies the elements of current <see cref="ImmutableArray{T}"/> to an <see cref="Span{T}"/>. 911/// <param name="destination">The <see cref="Span{T}"/> that is the destination of the elements copied from current <see cref="ImmutableArray{T}"/>.</param> 912public void CopyTo(Span<T> destination)
System.CommandLine (1)
Parsing\StringExtensions.cs (1)
210Span<char> candidate = ['-', '-'];
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\Base64StringAttribute.cs (1)
13/// using the <see cref="Convert.TryFromBase64String(string, Span{byte}, out int)"/> method.
System.ComponentModel.TypeConverter (6)
src\runtime\src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
61Span<Range> tokens = stackalloc Range[5];
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (1)
92public override int Read(Span<byte> buffer)
System\Drawing\PointConverter.cs (1)
39Span<Range> ranges = stackalloc Range[3];
System\Drawing\RectangleConverter.cs (1)
39Span<Range> ranges = stackalloc Range[5];
System\Drawing\SizeConverter.cs (1)
39Span<Range> ranges = stackalloc Range[3];
System\Drawing\SizeFConverter.cs (1)
39Span<Range> ranges = stackalloc Range[3];
System.Console (21)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\ConsolePal.Unix.ConsoleStream.cs (1)
42public override int Read(Span<byte> buffer) =>
System\ConsolePal.Unix.cs (5)
461Span<byte> readBytes = stackalloc byte[256]; 564static unsafe bool BufferUntil(byte toFind, ref Span<byte> dst, ref int dstPos, out int foundPos) 597static unsafe bool AppendToStdInReaderUntil(byte toFind, StdInReader reader, Span<byte> foundByteDst, ref int foundByteDstPos, out int foundPos) 946private static unsafe int Read(SafeFileHandle fd, Span<byte> buffer) 1130scoped Span<byte> data;
System\IO\CachedConsoleStream.cs (4)
23public override int Read(Span<byte> buffer) => throw Error.GetReadNotSupported(); 29Span<char> charSpan = (uint)maxCharCount <= 512 ? stackalloc char[512] : (pooledBuffer = ArrayPool<char>.Shared.Rent(maxCharCount)); 49private static void WriteOrCache(CachedConsoleStream stream, StringBuilder cache, Span<char> charBuffer) 54Span<char> lineSpan = charBuffer.Slice(0, lastNewLine);
System\IO\StdInReader.cs (3)
62Span<char> chars = (uint)maxCharsCount <= MaxStackAllocation ? 107public int ReadLine(Span<byte> buffer) 381Span<byte> bytes = stackalloc byte[32]; // 32 bytes seems ample
System\IO\SyncTextReader.Unix.cs (1)
43public int ReadLine(Span<byte> buffer) => Inner.ReadLine(buffer);
System\TermInfo.DatabaseFactory.cs (1)
110Span<char> stackBuffer = stackalloc char[256];
System.Data.Common (34)
System\Data\SQLTypes\SQLBytes.cs (5)
284internal long Read(long offset, Span<byte> buffer) 316private long ReadNoValidation(long offset, Span<byte> buffer) 422Span<byte> span = _rgbBuf.AsSpan((int)offset, buffer.Length); 720public override int Read(Span<byte> buffer) 736private int ReadNoValidation(Span<byte> buffer)
System\Data\SQLTypes\SQLDecimal.cs (25)
493Span<int> bits = [0, 0, 0, 0]; 930Span<uint> rgulNumeric = [_data1, _data2, _data3, _data4]; 932Span<char> pszTmp = stackalloc char[s_NUMERIC_MAX_PRECISION + 1]; //Local Character buffer to hold 1165public int WriteTdsValue(Span<uint> destination) 1296Span<uint> rglData1 = [x._data1, x._data2, x._data3, x._data4]; 1297Span<uint> rglData2 = [y._data1, y._data2, y._data3, y._data4]; 1345Span<uint> rguiTemp = rglData2; 1488Span<uint> rgulRes = stackalloc uint[x_culNumeMultRes]; //new [] are already initialized to zero 1716Span<uint> rgulData1 = [x._data1, x._data2, x._data3, x._data4]; 1717Span<uint> rgulData2 = [y._data1, y._data2, y._data3, y._data4]; 1720Span<uint> rgulR = stackalloc uint[s_cNumeMax + 1]; 1721Span<uint> rgulQ = stackalloc uint[s_cNumeMax]; 1864private static void ZeroToMaxLen(Span<uint> rgulData, int cUI4sCur) 1938private static bool FGt10_38(Span<uint> rglData) 2095Span<uint> rgulU = [_data1, _data2, _data3, _data4]; 2126Span<uint> rguiData = [_data1, _data2, _data3, _data4]; 2171Span<uint> rguiData = [_data1, _data2, _data3, _data4]; 2231Span<uint> rguiData = [_data1, _data2, _data3, _data4]; 2465Span<uint> rgulD, // Out | Destination number 2481Span<uint> rgulD, // Out | Number 2506Span<uint> piulD, // InOut| D 2538Span<uint> rgulU, // InOut| U 2602Span<uint> rgulD, // InOut | D 2604Span<uint> rgulQ, // Out | Q 2606Span<uint> rgulR, // Out | R
System\Data\SQLTypes\SQLGuid.cs (2)
122Span<byte> xBytes = stackalloc byte[SizeOfGuid]; 126Span<byte> yBytes = stackalloc byte[SizeOfGuid];
System\Data\SQLTypes\SqlXml.cs (1)
414public override int Read(Span<byte> buffer)
System\Data\XDRSchema.cs (1)
301Span<System.Range> parts = stackalloc System.Range[3];
System.Data.OleDb (2)
SafeHandles.cs (2)
279var dstSpan = new System.Span<byte>(dst.ToPointer(), count); 280var srcSpan = new System.Span<byte>(src.ToPointer(), count);
System.Diagnostics.DiagnosticSource (43)
src\runtime\src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (2)
121private Span<ulong> _bitMap; 123public BitMapper(Span<ulong> bitMap)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Diagnostics\Activity.cs (8)
246Span<char> flagsChars = ['\0', '\0']; 278Span<char> flagsChars = ['\0', '\0']; 1957Span<byte> span = stackalloc byte[sizeof(ulong) * 2]; 2027Span<ulong> span = [0, 0]; 2059public void CopyTo(Span<byte> destination) 2068internal static void SetToRandomBytes(Span<byte> outBytes) 2085internal static void SetSpanFromHexChars(ReadOnlySpan<char> charData, Span<byte> outBytes) 2227public void CopyTo(Span<byte> destination)
System\Diagnostics\Activity.GenerateRootId.netcoreapp.cs (1)
17Span<char> result = stackalloc char[1 + 16 + s_uniqSuffix.Length]; // max length needed
System\Diagnostics\DsesSamplerBuilder.cs (1)
48Span<byte> traceIdBytes = stackalloc byte[16];
System\Diagnostics\Metrics\AggregatorStore.cs (3)
449Span<object?> indexedValues = values.AsSpan(); 491Span<string> indexedNames = kvName.Key.AsSpan(); 498Span<object?> indexedValues = kvValue.Key.AsSpan();
System\Diagnostics\Metrics\ObjectSequence.netcore.cs (5)
11Span<object?> AsSpan(); 16public Span<object?> AsSpan() 24public Span<object?> AsSpan() 34public Span<object?> AsSpan() 45public Span<object?> AsSpan()
System\Diagnostics\Metrics\StringSequence.cs (1)
87public Span<string> AsSpan() =>
System\Diagnostics\Metrics\StringSequence.netcore.cs (4)
11Span<string> AsSpan(); 17public Span<string> AsSpan() 25public Span<string> AsSpan() 35public Span<string> AsSpan()
System\Diagnostics\Metrics\TagList.netcore.cs (4)
42scoped Span<KeyValuePair<string, object?>> tags = _tagsCount <= InlineTags.Length ? 141public readonly void CopyTo(Span<KeyValuePair<string, object?>> tags) 204Span<KeyValuePair<string, object?>> tags = _tags; 221Span<KeyValuePair<string, object?>> tags = _overflowTags is not null ? _overflowTags : _tags;
System.Diagnostics.EventLog (8)
_generated\0\LibraryImports.g.cs (3)
1381global::System.Span<global::System.IntPtr> __valuePaths_native__nativeSpan = __valuePaths_native__marshaller.GetUnmanagedValuesDestination(); 1549internal static partial bool EvtFormatMessage(global::System.Diagnostics.Eventing.Reader.EventLogHandle publisherMetadataHandle, global::System.Diagnostics.Eventing.Reader.EventLogHandle eventHandle, uint messageId, int valueCount, global::Microsoft.Win32.UnsafeNativeMethods.EvtStringVariant[] values, global::Microsoft.Win32.UnsafeNativeMethods.EvtFormatMessageFlags flags, int bufferSize, global::System.Span<char> buffer, out int bufferUsed) 1570global::System.Span<global::Microsoft.Win32.UnsafeNativeMethods.EvtStringVariant.Marshaller.Native> __values_native__nativeSpan = __values_native__marshaller.GetUnmanagedValuesDestination();
System\Diagnostics\Reader\NativeWrapper.cs (4)
485Span<char> emptyBuffer = ['\0']; // issue: https://github.com/dotnet/runtime/issues/100198 937Span<char> emptyBuffer = ['\0']; // issue: https://github.com/dotnet/runtime/issues/100198 990Span<char> emptyBuffer = ['\0']; // issue: https://github.com/dotnet/runtime/issues/100198 1077Span<char> emptyBuffer = ['\0']; // issue: https://github.com/dotnet/runtime/issues/100198
System\Diagnostics\Reader\UnsafeNativeMethods.cs (1)
775Span<char> buffer,
System.Diagnostics.FileVersionInfo (1)
System\Diagnostics\FileVersionInfo.Unix.cs (1)
204Span<Range> parts = stackalloc Range[5];
System.Diagnostics.PerformanceCounter (3)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
43Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.GetComputerName.cs (1)
19Span<char> buffer = stackalloc char[MAX_COMPUTERNAME_LENGTH + 1];
System\Diagnostics\PerformanceData\CounterSet.cs (1)
211Span<byte> CounterSetBuffer = CounterSetInfoSize > 512 ? new byte[(int)CounterSetInfoSize] : stackalloc byte[(int)CounterSetInfoSize];
System.Diagnostics.Process (20)
src\runtime\src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (1)
390Span<Range> lineParts = stackalloc Range[4];
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (5)
51scoped Span<int> inheritedFds = default; 132Span<nint> pointers = new Span<nint>(block, count + 1); 133Span<byte> data = new Span<byte>(dataPtr, dataByteLength); 175Span<nint> pointers = new Span<nint>(block, count + 1); 176Span<byte> data = new Span<byte>(dataPtr, dataByteLength);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetGroupList.cs (1)
19Span<uint> groups = stackalloc uint[InitialGroupsLength];
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (1)
24Span<uint> groups = stackalloc uint[InitialGroupsLength];
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
36Span<byte> spanBuffer = stackalloc byte[StackBufferSize];
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (1)
33public void FromManaged(ReadOnlySpan<char> managed, Span<byte> buffer)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Diagnostics\Process.Linux.cs (1)
244Span<byte> buffer = stackalloc byte[512];
System\Diagnostics\Process.Multiplexing.Unix.cs (3)
132Span<Interop.PollEvent> pollFds, 168Span<Interop.PollEvent> pollFds, 281Span<Interop.PollEvent> pollFds = stackalloc Interop.PollEvent[2];
System.Diagnostics.TextWriterTraceListener (3)
System\Diagnostics\XmlWriterTraceListener.cs (3)
397Span<char> span = stackalloc char[20]; // max length of longest formatted long with invariant culture 409Span<char> span = stackalloc char[38]; // length of a Guid formatted as "B" 421Span<char> span = stackalloc char[33]; // max length of a DateTime formatted as "o"
System.Diagnostics.TraceSource (1)
System\Diagnostics\TraceListener.cs (1)
418Span<char> stackBuffer = stackalloc char[128];
System.DirectoryServices.Protocols (4)
System\DirectoryServices\Protocols\common\AsnWriterExtensions.cs (1)
23Span<byte> tmpValue = octetStringLength <= StackAllocationThreshold
System\DirectoryServices\Protocols\common\DirectoryControl.cs (3)
151Span<byte> attributeNameScratchSpace = stackalloc byte[AttributeNameStackAllocationThreshold]; 161Span<byte> asnSpan = value; 244scoped Span<byte> attributeNameBuffer;
System.Drawing.Common (23)
_generated\3\Windows.Win32.byte.InlineArrays.g.cs (1)
43 internal unsafe Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength);
System\Drawing\BufferedGraphicsContext.cs (1)
269Span<RGBQUAD> rgbQuads = new((RGBQUAD*)&bitmapInfo->bmiColors, colorCount);
System\Drawing\Drawing2D\GraphicsPath.cs (2)
965int GetPathTypes(Span<byte> destination) 1010int GetPathPoints(Span<PointF> destination)
System\Drawing\Drawing2D\GraphicsPathIterator.cs (4)
160unsafe int Enumerate(Span<PointF> points, Span<byte> types) 207unsafe int CopyData(Span<PointF> points, Span<byte> types, int startIndex, int endIndex)
System\Drawing\Drawing2D\Matrix.cs (2)
145internal void GetElements(Span<float> elements) 164Span<float> elements = stackalloc float[6];
System\Drawing\Font.cs (1)
319Span<char> faceName = logFont.lfFaceName;
System\Drawing\FontFamily.cs (3)
189Span<char> name = stackalloc char[(int)PInvokeCore.LF_FACESIZE]; 231Span<char> name = stackalloc char[(int)PInvokeCore.LF_FACESIZE]; 236private unsafe void GetName(Span<char> span, ushort language)
System\Drawing\Imaging\Effects\ColorLookupTableEffect.cs (1)
46Span<byte> bytes = _bytes;
System\Drawing\Imaging\EncoderParameters.cs (2)
25Span<GdiPlus.EncoderParameter> parameters = native->Parameters; 42var nativeParameters = native->Parameters;
System\Drawing\Interop\LOGFONT.cs (1)
38public Span<char> lfFaceName => MemoryMarshal.CreateSpan(ref _lfFaceName[0], (int)PInvokeCore.LF_FACESIZE);
System\Drawing\Printing\PrinterSettings.cs (5)
740Span<char> names = new((char*)devnames, sizeInChars); 865Span<ushort> kinds = stackalloc ushort[count]; 875Span<Size> sizes = stackalloc Size[count]; 921Span<ushort> kinds = stackalloc ushort[count]; 965Span<Point> resolutions = stackalloc Point[count];
System.Drawing.Primitives (1)
src\runtime\src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
61Span<Range> tokens = stackalloc Range[5];
System.Formats.Asn1 (65)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (4)
46internal Span<byte> Span { get; private set; } 69Span<byte> toClear = Span.Slice(0, clearSize); 95Span<byte> currentBuffer, 109Span<byte> currentBuffer,
System\Formats\Asn1\Asn1Tag.cs (5)
269/// <seealso cref="TryEncode(Span{byte},out int)"/> 301/// <see langword="false"/> if <paramref name="destination"/>.<see cref="Span{T}.Length"/> &lt; 304public bool TryEncode(Span<byte> destination, out int bytesWritten) 360/// <paramref name="destination"/>.<see cref="Span{T}.Length"/> &lt; <see cref="CalculateEncodedSize"/>. 362public int Encode(Span<byte> destination)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (8)
41protected abstract int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool write); 42protected abstract int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool write); 65return GetBytes(chars, Span<byte>.Empty, write: false); 100return GetChars(bytes, Span<char>.Empty, write: false); 211protected override int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool write) 239protected override int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool write) 278protected override int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool write) 313protected override int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool write)
System\Formats\Asn1\AsnDecoder.BitString.cs (12)
158Span<byte> destination, 397Span<byte> destination); 402Span<byte> destination) 419Span<byte> destination = Span<byte>.Empty; 434Span<byte> destination, 440Span<byte> tmpDest = destination; 455Span<byte> destination, 469Span<byte> curDest = destination; 590Span<byte> dest, 782Span<byte> destination, 951Span<byte> destination,
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (1)
59Span<byte> tmpSpace = stackalloc byte[StackBufSize];
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (3)
198Span<byte> stackSpan = stackalloc byte[sizeof(ulong)]; 353Span<byte> valueSpan = rented.AsSpan(0, written); 393internal static void ReverseBitsPerByte(Span<byte> value)
System\Formats\Asn1\AsnDecoder.OctetString.cs (9)
63Span<byte> destination, 293Span<byte>.Empty, 310Span<byte> destination, 327Span<byte> destination, 339Span<byte> curDest = destination; 455Span<byte> dest, 483Span<byte> tmpSpace = default) 573Span<byte> destination, 721Span<byte> destination,
System\Formats\Asn1\AsnDecoder.Oid.cs (2)
182Span<byte> writeSpan = tmpBytes; 183Span<byte> accumValueBytes = stackalloc byte[sizeof(long)];
System\Formats\Asn1\AsnDecoder.Text.cs (8)
145Span<byte> destination, 242Span<char> destination, 337Span<byte> destination, 429Span<char> destination, 594Span<byte> destination, 662Span<char> destination, 828Span<byte> destination, 896Span<char> destination,
System\Formats\Asn1\AsnDecoder.UtcTime.cs (1)
83Span<byte> tmpSpace = stackalloc byte[17];
System\Formats\Asn1\AsnWriter.BitString.cs (1)
161Span<byte> dest;
System\Formats\Asn1\AsnWriter.cs (3)
137public bool TryEncode(Span<byte> destination, out int bytesWritten) 172public int Encode(Span<byte> destination) 687Span<byte> dest = _buffer.AsSpan(start + requiredPadding, containedLength);
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (2)
70scoped Span<byte> fraction = default; 121Span<byte> baseSpan = _buffer.AsSpan(_offset);
System\Formats\Asn1\AsnWriter.NamedBitList.cs (2)
149Span<byte> temp = stackalloc byte[sizeof(ulong)]; 207Span<byte> valueSpan = rented.AsSpan(0, requiredBytes);
System\Formats\Asn1\AsnWriter.OctetString.cs (1)
141Span<byte> dest;
System\Formats\Asn1\AsnWriter.Oid.cs (1)
188private static int EncodeSubIdentifier(Span<byte> dest, ref BigInteger subIdentifier)
System\Formats\Asn1\AsnWriter.Text.cs (1)
99Span<byte> dest = _buffer.AsSpan(_offset, size);
System\Formats\Asn1\AsnWriter.UtcTime.cs (1)
98Span<byte> baseSpan = _buffer.AsSpan(_offset);
System.Formats.Cbor (23)
src\runtime\src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
21public override Span<T> GetSpan()
System\Formats\Cbor\CborHelpers.netcoreapp.cs (3)
21public static void GetBitsFromDecimal(decimal d, Span<int> destination) 40public static unsafe void WriteSingleBigEndian(Span<byte> destination, float value) 44public static unsafe void WriteDoubleBigEndian(Span<byte> destination, double value)
System\Formats\Cbor\Reader\CborReader.String.cs (6)
62public bool TryReadByteString(Span<byte> destination, out int bytesWritten) 218public bool TryReadTextString(Span<char> destination, out int charsWritten) 336Span<byte> target = output; 351private bool TryReadIndefiniteLengthByteStringConcatenated(Span<byte> destination, out int bytesWritten) 397static void BuildString(Span<char> target, (List<(int Offset, int Length)> ranges, ReadOnlyMemory<byte> source, Encoding utf8Encoding) input) 411private bool TryReadIndefiniteLengthTextStringConcatenated(Span<char> destination, out int charsWritten)
System\Formats\Cbor\Writer\CborWriter.Array.cs (1)
83Span<byte> target = _buffer.AsSpan(_frameOffset + bytesToShift, currentOffset - _frameOffset);
System\Formats\Cbor\Writer\CborWriter.cs (2)
189public int Encode(Span<byte> destination) 207public bool TryEncode(Span<byte> destination, out int bytesWritten)
System\Formats\Cbor\Writer\CborWriter.Map.cs (5)
159Span<byte> source = _buffer.AsSpan(); 162Span<byte> tmpSpan = tempBuffer.AsSpan(0, totalMapPayloadEncodingLength); 164Span<byte> s = tmpSpan; 270private Span<byte> GetKeyEncoding((int Offset, int Length) range) 275private Span<byte> GetKeyEncoding(in KeyValuePairEncodingRange range)
System\Formats\Cbor\Writer\CborWriter.String.cs (3)
206Span<byte> buffer = _buffer.AsSpan(); 210Span<byte> tempSpan = tempBuffer.AsSpan(0, definiteLength); 212Span<byte> s = tempSpan;
System\Formats\Cbor\Writer\CborWriter.Tag.cs (2)
145Span<int> buf = [0, 0, 0, 0]; 157Span<int> buf = [0, 0, 0, 0];
System.Formats.Nrbf (6)
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (6)
131Span<T> valuesToRead = result.AsSpan(); 136Span<byte> resultAsBytes = MemoryMarshal.AsBytes<T>(valuesToRead.Slice(0, sliceSize)); 164Span<short> span = MemoryMarshal.Cast<T, short>(result.AsSpan()); 176Span<int> span = MemoryMarshal.Cast<T, int>(result.AsSpan()); 188Span<long> span = MemoryMarshal.Cast<T, long>(result.AsSpan()); 204Span<byte> resultAsBytes = MemoryMarshal.AsBytes<T>(result.AsSpan());
System.Formats.Tar (49)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Formats\Tar\GnuSparseStream.cs (2)
176public override int Read(Span<byte> destination) 293private int ReadFromPackedData(Span<byte> destination, long packedOffset)
System\Formats\Tar\SeekableSubReadStream.cs (1)
43public override int Read(Span<byte> destination)
System\Formats\Tar\SubReadStream.cs (1)
112public override int Read(Span<byte> destination)
System\Formats\Tar\TarHeader.Read.cs (3)
25Span<byte> buffer = stackalloc byte[TarHelpers.RecordSize]; 691Span<byte> span = (ulong)size <= 256 ? 765Span<byte> span = (ulong)size <= 256 ?
System\Formats\Tar\TarHeader.Write.cs (34)
37private void WriteWithSeekableDataStream(TarEntryFormat format, Stream archiveStream, Span<byte> buffer) 69private void WriteWithUnseekableDataStream(TarEntryFormat format, Stream destinationStream, Span<byte> buffer, bool shouldAdvanceToEnd) 173private void WriteV7FieldsToBuffer(Span<byte> buffer) 183private void WriteUstarFieldsToBuffer(Span<byte> buffer) 196internal void WriteAsPaxGlobalExtendedAttributes(Stream archiveStream, Span<byte> buffer, int globalExtendedAttributesEntryNumber) 221internal void WriteAsV7(Stream archiveStream, Span<byte> buffer) 248internal void WriteAsUstar(Stream archiveStream, Span<byte> buffer) 277internal void WriteAsPax(Stream archiveStream, Span<byte> buffer) 371internal void WriteAsGnu(Stream archiveStream, Span<byte> buffer) 482private void WriteGnuFieldsToBuffer(Span<byte> buffer) 494private void WriteAsPaxExtendedAttributes(Stream archiveStream, Span<byte> buffer, Dictionary<string, string> extendedAttributes, bool isGea, int globalExtendedAttributesEntryNumber) 525private void WritePaxFieldsToBuffer(Span<byte> buffer) 536private void WriteFieldsToBuffer(TarEntryFormat format, Span<byte> buffer) 557private int WriteName(Span<byte> buffer) 579private unsafe int WriteUstarName(Span<byte> buffer) 590Span<byte> encodingBuffer = stackalloc byte[MaxPathName]; 645private int WriteCommonFields(Span<byte> buffer, TarEntryType actualEntryType) 716private static int WritePosixMagicAndVersion(Span<byte> buffer) 724private static int WriteGnuMagicAndVersion(Span<byte> buffer) 732private int WritePosixAndGnuSharedFields(Span<byte> buffer) 786private int WriteGnuFields(Span<byte> buffer) 817Span<byte> zeros = stackalloc byte[TarHelpers.RecordSize]; 869Span<byte> span = stackalloc byte[512]; 958private static unsafe int WriteChecksum(int checksum, Span<byte> buffer) 964Span<byte> converted = stackalloc byte[FieldLengths.Checksum]; 968Span<byte> destination = buffer.Slice(FieldLocations.Checksum, FieldLengths.Checksum); 995private static int WriteLeftAlignedBytesAndGetChecksum(ReadOnlySpan<byte> bytesToWrite, Span<byte> destination) 1009private static int WriteRightAlignedBytesAndGetChecksum(ReadOnlySpan<byte> bytesToWrite, Span<byte> destination) 1069private int FormatNumeric(int value, Span<byte> destination) 1094private int FormatNumeric(long value, Span<byte> destination) 1120private static unsafe int FormatOctal(long value, Span<byte> destination) 1123Span<byte> digits = stackalloc byte[32]; // longer than any possible octal formatting of a ulong 1139private int WriteAsTimestamp(DateTimeOffset timestamp, Span<byte> destination) 1152private static int WriteAsUtf8String(ReadOnlySpan<char> text, Span<byte> buffer)
System\Formats\Tar\TarWriter.cs (2)
319Span<byte> buffer = stackalloc byte[TarHelpers.RecordSize]; 384Span<byte> emptyRecord = stackalloc byte[TarHelpers.RecordSize];
System.IO.Compression (91)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (2)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
System\IO\Compression\DeflateDecoder.cs (2)
56public OperationStatus Decompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten) 116public static bool TryDecompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten)
System\IO\Compression\DeflateEncoder.cs (5)
189public OperationStatus Compress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) 259public OperationStatus Flush(Span<byte> destination, out int bytesWritten) 306public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 317public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality) 329public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality, int windowLog)
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (1)
101public override int Read(Span<byte> buffer)
System\IO\Compression\DeflateManaged\HuffmanTree.cs (2)
117Span<uint> bitLengthCount = stackalloc uint[17]; 125Span<uint> nextCode = stackalloc uint[17];
System\IO\Compression\DeflateManaged\InflaterManaged.cs (1)
104public int Inflate(Span<byte> bytes)
System\IO\Compression\DeflateManaged\InputBuffer.cs (1)
79Span<byte> span = _buffer.Span;
System\IO\Compression\DeflateManaged\OutputWindow.cs (1)
121public int CopyTo(Span<byte> output)
System\IO\Compression\DeflateZLib\DeflateStream.cs (2)
290public override int Read(Span<byte> buffer) 305internal int ReadCore(Span<byte> buffer)
System\IO\Compression\DeflateZLib\Inflater.cs (1)
69public unsafe int Inflate(Span<byte> destination)
System\IO\Compression\GZipDecoder.cs (2)
47public OperationStatus Decompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten) 60public static bool TryDecompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten)
System\IO\Compression\GZipEncoder.cs (5)
104public OperationStatus Compress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) 116public OperationStatus Flush(Span<byte> destination, out int bytesWritten) 129public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 140public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality) 152public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality, int windowLog)
System\IO\Compression\GZipStream.cs (1)
103public override int Read(Span<byte> buffer)
System\IO\Compression\ZipArchive.cs (1)
611Span<byte> fileBuffer = arrayPoolArray.AsSpan();
System\IO\Compression\ZipArchiveEntry.cs (11)
629private void WriteCentralDirectoryFileHeaderPrepare(Span<byte> cdStaticHeader, uint compressedSizeTruncated, uint uncompressedSizeTruncated, ushort extraFieldLength, uint offsetOfLocalHeaderTruncated) 674Span<byte> cdStaticHeader = stackalloc byte[ZipCentralDirectoryFileHeader.BlockConstantSectionSize]; 1188private void WriteLocalFileHeaderPrepare(Span<byte> lfStaticHeader, uint crc32, uint compressedSizeTruncated, uint uncompressedSizeTruncated, ushort extraFieldLength) 1207Span<byte> lfStaticHeader = stackalloc byte[ZipLocalFileHeader.SizeOfLocalHeader]; 1310Span<byte> writeBuffer = stackalloc byte[Zip64DataDescriptorCrcAndSizesBufferLength]; 1369private void WriteCrcAndSizesInLocalHeaderPrepareForZip64PretendStreaming(Span<byte> writeBuffer) 1383private void WriteCrcAndSizesInLocalHeaderPrepareFor32bitValuesWriting(bool pretendStreaming, Span<byte> writeBuffer, uint compressedSizeTruncated, uint uncompressedSizeTruncated) 1403private void WriteCrcAndSizesInLocalHeaderPrepareForWritingWhenZip64HeaderUsed(Span<byte> writeBuffer) 1415private void WriteCrcAndSizesInLocalHeaderPrepareForWritingDataDescriptor(Span<byte> writeBuffer) 1433Span<byte> dataDescriptor = stackalloc byte[MaxSizeOfDataDescriptor]; 1438private int PrepareToWriteDataDescriptor(Span<byte> dataDescriptor)
System\IO\Compression\ZipBlocks.cs (24)
32Span<byte> extraFieldHeader = stackalloc byte[SizeOfHeader]; 38private void WriteBlockCore(Span<byte> extraFieldHeader) 367public void WriteBlockCore(Span<byte> extraFieldData) 400Span<byte> extraFieldData = stackalloc byte[TotalSize]; 419private static bool TryReadBlockCore(Span<byte> blockContents, int bytesRead, [NotNullWhen(returnValue: true)] out Zip64EndOfCentralDirectoryLocator? zip64EOCDLocator) 439Span<byte> blockContents = stackalloc byte[TotalSize]; 448private static void WriteBlockCore(Span<byte> blockContents, long zip64EOCDRecordStart) 461Span<byte> blockContents = stackalloc byte[TotalSize]; 487private static bool TryReadBlockCore(Span<byte> blockContents, int bytesRead, [NotNullWhen(returnValue: true)] out Zip64EndOfCentralDirectoryRecord? zip64EOCDRecord) 518Span<byte> blockContents = stackalloc byte[BlockConstantSectionSize]; 528private static void WriteBlockCore(Span<byte> blockContents, long numberOfEntries, long startOfCentralDirectory, long sizeOfCentralDirectory) 550Span<byte> blockContents = stackalloc byte[BlockConstantSectionSize]; 572private static void GetExtraFieldsCore(Span<byte> fixedHeaderBuffer, int relativeFilenameLengthLocation, int relativeExtraFieldLengthLocation, out ushort filenameLength, out ushort extraFieldLength) 578private static List<ZipGenericExtraField> GetExtraFieldPostReadWork(Span<byte> extraFieldBuffer, out byte[] trailingData) 590Span<byte> fixedHeaderBuffer = stackalloc byte[FieldLengths.FilenameLength + FieldLengths.ExtraFieldLength]; 599Span<byte> extraFieldBuffer = extraFieldLength <= StackAllocationThreshold ? stackalloc byte[StackAllocationThreshold].Slice(0, extraFieldLength) : arrayPoolBuffer.AsSpan(0, extraFieldLength); 616private static bool TrySkipBlockCore(Stream stream, Span<byte> blockBytes, int bytesRead, long currPosition) 638private static bool TrySkipBlockFinalize(Stream stream, Span<byte> blockBytes, int bytesRead) 663Span<byte> blockBytes = stackalloc byte[FieldLengths.Signature]; 818Span<byte> collatedHeader = dynamicHeaderSize <= StackAllocationThreshold ? stackalloc byte[StackAllocationThreshold].Slice(0, dynamicHeaderSize) : arrayPoolBuffer.AsSpan(0, dynamicHeaderSize); 872private static void WriteBlockInitialize(Span<byte> blockContents, long numberOfEntries, long startOfCentralDirectory, long sizeOfCentralDirectory, byte[] archiveComment) 902Span<byte> blockContents = stackalloc byte[TotalSize]; 913private static bool TryReadBlockInitialize(Stream stream, Span<byte> blockContents, int bytesRead, [NotNullWhen(returnValue: true)] out ZipEndOfCentralDirectoryBlock? eocdBlock, out bool readComment) 961Span<byte> blockContents = stackalloc byte[TotalSize];
System\IO\Compression\ZipCustomStreams.cs (3)
105public override int Read(Span<byte> buffer) 352public override int Read(Span<byte> destination) 788public override int Read(Span<byte> buffer)
System\IO\Compression\ZipHelper.cs (2)
106Span<byte> bufferSpan = buffer.AsSpan(0, BackwardsSeekingBufferSize); 165private static int SeekBackwardsAndRead(Stream stream, Span<byte> buffer, int overlap)
System\IO\Compression\ZLibDecoder.cs (2)
47public OperationStatus Decompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten) 60public static bool TryDecompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten)
System\IO\Compression\ZLibEncoder.cs (5)
96public OperationStatus Compress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) 108public OperationStatus Flush(Span<byte> destination, out int bytesWritten) 121public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 132public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality) 144public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality, int windowLog)
System\IO\Compression\ZLibStream.cs (1)
147public override int Read(Span<byte> buffer)
System\IO\Compression\Zstandard\ZstandardDecoder.cs (3)
129public OperationStatus Decompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten) 241public static bool TryDecompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 278public static bool TryDecompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, ZstandardDictionary dictionary)
System\IO\Compression\Zstandard\ZstandardDictionary.cs (1)
108Span<nuint> lengthsAsNuint = MemoryMarshal.Cast<byte, nuint>(lengthsArray.AsSpan(0, sampleLengths.Length * Unsafe.SizeOf<nuint>()));
System\IO\Compression\Zstandard\ZstandardEncoder.cs (7)
202public OperationStatus Compress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) 224public OperationStatus Flush(Span<byte> destination, out int bytesWritten) 232private OperationStatus CompressCore(ReadOnlySpan<byte> source, Span<byte> destination, 314public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 327public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality, int windowLog) 341public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, ZstandardDictionary dictionary, int windowLog) 347internal static bool TryCompressCore(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality, int windowLog, ZstandardDictionary? dictionary)
System\IO\Compression\Zstandard\ZstandardStream.Compress.cs (2)
114Span<byte> output = _buffer.AvailableSpan; 325WriteCore(Span<byte>.Empty, flush: true);
System\IO\Compression\Zstandard\ZstandardStream.Decompress.cs (3)
35private bool TryDecompress(Span<byte> destination, out int bytesWritten, out OperationStatus lastResult) 104public override int Read(Span<byte> buffer) 266Span<byte> singleByte = [0];
System.IO.Compression.Brotli (11)
System\IO\Compression\dec\BrotliDecoder.cs (2)
55public OperationStatus Decompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten) 114public static unsafe bool TryDecompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten)
System\IO\Compression\dec\BrotliStream.Decompress.cs (2)
58public override int Read(Span<byte> buffer) 204private bool TryDecompress(Span<byte> destination, out int bytesWritten, out OperationStatus lastResult)
System\IO\Compression\enc\BrotliEncoder.cs (5)
129public OperationStatus Flush(Span<byte> destination, out int bytesWritten) => Compress(ReadOnlySpan<byte>.Empty, destination, out _, out bytesWritten, BrotliEncoderOperation.Flush); 140public OperationStatus Compress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) => Compress(source, destination, out bytesConsumed, out bytesWritten, isFinalBlock ? BrotliEncoderOperation.Finish : BrotliEncoderOperation.Process); 142internal OperationStatus Compress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, BrotliEncoderOperation operation) 192public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) => TryCompress(source, destination, out bytesWritten, BrotliUtils.Quality_Default, BrotliUtils.WindowBits_Default); 201public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality, int window)
System\IO\Compression\enc\BrotliStream.Compress.cs (2)
86Span<byte> output = new Span<byte>(_buffer); 194Span<byte> output = new Span<byte>(_buffer);
System.IO.FileSystem.AccessControl (7)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
43Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System.IO.FileSystem.Watcher (11)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\IO\FileSystemWatcher.Linux.cs (5)
531Span<char> pathBuffer = stackalloc char[PATH_MAX]; 974public ReadOnlySpan<char> GetName(Span<char> pathBuffer) 977public ReadOnlySpan<char> GetOldName(Span<char> pathBuffer) 1355internal ReadOnlySpan<char> GetPath(ReadOnlySpan<char> childName, Span<char> pathBuffer, bool fullPath = false) 1375void Append(Span<char> pathBuffer, ReadOnlySpan<char> path)
System.IO.Hashing (42)
System\IO\Hashing\Adler32.cs (4)
80protected override void GetCurrentHashCore(Span<byte> destination) 87protected override void GetHashAndResetCore(Span<byte> destination) 142public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 164public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination)
System\IO\Hashing\Crc32.cs (8)
96protected override void GetCurrentHashCore(Span<byte> destination) 105protected override void GetHashAndResetCore(Span<byte> destination) 193public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) => 216Span<byte> destination, 227Span<byte> destination, 251public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination) => 267public static int Hash(Crc32ParameterSet parameterSet, ReadOnlySpan<byte> source, Span<byte> destination) 274private static int HashCore(Crc32ParameterSet parameterSet, ReadOnlySpan<byte> source, Span<byte> destination)
System\IO\Hashing\Crc32ParameterSet.cs (1)
74internal void WriteCrcToSpan(uint crc, Span<byte> destination)
System\IO\Hashing\Crc64.cs (8)
105protected override void GetCurrentHashCore(Span<byte> destination) 114protected override void GetHashAndResetCore(Span<byte> destination) 202public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) => 225Span<byte> destination, 236Span<byte> destination, 260public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination) => 276public static int Hash(Crc64ParameterSet parameterSet, ReadOnlySpan<byte> source, Span<byte> destination) 283private static int HashCore(Crc64ParameterSet parameterSet, ReadOnlySpan<byte> source, Span<byte> destination)
System\IO\Hashing\Crc64ParameterSet.cs (1)
74internal void WriteCrcToSpan(ulong crc, Span<byte> destination)
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (6)
75protected abstract void GetCurrentHashCore(Span<byte> destination); 158public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 183public int GetCurrentHash(Span<byte> destination) 220public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 245public int GetHashAndReset(Span<byte> destination) 279protected virtual void GetHashAndResetCore(Span<byte> destination)
System\IO\Hashing\XxHash128.cs (4)
86public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 102public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 168protected override void GetCurrentHashCore(Span<byte> destination) 215private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
System\IO\Hashing\XxHash3.cs (3)
86public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 102public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 166protected override void GetCurrentHashCore(Span<byte> destination)
System\IO\Hashing\XxHash32.cs (3)
132protected override void GetCurrentHashCore(Span<byte> destination) 212public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int seed = 0) 235public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, int seed = 0)
System\IO\Hashing\XxHash64.cs (3)
132protected override void GetCurrentHashCore(Span<byte> destination) 212public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 235public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0)
System\IO\Hashing\XxHashShared.cs (1)
322Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
System.IO.IsolatedStorage (1)
System\IO\IsolatedStorage\IsolatedStorageFileStream.cs (1)
251public override int Read(System.Span<byte> buffer)
System.IO.MemoryMappedFiles (1)
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (1)
258Span<char> guid = stackalloc char[32];
System.IO.Packaging (3)
System\IO\Packaging\InterleavedZipPackagePartStream.cs (2)
78public override int Read(Span<byte> buffer) 82private int ReadCore(Span<byte> buffer)
System\IO\Packaging\ZipWrappingStream.cs (1)
79Span<byte> buffer
System.IO.Pipelines (14)
System\IO\Pipelines\Pipe.cs (2)
143internal Span<byte> GetSpan(int sizeHint) 1100Span<byte> destination = _writingHeadMemory.Span;
System\IO\Pipelines\Pipe.DefaultPipeWriter.cs (1)
38public override Span<byte> GetSpan(int sizeHint = 0) => _pipe.GetSpan(sizeHint);
System\IO\Pipelines\PipeReaderStream.cs (4)
60Span<byte> oneByte = [0]; 64private int ReadInternal(Span<byte> buffer) 94public override int Read(Span<byte> buffer) 111private int HandleReadResult(ReadResult result, Span<byte> buffer)
System\IO\Pipelines\PipeWriter.cs (6)
61/// <summary>Notifies the <see cref="System.IO.Pipelines.PipeWriter" /> that <paramref name="bytes" /> bytes were written to the output <see cref="System.Span{T}" /> or <see cref="System.Memory{T}" />. You must request a new buffer after calling <see cref="System.IO.Pipelines.PipeWriter.Advance(int)" /> to continue writing more data; you cannot write to a previously acquired buffer.</summary> 62/// <param name="bytes">The number of bytes written to the <see cref="System.Span{T}" /> or <see cref="System.Memory{T}" />.</param> 74/// <summary>Returns a <see cref="System.Span{T}" /> to write to that is at least the requested size, as specified by the <paramref name="sizeHint" /> parameter.</summary> 75/// <param name="sizeHint">The minimum length of the returned <see cref="System.Span{T}" />. If 0, a non-empty buffer of arbitrary size is returned.</param> 78/// This method never returns <see cref="System.Span{T}.Empty" />, but it throws an <see cref="System.OutOfMemoryException" /> if the requested buffer size is not available. 81public abstract Span<byte> GetSpan(int sizeHint = 0);
System\IO\Pipelines\StreamPipeWriter.cs (1)
102public override Span<byte> GetSpan(int sizeHint = 0)
System.IO.Pipes (2)
System\IO\Pipes\PipeStream.Unix.cs (2)
47public override int Read(Span<byte> buffer) 256private int ReadCore(Span<byte> buffer)
System.IO.Ports (1)
System\IO\Ports\SerialStream.Unix.cs (1)
780Span<byte> buff = readRequest.Buffer.Span;
System.Linq (22)
System\Linq\Enumerable.cs (1)
36internal static Span<T> SetCountAndGetSpan<T>(List<T> list, int count)
System\Linq\Lookup.cs (1)
160Span<TResult> span = Enumerable.SetCountAndGetSpan(list, _count);
System\Linq\OrderedEnumerable.cs (1)
234private static void Sort(Span<TElement> span, bool descending)
System\Linq\OrderedEnumerable.SpeedOpt.cs (2)
45private void Fill(TElement[] buffer, Span<TElement> destination) 112private void Fill(int minIdx, int maxIdx, TElement[] buffer, Span<TElement> destination)
System\Linq\Range.cs (1)
78private static void FillIncrementing<T>(Span<T> destination, T value) where T : INumber<T>
System\Linq\SegmentedArrayBuilder.cs (7)
32private Span<T> _firstSegment; 34private Span<T> _currentSegment; 45public SegmentedArrayBuilder(Span<T> scratchBuffer) 105Span<T> currentSegment = _currentSegment; 214Span<T> currentSegment = _currentSegment; 299public readonly void ToSpan(Span<T> destination) => ToSpanInlined(destination); 304private readonly void ToSpanInlined(Span<T> destination)
System\Linq\Select.SpeedOpt.cs (6)
164private static void Fill(ReadOnlySpan<TSource> source, Span<TResult> destination, Func<TSource, TResult> func) 307private static void Fill(Span<TResult> results, T start, Func<T, TResult> func) 420private static void Fill(ReadOnlySpan<TSource> source, Span<TResult> destination, Func<TSource, TResult> func) 538private static void Fill(IList<TSource> source, Span<TResult> results, Func<TSource, TResult> func) 806private static void Fill(Iterator<TSource> source, Span<TResult> results, Func<TSource, TResult> func) 981private static void Fill(IList<TSource> source, Span<TResult> destination, Func<TSource, TResult> func, int sourceIndex)
System\Linq\SingleLinkedNode.cs (2)
103public void Fill(Span<TSource> span) 117public void FillReversed(Span<TSource> span)
System\Linq\SkipTake.SpeedOpt.cs (1)
147private static void Fill(IList<TSource> source, Span<TSource> destination, int sourceIndex)
System.Linq.AsyncEnumerable (2)
System\Linq\SingleLinkedNode.cs (2)
103public void Fill(Span<TSource> span) 117public void FillReversed(Span<TSource> span)
System.Linq.Expressions (1)
System\Linq\Expressions\Compiler\ILGen.cs (1)
978Span<int> bits = [0, 0, 0, 0];
System.Memory (27)
src\runtime\artifacts\obj\System.Memory\Release\net11.0\System.Memory.Forwards.cs (1)
18[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
src\runtime\src\libraries\Common\src\System\Buffers\ArrayBufferWriter.cs (6)
115/// Notifies <see cref="IBufferWriter{T}"/> that <paramref name="count"/> amount of data was written to the output <see cref="Span{T}"/>/<see cref="Memory{T}"/> 169/// Returns a <see cref="Span{T}"/> to write to that is at least the requested length (specified by <paramref name="sizeHint"/>). 177/// This will never return an empty <see cref="Span{T}"/>. 186/// If you reset the writer using the <see cref="ResetWrittenCount"/> method, this method may return a non-cleared <see cref="Span{T}"/>. 189/// If you clear the writer using the <see cref="Clear"/> method, this method will return a <see cref="Span{T}"/> with its content zeroed. 192public Span<T> GetSpan(int sizeHint = 0)
System\Buffers\BuffersExtensions.cs (6)
58/// Copy the <see cref="ReadOnlySequence{T}"/> to the specified <see cref="Span{Byte}"/>. 61/// <param name="destination">The destination <see cref="Span{Byte}"/>.</param> 63public static void CopyTo<T>(in this ReadOnlySequence<T> source, Span<T> destination) 78private static void CopyToMultiSegment<T>(in ReadOnlySequence<T> sequence, Span<T> destination) 118Span<T> destination = writer.GetSpan(); 132private static void WriteMultiSegment<T>(IBufferWriter<T> writer, in ReadOnlySpan<T> source, Span<T> destination)
System\Buffers\IBufferWriter.cs (4)
12/// Notifies <see cref="IBufferWriter{T}"/> that <paramref name="count"/> amount of data was written to the output <see cref="Span{T}"/>/<see cref="Memory{T}"/> 36/// Returns a <see cref="Span{T}"/> to write to that is at least the requested length (specified by <paramref name="sizeHint"/>). 40/// This must never return an empty <see cref="Span{T}"/> but it can throw 49Span<T> GetSpan(int sizeHint = 0);
System\Buffers\SequenceReader.cs (2)
410public readonly bool TryCopyTo(Span<T> destination) 427internal readonly bool TryCopyMultisegment(Span<T> destination)
System\Buffers\SequenceReaderExtensions.Binary.cs (1)
43Span<byte> tempSpan = new Span<byte>(&buffer, sizeof(T));
System\Text\EncodingExtensions.cs (7)
44Span<byte> scratchBuffer = writer.GetSpan(byteCount); 100public static int GetBytes(this Encoding encoding, in ReadOnlySequence<char> chars, Span<byte> bytes) 200Span<byte> remainingBytes = retVal; 235Span<char> scratchBuffer = writer.GetSpan(charCount); 291public static int GetChars(this Encoding encoding, in ReadOnlySequence<byte> bytes, Span<char> chars) 436Span<byte> scratchBuffer = writer.GetSpan(byteCountForThisSlice); 529Span<char> scratchBuffer = writer.GetSpan(charCountForThisSlice);
System.Memory.Data (2)
src\runtime\src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (2)
99public override int Read(Span<byte> buffer) => ReadBuffer(buffer); 102private int ReadBuffer(Span<byte> buffer)
System.Net.Http (115)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
95public override int Read(Span<byte> buffer)
src\runtime\src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (2)
99public override int Read(Span<byte> buffer) => ReadBuffer(buffer); 102private int ReadBuffer(Span<byte> buffer)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (2)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs (1)
41public static bool TryWriteFrameEnvelope(Http3FrameType frameType, long payloadLength, Span<byte> buffer, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (3)
114Span<byte> temp = (stackalloc byte[8])[..length]; 147public static bool TryWrite(Span<byte> buffer, long longToEncode, out int bytesWritten) 190public static int WriteInteger(Span<byte> buffer, long longToEncode)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (18)
23public static bool EncodeStaticIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 39Span<byte> buffer = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; 61public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Span<byte> destination, out int bytesWritten) 66public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 89/// Encodes just the name part of a Literal Header Field With Static Name Reference. Must call <see cref="EncodeValueString(string, Encoding?, Span{byte}, out int)"/> after to encode the header's value. 93Span<byte> temp = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; 104Span<byte> temp = value.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; 125public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Span<byte> destination, out int bytesWritten) 130public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 147public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 160/// Encodes just the value part of a Literawl Header Field Without Static Name Reference. Must call <see cref="EncodeValueString(string, Encoding?, Span{byte}, out int)"/> after to encode the header's value. 164Span<byte> temp = name.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength] : new byte[name.Length + IntegerEncoder.MaxInt32EncodedLength]; 174Span<byte> temp = (name.Length + value.Length) < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[name.Length + value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; 182private static bool EncodeValueString(string s, Encoding? valueEncoding, Span<byte> buffer, out int length) 220public static bool EncodeValueString(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> buffer, out int length) 301private static void EncodeValueStringPart(string s, Span<byte> buffer) 316private static bool EncodeNameString(string s, Span<byte> buffer, out int length) 355private static bool EncodeHeaderBlockPrefix(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
385public void CopyTo(Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Net\Http\EmptyReadStream.cs (1)
22public override int Read(Span<byte> buffer) => 0;
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (1)
457Span<Range> parts = stackalloc Range[6];
System\Net\Http\Headers\HttpHeaders.cs (2)
1238scoped Span<string?> values; 1309private static void ReadStoreValues<T>(Span<string?> values, object? storeValue, HttpHeaderParser? parser, ref int currentIndex)
System\Net\Http\Headers\RangeItemHeaderValue.cs (1)
54Span<char> stackBuffer = stackalloc char[128];
System\Net\Http\Headers\UriHeaderParser.cs (1)
69Span<byte> rawBytes = input.Length <= 256 ? stackalloc byte[input.Length] : new byte[input.Length];
System\Net\Http\HttpBaseStream.cs (1)
87public abstract override int Read(Span<byte> buffer);
System\Net\Http\HttpContent.cs (2)
1009Span<byte> remainingInCurrentBuffer = _lastBuffer.AsSpan(_lastBufferOffset); 1050public void CopyToCore(Span<byte> destination)
System\Net\Http\MultipartContent.cs (2)
480public override int Read(Span<byte> buffer) 639Span<byte> buffer = maxLength <= StackallocThreshold
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (1)
215Span<byte> hashBuffer = stackalloc byte[SHA256.HashSizeInBytes]; // SHA256 is the largest hash produced
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (2)
29public override int Read(Span<byte> buffer) 294private int ReadChunksFromConnectionBuffer(Span<byte> buffer, CancellationTokenRegistration cancellationRegistration)
System\Net\Http\SocketsHttpHandler\ConnectionCloseReadStream.cs (1)
18public override int Read(Span<byte> buffer)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (1)
457Span<HttpConnection> usable = stackCopy.AsSpan(0, usableConnections);
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (1)
23public override int Read(Span<byte> buffer)
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (3)
39Span<string?> methods = [null, null, null, null]; 280public override int Read(Span<byte> buffer) 384public override int Read(Span<byte> buffer)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (5)
1309Span<byte> span = writeBuffer.Span; 1321Span<byte> span = writeBuffer.Span; 1668Span<byte> span = writeBuffer.Span; 1779Span<byte> span = writeBuffer.Span; 1944public static void WriteTo(Span<byte> destination, int payloadLength, FrameType type, FrameFlags flags, int streamId)
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (4)
1106private (bool wait, int bytesRead) TryReadFromBuffer(Span<byte> buffer, bool partOfSyncRead = false) 1137public int ReadData(Span<byte> buffer, HttpResponseMessage responseMessage) 1523public override int Read(Span<byte> buffer) => throw new NotSupportedException(SR.net_http_content_writeonly_stream); 1597public override int Read(Span<byte> destination)
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (1)
516Span<byte> buffer = stackalloc byte[4 + VariableLengthIntegerHelper.MaximumEncodedLength];
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (3)
1195private int ReadResponseContent(HttpResponseMessage response, Span<byte> buffer) 1508public override int Read(Span<byte> buffer) 1558public override int Read(Span<byte> buffer)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (12)
408Span<byte> buffer = _writeBuffer.AvailableSpan; 476Span<byte> buffer = _writeBuffer.AvailableSpan; 507Span<byte> buffer = _writeBuffer.AvailableSpan; 1031Span<byte> buffer = _readBuffer.ActiveSpan; 1058private static void ParseStatusLineCore(Span<byte> line, HttpResponseMessage response) 1133Span<byte> buffer = _readBuffer.ActiveSpan; 1150private (bool finished, int bytesConsumed) ParseHeadersCore(Span<byte> buffer, HttpResponseMessage? response, bool isFromTrailer) 1180Span<byte> valueIterator = buffer.Slice(valueStartIdx); 1532Span<byte> temp = stackalloc byte[8]; // max length of Int32 as hex 1746private int ReadFromBuffer(Span<byte> buffer) 1757private int Read(Span<byte> destination) 1801private int ReadBuffered(Span<byte> destination)
System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs (1)
34public sealed override int Read(Span<byte> buffer) => throw new NotSupportedException();
System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs (1)
235Span<Range> tokens = stackalloc Range[3];
System\Net\Http\SocketsHttpHandler\RawConnectionStream.cs (1)
24public override int Read(Span<byte> buffer)
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (1)
321private static byte EncodeString(ReadOnlySpan<char> chars, Span<byte> buffer, string parameterName)
System.Net.Http.WinHttpHandler (3)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
43Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit
src\runtime\src\libraries\Common\src\Interop\Windows\WinHttp\Interop.winhttp.cs (1)
66Span<char> buffer = new(value, length);
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateValidation.Windows.cs (1)
17internal static SslPolicyErrors BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, bool checkCertName, bool isServer, string? hostName, Span<byte> certificateBuffer)
System.Net.HttpListener (9)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
79Span<Range> parts = stackalloc Range[3];
System.Net.Mail (32)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Net\Base64Stream.cs (2)
80public unsafe int DecodeBytes(Span<byte> buffer) 173protected override int ReadInternal(Span<byte> buffer)
System\Net\BufferedReadStream.cs (1)
32protected override int ReadInternal(Span<byte> buffer)
System\Net\CloseableStream.cs (1)
42protected override int ReadInternal(Span<byte> buffer)
System\Net\DelegatedStream.cs (2)
104protected abstract int ReadInternal(Span<byte> buffer); 113public sealed override int Read(Span<byte> buffer)
System\Net\Mail\SmtpNegotiateAuthenticationModule.cs (1)
118Span<byte> unwrappedChallenge;
System\Net\Mail\SmtpReplyReaderFactory.cs (1)
232internal int Read(SmtpReplyReader caller, Span<byte> buffer)
System\Net\Mime\ByteEncoder.cs (1)
80Span<byte> bytes = buffer.AsSpan(0, bytesCount);
System\Net\Mime\EightBitStream.cs (2)
50protected override int ReadInternal(Span<byte> buffer) 123public int DecodeBytes(Span<byte> buffer) { throw new NotImplementedException(); }
System\Net\Mime\IEncodableStream.cs (1)
10int DecodeBytes(Span<byte> buffer);
System\Net\Mime\MediaTypeMap.cs (1)
810Span<char> buffer = stackalloc char[1 + extension.Length];
System\Net\Mime\MimeBasePart.cs (1)
101Span<Range> subStrings = stackalloc Range[6];
System\Net\Mime\QEncodedStream.cs (2)
64public unsafe int DecodeBytes(Span<byte> buffer) 218protected override int ReadInternal(Span<byte> buffer)
System\Net\Mime\QuotedPrintableStream.cs (2)
93public unsafe int DecodeBytes(Span<byte> buffer) 332protected override int ReadInternal(Span<byte> buffer)
System.Net.NameResolution (9)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (9)
73public static unsafe void SetAddressFamily(Span<byte> buffer, AddressFamily family) 101public static unsafe void SetPort(Span<byte> buffer, ushort port) 125public static unsafe void GetIPv6Address(ReadOnlySpan<byte> buffer, Span<byte> address, out uint scope) 139public static unsafe void SetIPv4Address(Span<byte> buffer, uint address) 150public static unsafe void SetIPv4Address(Span<byte> buffer, byte* address) 156public static unsafe void SetIPv6Address(Span<byte> buffer, Span<byte> address, uint scope) 165public static unsafe void SetIPv6Address(Span<byte> buffer, byte* address, int addressLength, uint scope) 176public static void Clear(Span<byte> buffer)
System.Net.NetworkInformation (11)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (1)
361Span<byte> addressBytes = stackalloc byte[16];
System\Net\NetworkInformation\StringParsingHelpers.Statistics.cs (1)
410Span<Range> pieces = stackalloc Range[18]; // [0]-[16] used, +1 to ensure any additional segment goes into [17]
System\Net\NetworkInformation\UnicastIPAddressInformation.cs (1)
75Span<byte> addressBytes = (family == AddressFamily.InterNetwork) ?
System.Net.Ping (17)
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (6)
17Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 32public static unsafe void SetIPAddress(Span<byte> socketAddressBuffer, IPAddress address) 44Span<byte> addressBuffer = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 78Span<byte> addressBuffer1 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 79Span<byte> addressBuffer2 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes];
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (9)
73public static unsafe void SetAddressFamily(Span<byte> buffer, AddressFamily family) 101public static unsafe void SetPort(Span<byte> buffer, ushort port) 125public static unsafe void GetIPv6Address(ReadOnlySpan<byte> buffer, Span<byte> address, out uint scope) 139public static unsafe void SetIPv4Address(Span<byte> buffer, uint address) 150public static unsafe void SetIPv4Address(Span<byte> buffer, byte* address) 156public static unsafe void SetIPv6Address(Span<byte> buffer, Span<byte> address, uint scope) 165public static unsafe void SetIPv6Address(Span<byte> buffer, byte* address, int addressLength, uint scope) 176public static void Clear(Span<byte> buffer)
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (1)
33public void FromManaged(ReadOnlySpan<char> managed, Span<byte> buffer)
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
302Span<byte> socketAddress = stackalloc byte[SocketAddress.GetMaximumAddressSize(address.AddressFamily)];
System.Net.Primitives (54)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (6)
17Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 32public static unsafe void SetIPAddress(Span<byte> socketAddressBuffer, IPAddress address) 44Span<byte> addressBuffer = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 78Span<byte> addressBuffer1 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 79Span<byte> addressBuffer2 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes];
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (2)
39Span<byte> numbers = stackalloc byte[NumberOfLabels]; 213Span<long> parts = [0, 0, 0]; // One part per octet. Final octet doesn't have a terminator, so is stored in currentValue.
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
313internal static void Parse<TChar>(ReadOnlySpan<TChar> address, scoped Span<ushort> numbers, out ReadOnlySpan<TChar> scopeId)
src\runtime\src\libraries\Common\src\System\Net\NetworkInformation\InterfaceInfoPal.Unix.cs (1)
45Span<byte> buffer = ((uint)bufferSize <= StackAllocationThreshold
src\runtime\src\libraries\Common\src\System\Net\SocketAddress.cs (2)
105Span<byte> addressBytes = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 170Span<char> result = (uint)maxLength <= 256 ? // arbitrary limit that should be large enough for the vast majority of cases
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (9)
73public static unsafe void SetAddressFamily(Span<byte> buffer, AddressFamily family) 101public static unsafe void SetPort(Span<byte> buffer, ushort port) 125public static unsafe void GetIPv6Address(ReadOnlySpan<byte> buffer, Span<byte> address, out uint scope) 139public static unsafe void SetIPv4Address(Span<byte> buffer, uint address) 150public static unsafe void SetIPv4Address(Span<byte> buffer, byte* address) 156public static unsafe void SetIPv6Address(Span<byte> buffer, Span<byte> address, uint scope) 165public static unsafe void SetIPv6Address(Span<byte> buffer, byte* address, int addressLength, uint scope) 176public static void Clear(Span<byte> buffer)
System\Net\IPAddress.cs (10)
322public bool TryWriteBytes(Span<byte> destination, out int bytesWritten) 351private void WriteIPv6Bytes(Span<byte> destination) 379private void WriteIPv4Bytes(Span<byte> destination) 465Span<char> span = stackalloc char[IPAddressParser.MaxIPv6StringLength]; 480public bool TryFormat(Span<char> destination, out int charsWritten) => 487public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten) => 491bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 496bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 500private unsafe bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IBinaryInteger<TChar> 519Span<TChar> tmpDestination = stackalloc TChar[IPAddressParser.MaxIPv6StringLength];
System\Net\IPAddressParser.cs (7)
42Span<ushort> numbers = stackalloc ushort[IPAddressParserStatics.IPv6AddressShorts]; 80private static bool TryParseIPv6<TChar>(ReadOnlySpan<TChar> ipSpan, Span<ushort> numbers, int numbersLength, out uint scope) 136internal static int FormatIPv4Address<TChar>(uint address, Span<TChar> addressString) 152static int FormatByte(uint number, Span<TChar> addressString) 181internal static int FormatIPv6Address<TChar>(ushort[] address, uint scopeId, Span<TChar> destination) 225static void AppendSections(ReadOnlySpan<ushort> address, Span<TChar> destination, ref int offset) 264static void AppendHex(ushort value, Span<TChar> destination, ref int offset)
System\Net\IPEndPoint.cs (4)
295public bool TryFormat(Span<char> destination, out int charsWritten) => 304public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten) => 315bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 324bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) =>
System\Net\IPNetwork.cs (4)
292public bool TryFormat(Span<char> destination, out int charsWritten) => 301public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten) => 350bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 355bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) =>
System.Net.Quic (56)
_generated\0\LibraryImports.g.cs (1)
388private static partial int BioRead(global::Microsoft.Win32.SafeHandles.SafeBioHandle b, global::System.Span<byte> data, int len)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs (3)
25internal static unsafe int BioGets(SafeBioHandle b, Span<byte> buf) 37private static partial int BioRead(SafeBioHandle b, Span<byte> data, int len); 38internal static int BioRead(SafeBioHandle b, Span<byte> data) => BioRead(b, data, data.Length);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (2)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (6)
17Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 32public static unsafe void SetIPAddress(Span<byte> socketAddressBuffer, IPAddress address) 44Span<byte> addressBuffer = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 78Span<byte> addressBuffer1 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 79Span<byte> addressBuffer2 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes];
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (2)
39Span<byte> numbers = stackalloc byte[NumberOfLabels]; 213Span<long> parts = [0, 0, 0]; // One part per octet. Final octet doesn't have a terminator, so is stored in currentValue.
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
313internal static void Parse<TChar>(ReadOnlySpan<TChar> address, scoped Span<ushort> numbers, out ReadOnlySpan<TChar> scopeId)
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
385public void CopyTo(Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
16internal static SslPolicyErrors BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, bool checkCertName, bool isServer, string? hostName, Span<byte> certificateBuffer)
src\runtime\src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
83Span<byte> clientRandomUtf8 = clientRandom.Length <= 1024 ? stackalloc byte[clientRandom.Length * 2] : new byte[clientRandom.Length * 2]; 108Span<byte> line = (uint)totalLength <= 1024 ? stackalloc byte[totalLength] : new byte[totalLength]; 122private static void HexEncode(ReadOnlySpan<byte> source, Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (9)
73public static unsafe void SetAddressFamily(Span<byte> buffer, AddressFamily family) 101public static unsafe void SetPort(Span<byte> buffer, ushort port) 125public static unsafe void GetIPv6Address(ReadOnlySpan<byte> buffer, Span<byte> address, out uint scope) 139public static unsafe void SetIPv4Address(Span<byte> buffer, uint address) 150public static unsafe void SetIPv4Address(Span<byte> buffer, byte* address) 156public static unsafe void SetIPv6Address(Span<byte> buffer, Span<byte> address, uint scope) 165public static unsafe void SetIPv6Address(Span<byte> buffer, byte* address, int addressLength, uint scope) 176public static void Clear(Span<byte> buffer)
src\runtime\src\libraries\Common\src\System\Net\StreamBuffer.cs (2)
193private (bool wait, int bytesRead) TryReadFromBuffer(Span<byte> buffer) 224public int Read(Span<byte> buffer)
System\Net\Quic\Internal\MsQuicHelpers.cs (2)
41Span<byte> addressBytes = new Span<byte>(quicAddress, SocketAddressPal.IPv6AddressSize); 52Span<byte> rawAddress = MemoryMarshal.AsBytes(MemoryMarshal.CreateSpan(ref result, 1));
System\Net\Quic\Internal\MsQuicTlsSecret.cs (10)
58Span<byte> clientHandshakeTrafficSecret = _tlsSecrets->IsSet.ClientHandshakeTrafficSecret != 0 60: Span<byte>.Empty; 62Span<byte> serverHandshakeTrafficSecret = _tlsSecrets->IsSet.ServerHandshakeTrafficSecret != 0 64: Span<byte>.Empty; 66Span<byte> clientTrafficSecret0 = _tlsSecrets->IsSet.ClientTrafficSecret0 != 0 68: Span<byte>.Empty; 70Span<byte> serverTrafficSecret0 = _tlsSecrets->IsSet.ServerTrafficSecret0 != 0 72: Span<byte>.Empty; 74Span<byte> clientEarlyTrafficSecret = _tlsSecrets->IsSet.ClientEarlyTrafficSecret != 0 76: Span<byte>.Empty;
System\Net\Quic\Internal\ReceiveBuffers.cs (1)
55Span<byte> quicBuffer = quicBuffers[i].Span;
System\Net\Quic\Interop\msquic.cs (1)
23public readonly Span<byte> Span => new(Buffer, (int)Length);
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (2)
176private QUIC_TLS_ALERT_CODES ValidateCertificate(X509Certificate2? certificate, Span<byte> certData, Span<byte> chainData)
System\Net\Quic\QuicStream.Stream.cs (1)
114public override int Read(Span<byte> buffer)
System.Net.Requests (3)
System\Net\FtpControlStream.cs (1)
920Span<Range> parts = stackalloc Range[4];
System\Net\FtpDataStream.cs (1)
199public override int Read(Span<byte> buffer)
System\Net\HttpWebResponse.cs (1)
401public override int Read(Span<byte> buffer)
System.Net.Security (96)
_generated\0\LibraryImports.g.cs (3)
1232private static partial int BioRead(global::Microsoft.Win32.SafeHandles.SafeBioHandle b, global::System.Span<byte> data, int len) 2806private static unsafe partial int GetDefaultSignatureAlgorithms(global::System.Span<ushort> algorithms, ref int algorithmCount) 4287internal static unsafe partial int SslCtxSetCaching(global::Microsoft.Win32.SafeHandles.SafeSslContextHandle ctx, int mode, int cacheSize, int contextIdLength, global::System.Span<byte> contextId, delegate* unmanaged<nint, nint, int> neewSessionCallback, delegate* unmanaged<nint, nint, void> removeSessionCallback)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs (3)
25internal static unsafe int BioGets(SafeBioHandle b, Span<byte> buf) 37private static partial int BioRead(SafeBioHandle b, Span<byte> data, int len); 38internal static int BioRead(SafeBioHandle b, Span<byte> data) => BioRead(b, data, data.Length);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (6)
263Span<byte> contextId = stackalloc byte[32]; 492Span<IntPtr> handles = certList.Count <= StackAllocCertLimit ? 797internal static int Decrypt(SafeSslHandle context, Span<byte> buffer, out Ssl.SslErrorCode errorCode) 1043var clientList = new Span<byte>(inp, (int)inlen); 1047Span<byte> clientProto = clientList.Slice(1, length); 1157private static int BioRead(SafeBioHandle bio, Span<byte> buffer, int count)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (6)
87private static unsafe partial int GetDefaultSignatureAlgorithms(Span<ushort> algorithms, ref int algorithmCount); 92Span<ushort> algorithms = stackalloc ushort[256]; 271internal static void SerializeAlpnProtocolList(List<SslApplicationProtocol> applicationProtocols, Span<byte> buffer) 288Span<byte> buffer = (uint)length <= 256 ? stackalloc byte[256].Slice(0, length) : new byte[length]; 293internal static unsafe int SslSetAlpnProtos(SafeSslHandle ssl, Span<byte> serializedProtocols) 309internal static unsafe bool SslAddClientCAs(SafeSslHandle ssl, Span<IntPtr> x509handles)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (1)
43internal static unsafe partial int SslCtxSetCaching(SafeSslContextHandle ctx, int mode, int cacheSize, int contextIdLength, Span<byte> contextId, delegate* unmanaged<IntPtr, IntPtr, int> neewSessionCallback, delegate* unmanaged<IntPtr, IntPtr, void> removeSessionCallback);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (2)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (2)
39Span<byte> numbers = stackalloc byte[NumberOfLabels]; 213Span<long> parts = [0, 0, 0]; // One part per octet. Final octet doesn't have a terminator, so is stored in currentValue.
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
313internal static void Parse<TChar>(ReadOnlySpan<TChar> address, scoped Span<ushort> numbers, out ReadOnlySpan<TChar> scopeId)
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
16internal static SslPolicyErrors BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, bool checkCertName, bool isServer, string? hostName, Span<byte> certificateBuffer)
src\runtime\src\libraries\Common\src\System\Net\Security\MD4.cs (13)
63internal static unsafe void HashData(ReadOnlySpan<byte> source, Span<byte> destination) 67Span<byte> buffer = stackalloc byte[64]; 71Span<uint> state = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476]; 72Span<uint> count = [0, 0]; 77Span<byte> bits = stackalloc byte[8]; 84Span<byte> padding = stackalloc byte[padLen]; 96private static void HashCore(ReadOnlySpan<byte> input, Span<uint> state, Span<uint> count, Span<byte> buffer) 173private static void Encode(Span<byte> output, ReadOnlySpan<uint> input) 181private static void Decode(Span<uint> output, ReadOnlySpan<byte> input) 189private static unsafe void MD4Transform(Span<uint> state, ReadOnlySpan<byte> block) 195Span<uint> x = stackalloc uint[16];
src\runtime\src\libraries\Common\src\System\Net\Security\RC4.cs (1)
76public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
src\runtime\src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
83Span<byte> clientRandomUtf8 = clientRandom.Length <= 1024 ? stackalloc byte[clientRandom.Length * 2] : new byte[clientRandom.Length * 2]; 108Span<byte> line = (uint)totalLength <= 1024 ? stackalloc byte[totalLength] : new byte[totalLength]; 122private static void HexEncode(ReadOnlySpan<byte> source, Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (4)
46internal Span<byte> Span { get; private set; } 69Span<byte> toClear = Span.Slice(0, clearSize); 95Span<byte> currentBuffer, 109Span<byte> currentBuffer,
src\runtime\src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (1)
33Span<char> dest = urlEncoded;
System\Net\NegotiateAuthenticationPal.cs (1)
25public abstract NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (27)
362private static unsafe void CreateNtlmNegotiateMessage(Span<byte> asBytes, Flags requiredFlags) 401private static void AddToPayload(ref MessageField field, ReadOnlySpan<byte> data, Span<byte> payload, ref int offset) 408private static void AddToPayload(ref MessageField field, ReadOnlySpan<char> data, Span<byte> payload, ref int offset) 419private static unsafe void makeNtlm2Hash(string domain, string userName, ReadOnlySpan<char> password, Span<byte> hash) 428Span<byte> pwHash = stackalloc byte[DigestLength]; 429Span<byte> pwBytes = stackalloc byte[Encoding.Unicode.GetByteCount(password)]; 452private static unsafe void makeNtlm2ChallengeResponse(DateTime time, ReadOnlySpan<byte> ntlm2hash, ReadOnlySpan<byte> serverChallenge, Span<byte> clientChallenge, ReadOnlySpan<byte> serverInfo, ref MessageField field, Span<byte> payload, ref int payloadOffset) 458Span<byte> blob = payload.Slice(payloadOffset, sizeof(NtChallengeResponse) + serverInfo.Length); 465clientChallenge.CopyTo((Span<byte>)temp.ClientChallenge); 483private unsafe void WriteChannelBindingHash(Span<byte> hashBuffer) 494Span<byte> prefix = stackalloc byte[sizeof(uint) * 5]; 674Span<byte> responseAsSpan = new Span<byte>(responseBytes); 678Span<byte> payload = responseAsSpan; 689Span<byte> ntlm2hash = stackalloc byte[DigestLength]; 693Span<byte> clientChallenge = stackalloc byte[ChallengeLength]; 711Span<byte> exportedSessionKey = stackalloc byte[16]; 718Span<byte> sessionBaseKey = stackalloc byte[HMACMD5.HashSizeInBytes]; 725Span<byte> encryptedRandomSessionKey = payload.Slice(payloadOffset, 16); 738hmacMic.GetHashAndReset((Span<byte>)response.Mic); 772Span<byte> signature) 780Span<byte> hmacResult = stackalloc byte[hmac.HashLengthInBytes]; 797Span<byte> expectedSignature = stackalloc byte[SignatureLength]; 810Span<byte> signatureBuffer = signature.GetSpan(SignatureLength); 823Span<byte> output = outputWriter.GetSpan(input.Length + SignatureLength); 848Span<byte> output = outputWriter.GetSpan(input.Length - SignatureLength); 861public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (1)
424public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\NegotiateAuthenticationPal.Unix.cs (1)
386public override unsafe NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\NegotiateAuthenticationPal.Unsupported.cs (1)
54public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) => throw new InvalidOperationException();
System\Net\Security\NegotiateAuthentication.cs (1)
345public NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\Security\SslStream.cs (4)
84public Span<byte> DecryptedSpan => _buffer.ActiveSpan.Slice(0, _decryptedLength); 96public Span<byte> EncryptedSpanSliced(int length) => _buffer.ActiveSpan.Slice(_decryptedLength + _decryptedPadding, length); 784public override unsafe int Read(Span<byte> buffer) 992public override Span<byte> GetSpan()
System\Net\Security\SslStream.Protocol.cs (4)
183Span<byte> certHash = stackalloc byte[SHA512.HashSizeInBytes]; 991internal SecurityStatusPal Decrypt(Span<byte> buffer, out int outputOffset, out int outputCount) 1431internal Span<byte> AvailableSpan => Payload == null ? Span<byte>.Empty : new Span<byte>(Payload, Size, Available);
System\Net\Security\SslStreamPal.Unix.cs (1)
82public static SecurityStatusPal DecryptMessage(SafeDeleteSslContext securityContext, Span<byte> buffer, out int offset, out int count)
System.Net.ServerSentEvents (6)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (2)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
System\Net\ServerSentEvents\Helpers.cs (3)
17Span<byte> buffer = writer.GetSpan(MaxDecimalDigits); 35Span<byte> buffer = writer.GetSpan(value.Length); 49Span<byte> buffer = writer.GetSpan(maxByteCount);
System\Net\ServerSentEvents\PooledByteBufferWriter.cs (1)
22public Span<byte> GetSpan(int sizeHint = 0)
System.Net.Sockets (81)
_generated\0\LibraryImports.g.cs (4)
240internal static unsafe partial global::Interop.Error Connectx(global::System.Runtime.InteropServices.SafeHandle socket, byte* socketAddress, int socketAddressLen, global::System.Span<byte> buffer, int bufferLen, int enableTfo, int* sent) 1523internal static unsafe partial global::Interop.Error Select(global::System.Span<int> readFDs, int readFDsLength, global::System.Span<int> writeFDs, int writeFDsLength, global::System.Span<int> checkError, int checkErrorLength, int timeout, int maxFd, out int triggered)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Connect.cs (1)
15internal static unsafe partial Error Connectx(SafeHandle socket, byte* socketAddress, int socketAddressLen, Span<byte> buffer, int bufferLen, int enableTfo, int* sent);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Select.cs (3)
12internal static unsafe partial Error Select(Span<int> readFDs, int readFDsLength, Span<int> writeFDs, int writeFDsLength, Span<int> checkError, int checkErrorLength, int timeout, int maxFd, out int triggered);
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (6)
17Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 32public static unsafe void SetIPAddress(Span<byte> socketAddressBuffer, IPAddress address) 44Span<byte> addressBuffer = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 78Span<byte> addressBuffer1 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 79Span<byte> addressBuffer2 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes];
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (9)
73public static unsafe void SetAddressFamily(Span<byte> buffer, AddressFamily family) 101public static unsafe void SetPort(Span<byte> buffer, ushort port) 125public static unsafe void GetIPv6Address(ReadOnlySpan<byte> buffer, Span<byte> address, out uint scope) 139public static unsafe void SetIPv4Address(Span<byte> buffer, uint address) 150public static unsafe void SetIPv4Address(Span<byte> buffer, byte* address) 156public static unsafe void SetIPv6Address(Span<byte> buffer, Span<byte> address, uint scope) 165public static unsafe void SetIPv6Address(Span<byte> buffer, byte* address, int addressLength, uint scope) 176public static void Clear(Span<byte> buffer)
System\Net\Sockets\NetworkStream.cs (1)
248public override int Read(Span<byte> buffer)
System\Net\Sockets\SafeSocketHandle.Unix.OptionTracking.cs (1)
32internal void GetTrackedSocketOptions(Span<int> values, out LingerOption? lingerOption)
System\Net\Sockets\Socket.cs (15)
142Span<byte> buffer = stackalloc byte[SocketPal.MaximumAddressSize]; 165Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 199Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 310Span<byte> buffer = stackalloc byte[SocketAddress.GetMaximumAddressSize(_addressFamily)]; 358Span<byte> buffer = stackalloc byte[SocketAddress.GetMaximumAddressSize(_addressFamily)]; 1573public int Receive(Span<byte> buffer) => Receive(buffer, SocketFlags.None); 1575public int Receive(Span<byte> buffer, SocketFlags socketFlags) 1585public int Receive(Span<byte> buffer, SocketFlags socketFlags, out SocketError errorCode) 1728/// An <see cref="Span{T}"/> of type <see cref="byte"/> that is the storage location for received data. 1745/// <see cref="Socket.ReceiveMessageFrom(Span{byte}, ref SocketFlags, ref EndPoint, out IPPacketInformation)"/> 1750public int ReceiveMessageFrom(Span<byte> buffer, ref SocketFlags socketFlags, ref EndPoint remoteEP, out IPPacketInformation ipPacketInformation) 1923public int ReceiveFrom(Span<byte> buffer, ref EndPoint remoteEP) 1938public int ReceiveFrom(Span<byte> buffer, SocketFlags socketFlags, ref EndPoint remoteEP) 2021public int ReceiveFrom(Span<byte> buffer, SocketFlags socketFlags, SocketAddress receivedAddress) 2295public int GetRawSocketOption(int optionLevel, int optionName, Span<byte> optionValue)
System\Net\Sockets\Socket.Unix.cs (1)
138Span<int> optionValues = stackalloc int[SafeSocketHandle.TrackableOptionCount];
System\Net\Sockets\SocketAsyncContext.Unix.cs (4)
513bool completed = SocketPal.TryCompleteReceiveFrom(context._socket, default(Span<byte>), Buffers, Flags, SocketAddress.Span, out int socketAddressLen, out BytesTransferred, out ReceivedFlags, out ErrorCode); 1626public SocketError Receive(Span<byte> buffer, SocketFlags flags, int timeout, out int bytesReceived) 1669public unsafe SocketError ReceiveFrom(Span<byte> buffer, ref SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, int timeout, out int bytesReceived) 1887Span<byte> buffer, ref SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, int timeout, out IPPacketInformation ipPacketInformation, out int bytesReceived)
System\Net\Sockets\SocketPal.Unix.cs (36)
105private static unsafe int SysRead(SafeSocketHandle handle, Span<byte> buffer, out Interop.Error errno) 120private static unsafe int SysReceive(SafeSocketHandle socket, SocketFlags flags, Span<byte> buffer, out Interop.Error errno) 144private static unsafe int SysReceive(SafeSocketHandle socket, SocketFlags flags, Span<byte> buffer, Span<byte> socketAddress, out int socketAddressLen, out SocketFlags receivedFlags, out Interop.Error errno) 299Span<GCHandle> handles = allocOnStack ? stackalloc GCHandle[IovStackThreshold] : new GCHandle[maxBuffers]; 300Span<Interop.Sys.IOVector> iovecs = allocOnStack ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[maxBuffers]; 380private static unsafe int SysReceive(SafeSocketHandle socket, SocketFlags flags, IList<ArraySegment<byte>> buffers, Span<byte> socketAddress, out int socketAddressLen, out SocketFlags receivedFlags, out Interop.Error errno) 411Span<GCHandle> handles = allocOnStack ? stackalloc GCHandle[IovStackThreshold] : new GCHandle[maxBuffers]; 412Span<Interop.Sys.IOVector> iovecs = allocOnStack ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[maxBuffers]; 483private static unsafe int SysReceiveMessageFrom(SafeSocketHandle socket, SocketFlags flags, Span<byte> buffer, Span<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, out SocketFlags receivedFlags, out IPPacketInformation ipPacketInformation, out Interop.Error errno) 540Span<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, 553Span<GCHandle> handles = allocOnStack ? stackalloc GCHandle[IovStackThreshold] : new GCHandle[buffersCount]; 554Span<Interop.Sys.IOVector> iovecs = allocOnStack ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[buffersCount]; 669public static bool TryStartConnect(SafeSocketHandle socket, Memory<byte> socketAddress, out SocketError errorCode) => TryStartConnect(socket, socketAddress, out errorCode, Span<byte>.Empty, false, out int _ ); 671public static unsafe bool TryStartConnect(SafeSocketHandle socket, Memory<byte> socketAddress, out SocketError errorCode, Span<byte> data, bool tfo, out int sent) 767public static bool TryCompleteReceiveFrom(SafeSocketHandle socket, Span<byte> buffer, SocketFlags flags, Span<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out SocketFlags receivedFlags, out SocketError errorCode) => 770public static bool TryCompleteReceiveFrom(SafeSocketHandle socket, IList<ArraySegment<byte>> buffers, SocketFlags flags, Span<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out SocketFlags receivedFlags, out SocketError errorCode) => 771TryCompleteReceiveFrom(socket, default(Span<byte>), buffers, flags, socketAddress, out socketAddressLen, out bytesReceived, out receivedFlags, out errorCode); 773public static unsafe bool TryCompleteReceive(SafeSocketHandle socket, Span<byte> buffer, SocketFlags flags, out int bytesReceived, out SocketError errorCode) 832public static unsafe bool TryCompleteReceiveFrom(SafeSocketHandle socket, Span<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, Span<byte> socketAddress, out int receivedSocketAddressLength, out int bytesReceived, out SocketFlags receivedFlags, out SocketError errorCode) 903public static bool TryCompleteReceiveMessageFrom(SafeSocketHandle socket, Span<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, Memory<byte> socketAddress, out int receivedSocketAddressLength, bool isIPv4, bool isIPv6, out int bytesReceived, out SocketFlags receivedFlags, out IPPacketInformation ipPacketInformation, out SocketError errorCode) 949public static bool TryCompleteSendTo(SafeSocketHandle socket, Span<byte> buffer, ref int offset, ref int count, SocketFlags flags, ReadOnlySpan<byte> socketAddress, ref int bytesSent, out SocketError errorCode) 1107public static unsafe SocketError GetPeerName(SafeSocketHandle handle, Span<byte> buffer, ref int nameLen) 1271if (!TryCompleteReceiveFrom(handle, buffers, socketFlags, Span<byte>.Empty, out int _, out bytesTransferred, out _, out errorCode)) 1292public static SocketError Receive(SafeSocketHandle handle, Span<byte> buffer, SocketFlags socketFlags, out int bytesTransferred) 1330public static SocketError ReceiveMessageFrom(Socket socket, SafeSocketHandle handle, Span<byte> buffer, ref SocketFlags socketFlags, SocketAddress socketAddress, out SocketAddress receiveAddress, out IPPacketInformation ipPacketInformation, out int bytesTransferred) 1367public static SocketError ReceiveFrom(SafeSocketHandle handle, Span<byte> buffer, SocketFlags socketFlags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesTransferred) 1684public static unsafe SocketError GetRawSockOpt(SafeSocketHandle handle, int optionLevel, int optionName, Span<byte> optionValue, ref int optionLength) 1838Span<int> readFDs = checkRead?.Count > MaxStackAllocCount ? new int[checkRead.Count] : stackalloc int[checkRead?.Count ?? 0]; 1839Span<int> writeFDs = checkWrite?.Count > MaxStackAllocCount ? new int[checkWrite.Count] : stackalloc int[checkWrite?.Count ?? 0]; 1840Span<int> errorFDs = checkError?.Count > MaxStackAllocCount ? new int[checkError.Count] : stackalloc int[checkError?.Count ?? 0]; 1887private static void AddDesriptors(Span<int> buffer, IList? socketList, ref int refsAdded, ref int maxFd) 1916private static void FilterSelectList(IList? socketList, Span<int> results)
System.Net.WebClient (9)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
95public override int Read(Span<byte> buffer)
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
377Span<char> url = (uint)lengthRequired <= 256 ? stackalloc char[256] : new char[lengthRequired];
System.Net.WebSockets (10)
System\Net\WebSockets\Compression\WebSocketDeflater.cs (3)
79private void DeflatePrivate(ReadOnlySpan<byte> payload, Span<byte> output, bool endOfMessage, 122private unsafe void UnsafeDeflate(ReadOnlySpan<byte> input, Span<byte> output, out int consumed, out int written, out bool needsMoreBuffer) 153private unsafe int UnsafeFlush(Span<byte> output, out bool needsMoreBuffer)
System\Net\WebSockets\Compression\WebSocketInflater.cs (4)
57public Span<byte> Span => _buffer.AsSpan(_position + _available); 126public unsafe bool Inflate(Span<byte> output, out int written) 164private bool Finish(Span<byte> output, ref int written) 228private static unsafe int Inflate(ZLibStreamHandle stream, Span<byte> destination, FlushCode flushCode)
System\Net\WebSockets\ManagedWebSocket.cs (3)
1317Span<byte> receiveBufferSpan = _receiveBuffer.Span; 1668private static int ApplyMask(Span<byte> toMask, byte[] mask, int maskOffset, int maskOffsetIndex) 1680private static unsafe int ApplyMask(Span<byte> toMask, int mask, int maskIndex)
System.Net.WebSockets.Client (6)
_generated\0\JSImports.g.cs (6)
40global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __webSocket_native]; 93global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __uri_native, __subProtocols_native, __responseStatusPtr_native]; 140global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __webSocket_native]; 199global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __webSocket_native, __bufferPtr_native, __bufferLength_native, __messageType_native, __endOfMessage_native]; 252global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __webSocket_native, __bufferPtr_native, __bufferLength_native]; 308global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __webSocket_native, __code_native, __reason_native, __waitForCloseReceived_native];
System.Numerics.Tensors (522)
System\Buffers\NIndex.cs (1)
177Span<char> span = stackalloc char[21]; // 1 for ^ and 20 for longest possible nuint value
System\Buffers\NRange.cs (1)
65Span<char> span = stackalloc char[2 + 2 * 21]; // 2 for "..", then for each NIndex 1 for '^' and 20 for longest possible nuint
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBinaryOperator.cs (4)
32T x, ReadOnlySpan<T> y, Span<T> destination) 45ReadOnlySpan<T> x, T y, Span<T> destination) 58ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1396ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBooleanUnaryOperator.cs (5)
184ReadOnlySpan<T> x, Span<bool> destination) 209static void Vectorized_Size1(ReadOnlySpan<T> x, Span<bool> destination) 317static void Vectorized_Size2(ReadOnlySpan<T> x, Span<bool> destination) 434static void Vectorized_Size4(ReadOnlySpan<T> x, Span<bool> destination) 563static void Vectorized_Size8OrOther(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IStatefulUnaryOperator.cs (1)
27ReadOnlySpan<T> x, TStatefulUnaryOperator op, Span<T> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.ITernaryOperator.cs (4)
43ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> z, Span<T> destination) 1520ReadOnlySpan<T> x, ReadOnlySpan<T> y, T z, Span<T> destination) 2999ReadOnlySpan<T> x, T y, ReadOnlySpan<T> z, Span<T> destination) 3013ReadOnlySpan<T> x, T y, T z, Span<T> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryInputBinaryOutput.cs (8)
48ReadOnlySpan<T> x, Span<T> destination1, Span<T> destination2) 175ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination1, Span<T> destination2) 364ReadOnlySpan<T> x, T y, Span<T> destination1, Span<T> destination2) 546T x, ReadOnlySpan<T> y, Span<T> destination1, Span<T> destination2)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToFourOperator.cs (1)
30ReadOnlySpan<TInput> x, Span<TOutput> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToTwoOperator.cs (1)
30ReadOnlySpan<TInput> x, Span<TOutput> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOperator.cs (2)
54ReadOnlySpan<T> x, Span<T> destination) 67ReadOnlySpan<TInput> x, Span<TOutput> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryTwoToOneOperator.cs (1)
30ReadOnlySpan<TInput> x, Span<TOutput> destination)
System\Numerics\Tensors\netcore\IReadOnlyTensor_1.cs (2)
60void FlattenTo(scoped Span<T> destination); 126bool TryFlattenTo(scoped Span<T> destination);
System\Numerics\Tensors\netcore\ITensor_1.cs (4)
95new Span<T> GetSpan(scoped ReadOnlySpan<nint> startIndexes, int length); 98new Span<T> GetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length); 101bool TryGetSpan(scoped ReadOnlySpan<nint> startIndexes, int length, out Span<T> span); 104bool TryGetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length, out Span<T> span);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (4)
348/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.FlattenTo(Span{T})" /> 349public void FlattenTo(scoped Span<T> destination) 458/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.TryFlattenTo(Span{T})" /> 459public bool TryFlattenTo(scoped Span<T> destination)
System\Numerics\Tensors\netcore\Tensor.cs (28)
260Span<T> tempSpan = tempBuffer.AsSpan(0, (int)totalLength); 272Span<T> dstSpan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.FlattenedLength); 279private static void ConcatenateOnDimensionToSpan<T>(int dimension, scoped ReadOnlySpan<Tensor<T>> tensors, in TensorSpan<T> destination, Span<T> dstSpan) 291Span<NRange> ranges = TensorOperation.RentedBuffer.CreateUninitialized(destination.Rank, out TensorOperation.RentedBuffer<NRange> rentedBuffer); 392Span<T> span = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.FlattenedLength); 430Span<T> span = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.FlattenedLength); 1347scoped Span<nint> newLengths = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 1348scoped Span<nint> newStrides = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 1624Span<T> ospan = MemoryMarshal.CreateSpan(ref output.AsTensorSpan()._reference, (int)output.FlattenedLength); 1638Span<T> ospan = MemoryMarshal.CreateSpan(ref output.AsTensorSpan()._reference, (int)output.FlattenedLength); 1684Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination.FlattenedLength); 1767Span<NRange> srcIndexes = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<NRange> srcIndexesRentedBuffer); 1768Span<NRange> dstIndexes = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<NRange> dstIndexesRentedBuffer); 1891scoped Span<NRange> sliceDims = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<NRange> lengthsRentedBuffer); 1937scoped Span<nint> lengths = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 1938scoped Span<nint> strides = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2004scoped Span<nint> lengths = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2005scoped Span<nint> strides = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2071scoped Span<nint> lengths = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2072scoped Span<nint> strides = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2349scoped Span<nint> lengths = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2350scoped Span<nint> strides = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2425scoped Span<nint> newLengths = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2431Span<nint> newStrides = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2462scoped Span<nint> newLengths = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2468Span<nint> newStrides = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2499scoped Span<nint> newLengths = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2505Span<nint> newStrides = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer);
System\Numerics\Tensors\netcore\Tensor_1.cs (10)
175/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.FlattenTo(Span{T})" /> 176public void FlattenTo(scoped Span<T> destination) 201public Span<T> GetSpan(scoped ReadOnlySpan<nint> startIndexes, int length) => AsTensorSpan().GetSpan(startIndexes, length); 204public Span<T> GetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length) => AsTensorSpan().GetSpan(startIndexes, length); 276/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.TryFlattenTo(Span{T})" /> 277public bool TryFlattenTo(scoped Span<T> destination) => AsReadOnlyTensorSpan().TryFlattenTo(destination); 279/// <inheritdoc cref="ITensor{TSelf, T}.TryGetSpan(ReadOnlySpan{nint}, int, out Span{T})" /> 280public bool TryGetSpan(scoped ReadOnlySpan<nint> startIndexes, int length, out Span<T> span) => AsTensorSpan().TryGetSpan(startIndexes, length, out span); 282/// <inheritdoc cref="ITensor{TSelf, T}.TryGetSpan(ReadOnlySpan{NIndex}, int, out Span{T})" /> 283public bool TryGetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length, out Span<T> span) => AsTensorSpan().TryGetSpan(startIndexes, length, out span);
System\Numerics\Tensors\netcore\TensorOperation.cs (172)
16scoped Span<nint> indexes = RentedBuffer.Create(x.Rank, x.Strides, out nint linearOffset, out RentedBuffer<nint> rentedBuffer); 35scoped Span<nint> xIndexes = RentedBuffer.Create(destinationShape.Rank, x.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 36scoped Span<nint> yIndexes = RentedBuffer.Create(destinationShape.Rank, y.Strides, out nint yLinearOffset, out RentedBuffer<nint> yRentedBuffer); 66scoped Span<nint> xIndexes = RentedBuffer.Create(x.Rank, x.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 92scoped Span<nint> indexes = RentedBuffer.Create(destination.Rank, destination.Strides, out nint linearOffset, out RentedBuffer<nint> rentedBuffer); 109scoped Span<nint> xIndexes = RentedBuffer.Create(destination.Rank, x.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 110scoped Span<nint> destinationIndexes = RentedBuffer.Create(destination.Rank, destination.Strides, out nint destinationLinearOffset, out RentedBuffer<nint> destinationRentedBuffer); 130scoped Span<nint> xIndexes = RentedBuffer.Create(destination.Rank, x.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 131scoped Span<nint> destinationIndexes = RentedBuffer.Create(destination.Rank, destination.Strides, out nint negInnermostStride, out RentedBuffer<nint> destinationRentedBuffer); 156public static void Invoke<TOperation, TArg, TResult>(in ReadOnlyTensorSpan<TArg> x, in Span<TResult> destination) 159scoped Span<nint> xIndexes = RentedBuffer.Create(x.Rank, x.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 179scoped Span<nint> xIndexes = RentedBuffer.Create(x.Rank, x.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 197scoped Span<nint> xIndexes = RentedBuffer.Create(destination.Rank, x.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 198scoped Span<nint> yIndexes = RentedBuffer.Create(destination.Rank, y.Strides, out nint yLinearOffset, out RentedBuffer<nint> yRentedBuffer); 199scoped Span<nint> destinationIndexes = RentedBuffer.Create(destination.Rank, destination.Strides, out nint destinationLinearOffset, out RentedBuffer<nint> destinationRentedBuffer); 228scoped Span<nint> xIndexes = RentedBuffer.Create(destinationShape.Rank, x.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 229scoped Span<nint> yIndexes = RentedBuffer.Create(destinationShape.Rank, y.Strides, out nint yLinearOffset, out RentedBuffer<nint> yRentedBuffer); 258scoped Span<nint> xIndexes = RentedBuffer.Create(destination.Rank, x.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 259scoped Span<nint> destinationIndexes = RentedBuffer.Create(destination.Rank, destination.Strides, out nint destinationLinearOffset, out RentedBuffer<nint> destinationRentedBuffer); 280scoped Span<nint> xIndexes = RentedBuffer.Create(destination.Rank, y.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 281scoped Span<nint> destinationIndexes = RentedBuffer.Create(destination.Rank, destination.Strides, out nint destinationLinearOffset, out RentedBuffer<nint> destinationRentedBuffer); 302scoped Span<nint> xIndexes = RentedBuffer.Create(x.Rank, x.Strides, out nint xLinearOffset, out RentedBuffer<nint> xRentedBuffer); 367scoped Span<nint> resultLengths = (maxRank <= TensorShape.MaxInlineRank) 406public static void Invoke(Span<T> destination) 420public static void Invoke(ReadOnlySpan<T> source, Span<T> destination) 441public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 449public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 478public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 496public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 525public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 540public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 555public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 570public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 586public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 596public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 611public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 626public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 641public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 656public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 672public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 685public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 701public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 714public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 729public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 744public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 760public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 770public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 786public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 796public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 811public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 826public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 842public static void Invoke(ReadOnlySpan<TFrom> x, Span<TTo> destination) 858public static void Invoke(ReadOnlySpan<TFrom> x, Span<TTo> destination) 874public static void Invoke(ReadOnlySpan<TFrom> x, Span<TTo> destination) 890public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 900public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 915public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 930public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 949public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<(T, T, T)> destination) 966public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 982public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 997public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1014public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1024public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1033public static void Invoke(T x, ReadOnlySpan<T> y, Span<T> destination) 1048public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1063public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1078public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1093public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1108public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1123public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1138public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1153public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1168public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1185public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1195public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1204public static void Invoke(T x, ReadOnlySpan<T> y, Span<T> destination) 1219public static void Invoke(ReadOnlySpan<T> x, Span<int> destination) 1235public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1250public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1267public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1277public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1287public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1302public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1317public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1332public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1347public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1362public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1389public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1399public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1426public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1436public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1463public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1473public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1500public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1510public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1537public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1547public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1574public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1584public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1611public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1621public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1648public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1658public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1674public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1684public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1699public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1714public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1729public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1746public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1756public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1766public static void Invoke(T x, ReadOnlySpan<T> y, Span<T> destination) 1796public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1811public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1826public static void Invoke(ReadOnlySpan<T> x, int y, Span<T> destination) 1840public static void Invoke(ReadOnlySpan<T> x, int y, Span<T> destination) 1854public static void Invoke(ReadOnlySpan<T> x, int y, Span<T> destination) 1870public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1880public static void Invoke(ReadOnlySpan<T> x, Tuple<int, MidpointRounding> y, Span<T> destination) 1895public static void Invoke(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination) 1910public static void Invoke(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination) 1925public static void Invoke(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination) 1940public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1955public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1970public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1985public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2019public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 2037public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2054public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 2064public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 2074public static void Invoke(T x, ReadOnlySpan<T> y, Span<T> destination) 2104public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 2117public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 2136public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 2170public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2185public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2200public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2215public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2230public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2246public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 2256public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 2272public static void Invoke(Span<T> destination, T value) 2289public static void Invoke(ReadOnlySpan<bool> x, ReadOnlySpan<T> y, Span<T> destination) 2308public static void Invoke(ReadOnlySpan<bool> x, T y, Span<T> destination) 2335public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2343public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2372public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2390public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2424public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2432public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2461public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2479public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2513public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2521public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2550public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2568public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2602public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2610public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2639public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2657public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2689static abstract void Invoke(ReadOnlySpan<T1> x, T2 y, Span<TResult> destination); 2695static abstract void Invoke(T1 x, ReadOnlySpan<T2> y, Span<TResult> destination); 2701static abstract void Invoke(ReadOnlySpan<T1> x, ReadOnlySpan<T2> y, Span<TResult> destination); 2712static abstract void Invoke(Span<T> destination); 2718static abstract void Invoke(Span<TResult> destination, T x); 2724static abstract void Invoke(ReadOnlySpan<T> x, Span<TResult> destination); 2735public static Span<T> Create<T>(int rank, ReadOnlySpan<nint> strides, out nint linearOffset, [UnscopedRef] out RentedBuffer<T> rentedBuffer) 2738Span<T> output = RentedBuffer<T>.Create(rank, out rentedBuffer); 2745public static Span<T> CreateUninitialized<T>(int rank, [UnscopedRef] out RentedBuffer<T> rentedBuffer) 2754public static Span<T> Create(int rank, [UnscopedRef] out RentedBuffer<T> rentedBuffer) 2761Span<T> resultBuffer = rentedBuffer._array.AsSpan(0, rank); 2770return ((Span<T>)rentedBuffer._inline)[..rank];
System\Numerics\Tensors\netcore\TensorPrimitives.Abs.cs (1)
29public static void Abs<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Acos.cs (1)
24public static void Acos<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Acosh.cs (1)
24public static void Acosh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.AcosPi.cs (1)
24public static void AcosPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Add.cs (2)
26public static void Add<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 51public static void Add<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.AddMultiply.cs (3)
28public static void AddMultiply<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> multiplier, Span<T> destination) 56public static void AddMultiply<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T multiplier, Span<T> destination) 84public static void AddMultiply<T>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> multiplier, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Asin.cs (1)
25public static void Asin<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Asinh.cs (1)
24public static void Asinh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.AsinPi.cs (1)
24public static void AsinPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Atan.cs (1)
24public static void Atan<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Atan2.cs (3)
27public static void Atan2<T>(ReadOnlySpan<T> y, ReadOnlySpan<T> x, Span<T> destination) 46public static void Atan2<T>(ReadOnlySpan<T> y, T x, Span<T> destination) 65public static void Atan2<T>(T y, ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Atan2Pi.cs (3)
27public static void Atan2Pi<T>(ReadOnlySpan<T> y, ReadOnlySpan<T> x, Span<T> destination) 46public static void Atan2Pi<T>(ReadOnlySpan<T> y, T x, Span<T> destination) 65public static void Atan2Pi<T>(T y, ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Atanh.cs (1)
24public static void Atanh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.AtanPi.cs (1)
24public static void AtanPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.BitDecrement.cs (1)
22public static void BitDecrement<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.BitIncrement.cs (1)
22public static void BitIncrement<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.BitwiseAnd.cs (2)
23public static void BitwiseAnd<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 45public static void BitwiseAnd<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.BitwiseOr.cs (2)
23public static void BitwiseOr<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 45public static void BitwiseOr<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Cbrt.cs (1)
21public static void Cbrt<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Ceiling.cs (1)
21public static void Ceiling<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Clamp.cs (7)
30public static void Clamp<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> min, ReadOnlySpan<T> max, Span<T> destination) 59public static void Clamp<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> min, T max, Span<T> destination) 88public static void Clamp<T>(ReadOnlySpan<T> x, T min, ReadOnlySpan<T> max, Span<T> destination) 117public static void Clamp<T>(T x, ReadOnlySpan<T> min, ReadOnlySpan<T> max, Span<T> destination) 144public static void Clamp<T>(ReadOnlySpan<T> x, T min, T max, Span<T> destination) 176public static void Clamp<T>(T x, ReadOnlySpan<T> min, T max, Span<T> destination) 203public static void Clamp<T>(T x, T min, ReadOnlySpan<T> max, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertChecked.cs (1)
22public static void ConvertChecked<TFrom, TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertHelpers.cs (1)
13private static bool TryConvertUniversal<TFrom, TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertSaturating.cs (1)
22public static void ConvertSaturating<TFrom, TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertToInteger.cs (1)
22public static void ConvertToInteger<TFrom, TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertToIntegerNative.cs (1)
22public static void ConvertToIntegerNative<TFrom, TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertTruncating.cs (1)
22public static void ConvertTruncating<TFrom, TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.CopySign.cs (2)
23public static void CopySign<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> sign, Span<T> destination) 45public static void CopySign<T>(ReadOnlySpan<T> x, T sign, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Cos.cs (1)
28public static void Cos<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Cosh.cs (1)
32public static void Cosh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.CosPi.cs (1)
28public static void CosPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Decrement.cs (1)
20public static void Decrement<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.DegreesToRadians.cs (1)
21public static void DegreesToRadians<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Divide.cs (3)
26public static void Divide<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 52public static void Divide<T>(ReadOnlySpan<T> x, T y, Span<T> destination) 78public static void Divide<T>(T x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.DivRem.cs (6)
29public static void DivRem<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> quotientDestination, Span<T> remainderDestination) 51public static void DivRem<T>(ReadOnlySpan<T> x, T y, Span<T> quotientDestination, Span<T> remainderDestination) 73public static void DivRem<T>(T x, ReadOnlySpan<T> y, Span<T> quotientDestination, Span<T> remainderDestination)
System\Numerics\Tensors\netcore\TensorPrimitives.Exp.cs (1)
29public static void Exp<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Exp10.cs (1)
24public static void Exp10<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Exp10M1.cs (1)
24public static void Exp10M1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Exp2.cs (1)
24public static void Exp2<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Exp2M1.cs (1)
24public static void Exp2M1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ExpM1.cs (1)
24public static void ExpM1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Floor.cs (1)
21public static void Floor<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.FusedMultiplyAdd.cs (3)
37public static void FusedMultiplyAdd<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> addend, Span<T> destination) 72public static void FusedMultiplyAdd<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T addend, Span<T> destination) 106public static void FusedMultiplyAdd<T>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> addend, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Half.cs (15)
27public static void ConvertToHalf(ReadOnlySpan<float> source, Span<Half> destination) => 45public static void ConvertToSingle(ReadOnlySpan<Half> source, Span<float> destination) => 49private static bool TryUnaryInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, Span<T> destination) 66private static bool TryUnaryBitwiseInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, Span<T> destination) 83private static bool TryBinaryInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 101private static bool TryBinaryInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, T y, Span<T> destination) 119private static bool TryBinaryInvokeHalfAsInt16<T, TOp>(T x, ReadOnlySpan<T> y, Span<T> destination) 137private static bool TryBinaryBitwiseInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 155private static bool TryBinaryBitwiseInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, T y, Span<T> destination) 173private static bool TryAggregateInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 191private static bool TryAggregateInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, T y, Span<T> destination) 225private static bool TryTernaryInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> z, Span<T> destination) 244private static bool TryTernaryInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> z, Span<T> destination) 263private static bool TryTernaryInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T z, Span<T> destination) 282private static bool TryTernaryInvokeHalfAsInt16<T, TOp>(ReadOnlySpan<T> x, T y, T z, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Hypot.cs (1)
24public static void Hypot<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Ieee754Remainder.cs (3)
23public static void Ieee754Remainder<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 39public static void Ieee754Remainder<T>(ReadOnlySpan<T> x, T y, Span<T> destination) 54public static void Ieee754Remainder<T>(T x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ILogB.cs (1)
20public static void ILogB<T>(ReadOnlySpan<T> x, Span<int> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Increment.cs (1)
20public static void Increment<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsCanonical.cs (1)
18public static void IsCanonical<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsComplexNumber.cs (1)
18public static void IsComplexNumber<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsEvenInteger.cs (1)
18public static void IsEvenInteger<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsFinite.cs (1)
18public static void IsFinite<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsImaginaryNumber.cs (1)
18public static void IsImaginaryNumber<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsInfinity.cs (1)
18public static void IsInfinity<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsInteger.cs (1)
18public static void IsInteger<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNaN.cs (1)
18public static void IsNaN<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNegative.cs (1)
18public static void IsNegative<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNegativeInfinity.cs (1)
18public static void IsNegativeInfinity<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNormal.cs (1)
18public static void IsNormal<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsOddInteger.cs (1)
18public static void IsOddInteger<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsPositive.cs (1)
18public static void IsPositive<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsPositiveInfinity.cs (1)
18public static void IsPositiveInfinity<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsPow2.cs (1)
18public static void IsPow2<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsRealNumber.cs (1)
18public static void IsRealNumber<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsSubnormal.cs (1)
18public static void IsSubnormal<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsZero.cs (1)
18public static void IsZero<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.LeadingZeroCount.cs (1)
24public static void LeadingZeroCount<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Lerp.cs (3)
29public static void Lerp<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> amount, Span<T> destination) 57public static void Lerp<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T amount, Span<T> destination) 85public static void Lerp<T>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> amount, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Log.cs (3)
31public static void Log<T>(ReadOnlySpan<T> x, Span<T> destination) 59public static void Log<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 85public static void Log<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Log10.cs (1)
30public static void Log10<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Log10P1.cs (1)
30public static void Log10P1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Log2.cs (1)
31public static void Log2<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Log2P1.cs (1)
30public static void Log2P1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.LogP1.cs (1)
30public static void LogP1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Max.cs (2)
58public static void Max<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 88public static void Max<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MaxMagnitude.cs (2)
52public static void MaxMagnitude<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 76public static void MaxMagnitude<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MaxMagnitudeNumber.cs (2)
60public static void MaxMagnitudeNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 91public static void MaxMagnitudeNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MaxNumber.cs (2)
56public static void MaxNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 86public static void MaxNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Min.cs (2)
57public static void Min<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 87public static void Min<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MinMagnitude.cs (2)
57public static void MinMagnitude<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 86public static void MinMagnitude<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MinMagnitudeNumber.cs (2)
60public static void MinMagnitudeNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 91public static void MinMagnitudeNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MinNumber.cs (2)
56public static void MinNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 86public static void MinNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Multiply.cs (2)
26public static void Multiply<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 52public static void Multiply<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MultiplyAdd.cs (3)
28public static void MultiplyAdd<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> addend, Span<T> destination) 57public static void MultiplyAdd<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T addend, Span<T> destination) 85public static void MultiplyAdd<T>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> addend, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MultiplyAddEstimate.cs (9)
31/// Behaves the same as either <see cref="MultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, ReadOnlySpan{T}, Span{T})"/> or 32/// <see cref="FusedMultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, ReadOnlySpan{T}, Span{T})"/> depending on the current machine's capabilities. 35public static void MultiplyAddEstimate<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> addend, Span<T> destination) 64/// Behaves the same as either <see cref="MultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, T, Span{T})"/> or 65/// <see cref="FusedMultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, T, Span{T})"/> depending on the current machine's capabilities. 68public static void MultiplyAddEstimate<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T addend, Span<T> destination) 96/// Behaves the same as either <see cref="MultiplyAdd{T}(ReadOnlySpan{T}, T, ReadOnlySpan{T}, Span{T})"/> or 97/// <see cref="FusedMultiplyAdd{T}(ReadOnlySpan{T}, T, ReadOnlySpan{T}, Span{T})"/> depending on the current machine's capabilities. 100public static void MultiplyAddEstimate<T>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> addend, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Negate.cs (1)
23public static void Negate<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.OnesComplement.cs (1)
20public static void OnesComplement<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.PopCount.cs (1)
38public static void PopCount<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Pow.cs (3)
24public static void Pow<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 39public static void Pow<T>(ReadOnlySpan<T> x, T y, Span<T> destination) 54public static void Pow<T>(T x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.RadiansToDegrees.cs (1)
21public static void RadiansToDegrees<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Reciprocal.cs (4)
23public static void Reciprocal<T>(ReadOnlySpan<T> x, Span<T> destination) 45public static void ReciprocalEstimate<T>(ReadOnlySpan<T> x, Span<T> destination) 67public static void ReciprocalSqrt<T>(ReadOnlySpan<T> x, Span<T> destination) 89public static void ReciprocalSqrtEstimate<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Remainder.cs (3)
26public static void Remainder<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 52public static void Remainder<T>(ReadOnlySpan<T> x, T y, Span<T> destination) 78public static void Remainder<T>(T x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.RootN.cs (1)
22public static void RootN<T>(ReadOnlySpan<T> x, int n, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Rotate.cs (2)
21public static void RotateLeft<T>(ReadOnlySpan<T> x, int rotateAmount, Span<T> destination) 36public static void RotateRight<T>(ReadOnlySpan<T> x, int rotateAmount, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Round.cs (4)
22public static void Round<T>(ReadOnlySpan<T> x, Span<T> destination) 44public static void Round<T>(ReadOnlySpan<T> x, MidpointRounding mode, Span<T> destination) 90public static void Round<T>(ReadOnlySpan<T> x, int digits, Span<T> destination) where T : IFloatingPoint<T> => 107public static void Round<T>(ReadOnlySpan<T> x, int digits, MidpointRounding mode, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ScaleB.cs (1)
21public static void ScaleB<T>(ReadOnlySpan<T> x, int n, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ShiftLeft.cs (1)
21public static void ShiftLeft<T>(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ShiftRightArithmetic.cs (1)
21public static void ShiftRightArithmetic<T>(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ShiftRightLogical.cs (1)
21public static void ShiftRightLogical<T>(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Sigmoid.cs (1)
25public static void Sigmoid<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Sign.cs (1)
21public static void Sign<T>(ReadOnlySpan<T> x, Span<int> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Sin.cs (1)
28public static void Sin<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.SinCos.cs (2)
25public static void SinCos<T>(ReadOnlySpan<T> x, Span<T> sinDestination, Span<T> cosDestination)
System\Numerics\Tensors\netcore\TensorPrimitives.SinCosPi.cs (2)
25public static void SinCosPi<T>(ReadOnlySpan<T> x, Span<T> sinPiDestination, Span<T> cosPiDestination)
System\Numerics\Tensors\netcore\TensorPrimitives.Single.netcore.cs (7)
41ReadOnlySpan<float> x, Span<float> destination) 46ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) 51ReadOnlySpan<float> x, float y, Span<float> destination) 56ReadOnlySpan<float> x, float y, Span<float> destination) 62ReadOnlySpan<float> x, ReadOnlySpan<float> y, ReadOnlySpan<float> z, Span<float> destination) 67ReadOnlySpan<float> x, ReadOnlySpan<float> y, float z, Span<float> destination) 72ReadOnlySpan<float> x, float y, ReadOnlySpan<float> z, Span<float> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Sinh.cs (1)
32public static void Sinh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.SinPi.cs (1)
28public static void SinPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.SoftMax.cs (1)
24public static void SoftMax<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Sqrt.cs (1)
20public static void Sqrt<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Subtract.cs (3)
26public static void Subtract<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 51public static void Subtract<T>(ReadOnlySpan<T> x, T y, Span<T> destination) 76public static void Subtract<T>(T x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Tan.cs (1)
28public static void Tan<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Tanh.cs (1)
32public static void Tanh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.TanPi.cs (1)
27public static void TanPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.TrailingZeroCount.cs (1)
23public static void TrailingZeroCount<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Truncate.cs (1)
23public static void Truncate<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Xor.cs (2)
23public static void Xor<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 45public static void Xor<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorShape.cs (21)
79scoped Span<nint> destinationLengths; 80scoped Span<nint> destinationStrides; 93destinationLengths = ((Span<nint>)_inlineLengths)[..rank]; 94destinationStrides = ((Span<nint>)_inlineStrides)[..rank]; 161scoped Span<int> stridesOrder; 171stridesOrder = ((Span<int>)stridesOrderBuffer)[..rank]; 284scoped Span<nint> destinationLengths; 285scoped Span<nint> destinationStrides; 298destinationLengths = ((Span<nint>)_inlineLengths)[..rank]; 299destinationStrides = ((Span<nint>)_inlineStrides)[..rank]; 407public nint AdjustToNextIndex(in TensorShape destinationShape, nint linearOffset, Span<nint> indexes) 472public nint AdjustToPreviousIndex(in TensorShape destinationShape, nint linearOffset, Span<nint> indexes) 537public static bool AdjustToNextIndex(Span<NRange> ranges, int dimension, ReadOnlySpan<nint> lengths) 706scoped Span<nint> lengths; 716lengths = ((Span<nint>)lengthsBuffer)[..rank]; 746scoped Span<nint> intermediateLengths = default; 773intermediateLengths = ((Span<nint>)intermediateLengthsBuffer)[..rank]; 1114scoped Span<nint> intermediateLengths; 1118scoped Span<nint> intermediateStrides; 1131intermediateLengths = ((Span<nint>)intermediateLengthsBuffer)[..rank]; 1134intermediateStrides = ((Span<nint>)intermediateStridesBuffer)[..rank];
System\Numerics\Tensors\netcore\TensorSpan_1.cs (15)
74public TensorSpan(Span<T> span) 82public TensorSpan(Span<T> span, scoped ReadOnlySpan<nint> lengths) 86public TensorSpan(Span<T> span, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) 247/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.FlattenTo(Span{T})" /> 248public void FlattenTo(scoped Span<T> destination) 279public Span<T> GetSpan(scoped ReadOnlySpan<nint> startIndexes, int length) 281if (!TryGetSpan(startIndexes, length, out Span<T> span)) 289public Span<T> GetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length) 291if (!TryGetSpan(startIndexes, length, out Span<T> span)) 337/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.TryFlattenTo(Span{T})" /> 338public bool TryFlattenTo(scoped Span<T> destination) => AsReadOnlyTensorSpan().TryFlattenTo(destination); 340/// <inheritdoc cref="ITensor{TSelf, T}.TryGetSpan(ReadOnlySpan{nint}, int, out Span{T})" /> 341public bool TryGetSpan(scoped ReadOnlySpan<nint> startIndexes, int length, out Span<T> span) 356/// <inheritdoc cref="ITensor{TSelf, T}.TryGetSpan(ReadOnlySpan{NIndex}, int, out Span{T})" /> 357public bool TryGetSpan(scoped ReadOnlySpan<NIndex> startIndexes, int length, out Span<T> span)
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (7)
15private static void ValidateInputOutputSpanNonOverlapping<T>(ReadOnlySpan<T> input, Span<T> destination) 28private static void ValidateOutputSpansNonOverlapping<T>(int inputLength, Span<T> destination1, Span<T> destination2) 48private static unsafe Span<TTo> Rename<TFrom, TTo>(Span<TFrom> span) 52return Unsafe.BitCast<Span<TFrom>, Span<TTo>>(span);
System\Numerics\Tensors\TensorPrimitives.Single.cs (28)
26public static void Abs(ReadOnlySpan<float> x, Span<float> destination) => 45public static void Add(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 62public static void Add(ReadOnlySpan<float> x, float y, Span<float> destination) => 83public static void AddMultiply(ReadOnlySpan<float> x, ReadOnlySpan<float> y, ReadOnlySpan<float> multiplier, Span<float> destination) => 103public static void AddMultiply(ReadOnlySpan<float> x, ReadOnlySpan<float> y, float multiplier, Span<float> destination) => 123public static void AddMultiply(ReadOnlySpan<float> x, float y, ReadOnlySpan<float> multiplier, Span<float> destination) => 147public static void Cosh(ReadOnlySpan<float> x, Span<float> destination) => 222public static void Divide(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 239public static void Divide(ReadOnlySpan<float> x, float y, Span<float> destination) => 286public static void Exp(ReadOnlySpan<float> x, Span<float> destination) => 375public static void Log(ReadOnlySpan<float> x, Span<float> destination) => 398public static void Log2(ReadOnlySpan<float> x, Span<float> destination) => 439public static void Max(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 475public static void MaxMagnitude(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 516public static void Min(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 557public static void MinMagnitude(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 576public static void Multiply(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 594public static void Multiply(ReadOnlySpan<float> x, float y, Span<float> destination) => 615public static void MultiplyAdd(ReadOnlySpan<float> x, ReadOnlySpan<float> y, ReadOnlySpan<float> addend, Span<float> destination) => 636public static void MultiplyAdd(ReadOnlySpan<float> x, ReadOnlySpan<float> y, float addend, Span<float> destination) => 656public static void MultiplyAdd(ReadOnlySpan<float> x, float y, ReadOnlySpan<float> addend, Span<float> destination) => 672public static void Negate(ReadOnlySpan<float> x, Span<float> destination) => 795public static void Sigmoid(ReadOnlySpan<float> x, Span<float> destination) 826public static void Sinh(ReadOnlySpan<float> x, Span<float> destination) => 845public static void SoftMax(ReadOnlySpan<float> x, Span<float> destination) 880public static void Subtract(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 897public static void Subtract(ReadOnlySpan<float> x, float y, Span<float> destination) => 979public static void Tanh(ReadOnlySpan<float> x, Span<float> destination) =>
System.Private.CoreLib (1302)
_generated\2\LibraryImports.g.cs (4)
681internal static partial int ToAscii(uint flags, global::System.ReadOnlySpan<char> src, int srcLen, global::System.Span<char> dstBuffer, int dstBufferCapacity) 703internal static partial int ToUnicode(uint flags, global::System.ReadOnlySpan<char> src, int srcLen, global::System.Span<char> dstBuffer, int dstBufferCapacity) 1326internal static partial int IdnToAscii(uint dwFlags, global::System.ReadOnlySpan<char> lpUnicodeCharStr, int cchUnicodeChar, global::System.Span<char> lpASCIICharStr, int cchASCIIChar) 1352internal static partial int IdnToUnicode(uint dwFlags, global::System.ReadOnlySpan<char> lpASCIICharStr, int cchASCIIChar, global::System.Span<char> lpUnicodeCharStr, int cchUnicodeChar)
Internal\Reflection\Core\Execution\MethodBaseInvoker.cs (4)
45protected internal abstract object CreateInstance(Span<object?> arguments); 46protected internal abstract object CreateInstanceWithFewArgs(Span<object?> arguments); 48protected internal abstract object? Invoke(object? thisObject, Span<object?> arguments); 49protected internal abstract object? InvokeDirectWithFewArgs(object? thisObject, Span<object?> arguments);
Internal\Runtime\CompilerHelpers\InteropHelpers.cs (1)
71Span<char> native = new Span<char>((char*)buffer, length);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.CoreCLR.cs (2)
453Span<byte> callstackSpan = buffer.AsSpan(index); 591Span<byte> callstackHeaderSpan = eventBuffer.Data.AsSpan(index, MaxCallstackHeaderSize);
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (3)
49public readonly Span<T> AsSpan() => _items.AsSpan(0, _count); 51public readonly Span<T> AsSpan(int start) => _items.AsSpan(start, _count - start); 53public Span<T> AppendSpan(int length)
src\runtime\src\libraries\Common\src\Interop\Interop.Idna.cs (2)
15internal static partial int ToAscii(uint flags, ReadOnlySpan<char> src, int srcLen, Span<char> dstBuffer, int dstBufferCapacity); 18internal static partial int ToUnicode(uint flags, ReadOnlySpan<char> src, int srcLen, Span<char> dstBuffer, int dstBufferCapacity);
src\runtime\src\libraries\Common\src\Interop\Interop.Utils.cs (1)
22Span<char> buffer = stackalloc char[InitialSize];
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (1)
24Span<uint> groups = stackalloc uint[InitialGroupsLength];
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (1)
33internal ReadOnlySpan<char> GetName(Span<char> buffer)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
36Span<byte> spanBuffer = stackalloc byte[StackBufferSize];
src\runtime\src\libraries\Common\src\Interop\Windows\Normaliz\Interop.Idna.cs (2)
20Span<char> lpASCIICharStr, 28Span<char> lpUnicodeCharStr,
src\runtime\src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (3)
11private readonly Span<int> _span; 13internal BitHelper(Span<int> span, bool clear) 29Span<int> span = _span;
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T?> scratchBuffer) 52Span<T> span = _span; 68Span<T> span = _span; 107public Span<T> AppendSpan(int length) 112Span<T> span = _span; 125private Span<T> AppendSpanWithGrow(int length) 149public bool TryCopyTo(Span<T> destination, out int itemsWritten)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (12)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 118private static void EncodeTo_Vector128<TChar>(ReadOnlySpan<byte> source, Span<TChar> destination, Casing casing) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 209EncodeTo_Vector128(source, Unsafe.BitCast<Span<char>, Span<ushort>>(destination), casing); 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 302public static bool TryDecodeFrom_Vector128<TChar>(ReadOnlySpan<TChar> source, Span<byte> destination, out int elementsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
467Span<int> thousandsSepPos = [0, 0, 0, 0];
src\runtime\src\libraries\Common\src\System\Number.NumberBuffer.cs (2)
32public Span<byte> Digits; 43public NumberBuffer(NumberBufferKind kind, Span<byte> digits)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (2)
251Span<Range> parts = stackalloc Range[5]; 261Span<ushort> versionNumbers = [ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue];
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (1)
33public void FromManaged(ReadOnlySpan<char> managed, Span<byte> buffer)
src\runtime\src\libraries\Common\src\System\Sha1ForNonSecretPurposes.cs (6)
27public static unsafe void HashData(ReadOnlySpan<byte> source, Span<byte> destination) 31Span<uint> w = stackalloc uint[85]; 47Span<byte> tail = stackalloc byte[2 * 64]; 86private static void Start(Span<uint> w) 137public void Finish(Span<byte> output) 174private static void Drain(Span<uint> w)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Action.cs (2)
194public delegate void SpanAction<T, in TArg>(Span<T> span, TArg arg) 200internal delegate TResult SpanFunc<TSpan, in T1, in T2, in T3, out TResult>(Span<TSpan> span, T1 arg1, T2 arg2, T3 arg3);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.cs (8)
1557Span<T> span = stackAllocatedMatches; 2492Span<T> keysSpan = UnsafeArrayAsSpan<T>(keys, adjustedIndex, length); 2515var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2564var span = new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), length); 2588var spanKeys = new Span<TKey>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(keys), index), length); 2589var spanItems = new Span<TValue>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(items), index), length); 2606var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 3072private static Span<T> UnsafeArrayAsSpan<T>(Array array, int adjustedIndex, int length) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (15)
42public static bool TryWriteBytes(Span<byte> destination, bool value) 70public static bool TryWriteBytes(Span<byte> destination, char value) 98public static bool TryWriteBytes(Span<byte> destination, short value) 126public static bool TryWriteBytes(Span<byte> destination, int value) 154public static bool TryWriteBytes(Span<byte> destination, long value) 182public static bool TryWriteBytes(Span<byte> destination, Int128 value) 212public static bool TryWriteBytes(Span<byte> destination, ushort value) 242public static bool TryWriteBytes(Span<byte> destination, uint value) 272public static bool TryWriteBytes(Span<byte> destination, ulong value) 302public static bool TryWriteBytes(Span<byte> destination, UInt128 value) 330public static unsafe bool TryWriteBytes(Span<byte> destination, BFloat16 value) 358public static unsafe bool TryWriteBytes(Span<byte> destination, Half value) 386public static bool TryWriteBytes(Span<byte> destination, float value) 414public static bool TryWriteBytes(Span<byte> destination, double value) 870var dst = new Span<char>(ref result.GetRawStringData(), result.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Boolean.cs (1)
95public bool TryFormat(Span<char> destination, out int charsWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (20)
201public static void ReverseEndianness(ReadOnlySpan<ushort> source, Span<ushort> destination) => 204/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 205public static void ReverseEndianness(ReadOnlySpan<short> source, Span<short> destination) => 208/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 210public static void ReverseEndianness(ReadOnlySpan<uint> source, Span<uint> destination) => 213/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 214public static void ReverseEndianness(ReadOnlySpan<int> source, Span<int> destination) => 217/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 219public static void ReverseEndianness(ReadOnlySpan<ulong> source, Span<ulong> destination) => 222/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 223public static void ReverseEndianness(ReadOnlySpan<long> source, Span<long> destination) => 226/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 228public static void ReverseEndianness(ReadOnlySpan<nuint> source, Span<nuint> destination) => 235/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 236public static void ReverseEndianness(ReadOnlySpan<nint> source, Span<nint> destination) => 285private static void ReverseEndianness<T, TReverser>(ReadOnlySpan<T> source, Span<T> destination) 373/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 375public static void ReverseEndianness(ReadOnlySpan<UInt128> source, Span<UInt128> destination) => 378/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 379public static void ReverseEndianness(ReadOnlySpan<Int128> source, Span<Int128> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteBigEndian.cs (28)
22public static void WriteDoubleBigEndian(Span<byte> destination, double value) 45public static void WriteHalfBigEndian(Span<byte> destination, Half value) 68public static void WriteBFloat16BigEndian(Span<byte> destination, BFloat16 value) 91public static void WriteInt16BigEndian(Span<byte> destination, short value) 114public static void WriteInt32BigEndian(Span<byte> destination, int value) 137public static void WriteInt64BigEndian(Span<byte> destination, long value) 160public static void WriteInt128BigEndian(Span<byte> destination, Int128 value) 183public static void WriteIntPtrBigEndian(Span<byte> destination, nint value) 206public static void WriteSingleBigEndian(Span<byte> destination, float value) 230public static void WriteUInt16BigEndian(Span<byte> destination, ushort value) 254public static void WriteUInt32BigEndian(Span<byte> destination, uint value) 278public static void WriteUInt64BigEndian(Span<byte> destination, ulong value) 302public static void WriteUInt128BigEndian(Span<byte> destination, UInt128 value) 326public static void WriteUIntPtrBigEndian(Span<byte> destination, nuint value) 349public static bool TryWriteDoubleBigEndian(Span<byte> destination, double value) 370public static bool TryWriteHalfBigEndian(Span<byte> destination, Half value) 391public static bool TryWriteBFloat16BigEndian(Span<byte> destination, BFloat16 value) 412public static bool TryWriteInt16BigEndian(Span<byte> destination, short value) 433public static bool TryWriteInt32BigEndian(Span<byte> destination, int value) 454public static bool TryWriteInt64BigEndian(Span<byte> destination, long value) 475public static bool TryWriteInt128BigEndian(Span<byte> destination, Int128 value) 496public static bool TryWriteIntPtrBigEndian(Span<byte> destination, nint value) 517public static bool TryWriteSingleBigEndian(Span<byte> destination, float value) 539public static bool TryWriteUInt16BigEndian(Span<byte> destination, ushort value) 561public static bool TryWriteUInt32BigEndian(Span<byte> destination, uint value) 583public static bool TryWriteUInt64BigEndian(Span<byte> destination, ulong value) 605public static bool TryWriteUInt128BigEndian(Span<byte> destination, UInt128 value) 627public static bool TryWriteUIntPtrBigEndian(Span<byte> destination, nuint value)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteLittleEndian.cs (28)
22public static void WriteDoubleLittleEndian(Span<byte> destination, double value) 45public static void WriteHalfLittleEndian(Span<byte> destination, Half value) 68public static void WriteBFloat16LittleEndian(Span<byte> destination, BFloat16 value) 91public static void WriteInt16LittleEndian(Span<byte> destination, short value) 114public static void WriteInt32LittleEndian(Span<byte> destination, int value) 137public static void WriteInt64LittleEndian(Span<byte> destination, long value) 160public static void WriteInt128LittleEndian(Span<byte> destination, Int128 value) 183public static void WriteIntPtrLittleEndian(Span<byte> destination, nint value) 206public static void WriteSingleLittleEndian(Span<byte> destination, float value) 230public static void WriteUInt16LittleEndian(Span<byte> destination, ushort value) 254public static void WriteUInt32LittleEndian(Span<byte> destination, uint value) 278public static void WriteUInt64LittleEndian(Span<byte> destination, ulong value) 302public static void WriteUInt128LittleEndian(Span<byte> destination, UInt128 value) 326public static void WriteUIntPtrLittleEndian(Span<byte> destination, nuint value) 349public static bool TryWriteDoubleLittleEndian(Span<byte> destination, double value) 370public static bool TryWriteHalfLittleEndian(Span<byte> destination, Half value) 391public static bool TryWriteBFloat16LittleEndian(Span<byte> destination, BFloat16 value) 412public static bool TryWriteInt16LittleEndian(Span<byte> destination, short value) 433public static bool TryWriteInt32LittleEndian(Span<byte> destination, int value) 454public static bool TryWriteInt64LittleEndian(Span<byte> destination, long value) 475public static bool TryWriteInt128LittleEndian(Span<byte> destination, Int128 value) 496public static bool TryWriteIntPtrLittleEndian(Span<byte> destination, nint value) 517public static bool TryWriteSingleLittleEndian(Span<byte> destination, float value) 539public static bool TryWriteUInt16LittleEndian(Span<byte> destination, ushort value) 561public static bool TryWriteUInt32LittleEndian(Span<byte> destination, uint value) 583public static bool TryWriteUInt64LittleEndian(Span<byte> destination, ulong value) 605public static bool TryWriteUInt128LittleEndian(Span<byte> destination, UInt128 value) 627public static bool TryWriteUIntPtrLittleEndian(Span<byte> destination, nuint value)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\MemoryManager.cs (1)
21public abstract Span<T> GetSpan();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (2)
158internal Span<char> Format(Span<char> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Decoder.cs (9)
65public static OperationStatus DecodeFromUtf8(ReadOnlySpan<byte> utf8, Span<byte> bytes, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) => 77public static int DecodeFromUtf8(ReadOnlySpan<byte> source, Span<byte> destination) 107Span<byte> destination = (uint)upperBound <= MaxStackallocThreshold 132public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 160public static OperationStatus DecodeFromUtf8InPlace(Span<byte> buffer, out int bytesWritten) => 173public static OperationStatus DecodeFromChars(ReadOnlySpan<char> source, Span<byte> destination, 187public static int DecodeFromChars(ReadOnlySpan<char> source, Span<byte> destination) 214public static bool TryDecodeFromChars(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 239Span<byte> destination = (uint)upperBound <= MaxStackallocThreshold
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Encoder.cs (8)
64public static OperationStatus EncodeToUtf8(ReadOnlySpan<byte> bytes, Span<byte> utf8, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) => 74public static int EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> destination) 108public static bool TryEncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 130public static OperationStatus EncodeToUtf8InPlace(Span<byte> buffer, int dataLength, out int bytesWritten) => 143public static bool TryEncodeToUtf8InPlace(Span<byte> buffer, int dataLength, out int bytesWritten) 160public static OperationStatus EncodeToChars(ReadOnlySpan<byte> source, Span<char> destination, 171public static int EncodeToChars(ReadOnlySpan<byte> source, Span<char> destination) 217public static bool TryEncodeToChars(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (11)
22internal static unsafe OperationStatus DecodeFrom<TBase64Decoder, T>(TBase64Decoder decoder, ReadOnlySpan<T> source, Span<byte> bytes, 280static OperationStatus InvalidDataFallback(TBase64Decoder decoder, ReadOnlySpan<T> source, Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock) 336internal static unsafe OperationStatus DecodeFromUtf8InPlace<TBase64Decoder>(TBase64Decoder decoder, Span<byte> buffer, out int bytesWritten, bool ignoreWhiteSpace) 468internal static unsafe OperationStatus DecodeWithWhiteSpaceBlockwise<TBase64Decoder>(TBase64Decoder decoder, ReadOnlySpan<byte> source, Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock = true) 472Span<byte> buffer = stackalloc byte[BlockSize]; 573internal static unsafe OperationStatus DecodeWithWhiteSpaceBlockwise<TBase64Decoder>(TBase64Decoder decoder, ReadOnlySpan<ushort> source, Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock = true) 577Span<ushort> buffer = stackalloc ushort[BlockSize]; 715private static unsafe OperationStatus DecodeWithWhiteSpaceFromUtf8InPlace<TBase64Decoder>(TBase64Decoder decoder, Span<byte> source, ref int destIndex, uint sourceIndex) 719Span<byte> buffer = stackalloc byte[BlockSize]; 1597Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock = true) 1813Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock = true) where TBase64Decoder : IBase64Decoder<ushort> =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64EncoderHelper.cs (2)
20Span<T> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) 579internal static unsafe OperationStatus EncodeToUtf8InPlace<TBase64Encoder>(TBase64Encoder encoder, Span<byte> buffer, int dataLength, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64Helper.cs (1)
243Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock = true)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlDecoder.cs (11)
66public static OperationStatus DecodeFromUtf8(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) => 84public static int DecodeFromUtf8InPlace(Span<byte> buffer) 115public static int DecodeFromUtf8(ReadOnlySpan<byte> source, Span<byte> destination) 142public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 167Span<byte> destination = (uint)upperBound <= MaxStackallocThreshold 200public static OperationStatus DecodeFromChars(ReadOnlySpan<char> source, Span<byte> destination, 214public static int DecodeFromChars(ReadOnlySpan<char> source, Span<byte> destination) 241public static bool TryDecodeFromChars(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 265Span<byte> destination = (uint)upperBound <= MaxStackallocThreshold 479public OperationStatus DecodeWithWhiteSpaceBlockwiseWrapper<TBase64Decoder>(TBase64Decoder decoder, ReadOnlySpan<byte> utf8, Span<byte> bytes, 564public OperationStatus DecodeWithWhiteSpaceBlockwiseWrapper<TBase64Decoder>(TBase64Decoder decoder, ReadOnlySpan<ushort> source, Span<byte> bytes,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlEncoder.cs (7)
31Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) => 68public static int EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> destination) 107public static OperationStatus EncodeToChars(ReadOnlySpan<byte> source, Span<char> destination, 119public static int EncodeToChars(ReadOnlySpan<byte> source, Span<char> destination) 181public static bool TryEncodeToChars(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 196public static bool TryEncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 214public static bool TryEncodeToUtf8InPlace(Span<byte> buffer, int dataLength, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlValidator.cs (4)
16/// <see cref="Base64Url.TryDecodeFromChars(ReadOnlySpan{char}, Span{byte}, out int)"/> would successfully decode (in the case 17/// of <see cref="Base64Url.TryDecodeFromChars(ReadOnlySpan{char}, Span{byte}, out int)"/> assuming sufficient output space). 29/// <see cref="Base64Url.TryDecodeFromChars(ReadOnlySpan{char}, Span{byte}, out int)"/> would successfully decode (in the case 30/// of <see cref="Base64Url.TryDecodeFromChars(ReadOnlySpan{char}, Span{byte}, out int)"/> assuming sufficient output space).
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\FormattingHelpers.cs (2)
11public static unsafe bool TryFormat<T>(T value, Span<byte> utf8Destination, out int bytesWritten, StandardFormat format) where T : IUtf8SpanFormattable 13scoped Span<char> formatText = default;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Boolean.cs (1)
27public static bool TryFormat(bool value, Span<byte> destination, out int bytesWritten, StandardFormat format = default)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (3)
33public static bool TryFormat(DateTimeOffset value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) 81public static bool TryFormat(DateTime value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) 104private static bool TryFormatDateTimeL(DateTime value, Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Decimal.cs (1)
28public static bool TryFormat(decimal value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Float.cs (2)
28public static bool TryFormat(double value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 51public static bool TryFormat(float value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Guid.cs (1)
29public static bool TryFormat(Guid value, Span<byte> destination, out int bytesWritten, StandardFormat format = default)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Integer.cs (9)
34public static bool TryFormat(byte value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 59public static bool TryFormat(sbyte value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 84public static bool TryFormat(ushort value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 108public static bool TryFormat(short value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 134public static bool TryFormat(uint value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) 186public static bool TryFormat(int value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 190private static bool TryFormat(int value, int hexMask, Span<byte> destination, out int bytesWritten, StandardFormat format = default) 248public static bool TryFormat(ulong value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) 301public static bool TryFormat(long value, Span<byte> destination, out int bytesWritten, StandardFormat format = default)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.TimeSpan.cs (1)
30public static bool TryFormat(TimeSpan value, Span<byte> destination, out int bytesWritten, StandardFormat format = default)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Number.cs (1)
32Span<byte> digits = number.Digits;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (6)
162public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 168public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 371/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 372bool IBinaryInteger<byte>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 388/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 389bool IBinaryInteger<byte>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (6)
197bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) 211bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 1320/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 1321bool IBinaryInteger<char>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 1333/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 1334bool IBinaryInteger<char>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (15)
99BinaryPrimitives.ReverseEndianness(array, MemoryMarshal.Cast<byte, int>((Span<byte>)_array)); 123MemoryMarshal.Cast<byte, int>((Span<byte>)_array)[(int)index] &= ReverseIfBE((1 << (int)extraBits) - 1); 261BinaryPrimitives.ReverseEndianness(values, MemoryMarshal.Cast<byte, int>((Span<byte>)_array)); 449Span<int> thisRemaining = MemoryMarshal.Cast<byte, int>(((Span<byte>)thisArray).Slice(i, roundedBytesRemaining)); 450Span<int> valueRemaining = MemoryMarshal.Cast<byte, int>(((Span<byte>)valueArray).Slice(i, roundedBytesRemaining)); 525Span<int> intSpan = MemoryMarshal.Cast<byte, int>((Span<byte>)_array); 588Span<int> intSpan = MemoryMarshal.Cast<byte, int>((Span<byte>)_array); 691Span<int> source = MemoryMarshal.Cast<byte, int>((Span<byte>)_array).Slice(0, intLength); 743Span<int> in32Span = MemoryMarshal.Cast<byte, int>((Span<byte>)_array);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (80)
19public void Sort(Span<T> keys, IComparer<T>? comparer) 54internal static void Sort(Span<T> keys, Comparison<T> comparer) 99private static void SwapIfGreater(Span<T> keys, Comparison<T> comparer, int i, int j) 112private static void Swap(Span<T> a, int i, int j) 121internal static void IntrospectiveSort(Span<T> keys, Comparison<T> comparer) 134private static void IntroSort(Span<T> keys, int depthLimit, Comparison<T> comparer) 179private static int PickPivotAndPartition(Span<T> keys, Comparison<T> comparer) 217private static void HeapSort(Span<T> keys, Comparison<T> comparer) 235private static void DownHeap(Span<T> keys, int i, int n, Comparison<T> comparer) 258private static void InsertionSort(Span<T> keys, Comparison<T> comparer) 283public void Sort(Span<T> keys, IComparer<T>? comparer) 298int nanLeft = SortUtils.MoveNansToFront(keys, default(Span<byte>)); 411private static void IntroSort(Span<T> keys, int depthLimit) 458private static unsafe int PickPivotAndPartition(Span<T> keys) 507private static void HeapSort(Span<T> keys) 524private static void DownHeap(Span<T> keys, int i, int n) 545private static void InsertionSort(Span<T> keys) 615public void Sort(Span<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 633private static void SwapIfGreaterWithValues(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 653private static void Swap(Span<TKey> keys, Span<TValue> values, int i, int j) 666internal static void IntrospectiveSort(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 677private static void IntroSort(Span<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 723private static int PickPivotAndPartition(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 761private static void HeapSort(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 779private static void DownHeap(Span<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 806private static void InsertionSort(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 832public void Sort(Span<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 876private static void SwapIfGreaterWithValues(Span<TKey> keys, Span<TValue> values, int i, int j) 894private static void Swap(Span<TKey> keys, Span<TValue> values, int i, int j) 907private static void IntroSort(Span<TKey> keys, Span<TValue> values, int depthLimit) 952private static int PickPivotAndPartition(Span<TKey> keys, Span<TValue> values) 997private static void HeapSort(Span<TKey> keys, Span<TValue> values) 1014private static void DownHeap(Span<TKey> keys, Span<TValue> values, int i, int n) 1039private static void InsertionSort(Span<TKey> keys, Span<TValue> values) 1111public static int MoveNansToFront<TKey, TValue>(Span<TKey> keys, Span<TValue> values) where TKey : notnull 1149internal static void Sort(Span<T> keys, TComparer comparer) 1169private static void Swap(Span<T> a, int i, int j) 1178private static void SwapIfGreater(Span<T> keys, TComparer comparer, int i, int j) 1190internal static void IntrospectiveSort(Span<T> keys, TComparer comparer) 1203private static void IntroSort(Span<T> keys, int depthLimit, TComparer comparer) 1247private static int PickPivotAndPartition(Span<T> keys, TComparer comparer) 1285private static void HeapSort(Span<T> keys, TComparer comparer) 1303private static void DownHeap(Span<T> keys, int i, int n, TComparer comparer) 1326private static void InsertionSort(Span<T> keys, TComparer comparer) 1351public static void Sort(Span<TKey> keys, Span<TValue> values, TComparer comparer) 1372private static void Swap(Span<TKey> keys, Span<TValue> values, int i, int j) 1385private static void SwapIfGreaterWithValues(Span<TKey> keys, Span<TValue> values, TComparer comparer, int i, int j) 1404internal static void IntrospectiveSort(Span<TKey> keys, Span<TValue> values, TComparer comparer) 1415private static void IntroSort(Span<TKey> keys, Span<TValue> values, int depthLimit, TComparer comparer) 1460private static int PickPivotAndPartition(Span<TKey> keys, Span<TValue> values, TComparer comparer) 1497private static void HeapSort(Span<TKey> keys, Span<TValue> values, TComparer comparer) 1515private static void DownHeap(Span<TKey> keys, Span<TValue> values, int i, int n, TComparer comparer) 1542private static void InsertionSort(Span<TKey> keys, Span<TValue> values, TComparer comparer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (1)
164public static void CopyTo<T>(this List<T> list, Span<T> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (4)
1590Span<int> span = stackalloc int[StackAllocThreshold]; 1658Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1663Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1746Span<int> span = stackalloc int[StackAllocThreshold];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Convert.cs (12)
2299Span<char> chars = stackalloc char[22]; // max length of a ulong in octal 2416public static bool TryToBase64Chars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten, Base64FormattingOptions options = Base64FormattingOptions.None) 2453private static int ConvertToBase64WithLineBreaks(Span<char> destination, ReadOnlySpan<byte> source) 2524public static bool TryFromBase64String(string s, Span<byte> bytes, out int bytesWritten) 2534public static bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 2641public static OperationStatus FromHexString(string source, Span<byte> destination, out int charsConsumed, out int bytesWritten) 2657public static OperationStatus FromHexString(ReadOnlySpan<char> source, Span<byte> destination, out int charsConsumed, out int bytesWritten) 2713public static OperationStatus FromHexString(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesConsumed, out int bytesWritten) 2813public static bool TryToHexString(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 2836public static bool TryToHexString(ReadOnlySpan<byte> source, Span<byte> utf8Destination, out int bytesWritten) 2908public static bool TryToHexStringLower(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 2931public static bool TryToHexStringLower(ReadOnlySpan<byte> source, Span<byte> utf8Destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (3)
844public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 848public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 851private bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format, IFormatProvider? provider = null)
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateTime.cs (2)
1764public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 1768public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (2)
804public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null) => 808public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (13)
502public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 508public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 591public static int GetBits(decimal d, Span<int> destination) 612public static bool TryGetBits(decimal d, Span<int> destination, out int valuesWritten) 628internal static void GetBytes(in decimal d, Span<byte> buffer) 1145/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 1146bool IFloatingPoint<decimal>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 1159/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 1160bool IFloatingPoint<decimal>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 1173/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 1174bool IFloatingPoint<decimal>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 1191/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 1192bool IFloatingPoint<decimal>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.cs (1)
121Span<EventPipeProviderConfigurationNative> providersNative = new Span<EventPipeProviderConfigurationNative>((void*)Marshal.AllocCoTaskMem(sizeof(EventPipeProviderConfigurationNative) * providers.Length), providers.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (4)
485Span<int> refObjPosition = stackalloc int[EtwAPIMaxRefObjCount]; 486Span<object?> dataRefObj = eightObjectStack; 525Span<object?> newDataRefObj = new object?[dataRefObj.Length * 2]; 529Span<int> newRefObjPosition = new int[refObjPosition.Length * 2];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
1778Span<byte> source = totalLength <= 256 ? stackalloc byte[totalLength] : new byte[totalLength]; 1783Span<byte> bytes = stackalloc byte[20];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ManifestBuilder.cs (1)
363Span<char> ulongHexScratch = stackalloc char[16]; // long enough for ulong.MaxValue formatted as hex
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (14)
377public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 383public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 724internal bool TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 736/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 737bool IFloatingPoint<double>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 742internal bool TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 754/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 755bool IFloatingPoint<double>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 760internal bool TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 772/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 773bool IFloatingPoint<double>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 778internal bool TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten) 790/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 791bool IFloatingPoint<double>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (12)
1554private static unsafe bool TryFormatNumberAsHex<TStorage>(ref byte data, Span<char> destination, out int charsWritten) where TStorage : struct 1688bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) 1748public static unsafe bool TryFormat<TEnum>(TEnum value, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.EnumFormat)] ReadOnlySpan<char> format = default) where TEnum : struct 1804internal static unsafe bool TryFormatUnconstrained<TEnum>(TEnum value, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.EnumFormat)] ReadOnlySpan<char> format = default) 1857private static bool TryFormatPrimitiveDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten) 1892private static bool TryFormatPrimitiveNonDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format) 1943Span<int> foundItems = stackalloc int[64]; 1962private static unsafe bool TryFormatFlagNames<TStorage>(EnumInfo<TStorage> enumInfo, TStorage resultValue, Span<char> destination, out int charsWritten, ref bool isDestinationTooSmall) 1987Span<int> foundItems = stackalloc int[64]; 2062private static bool TryFindFlagsNames<TStorage>(TStorage resultValue, string[] names, TStorage[] values, int index, Span<int> foundItems, out int resultLength, out int foundItemsCount) 2108private static void WriteMultipleFoundFlagsNames(string[] names, ReadOnlySpan<int> foundItems, Span<char> destination) 2117Span<char> afterSeparator = destination.Slice(2); // done before copying ", " to eliminate those two bounds checks
src\runtime\src\libraries\System.Private.CoreLib\src\System\Exception.cs (2)
152Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 180static void Write(string source, ref Span<char> dest)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (1)
183Span<char> modifiedPattern = stackalloc char[s.Length + 2];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (5)
164Span<char> valueAsUtf16 = stackalloc char[Rune.MaxUtf16CharsPerRune]; 1036Span<char> valueAsUtf16 = stackalloc char[Rune.MaxUtf16CharsPerRune]; 1408Span<char> valueAsUtf16 = stackalloc char[Rune.MaxUtf16CharsPerRune]; 1458public int GetSortKey(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options = CompareOptions.None) 1475private int GetSortKeyCore(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (2)
741private unsafe int IcuGetSortKey(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options) 866Span<byte> sortKey = (uint)sortKeyLength <= 1024
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Invariant.cs (4)
44private static void InvariantCreateSortKeyOrdinal(ReadOnlySpan<char> source, Span<byte> sortKey) 56private static void InvariantCreateSortKeyOrdinalIgnoreCase(ReadOnlySpan<char> source, Span<byte> sortKey) 69Span<byte> tmp = sortKey.Slice(0, 2 * sizeof(ushort)); // help with bounds check elimination 84private static int InvariantGetSortKey(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (2)
144Span<byte> span = (uint)sortKeyLength <= 512 ? 411private unsafe int NlsGetSortKey(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Utf8.cs (2)
82scoped Span<char> sourceUtf16; 113scoped Span<char> prefixUtf16;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (1)
727Span<char> normalizedName = stackalloc char[name.Length];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (3)
40Span<char> buffer = stackalloc char[ICU_ULOC_FULLNAME_CAPACITY]; 368Span<char> result = stackalloc char[ICU_ULOC_FULLNAME_CAPACITY]; 384static bool HandleQuoteLiteral(ReadOnlySpan<char> icuFormatString, ref int i, Span<char> result, ref int resultPos)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (19)
771Encoding.UTF8.GetBytes(s, Unsafe.BitCast<Span<TChar>, Span<byte>>(result.AppendSpan(Encoding.UTF8.GetByteCount(s)))); 777Span<TChar> chars = stackalloc TChar[11]; 780fraction.TryFormat(Unsafe.BitCast<Span<TChar>, Span<char>>(chars), out charCount, fractionFormat, CultureInfo.InvariantCulture) : 781fraction.TryFormat(Unsafe.BitCast<Span<TChar>, Span<byte>>(chars), out charCount, fractionFormat, CultureInfo.InvariantCulture); 977Span<char> span = stackalloc char[FormatOMaxLength]; 1029internal static bool TryFormat<TChar>(DateTime dateTime, Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) where TChar : unmanaged, IUtfChar<TChar> => 1032internal static bool TryFormat<TChar>(DateTime dateTime, Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider, TimeSpan offset) where TChar : unmanaged, IUtfChar<TChar> 1316internal static unsafe bool TryFormatTimeOnlyO<TChar>(TimeOnly value, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1344internal static unsafe bool TryFormatTimeOnlyR<TChar>(TimeOnly value, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1371internal static unsafe bool TryFormatDateOnlyO<TChar>(DateOnly value, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1398internal static unsafe bool TryFormatDateOnlyR<TChar>(DateOnly value, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1442internal static unsafe bool TryFormatO<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1522internal static unsafe bool TryFormatS<TChar>(DateTime dateTime, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1557internal static unsafe bool TryFormatu<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1598internal static unsafe bool TryFormatR<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1663internal static unsafe bool TryFormatInvariantG<TChar>(DateTime value, TimeSpan offset, Span<TChar> destination, out int bytesWritten) where TChar : unmanaged, IUtfChar<TChar>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (2)
5972Span<char> result = new char[i + 1]; 5999Span<char> result = new char[Value.Length - i];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IcuLocaleData.cs (2)
3810Span<byte> lower_case = stackalloc byte[name.Length]; 3864var s = new Span<char>(ref result.GetRawStringData(), buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (4)
105public bool TryGetAscii(ReadOnlySpan<char> unicode, Span<char> destination, out int charsWritten) 178public bool TryGetUnicode(ReadOnlySpan<char> ascii, Span<char> destination, out int charsWritten) 278private bool TryGetAsciiInvariant(ReadOnlySpan<char> unicode, Span<char> destination, out int charsWritten) 678private bool TryGetUnicodeInvariant(ReadOnlySpan<char> ascii, Span<char> destination, out int charsWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (6)
26Span<char> outputStack = stackalloc char[estimatedLength]; 35actualLength = Interop.Globalization.ToAscii(flags, unicode, count, Span<char>.Empty, 0); 52private bool IcuTryGetAsciiCore(ReadOnlySpan<char> unicode, Span<char> destination, out int charsWritten) 89Span<char> output = stackalloc char[count]; 99private static string IcuGetUnicodeCore(string asciiString, ReadOnlySpan<char> ascii, uint flags, Span<char> output, bool reattempt) 123private bool IcuTryGetUnicodeCore(ReadOnlySpan<char> ascii, Span<char> destination, out int charsWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (10)
21int length = Interop.Normaliz.IdnToAscii(flags, unicode, count, Span<char>.Empty, 0); 31Span<char> output = stackalloc char[length]; 41private static string NlsGetAsciiCore(string unicodeString, ReadOnlySpan<char> unicode, uint flags, Span<char> output) 55private bool NlsTryGetAsciiCore(ReadOnlySpan<char> unicode, Span<char> destination, out int charsWritten) 63int length = Interop.Normaliz.IdnToAscii(flags, unicode, unicode.Length, Span<char>.Empty, 0); 95int length = Interop.Normaliz.IdnToUnicode(flags, ascii, count, Span<char>.Empty, 0); 105Span<char> output = stackalloc char[length]; 115private static string NlsGetUnicodeCore(string asciiString, ReadOnlySpan<char> ascii, uint flags, Span<char> output) 129private bool NlsTryGetUnicodeCore(ReadOnlySpan<char> ascii, Span<char> destination, out int charsWritten) 137int length = Interop.Normaliz.IdnToUnicode(flags, ascii, ascii.Length, Span<char>.Empty, 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (4)
57var destination = new Span<char>(ref result.GetRawStringData(), result.Length); 103var destination = new Span<char>(ref result.GetRawStringData(), result.Length); 111internal static void ToUpper(ReadOnlySpan<char> source, Span<char> destination) 137internal static void ToLower(ReadOnlySpan<char> source, Span<char> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Nls.cs (1)
192Span<Range> names = stackalloc Range[5];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.cs (1)
43internal static bool TryNormalize(ReadOnlySpan<char> source, Span<char> destination, out int charsWritten, NormalizationForm normalizationForm = NormalizationForm.FormC)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (2)
60Span<char> buffer = strInput.Length <= StackallocThreshold 122private static unsafe bool IcuTryNormalize(ReadOnlySpan<char> source, Span<char> destination, out int charsWritten, NormalizationForm normalizationForm = NormalizationForm.FormC)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (2)
52Span<char> buffer = strInput.Length <= StackallocThreshold 115private static unsafe bool NlsTryNormalize(ReadOnlySpan<char> source, Span<char> destination, out int charsWritten, NormalizationForm normalizationForm = NormalizationForm.FormC)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (1)
686internal static int ToUpperOrdinal(ReadOnlySpan<char> source, Span<char> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (1)
145internal static void ToUpperOrdinal(ReadOnlySpan<char> source, Span<char> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (10)
176internal void ToLower(ReadOnlySpan<char> source, Span<char> destination) 208internal void ChangeCaseToLower(ReadOnlySpan<char> source, Span<char> destination) 215internal void ChangeCaseToUpper(ReadOnlySpan<char> source, Span<char> destination) 222private static unsafe void ChangeCaseCommon<TConversion>(TextInfo? instance, ReadOnlySpan<char> source, Span<char> destination) where TConversion : struct 345Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 369Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 478internal void ToUpper(ReadOnlySpan<char> source, Span<char> destination) 506Span<char> lowerChars = ['\0', '\0']; 528Span<char> upperChars = ['\0', '\0']; 732Span<char> dst = ['\0', '\0'];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (4)
51internal static unsafe bool TryFormat<TChar>(TimeSpan value, Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? formatProvider) where TChar : unmanaged, IUtfChar<TChar> 86Span<char> destination = stackalloc char[26]; // large enough for any "c" TimeSpan 95Span<char> destination = (uint)maxLength < 128 ? 109internal static unsafe bool TryFormatStandard<TChar>(TimeSpan value, StandardFormat format, ReadOnlySpan<TChar> decimalSeparator, Span<TChar> destination, out int written) where TChar : unmanaged, IUtfChar<TChar>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (13)
529Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 617Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 961Span<byte> destUtf8Span = new byte[srcUtf8Span.Length]; 1033public bool TryWriteBytes(Span<byte> destination) 1052public bool TryWriteBytes(Span<byte> destination, bool bigEndian, out int bytesWritten) 1255public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format = default) => 1258bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format, IFormatProvider? provider) => 1262public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format = default) => 1265bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format, IFormatProvider? provider) => 1278private bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format) where TChar : unmanaged, IUtfChar<TChar> 1325internal unsafe bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, int flags) where TChar : unmanaged, IUtfChar<TChar> 1450private bool TryFormatX<TChar>(Span<TChar> dest, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1500static void WriteHex(Span<TChar> dest, int offset, int val, bool appendComma = true)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (10)
544public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 550public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 1364/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 1365bool IFloatingPoint<Half>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 1378/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 1379bool IFloatingPoint<Half>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 1392/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 1393bool IFloatingPoint<Half>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 1405/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 1406bool IFloatingPoint<Half>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Index.cs (1)
158Span<char> span = stackalloc char[11]; // 1 for ^ and 10 for longest possible uint value
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (6)
118public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 124public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 930/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 931bool IBinaryInteger<Int128>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 943/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 944bool IBinaryInteger<Int128>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (6)
118public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 124public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 459/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 460bool IBinaryInteger<short>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 472/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 473bool IBinaryInteger<short>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (6)
134public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 140public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 499/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 500bool IBinaryInteger<int>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 512/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 513bool IBinaryInteger<int>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (6)
131public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 137public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 496/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 497bool IBinaryInteger<long>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 509/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 510bool IBinaryInteger<long>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (6)
229public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 233public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 519/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 520bool IBinaryInteger<nint>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 532/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 533bool IBinaryInteger<nint>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (8)
126Span<byte> charBytes = stackalloc byte[MaxCharBytesSize]; 259Span<byte> charBytes = stackalloc byte[MaxCharBytesSize]; 309public virtual int Read(Span<char> buffer) 315private unsafe int InternalReadChars(Span<char> buffer) 322Span<byte> charBytes = stackalloc byte[MaxCharBytesSize]; 428public virtual int Read(Span<byte> buffer) 466public virtual void ReadExactly(Span<byte> buffer) 472private ReadOnlySpan<byte> InternalRead(Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (12)
184Span<byte> buffer = stackalloc byte[8]; // reasonable guess for worst-case expansion for any arbitrary encoding 246Span<byte> buffer = stackalloc byte[sizeof(double)]; 253Span<byte> buffer = stackalloc byte[sizeof(decimal)]; 263Span<byte> buffer = stackalloc byte[sizeof(short)]; 274Span<byte> buffer = stackalloc byte[sizeof(ushort)]; 284Span<byte> buffer = stackalloc byte[sizeof(int)]; 295Span<byte> buffer = stackalloc byte[sizeof(uint)]; 305Span<byte> buffer = stackalloc byte[sizeof(long)]; 316Span<byte> buffer = stackalloc byte[sizeof(ulong)]; 326Span<byte> buffer = stackalloc byte[sizeof(float)]; 336Span<byte> buffer = stackalloc byte[sizeof(ushort) /* = sizeof(Half) */]; 362Span<byte> buffer = stackalloc byte[128];
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (2)
446private int ReadFromBuffer(Span<byte> destination) 528public override int Read(Span<byte> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (1)
36Span<byte> path = (uint)totalByteCount <= 256 ? stackalloc byte[totalByteCount] : new byte[totalByteCount];
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (3)
21private Span<char> _pathBuffer; 38Span<char> pathBuffer) 104Span<char> buffer = MemoryMarshal.CreateSpan(ref _fileNameBuffer._char0, DecodedNameBufferLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemName.cs (3)
188scoped Span<int> temp = default; 189Span<int> currentMatches = stackalloc int[16]; 190Span<int> priorMatches = stackalloc int[16];
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (3)
1511Span<byte> buffer = stackalloc byte[512]; 1573Span<byte> bytes = (uint)bytesNeeded <= 1024 ? stackalloc byte[1024] : (rentedBytes = ArrayPool<byte>.Shared.Rent(bytesNeeded)); 1592Span<byte> toStore = bytes.Slice(0, preambleSize + encoded);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileStream.cs (2)
271public override int Read(Span<byte> buffer) => _strategy.Read(buffer); 602internal int BaseRead(Span<byte> buffer) => base.Read(buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (1)
346public override int Read(Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (3)
583public static bool TryJoin(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, Span<char> destination, out int charsWritten) 617public static bool TryJoin(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, ReadOnlySpan<char> path3, Span<char> destination, out int charsWritten) 794internal static unsafe void Populate83FileNameFromRandomBytes(byte* bytes, int byteCount, Span<char> chars)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
106Span<byte> path = (uint)totalByteCount <= 256 ? stackalloc byte[totalByteCount] : new byte[totalByteCount];
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (2)
26fixed (byte* ptr = &MemoryMarshal.GetReference((Span<byte>)array)) 31public override int Read(Span<byte> buffer) => ReadCore(buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.cs (1)
67public static int Read(SafeFileHandle handle, Span<byte> buffer, long fileOffset)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (4)
25internal static unsafe int ReadAtOffset(SafeFileHandle handle, Span<byte> buffer, long fileOffset) 61Span<Interop.Sys.IOVector> vectors = buffers.Count <= IovStackThreshold ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[buffers.Count]; 177Span<Interop.Sys.IOVector> vectors = buffersCount <= IovStackThreshold ? 198Span<Interop.Sys.IOVector> left = vectors.Slice(buffersOffset);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (2)
153public override int Read(Span<byte> destination) 160private int ReadSpan(Span<byte> destination, ArraySegment<byte> arraySegment)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\DerivedFileStreamStrategy.cs (1)
79public override int Read(Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
209public sealed override int Read(Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (6)
782public virtual int Read(Span<byte> buffer) 819public void ReadExactly(Span<byte> buffer) => 880public int ReadAtLeast(Span<byte> buffer, int minimumBytes, bool throwOnEndOfStream = true) 888private int ReadAtLeastCore(Span<byte> buffer, int minimumBytes, bool throwOnEndOfStream) 1049public override int Read(Span<byte> buffer) => 0; 1197public override int Read(Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (6)
363public override int Read(Span<char> buffer) => 367private int ReadSpan(Span<char> buffer) 444public override int ReadBlock(Span<char> buffer) 671private int ReadBuffer(Span<char> userBuffer, out bool readToUserBuffer) 1428public override int Read(Span<char> buffer) => 0; 1437public override int ReadBlock(Span<char> buffer) => 0;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
303scoped Span<byte> byteBuffer;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (2)
115public override int Read(Span<char> buffer) 145public override int ReadBlock(Span<char> buffer) => Read(buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (2)
96public virtual int Read(Span<char> buffer) 146public virtual int ReadBlock(Span<char> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (1)
463Span<int> bits = [0, 0, 0, 0];
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (2)
343public override int Read(Span<byte> buffer) 358internal int ReadCore(Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStreamWrapper.cs (1)
75public override int Read(Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\ISpanFormattable.cs (1)
20bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IUtf8SpanFormattable.cs (1)
19bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Marvin.OrdinalIgnoreCase.cs (1)
87Span<char> scratch = (uint)count <= 64 ? stackalloc char[64] : (borrowedArr = ArrayPool<char>.Shared.Rent(count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Memory.cs (4)
16/// Memory represents a contiguous region of arbitrary memory similar to <see cref="Span{T}"/>. 17/// Unlike <see cref="Span{T}"/>, it is not a byref-like type. 263public Span<T> Span 316Span<T> memoryManagerSpan = Unsafe.As<MemoryManager<T>>(tmpObject).GetSpan();
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (126)
26public static Span<T> AsSpan<T>(this T[]? array, int start) 46public static Span<T> AsSpan<T>(this T[]? array, Index startIndex) 70public static Span<T> AsSpan<T>(this T[]? array, Range range) 318public static bool Contains<T>(this Span<T> span, T value) where T : IEquatable<T>? => 379public static bool ContainsAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 385public static bool ContainsAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 391public static bool ContainsAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 397public static bool ContainsAny<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 403public static bool ContainsAny(this Span<char> span, SearchValues<string> values) => 409public static bool ContainsAnyExcept<T>(this Span<T> span, T value) where T : IEquatable<T>? => 415public static bool ContainsAnyExcept<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 421public static bool ContainsAnyExcept<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 427public static bool ContainsAnyExcept<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 433public static bool ContainsAnyExcept<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 439public static bool ContainsAnyInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 445public static bool ContainsAnyExceptInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 705public static int IndexOf<T>(this Span<T> span, T value) where T : IEquatable<T>? => 715public static int IndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 725public static int LastIndexOf<T>(this Span<T> span, T value) where T : IEquatable<T>? => 735public static int LastIndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 747public static int IndexOfAnyExcept<T>(this Span<T> span, T value) where T : IEquatable<T>? => 760public static int IndexOfAnyExcept<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 774public static int IndexOfAnyExcept<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 786public static int IndexOfAnyExcept<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 799public static int IndexOfAnyExcept<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 1325public static int LastIndexOfAnyExcept<T>(this Span<T> span, T value) where T : IEquatable<T>? => 1338public static int LastIndexOfAnyExcept<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 1352public static int LastIndexOfAnyExcept<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 1364public static int LastIndexOfAnyExcept<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 1377public static int LastIndexOfAnyExcept<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 1899public static int IndexOfAnyInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 1970public static int IndexOfAnyExceptInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 2041public static int LastIndexOfAnyInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 2112public static int LastIndexOfAnyExceptInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 2194public static bool SequenceEqual<T>(this Span<T> span, ReadOnlySpan<T> other) where T : IEquatable<T>? => 2201public static int SequenceCompareTo<T>(this Span<T> span, ReadOnlySpan<T> other) where T : IComparable<T>? => 2616public static int IndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 2628public static int IndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 2638public static int IndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 2648public static int IndexOfAny<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 2658public static int IndexOfAny(this Span<char> span, SearchValues<string> values) => 3046public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 3058public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 3068public static int LastIndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 3078public static int LastIndexOfAny<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 3472public static bool SequenceEqual<T>(this Span<T> span, ReadOnlySpan<T> other, IEqualityComparer<T>? comparer = null) => 3581public static bool StartsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 3623public static bool EndsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 3715public static void Reverse<T>(this Span<T> span) 3727public static Span<T> AsSpan<T>(this T[]? array) 3745public static Span<T> AsSpan<T>(this T[]? array, int start, int length) 3754public static Span<T> AsSpan<T>(this ArraySegment<T> segment) 3771public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start) 3786public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Index startIndex) 3805public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start, int length) 3821public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Range range) 3954public static void CopyTo<T>(this T[]? source, Span<T> destination) 4108public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other) => 4116public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other, out int elementOffset) => 4169/// Searches an entire sorted <see cref="Span{T}"/> for a value 4173/// <param name="span">The sorted <see cref="Span{T}"/> to search.</param> 4179/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 4186public static int BinarySearch<T>(this Span<T> span, IComparable<T> comparable) => 4190/// Searches an entire sorted <see cref="Span{T}"/> for a value 4195/// <param name="span">The sorted <see cref="Span{T}"/> to search.</param> 4201/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 4209this Span<T> span, TComparable comparable) 4214/// Searches an entire sorted <see cref="Span{T}"/> for the specified <paramref name="value"/> 4219/// <param name="span">The sorted <see cref="Span{T}"/> to search.</param> 4226/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 4234this Span<T> span, T value, TComparer comparer) 4316/// Sorts the elements in the entire <see cref="Span{T}" /> using the <see cref="IComparable{T}" /> implementation 4317/// of each element of the <see cref= "Span{T}" /> 4320/// <param name="span">The <see cref="Span{T}"/> to sort.</param> 4324public static void Sort<T>(this Span<T> span) => 4328/// Sorts the elements in the entire <see cref="Span{T}" /> using the <typeparamref name="TComparer" />. 4332/// <param name="span">The <see cref="Span{T}"/> to sort.</param> 4344public static void Sort<T, TComparer>(this Span<T> span, TComparer comparer) where TComparer : IComparer<T>? 4362/// Sorts the elements in the entire <see cref="Span{T}" /> using the specified <see cref="Comparison{T}" />. 4365/// <param name="span">The <see cref="Span{T}"/> to sort.</param> 4368public static void Sort<T>(this Span<T> span, Comparison<T> comparison) 4381/// based on the keys in the first <see cref="Span{TKey}" /> using the <see cref="IComparable{T}" /> 4394public static void Sort<TKey, TValue>(this Span<TKey> keys, Span<TValue> items) => 4399/// based on the keys in the first <see cref="Span{TKey}" /> using the specified comparer. 4417public static void Sort<TKey, TValue, TComparer>(this Span<TKey> keys, Span<TValue> items, TComparer comparer) where TComparer : IComparer<TKey>? 4439/// based on the keys in the first <see cref="Span{TKey}" /> using the specified comparison. 4450public static void Sort<TKey, TValue>(this Span<TKey> keys, Span<TValue> items, Comparison<TKey> comparison) 4471public static unsafe void Replace<T>(this Span<T> span, T oldValue, T newValue) where T : IEquatable<T>? 4537public static unsafe void Replace<T>(this Span<T> span, T oldValue, T newValue, IEqualityComparer<T>? comparer = null) 4591static void ReplaceDefaultComparer(Span<T> span, T oldValue, T newValue) 4605static void ReplaceComparer(Span<T> span, T oldValue, T newValue, IEqualityComparer<T>? comparer) 4630public static unsafe void Replace<T>(this ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue) where T : IEquatable<T>? 4714public static unsafe void Replace<T>(this ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue, IEqualityComparer<T>? comparer = null) 4786static void ReplaceDefaultComparer(ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue) 4799static void ReplaceComparer(ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue, IEqualityComparer<T>? comparer) 4826public static void ReplaceAny<T>(this ReadOnlySpan<T> source, Span<T> destination, SearchValues<T> values, T newValue) where T : IEquatable<T>? 4852public static void ReplaceAny<T>(this Span<T> span, SearchValues<T> values, T newValue) where T : IEquatable<T>? 4876public static void ReplaceAnyExcept<T>(this ReadOnlySpan<T> source, Span<T> destination, SearchValues<T> values, T newValue) where T : IEquatable<T>? 4901public static void ReplaceAnyExcept<T>(this Span<T> span, SearchValues<T> values, T newValue) where T : IEquatable<T>? 4917public static int CommonPrefixLength<T>(this Span<T> span, ReadOnlySpan<T> other) => 4927public static int CommonPrefixLength<T>(this Span<T> span, ReadOnlySpan<T> other, IEqualityComparer<T>? comparer) => 5055/// or when <see cref="SplitAny(ReadOnlySpan{char}, Span{Range}, ReadOnlySpan{char}, StringSplitOptions)"/> 5105public static int Split(this ReadOnlySpan<char> source, Span<Range> destination, char separator, StringSplitOptions options = StringSplitOptions.None) 5139public static int Split(this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<char> separator, StringSplitOptions options = StringSplitOptions.None) 5195public static int SplitAny(this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<char> separators, StringSplitOptions options = StringSplitOptions.None) 5236public static int SplitAny(this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<string> separators, StringSplitOptions options = StringSplitOptions.None) 5260ReadOnlySpan<char> source, Span<Range> destination, 5333Span<Range> destinationMinusOne = destination.Slice(0, destination.Length - 1); 5417public static int Count<T>(this Span<T> span, T value) where T : IEquatable<T>? => 5551public static int Count<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 5684public static bool TryWrite(this Span<char> destination, [InterpolatedStringHandlerArgument(nameof(destination))] ref TryWriteInterpolatedStringHandler handler, out int charsWritten) 5704public static bool TryWrite(this Span<char> destination, IFormatProvider? provider, [InterpolatedStringHandlerArgument(nameof(destination), nameof(provider))] ref TryWriteInterpolatedStringHandler handler, out int charsWritten) => 5722public static bool TryWrite<TArg0>(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0) 5744public static bool TryWrite<TArg0, TArg1>(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0, TArg1 arg1) 5768public static bool TryWrite<TArg0, TArg1, TArg2>(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0, TArg1 arg1, TArg2 arg2) 5788public static bool TryWrite(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, params object?[] args) 5807public static bool TryWrite(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, params ReadOnlySpan<object?> args) 5820private static bool TryWrite<TArg0, TArg1, TArg2>(Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0, TArg1 arg1, TArg2 arg2, ReadOnlySpan<object?> args) 6063private readonly Span<char> _destination; 6080/// <summary>Creates a handler used to write an interpolated string into a <see cref="Span{Char}"/>.</summary> 6086public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, Span<char> destination, out bool shouldAppend) 6095/// <summary>Creates a handler used to write an interpolated string into a <see cref="Span{Char}"/>.</summary> 6102public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, Span<char> destination, IFormatProvider? provider, out bool shouldAppend)
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (6)
239public static int ToLower(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo? culture) 265public static int ToLowerInvariant(this ReadOnlySpan<char> source, Span<char> destination) 291public static int ToUpper(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo? culture) 317public static int ToUpperInvariant(this ReadOnlySpan<char> source, Span<char> destination) 424public static SpanRuneEnumerator EnumerateRunes(this Span<char> span) 451public static SpanLineEnumerator EnumerateLines(this Span<char> span)
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.cs (20)
74public static Span<T> Trim<T>(this Span<T> span, T trimElement) where T : IEquatable<T>? 86public static Span<T> TrimStart<T>(this Span<T> span, T trimElement) where T : IEquatable<T>? 94public static Span<T> TrimEnd<T>(this Span<T> span, T trimElement) where T : IEquatable<T>? 340public static Span<T> Trim<T>(this Span<T> span, ReadOnlySpan<T> trimElements) where T : IEquatable<T>? 364public static Span<T> TrimStart<T>(this Span<T> span, ReadOnlySpan<T> trimElements) where T : IEquatable<T>? 386public static Span<T> TrimEnd<T>(this Span<T> span, ReadOnlySpan<T> trimElements) where T : IEquatable<T>? 787public static Span<char> Trim(this Span<char> span) 798static Span<char> TrimFallback(Span<char> span) 825public static Span<char> TrimStart(this Span<char> span) 832public static Span<char> TrimEnd(this Span<char> span)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (2)
139Span<char> encodingBuffer = output.AppendSpan(MaxInt32Digits); 349Span<byte> utf8Bytes = MemoryMarshal.AsBytes(dest).Slice(dest.Length * 2 - state.byteCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.BigInteger.cs (1)
1355private void Clear(int length) => ((Span<uint>)_blocks).Slice(0, length).Clear();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (1)
57private static uint Dragon4(ulong mantissa, int exponent, uint mantissaHighBitIdx, bool hasUnequalMargins, int cutoffNumber, bool isSignificantDigits, Span<byte> buffer, out int decimalExponent)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (33)
360public static unsafe bool TryFormatDecimal<TChar>(decimal value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 756public static unsafe bool TryFormatFloat<TNumber, TChar>(TNumber value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten) 871private static bool TryCopyTo<TChar>(string source, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 878if (source.TryCopyTo(Unsafe.BitCast<Span<TChar>, Span<char>>(destination))) 889return Encoding.UTF8.TryGetBytes(source, Unsafe.BitCast<Span<TChar>, Span<byte>>(destination), out charsWritten); 960public static bool TryFormatInt32<TChar>(int value, int hexMask, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 972static unsafe bool TryFormatInt32Slow(int value, int hexMask, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1074public static bool TryFormatUInt32<TChar>(uint value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1086static unsafe bool TryFormatUInt32Slow(uint value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1190public static bool TryFormatInt64<TChar>(long value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1204static unsafe bool TryFormatInt64Slow(long value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1306public static bool TryFormatUInt64<TChar>(ulong value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1318static unsafe bool TryFormatUInt64Slow(ulong value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1423public static bool TryFormatInt128<TChar>(Int128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1437static unsafe bool TryFormatInt128Slow(Int128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1541public static bool TryFormatUInt128<TChar>(UInt128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1553static unsafe bool TryFormatUInt128Slow(UInt128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1661internal static unsafe bool TryNegativeInt32ToDecStr<TChar>(int value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1710internal static unsafe bool TryInt32ToHexStr<TChar>(int value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1766private static unsafe bool TryUInt32ToBinaryStr<TChar>(uint value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1985internal static unsafe bool TryUInt32ToDecStr<TChar>(uint value, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2005internal static unsafe bool TryUInt32ToDecStr<TChar>(uint value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2094internal static unsafe bool TryNegativeInt64ToDecStr<TChar>(long value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2143internal static unsafe bool TryInt64ToHexStr<TChar>(long value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2215private static unsafe bool TryUInt64ToBinaryStr<TChar>(ulong value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2413internal static unsafe bool TryUInt64ToDecStr<TChar>(ulong value, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2434internal static unsafe bool TryUInt64ToDecStr<TChar>(ulong value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2522private static unsafe bool TryNegativeInt128ToDecStr<TChar>(Int128 value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2575private static unsafe bool TryInt128ToHexStr<TChar>(Int128 value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2638private static unsafe bool TryUInt128ToBinaryStr<TChar>(Int128 value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2775private static unsafe bool TryUInt128ToDecStr<TChar>(UInt128 value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Grisu3.cs (6)
362private static bool TryRunCounted(in DiyFp w, int requestedDigits, Span<byte> buffer, out int length, out int decimalExponent) 410private static bool TryRunShortest(in DiyFp boundaryMinus, in DiyFp w, in DiyFp boundaryPlus, Span<byte> buffer, out int length, out int decimalExponent) 513private static bool TryDigitGenCounted(in DiyFp w, int requestedDigits, Span<byte> buffer, out int length, out int kappa) 682private static bool TryDigitGenShortest(in DiyFp low, in DiyFp w, in DiyFp high, Span<byte> buffer, out int length, out int kappa) 847private static bool TryRoundWeedCounted(Span<byte> buffer, int length, ulong rest, ulong tenKappa, ulong unit, ref int kappa) 920private static bool TryRoundWeedShortest(Span<byte> buffer, int length, ulong distanceTooHighW, ulong unsafeInterval, ulong rest, ulong tenKappa, ulong unit)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (10)
428public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 434public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 1018/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 1019bool IFloatingPoint<BFloat16>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 1032/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 1033bool IFloatingPoint<BFloat16>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 1046/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 1047bool IFloatingPoint<BFloat16>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 1060/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 1061bool IFloatingPoint<BFloat16>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Colors\Argb.T.cs (2)
80/// The <see cref="Span{T}"/> to which the color components will be copied in the order alpha, red, green, blue. 82public void CopyTo(Span<T> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Colors\Rgba.T.cs (2)
80/// The <see cref="Span{T}"/> to which the color components will be copied in the order red, green, blue, alpha. 82public void CopyTo(Span<T> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\IBinaryInteger.cs (6)
452/// <summary>Gets the number of bytes that will be written as part of <see cref="TryWriteLittleEndian(Span{byte}, out int)" />.</summary> 453/// <returns>The number of bytes that will be written as part of <see cref="TryWriteLittleEndian(Span{byte}, out int)" />.</returns> 464bool TryWriteBigEndian(Span<byte> destination, out int bytesWritten); 470bool TryWriteLittleEndian(Span<byte> destination, out int bytesWritten); 500int WriteBigEndian(Span<byte> destination) 537int WriteLittleEndian(Span<byte> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\IFloatingPoint.cs (12)
73/// <summary>Gets the number of bytes that will be written as part of <see cref="TryWriteExponentLittleEndian(Span{byte}, out int)" />.</summary> 74/// <returns>The number of bytes that will be written as part of <see cref="TryWriteExponentLittleEndian(Span{byte}, out int)" />.</returns> 85/// <summary>Gets the number of bytes that will be written as part of <see cref="TryWriteSignificandLittleEndian(Span{byte}, out int)" />.</summary> 86/// <returns>The number of bytes that will be written as part of <see cref="TryWriteSignificandLittleEndian(Span{byte}, out int)" />.</returns> 93bool TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten); 99bool TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten); 105bool TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten); 111bool TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten); 141int WriteExponentBigEndian(Span<byte> destination) 178int WriteExponentLittleEndian(Span<byte> destination) 215int WriteSignificandBigEndian(Span<byte> destination) 252int WriteSignificandLittleEndian(Span<byte> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\INumberBase.cs (6)
309scoped Span<char> utf16Text; 443scoped Span<char> utf16Text; 486unsafe bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) 489scoped Span<char> utf16Destination; 545scoped Span<char> utf16Text; 592scoped Span<char> utf16Text;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\TotalOrderIeee754Comparer.cs (2)
158Span<byte> significandX = (uint)xSignificandLength <= StackAllocThreshold ? stackalloc byte[xSignificandLength] : new byte[xSignificandLength]; 159Span<byte> significandY = (uint)ySignificandLength <= StackAllocThreshold ? stackalloc byte[ySignificandLength] : new byte[ySignificandLength];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector_1.cs (9)
123public Vector(Span<T> values) : this((ReadOnlySpan<T>)values) 656public void CopyTo(Span<byte> destination) 672public void CopyTo(Span<T> destination) 777public bool TryCopyTo(Span<byte> destination) 794public bool TryCopyTo(Span<T> destination) 884/// <inheritdoc cref="ISimdVector{TSelf, T}.CopyTo(TSelf, Span{T})" /> 885static void ISimdVector<Vector<T>, T>.CopyTo(Vector<T> vector, Span<T> destination) => vector.CopyTo(destination); 1207/// <inheritdoc cref="ISimdVector{TSelf, T}.TryCopyTo(TSelf, Span{T})" /> 1208static bool ISimdVector<Vector<T>, T>.TryCopyTo(Vector<T> vector, Span<T> destination) => vector.TryCopyTo(destination);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (4)
1005/// <summary>Copies the vector to the given <see cref="Span{T}" />.The length of the destination span must be at least 2.</summary> 1009public readonly void CopyTo(Span<float> destination) 1019/// <summary>Attempts to copy the vector to the given <see cref="Span{Single}" />. The length of the destination span must be at least 2.</summary> 1023public readonly bool TryCopyTo(Span<float> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (4)
1015/// <summary>Copies the vector to the given <see cref="Span{T}" />. The length of the destination span must be at least 3.</summary> 1019public readonly void CopyTo(Span<float> destination) 1029/// <summary>Attempts to copy the vector to the given <see cref="Span{Single}" />. The length of the destination span must be at least 3.</summary> 1033public readonly bool TryCopyTo(Span<float> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (4)
1070/// <summary>Copies the vector to the given <see cref="Span{T}" />. The length of the destination span must be at least 4.</summary> 1073public readonly void CopyTo(Span<float> destination) => this.AsVector128().CopyTo(destination); 1075/// <summary>Attempts to copy the vector to the given <see cref="Span{Single}" />. The length of the destination span must be at least 4.</summary> 1078public readonly bool TryCopyTo(Span<float> destination) => this.AsVector128().TryCopyTo(destination);
src\runtime\src\libraries\System.Private.CoreLib\src\System\OperatingSystem.cs (1)
112Span<char> stackBuffer = stackalloc char[128];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.CompatImpl.cs (3)
109public override void NextBytes(Span<byte> buffer) => _prng.NextBytes(buffer); 241public override void NextBytes(Span<byte> buffer) 330internal void NextBytes(Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (10)
182public virtual void NextBytes(Span<byte> buffer) => _impl.NextBytes(buffer); 213Span<byte> bytes = byteCount <= StackallocThreshold 355Span<byte> bytes = byteCount <= StackallocThreshold 394Span<byte> bytes = byteCount <= StackallocThreshold 487public unsafe void GetItems<T>(ReadOnlySpan<T> choices, Span<T> destination) 507Span<byte> randomBytes = stackalloc byte[512]; 658public void Shuffle<T>(Span<T> values) 679/// <seealso cref="GetItems{T}(ReadOnlySpan{T}, Span{T})" /> 714public void GetHexString(Span<char> destination, bool lowercase = false) => 858public override void NextBytes(Span<byte> buffer) => LocalRandom.NextBytes(buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.ImplBase.cs (1)
34public abstract void NextBytes(Span<byte> buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.Xoshiro256StarStarImpl.cs (2)
134public override void NextBytes(byte[] buffer) => NextBytes((Span<byte>)buffer); 136public override unsafe void NextBytes(Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Range.cs (1)
70Span<char> span = stackalloc char[2 + (2 * 11)]; // 2 for "..", then for each index 1 for '^' and 10 for longest possible uint
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (1)
238Span<T> memoryManagerSpan = Unsafe.As<MemoryManager<T>>(tmpObject).GetSpan();
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (2)
308public void CopyTo(Span<T> destination) 332public bool TryCopyTo(Span<T> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (1)
327Span<byte> utf8Bytes = [0, 0, 0, 0];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyNameHelpers.StrongName.cs (1)
22Span<byte> hash = stackalloc byte[20];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (1)
601Span<int> bits = [0, 0, 0, 0];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (10)
127Span<byte> payloadSpan = eventBuffer.Data.AsSpan(eventBuffer.Index, MaxStaticEventPayloadSize + maxDynamicEventPayloadSize); 185Span<byte> payloadSpan = eventBuffer.Data.AsSpan(eventBuffer.Index, MaxEventPayloadSize); 292public static int WriteCompressedInt32(Span<byte> buffer, int value) 298public static int WriteCompressedUInt32(Span<byte> buffer, uint value) 319public static int WriteCompressedInt64(Span<byte> buffer, long value) 325public static int WriteCompressedUInt64(Span<byte> buffer, ulong value) 357Span<byte> headerSpan = eventBuffer.Data.AsSpan(0, MaxEventHeaderSize); 437Span<byte> headerSpan = buffer.AsSpan(index, MaxAsyncEventHeaderSize); 472Span<byte> headerSpan = buffer.AsSpan(index, MaxAsyncEventHeaderSize); 628Span<byte> headerSpan = eventBuffer.Data.AsSpan(0, Serializer.MaxEventHeaderSize);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (2)
38private Span<char> _chars; 82public DefaultInterpolatedStringHandler(int literalLength, int formattedCount, IFormatProvider? provider, Span<char> initialBuffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (9)
17/// Get a <see cref="Span{T}"/> view over a <see cref="List{T}"/>'s data. 18/// Items should not be added or removed from the <see cref="List{T}"/> while the <see cref="Span{T}"/> is in use. 23public static Span<T> AsSpan<T>(List<T>? list) 25Span<T> span = default; 46/// Get a <see cref="Span{Byte}"/> view over a <see cref="BitArray"/>'s data. 50/// A <see cref="Span{Byte}"/> representing the underlying byte storage for the given <paramref name="array"/>, 56/// <see cref="BitArray.Length"/>. The returned span's <see cref="Span{Byte}.Length"/> will be the smallest number 62/// The length of the <see cref="BitArray"/> should not be changed while the resulting <see cref="Span{Byte}"/> 67public static Span<byte> AsBytes(BitArray? array) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (3)
838Span<IntPtr> runtimeDefinedVtable = stackalloc IntPtr[3]; 879Span<InternalComInterfaceDispatch> dispatches = new Span<InternalComInterfaceDispatch>(pDispatches, numSections); 883Span<IntPtr> dispatchVtables = dispatches[i].Vtables;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
54internal static unsafe void GetAnsiStringBytes(ReadOnlySpan<char> chars, Span<byte> bytes)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\AnsiStringMarshaller.cs (2)
29Span<byte> buffer = new(mem, exactByteCount); 68public void FromManaged(string? managed, Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (7)
60/// <returns>The <see cref="Span{TUnmanagedElement}"/> of unmanaged elements.</returns> 61public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 87/// <returns>The <see cref="Span{T}"/> of managed elements.</returns> 88public static Span<T> GetManagedValuesDestination(T[]? managed) 128private Span<TUnmanagedElement> _span; 139public void FromManaged(T[]? array, Span<TUnmanagedElement> buffer) 175public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
65public void FromManaged(string? managed, Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (1)
84public Span<T> AsSpan() => new(_data, _numElements);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (7)
61/// <returns>The <see cref="Span{TUnmanagedElement}"/> of unmanaged elements.</returns> 62public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 88/// <returns>The <see cref="Span{T}"/> of managed elements.</returns> 89public static Span<IntPtr> GetManagedValuesDestination(T*[]? managed) 129private Span<TUnmanagedElement> _span; 140public void FromManaged(T*[]? array, Span<TUnmanagedElement> buffer) 176public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (5)
72public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 94private Span<TUnmanagedElement> _span; 105public void FromManaged(ReadOnlySpan<T> managed, Span<TUnmanagedElement> buffer) 142public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span; 221public Span<T> GetManagedValuesDestination(int numElements)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (17)
13/// Supports marshalling a <see cref="Span{T}"/> from managed value 19/// A <see cref="Span{T}"/> marshalled with this marshaller will match the semantics of <see cref="MemoryMarshal.GetReference{T}(Span{T})"/>. 23[CustomMarshaller(typeof(Span<>), MarshalMode.Default, typeof(SpanMarshaller<,>))] 24[CustomMarshaller(typeof(Span<>), MarshalMode.ManagedToUnmanagedIn, typeof(SpanMarshaller<,>.ManagedToUnmanagedIn))] 35public static TUnmanagedElement* AllocateContainerForUnmanagedElements(Span<T> managed, out int numElements) 57public static ReadOnlySpan<T> GetManagedValuesSource(Span<T> managed) 66public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 80public static Span<T> AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) 93public static Span<T> GetManagedValuesDestination(Span<T> managed) 125private Span<T> _managedArray; 127private Span<TUnmanagedElement> _span; 138public void FromManaged(Span<T> managed, Span<TUnmanagedElement> buffer) 174public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span; 203public static ref T GetPinnableReference(Span<T> managed)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (2)
30Span<byte> buffer = new(mem, exactByteCount); 70public void FromManaged(string? managed, Span<byte> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (11)
14/// <see cref="Span{T}"/>, and <see cref="ReadOnlySpan{T}"/>. 31public static unsafe Span<byte> AsBytes<T>(Span<T> span) 81public static ref T GetReference<T>(Span<T> span) => ref span._reference; 94internal static unsafe ref T GetNonNullPinnableReference<T>(Span<T> span) => ref (span.Length != 0) ? ref Unsafe.AsRef(in span._reference) : ref Unsafe.AsRef<T>((void*)1); 116public static unsafe Span<TTo> Cast<TFrom, TTo>(Span<TFrom> span) 228public static Span<T> CreateSpan<T>(scoped ref T reference, int length) => 509public static unsafe void Write<T>(Span<byte> destination, in T value) 528public static unsafe bool TryWrite<T>(Span<byte> destination, in T value) 552public static unsafe ref T AsRef<T>(Span<byte> span)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (10)
859public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => _value.TryFormat(destination, out charsWritten, format, provider); 862public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => _value.TryFormat(utf8Destination, out bytesWritten, format, provider); 1039/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 1040bool IFloatingPoint<NFloat>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 1045/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 1046bool IFloatingPoint<NFloat>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 1051/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 1052bool IFloatingPoint<NFloat>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 1057/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 1058bool IFloatingPoint<NFloat>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ObjectiveC\ObjectiveCMarshal.PlatformNotSupported.cs (2)
81/// The memory it points at is defined by the length in the <see cref="Span{IntPtr}"/> and 94out Span<IntPtr> taggedMemory)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (1)
231public void ReadSpan<T>(ulong byteOffset, Span<T> buffer)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\ISimdVector_2.cs (2)
201static virtual void CopyTo(TSelf vector, Span<T> destination) 785static virtual bool TryCopyTo(TSelf vector, Span<T> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\SimdVectorExtensions.cs (2)
47public static void CopyTo<TVector, T>(this TVector vector, Span<T> destination) 148public static bool TryCopyTo<TVector, T>(this TVector vector, Span<T> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (2)
783public static void CopyTo<T>(this Vector128<T> vector, Span<T> destination) 3770public static bool TryCopyTo<T>(this Vector128<T> vector, Span<T> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128_1.cs (4)
546/// <inheritdoc cref="ISimdVector{TSelf, T}.CopyTo(TSelf, Span{T})" /> 547static void ISimdVector<Vector128<T>, T>.CopyTo(Vector128<T> vector, Span<T> destination) => vector.CopyTo(destination); 870/// <inheritdoc cref="ISimdVector{TSelf, T}.TryCopyTo(TSelf, Span{T})" /> 871static bool ISimdVector<Vector128<T>, T>.TryCopyTo(Vector128<T> vector, Span<T> destination) => vector.TryCopyTo(destination);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (2)
790public static void CopyTo<T>(this Vector256<T> vector, Span<T> destination) 3707public static bool TryCopyTo<T>(this Vector256<T> vector, Span<T> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256_1.cs (4)
535/// <inheritdoc cref="ISimdVector{TSelf, T}.CopyTo(TSelf, Span{T})" /> 536static void ISimdVector<Vector256<T>, T>.CopyTo(Vector256<T> vector, Span<T> destination) => vector.CopyTo(destination); 858/// <inheritdoc cref="ISimdVector{TSelf, T}.TryCopyTo(TSelf, Span{T})" /> 859static bool ISimdVector<Vector256<T>, T>.TryCopyTo(Vector256<T> vector, Span<T> destination) => vector.TryCopyTo(destination);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (2)
701public static void CopyTo<T>(this Vector512<T> vector, Span<T> destination) 3678public static bool TryCopyTo<T>(this Vector512<T> vector, Span<T> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512_1.cs (4)
535/// <inheritdoc cref="ISimdVector{TSelf, T}.CopyTo(TSelf, Span{T})" /> 536static void ISimdVector<Vector512<T>, T>.CopyTo(Vector512<T> vector, Span<T> destination) => vector.CopyTo(destination); 858/// <inheritdoc cref="ISimdVector{TSelf, T}.TryCopyTo(TSelf, Span{T})" /> 859static bool ISimdVector<Vector512<T>, T>.TryCopyTo(Vector512<T> vector, Span<T> destination) => vector.TryCopyTo(destination);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (2)
742public static void CopyTo<T>(this Vector64<T> vector, Span<T> destination) 3767public static bool TryCopyTo<T>(this Vector64<T> vector, Span<T> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64_1.cs (4)
603/// <inheritdoc cref="ISimdVector{TSelf, T}.CopyTo(TSelf, Span{T})" /> 604static void ISimdVector<Vector64<T>, T>.CopyTo(Vector64<T> vector, Span<T> destination) => vector.CopyTo(destination); 927/// <inheritdoc cref="ISimdVector{TSelf, T}.TryCopyTo(TSelf, Span{T})" /> 928static bool ISimdVector<Vector64<T>, T>.TryCopyTo(Vector64<T> vector, Span<T> destination) => vector.TryCopyTo(destination);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (1)
114Span<Range> components = stackalloc Range[4];
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (6)
121public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 127public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 436/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 437bool IBinaryInteger<sbyte>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 450/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 451bool IBinaryInteger<sbyte>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\BitVector256.cs (2)
53Span<char> chars = stackalloc char[256]; 68Span<byte> bytes = stackalloc byte[256];
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.cs (2)
140Span<char> copy = ['\0', '\0', '\0', '\0']; 265Span<bool> seenValues = range <= 256 ? stackalloc bool[256] : new bool[range];
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasick.cs (2)
267Span<char> destination = new char[2]; // Avoid stackalloc in a loop 335Span<char> destination = ['\0', '\0'];
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
172Span<char> upperCase = stackalloc char[MaxInputLength].Slice(0, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (1)
83Span<int> bucketIndexes = stackalloc int[RabinKarp.MaxValues].Slice(0, values.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (3)
59Span<string> normalizedValues = new string[uniqueValues.Count]; 99static Span<string> RemoveUnreachableValues(Span<string> values, HashSet<string> unreachableValues)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (10)
44Span<char> span = AcquireSpan(ref bufferToRelease); 113Span<char> span = AcquireSpan(ref bufferToRelease); 140Span<char> span = AcquireSpan(ref bufferToRelease); 194Span<char> span = AcquireSpan(ref bufferToRelease); 239Span<char> span = AcquireSpan(ref bufferToRelease); 271Span<char> span = AcquireSpan(ref bufferToRelease); 282private unsafe Span<char> AcquireSpan(ref SafeBuffer? bufferToRelease) 320Span<char> span = AcquireSpan(ref bufferToRelease); 358Span<char> span = AcquireSpan(ref bufferToRelease).Slice(0, _decryptedLength); 380Span<char> resultSpan = new Span<char>((void*)ptr, byteLength / sizeof(char));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (14)
372public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 378public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 719internal bool TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 732/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 733bool IFloatingPoint<float>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 738internal bool TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 751/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 752bool IFloatingPoint<float>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 757internal bool TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 769/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 770bool IFloatingPoint<float>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 775internal bool TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten) 787/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 788bool IFloatingPoint<float>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Span.cs (22)
120/// <summary>Creates a new <see cref="Span{T}"/> of length 1 around the specified reference.</summary> 171/// Gets a value indicating whether this <see cref="Span{T}"/> is empty. 184public static bool operator !=(Span<T> left, Span<T> right) => !(left == right); 209/// Defines an implicit conversion of an array to a <see cref="Span{T}"/> 211public static implicit operator Span<T>(T[]? array) => new Span<T>(array); 214/// Defines an implicit conversion of a <see cref="ArraySegment{T}"/> to a <see cref="Span{T}"/> 216public static implicit operator Span<T>(ArraySegment<T> segment) => 220/// Returns an empty <see cref="Span{T}"/> 222public static Span<T> Empty => default; 227/// <summary>Enumerates the elements of a <see cref="Span{T}"/>.</summary> 231private readonly Span<T> _span; 238internal Enumerator(Span<T> span) 326public void CopyTo(Span<T> destination) 350public bool TryCopyTo(Span<T> destination) 365public static bool operator ==(Span<T> left, Span<T> right) => 370/// Defines an implicit conversion of a <see cref="Span{T}"/> to a <see cref="ReadOnlySpan{T}"/> 372public static implicit operator ReadOnlySpan<T>(Span<T> span) => 376/// For <see cref="Span{Char}"/>, returns a new instance of string that represents the characters pointed to by the span. 396public Span<T> Slice(int start) 413public Span<T> Slice(int start, int length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanDebugView.cs (1)
12public SpanDebugView(Span<T> span)
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (1)
1001Span<char> scratch = (uint)length < 256 ?
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.cs (3)
360public static string Create(IFormatProvider? provider, Span<char> initialBuffer, [InterpolatedStringHandlerArgument(nameof(provider), nameof(initialBuffer))] ref DefaultInterpolatedStringHandler handler) => 436public void CopyTo(Span<char> destination) 452public bool TryCopyTo(Span<char> destination)
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (5)
296Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 313Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 335Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 360Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 1418Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\StringNormalizationExtensions.cs (1)
80public static bool TryNormalize(this ReadOnlySpan<char> source, Span<char> destination, out int charsWritten, NormalizationForm normalizationForm = NormalizationForm.FormC) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (18)
26/// <remarks>In-place conversion is prohibited, please use <see cref="ToUpperInPlace(Span{byte}, out int)"/> for that.</remarks> 28public static OperationStatus ToUpper(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 39/// <remarks>In-place conversion is prohibited, please use <see cref="ToUpperInPlace(Span{char}, out int)"/> for that.</remarks> 41public static OperationStatus ToUpper(ReadOnlySpan<char> source, Span<char> destination, out int charsWritten) 53public static OperationStatus ToUpper(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 65public static OperationStatus ToUpper(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 76/// <remarks>In-place conversion is prohibited, please use <see cref="ToLowerInPlace(Span{byte}, out int)"/> for that.</remarks> 78public static OperationStatus ToLower(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 89/// <remarks>In-place conversion is prohibited, please use <see cref="ToLowerInPlace(Span{char}, out int)"/> for that.</remarks> 91public static OperationStatus ToLower(ReadOnlySpan<char> source, Span<char> destination, out int charsWritten) 103public static OperationStatus ToLower(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 115public static OperationStatus ToLower(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 125public static OperationStatus ToLowerInPlace(Span<byte> value, out int bytesWritten) 135public static OperationStatus ToLowerInPlace(Span<char> value, out int charsWritten) 145public static OperationStatus ToUpperInPlace(Span<byte> value, out int bytesWritten) 155public static OperationStatus ToUpperInPlace(Span<char> value, out int charsWritten) 158private static unsafe OperationStatus ChangeCase<TFrom, TTo, TCasing>(ReadOnlySpan<TFrom> source, Span<TTo> destination, out int destinationElementsWritten) 193private static unsafe OperationStatus ChangeCase<T, TCasing>(Span<T> buffer, out int elementsWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Transcoding.cs (2)
20public static unsafe OperationStatus ToUtf16(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 55public static unsafe OperationStatus FromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (7)
315public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes) 327public override unsafe bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 382private protected sealed override int GetBytesWithFallback(ReadOnlySpan<char> chars, int originalCharsLength, Span<byte> bytes, int originalBytesLength, EncoderNLS? encoder, bool throwForDestinationOverflow = true) 606public override unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 618public override unsafe bool TryGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten) 671private protected sealed override int GetCharsWithFallback(ReadOnlySpan<byte> bytes, int originalBytesLength, Span<char> chars, int originalCharsLength, DecoderNLS? decoder, bool throwForDestinationOverflow = true) 779internal sealed override OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (2)
197public virtual unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool flush) 303public virtual unsafe void Convert(ReadOnlySpan<byte> bytes, Span<char> chars, bool flush, out int bytesUsed, out int charsUsed, out bool completed)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (2)
215internal bool TryInternalFallbackGetChars(ReadOnlySpan<byte> remainingBytes, int fallbackLength, Span<char> chars, out int charsWritten) 267internal bool TryDrainRemainingDataForGetChars(Span<char> chars, out int charsWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (4)
234Span<byte> combinedBuffer = [0, 0, 0, 0]; 278internal int DrainLeftoverDataForGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int bytesConsumed) 290Span<byte> combinedBuffer = [0, 0, 0, 0]; 377private static int ConcatInto(ReadOnlySpan<byte> srcLeft, ReadOnlySpan<byte> srcRight, Span<byte> dest)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (2)
194public virtual unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool flush) 302public virtual unsafe void Convert(ReadOnlySpan<char> chars, Span<byte> bytes, bool flush, out int charsUsed, out int bytesUsed, out bool completed)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncoderFallback.cs (2)
176internal bool TryInternalFallbackGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsConsumed, out int bytesWritten) 193internal bool TryDrainRemainingDataForGetBytes(Span<byte> bytes, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (1)
313internal bool TryDrainLeftoverDataForGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsConsumed, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (4)
727public virtual unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes) 741public virtual bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 876public virtual unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 890public virtual bool TryGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (6)
80internal virtual OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten) 513/// after data has been drained, then to call <see cref="GetBytesWithFallback(ReadOnlySpan{char}, int, Span{byte}, int, EncoderNLS, bool)"/>. 533Span<byte> bytes = new Span<byte>(pOriginalBytes, originalByteCount).Slice(bytesWrittenSoFar); 587private protected virtual unsafe int GetBytesWithFallback(ReadOnlySpan<char> chars, int originalCharsLength, Span<byte> bytes, int originalBytesLength, EncoderNLS? encoder, bool throwForDestinationOverflow = true) 1135Span<char> chars = new Span<char>(pOriginalChars, originalCharCount).Slice(charsWrittenSoFar); 1188private protected virtual unsafe int GetCharsWithFallback(ReadOnlySpan<byte> bytes, int originalBytesLength, Span<char> chars, int originalCharsLength, DecoderNLS? decoder, bool throwForDestinationOverflow = true)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (5)
227public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes) 239public override unsafe bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 522public override unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 534public override unsafe bool TryGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten) 660internal sealed override OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (11)
230Span<char> original = stackalloc char[MaxUtf16CharsPerRune]; 231Span<char> modified = stackalloc char[MaxUtf16CharsPerRune]; 297internal ReadOnlySpan<char> AsSpan(Span<char> buffer) 758public int EncodeToUtf16(Span<char> destination) 776public int EncodeToUtf8(Span<byte> destination) 966bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 969bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 1086public bool TryEncodeToUtf16(Span<char> destination, out int charsWritten) 1093private static bool TryEncodeToUtf16(Rune value, Span<char> destination, out int charsWritten) 1130public bool TryEncodeToUtf8(Span<byte> destination, out int bytesWritten) 1137private static bool TryEncodeToUtf8(Rune value, Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (7)
932public void CopyTo(int sourceIndex, Span<char> destination, int count) 1493Span<char> buffer = stackalloc char[string.StackallocCharBufferSizeLimit]; 2307Span<char> span = chunk.m_ChunkChars.AsSpan(curInChunk, endInChunk - curInChunk); 2627private Span<char> RemainingCurrentChunk 2941Span<char> chars = index + 1 < Length 3058Span<char> destination = _stringBuilder.RemainingCurrentChunk; 3129Span<char> destination = _stringBuilder.RemainingCurrentChunk;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
296public override int Read(Span<byte> buffer) 508Span<char> decodedChars = scratchChars.AsSpan(0, charsWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (13)
45public static unsafe OperationStatus FromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsRead, out int bytesWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) 131public static unsafe OperationStatus ToUtf16(ReadOnlySpan<byte> source, Span<char> destination, out int bytesRead, out int charsWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) 218internal static unsafe OperationStatus ToUtf16PreservingReplacement(ReadOnlySpan<byte> source, Span<char> destination, out int bytesRead, out int charsWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) 322public static bool TryWrite(Span<byte> destination, [InterpolatedStringHandlerArgument(nameof(destination))] ref TryWriteInterpolatedStringHandler handler, out int bytesWritten) 342public static bool TryWrite(Span<byte> destination, IFormatProvider? provider, [InterpolatedStringHandlerArgument(nameof(destination), nameof(provider))] ref TryWriteInterpolatedStringHandler handler, out int bytesWritten) => 353private readonly Span<byte> _destination; 363/// <summary>Creates a handler used to write an interpolated string into a UTF-8 <see cref="Span{Byte}"/>.</summary> 369public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, Span<byte> destination, out bool shouldAppend) 378/// <summary>Creates a handler used to write an interpolated string into a UTF-8 <see cref="Span{Byte}"/>.</summary> 385public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, Span<byte> destination, IFormatProvider? provider, out bool shouldAppend) 402Span<byte> dest = _destination.Slice(_pos); 686Span<char> utf16 = stackalloc char[256]; 733Span<char> utf16 = stackalloc char[256];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (6)
361public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes) 373public override unsafe bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 556public override unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 568public override unsafe bool TryGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten) 634private protected sealed override int GetCharsWithFallback(ReadOnlySpan<byte> bytes, int originalBytesLength, Span<char> chars, int originalCharsLength, DecoderNLS? decoder, bool throwForDestinationOverflow = true) 777internal sealed override OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (1)
153public override bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (1)
3659Span<object?> continuations = CollectionsMarshal.AsSpan(list);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (4)
238Span<SafeWaitHandle?> safeWaitHandles, 239Span<IntPtr> unsafeWaitHandles) 324Span<IntPtr> unsafeWaitHandles = stackalloc IntPtr[waitHandles.Length]; 386Span<IntPtr> unsafeWaitHandles = stackalloc IntPtr[safeWaitHandles.Length];
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (3)
1016public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 1020public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 1023private bool TryFormatCore<TChar>(Span<TChar> destination, out int written, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] ReadOnlySpan<char> format, IFormatProvider? provider) where TChar : unmanaged, IUtfChar<TChar>
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (2)
859public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null) 863public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null)
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Cache.cs (1)
203private bool IsAmbiguousLocalTime(DateTime localDateTime, Span<TimeSpan> offsets = default)
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (2)
221Span<TimeSpan> offsets = stackalloc TimeSpan[2]; 258Span<TimeSpan> offsets = stackalloc TimeSpan[2];
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (6)
120public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 126public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 1215/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 1216bool IBinaryInteger<UInt128>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 1228/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 1229bool IBinaryInteger<UInt128>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (6)
113public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 119public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 384/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 385bool IBinaryInteger<ushort>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 397/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 398bool IBinaryInteger<ushort>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (6)
129public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 135public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 448/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 449bool IBinaryInteger<uint>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 461/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 462bool IBinaryInteger<uint>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (6)
128public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 134public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 455/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 456bool IBinaryInteger<ulong>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 468/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 469bool IBinaryInteger<ulong>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (6)
225public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 229public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 450/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 451bool IBinaryInteger<nuint>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 463/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 464bool IBinaryInteger<nuint>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Version.cs (12)
174Span<char> dest = stackalloc char[(4 * Number.Int32NumberBufferLength) + 3]; // at most 4 Int32s and 3 periods 183public bool TryFormat(Span<char> destination, out int charsWritten) => 186public bool TryFormat(Span<char> destination, int fieldCount, out int charsWritten) => 193public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten) => 201public bool TryFormat(Span<byte> utf8Destination, int fieldCount, out int bytesWritten) => 204private bool TryFormatCore<TChar>(Span<TChar> destination, int fieldCount, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 253((uint)value).TryFormat(Unsafe.BitCast<Span<TChar>, Span<char>>(destination), out valueCharsWritten) : 254((uint)value).TryFormat(Unsafe.BitCast<Span<TChar>, Span<byte>>(destination), out valueCharsWritten, default, CultureInfo.InvariantCulture); 270bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 275bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) =>
System\CrashInfo.cs (3)
379Span<byte> destination = AllocBuffer(size); 390Span<byte> destination = AllocBuffer(bytes.Length); 399private Span<byte> AllocBuffer(int size)
System\Reflection\ConstructorInvoker.cs (4)
72object result = _methodBaseInvoker.CreateInstanceWithFewArgs(((Span<object?>)argStorage._args).Slice(0, 2)); 89object result = _methodBaseInvoker.CreateInstanceWithFewArgs(((Span<object?>)argStorage._args).Slice(0, 3)); 107object result = _methodBaseInvoker.CreateInstanceWithFewArgs(((Span<object?>)argStorage._args).Slice(0, 4)); 113public object Invoke(Span<object?> arguments)
System\Reflection\DynamicInvokeInfo.cs (16)
257Span<object?> parameters) 320Span<object?> parameters) 421Span<object?> copyOfParameters = new(ref Unsafe.As<IntPtr, object?>(ref *pStorage), argCount); 451IntPtr methodToCall, ref byte thisArg, ref byte ret, Span<object?> parameters) 470Span<object?> copyOfParameters = new(ref Unsafe.As<IntPtr, object?>(ref *pStorage), argCount); 496Span<object?> copyOfParameters = ((Span<object?>)argStorage._args).Slice(0, _argumentCount); 523IntPtr methodToCall, ref byte thisArg, ref byte ret, Span<object?> parameters) 528Span<object?> copyOfParameters = ((Span<object?>)argStorage._args).Slice(0, _argumentCount); 550IntPtr methodToCall, ref byte thisArg, ref byte ret, Span<object?> parameters) 589Span<object?> copyOfParameters, 672Span<object?> copyOfParameters, 674Span<object?> parameters) 772private unsafe void CopyBackToSpan(Span<object?> src, Span<object?> dest)
System\Reflection\MethodInvoker.cs (4)
87object? result = _methodBaseInvoker.InvokeDirectWithFewArgs(obj, ((Span<object?>)argStorage._args).Slice(0, 2)); 105object? result = _methodBaseInvoker.InvokeDirectWithFewArgs(obj, ((Span<object?>)argStorage._args).Slice(0, 3)); 124object? result = _methodBaseInvoker.InvokeDirectWithFewArgs(obj, ((Span<object?>)argStorage._args).Slice(0, 4)); 130public object? Invoke(object? obj, Span<object?> arguments)
System\Reflection\Runtime\MethodInfos\CustomMethodInvoker.cs (4)
27protected internal sealed override object? Invoke(object? thisObject, Span<object?> arguments) => 30protected internal sealed override object? InvokeDirectWithFewArgs(object? thisObject, Span<object?> arguments) => 67protected internal sealed override object CreateInstance(Span<object?> arguments) 74protected internal sealed override object CreateInstanceWithFewArgs(Span<object?> arguments)
System\Reflection\Runtime\MethodInfos\OpenMethodInvoker.cs (4)
27protected internal sealed override object CreateInstance(Span<object?> arguments) 32protected internal sealed override object CreateInstanceWithFewArgs(Span<object?> arguments) 37protected internal sealed override object? Invoke(object? thisObject, Span<object?> arguments) 42protected internal sealed override object? InvokeDirectWithFewArgs(object? thisObject, Span<object?> arguments)
System.Private.CoreLib.Generators (8)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T?> scratchBuffer) 52Span<T> span = _span; 68Span<T> span = _span; 107public Span<T> AppendSpan(int length) 112Span<T> span = _span; 125private Span<T> AppendSpanWithGrow(int length) 149public bool TryCopyTo(Span<T> destination, out int itemsWritten)
System.Private.DataContractSerialization (28)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
System\Runtime\Serialization\DataContract.cs (1)
1684Span<char> formatted = stackalloc char[Globals.SerializationNamespace.Length];
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (1)
170public override int Read(Span<byte> buffer)
System\Runtime\Serialization\MemoryStreamAdapter.cs (1)
63Span<byte> slicedBuffer = value.Buffer.AsSpan(value.Origin, value.Length - value.Origin);
System\Xml\EncodingStreamWrapper.cs (1)
587public override int Read(Span<byte> buffer)
System\Xml\UniqueId.cs (2)
215private unsafe void ToSpan(Span<char> chars) 291Span<byte> destination = buffer.AsSpan(offset, guidLength);
System\Xml\XmlBinaryWriter.cs (10)
736Span<byte> span = GetTextNodeBuffer(1 + sizeof(float), out int offset).AsSpan(offset, 1 + sizeof(float)); 761Span<byte> span = GetTextNodeBuffer(1 + sizeof(double), out int offset).AsSpan(offset, 1 + sizeof(double)); 777Span<int> bits = [0, 0, 0, 0]; 781Span<byte> span = GetTextNodeBuffer(1 + sizeof(decimal), out int offset).AsSpan(offset, 1 + sizeof(decimal)); 813Span<byte> span = GetTextNodeBuffer(17, out int offset).AsSpan(offset, 17); 924Span<byte> span = GetBuffer(sizeof(float), out int bufferOffset).AsSpan(bufferOffset, sizeof(float)); 942Span<byte> span = GetBuffer(sizeof(double), out int bufferOffset).AsSpan(bufferOffset, sizeof(double)); 957Span<int> bits = [0, 0, 0, 0]; 964Span<byte> span = GetBuffer(16, out int bufferOffset).AsSpan(bufferOffset, 16); 995Span<byte> bytes = GetBuffer(16, out int bufferOffset).AsSpan(bufferOffset, 16);
System\Xml\XmlBufferReader.cs (2)
485public void ReadRawArrayBytes<T>(Span<T> dst) 491public void ReadRawArrayBytes(Span<byte> dst)
System\Xml\XmlConverter.cs (1)
1094public static int StripWhitespace(Span<char> chars)
System\Xml\XmlStreamNodeWriter.cs (1)
232var buffer = GetBuffer(bytes.Length, out int offset).AsSpan(offset, bytes.Length);
System.Private.Reflection.Execution (15)
Internal\Reflection\Execution\MethodInvokers\InstanceMethodInvoker.cs (4)
62protected sealed override object? Invoke(object? thisObject, Span<object?> arguments) 78protected sealed override object? InvokeDirectWithFewArgs(object? thisObject, Span<object?> arguments) 107protected sealed override object CreateInstance(Span<object?> arguments) 114protected sealed override object CreateInstanceWithFewArgs(Span<object?> arguments)
Internal\Reflection\Execution\MethodInvokers\StaticMethodInvoker.cs (4)
34protected sealed override object? Invoke(object? thisObject, Span<object?> arguments) 45protected sealed override object? InvokeDirectWithFewArgs(object? thisObject, Span<object?> arguments) 61protected sealed override object CreateInstance(Span<object?> arguments) 66protected sealed override object CreateInstanceWithFewArgs(Span<object?> arguments)
Internal\Reflection\Execution\MethodInvokers\VirtualMethodInvoker.cs (4)
78protected sealed override object? Invoke(object? thisObject, Span<object?> arguments) 97protected sealed override object? InvokeDirectWithFewArgs(object? thisObject, Span<object?> arguments) 120protected sealed override object CreateInstance(Span<object?> arguments) 125protected sealed override object CreateInstanceWithFewArgs(Span<object?> arguments)
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (3)
49public readonly Span<T> AsSpan() => _items.AsSpan(0, _count); 51public readonly Span<T> AsSpan(int start) => _items.AsSpan(start, _count - start); 53public Span<T> AppendSpan(int length)
System.Private.TypeLoader (3)
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (3)
49public readonly Span<T> AsSpan() => _items.AsSpan(0, _count); 51public readonly Span<T> AsSpan(int start) => _items.AsSpan(start, _count - start); 53public Span<T> AppendSpan(int length)
System.Private.Uri (43)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T?> scratchBuffer) 52Span<T> span = _span; 68Span<T> span = _span; 107public Span<T> AppendSpan(int length) 112Span<T> span = _span; 125private Span<T> AppendSpanWithGrow(int length) 149public bool TryCopyTo(Span<T> destination, out int itemsWritten)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (2)
39Span<byte> numbers = stackalloc byte[NumberOfLabels]; 213Span<long> parts = [0, 0, 0]; // One part per octet. Final octet doesn't have a terminator, so is stored in currentValue.
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
313internal static void Parse<TChar>(ReadOnlySpan<TChar> address, scoped Span<ushort> numbers, out ReadOnlySpan<TChar> scopeId)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\DomainNameHelper.cs (1)
230Span<char> asciiBuffer = stackalloc char[256];
System\IPv4AddressHelper.cs (2)
20Span<byte> numbers = 31Span<char> stackSpace = stackalloc char[NumberOfLabels * 3 + 3];
System\IPv6AddressHelper.cs (2)
14Span<ushort> numbers = stackalloc ushort[NumberOfLabels]; 25Span<char> stackSpace = stackalloc char[48]; // large enough for any IPv6 string, including brackets
System\IriHelper.cs (1)
76Span<byte> maxUtf8EncodedSpan = [0, 0, 0, 0];
System\Uri.cs (6)
1073Span<char> slashSpan = result.RawChars.Slice(0, result.Length); 1393return string.Create(3, (byte)character, (Span<char> chars, byte b) => 1584public bool TryFormat(Span<char> destination, out int charsWritten) 1652bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 2717private bool TryRecreateParts(scoped Span<char> span, out int charsWritten, UriComponents parts, ushort nonCanonical, UriFormat formatAs) 4348Span<char> chars = vsb.RawChars.Slice(0, vsb.Length);
System\UriExt.cs (2)
535public static bool TryUnescapeDataString(ReadOnlySpan<char> charsToUnescape, Span<char> destination, out int charsWritten) 631public static bool TryEscapeDataString(ReadOnlySpan<char> charsToEscape, Span<char> destination, out int charsWritten) =>
System\UriHelper.cs (3)
134public static bool TryEscapeDataString(ReadOnlySpan<char> charsToEscape, Span<char> destination, out int charsWritten) 256Span<byte> utf8Bytes = [0, 0, 0, 0]; 620public static int Compress(Span<char> span, bool convertPathSlashes, bool canonicalizeAsFilePath)
System\ValueStringBuilderExtensions.cs (1)
14Span<char> chars = _chars;
System.Private.Windows.Core (115)
_generated\12\Windows.Win32.byte.InlineArrays.g.cs (1)
43 internal unsafe Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength);
_generated\129\Windows.Win32.IDispatch.g.cs (1)
93 internal unsafe winmdroot.Foundation.HRESULT GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\130\Windows.Win32.IDispatchEx.g.cs (1)
75 internal unsafe winmdroot.Foundation.HRESULT GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\139\Windows.Win32.IEnumFORMATETC.g.cs (1)
56 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.System.Com.FORMATETC> rgelt, uint* pceltFetched)
_generated\141\Windows.Win32.IEnumSTATDATA.g.cs (1)
56 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.System.Com.STATDATA> rgelt, uint* pceltFetched)
_generated\142\Windows.Win32.IEnumSTATSTG.g.cs (1)
56 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.System.Com.STATSTG> rgelt, uint* pceltFetched)
_generated\143\Windows.Win32.IEnumString.g.cs (1)
56 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.Foundation.PWSTR> rgelt, uint* pceltFetched)
_generated\155\Windows.Win32.IPictureDisp.g.cs (1)
76 internal unsafe winmdroot.Foundation.HRESULT GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\163\Windows.Win32.ITypeInfo.g.cs (1)
352 internal unsafe winmdroot.Foundation.HRESULT GetIDsOfNames(ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, Span<int> pMemId)
_generated\164\Windows.Win32.ITypeLib.g.cs (2)
330 internal unsafe winmdroot.Foundation.HRESULT IsName(ref Span<char>szNameBuf, uint lHashVal, out winmdroot.Foundation.BOOL pfName) 382 internal unsafe winmdroot.Foundation.HRESULT FindName(ref Span<char>szNameBuf, uint lHashVal, winmdroot.System.Com.ITypeInfo** ppTInfo, int* rgMemId, ref ushort pcFound)
_generated\195\Windows.Win32.PInvokeCore.GDI32.dll.g.cs (2)
454 internal static unsafe uint GetEnhMetaFileBits(winmdroot.Graphics.Gdi.HENHMETAFILE hEMF, Span<byte> lpData) 505 internal static unsafe uint GetPaletteEntries(winmdroot.Graphics.Gdi.HPALETTE hpal, uint iStart, Span<winmdroot.Graphics.Gdi.PALETTEENTRY> pPalEntries)
_generated\206\Windows.Win32.PSTR.g.cs (2)
63 internal Span<byte> AsSpan() => this.Value is null ? default(Span<byte>) : new Span<byte>(this.Value, this.Length);
_generated\207\Windows.Win32.PWSTR.g.cs (2)
63 internal Span<char> AsSpan() => this.Value is null ? default(Span<char>) : new Span<char>(this.Value, this.Length);
_generated\232\Windows.Win32.System_Com_IEnumFORMATETC_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Com.IEnumFORMATETC.Interface @this, Span<winmdroot.System.Com.FORMATETC> rgelt, uint* pceltFetched)
_generated\233\Windows.Win32.System_Com_IEnumSTATDATA_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Com.IEnumSTATDATA.Interface @this, Span<winmdroot.System.Com.STATDATA> rgelt, uint* pceltFetched)
_generated\234\Windows.Win32.System_Com_IEnumString_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Com.IEnumString.Interface @this, Span<winmdroot.Foundation.PWSTR> rgelt, uint* pceltFetched)
_generated\243\Windows.Win32.System_Com_ITypeInfo_Extensions.g.cs (1)
84 internal static unsafe winmdroot.Foundation.HRESULT GetIDsOfNames(this winmdroot.System.Com.ITypeInfo.Interface @this, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, Span<int> pMemId)
_generated\244\Windows.Win32.System_Com_ITypeLib_Extensions.g.cs (2)
64 internal static unsafe winmdroot.Foundation.HRESULT IsName(this winmdroot.System.Com.ITypeLib.Interface @this, ref Span<char>szNameBuf, uint lHashVal, out winmdroot.Foundation.BOOL pfName) 80 internal static unsafe winmdroot.Foundation.HRESULT FindName(this winmdroot.System.Com.ITypeLib.Interface @this, ref Span<char>szNameBuf, uint lHashVal, winmdroot.System.Com.ITypeInfo** ppTInfo, int* rgMemId, ref ushort pcFound)
_generated\245\Windows.Win32.System_Com_StructuredStorage_IEnumSTATSTG_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Com.StructuredStorage.IEnumSTATSTG.Interface @this, Span<winmdroot.System.Com.STATSTG> rgelt, uint* pceltFetched)
_generated\268\Windows.Win32.VariableLengthInlineArray.g.cs (1)
37 internal Span<T> AsSpan(int length)
_generated\37\Windows.Win32.char.InlineArrays.g.cs (2)
44 internal unsafe Span<char> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength); 108 internal unsafe Span<char> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength);
_generated\45\Windows.Win32.DECIMAL.g.cs (1)
44 Span<int> bits = stackalloc int[4];
System\BufferScope.cs (8)
10/// were a <see cref="Span{T}"/>. 20private Span<T> _span; 32public BufferScope(Span<T> initialBuffer) 57public BufferScope(Span<T> initialBuffer, int minimumLength) 105public readonly Span<T> this[Range range] => _span[range]; 107public readonly Span<T> Slice(int start, int length) => _span.Slice(start, length); 113public readonly Span<T> AsSpan() => _span; 115public static implicit operator Span<T>(BufferScope<T> scope) => scope._span;
System\IO\BinaryReaderExtensions.cs (4)
122Span<byte> arrayData = new(a, array.Length * sizeof(T)); 134Span<ushort> ushorts = MemoryMarshal.Cast<byte, ushort>(arrayData); 139Span<int> ints = MemoryMarshal.Cast<byte, int>(arrayData); 144Span<long> longs = MemoryMarshal.Cast<byte, long>(arrayData);
System\IO\Compression\RunLengthEncoder.cs (2)
58public static bool TryEncode(ReadOnlySpan<byte> data, Span<byte> encoded, out int written) 82public static bool TryDecode(ReadOnlySpan<byte> encoded, Span<byte> data, out int written)
System\IO\StreamExtensions.cs (1)
62Span<byte> span = new(buffer, size);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
53Span<int> ints = stackalloc int[4];
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (3)
359Span<char> fileBuffer = new( 404Span<char> span = buffer.AsCharSpan(); 423Span<byte> span = buffer.AsSpan();
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
317Span<char> fileName = stackalloc char[(int)PInvokeCore.MAX_PATH + 1];
System\Private\Windows\Ole\DataFormatsCore.cs (1)
102Span<char> buffer = stackalloc char[256];
System\SpanHelpers.cs (3)
13public static void CopyAndTerminate(this ReadOnlySpan<char> source, Span<char> destination) 40public static Span<char> SliceAtFirstNull(this Span<char> span)
System\SpanWriter.cs (5)
7/// Fast stack based <see cref="Span{T}"/> writer. 9internal ref struct SpanWriter<T>(Span<T> span) where T : unmanaged, IEquatable<T> 11private Span<T> _unwritten = span; 12public Span<T> Span { get; } = span; 97private static void UncheckedSlice(ref Span<T> span, int start, int length)
System\Text\ValueStringBuilder.cs (6)
21private Span<char> _chars; 32public ValueStringBuilder(Span<char> initialBuffer) 116public readonly Span<char> RawChars => _chars; 137public bool TryCopyTo(Span<char> destination, out int charsWritten) 265Span<char> dst = _chars.Slice(_pos, count); 282Span<char> dst = _chars.Slice(_pos, length);
Windows\Win32\Foundation\GlobalBuffer.cs (3)
14private Span<byte> _buffer; 48public readonly Span<byte> AsSpan() => _buffer; 50public readonly Span<char> AsCharSpan() => MemoryMarshal.Cast<byte, char>(_buffer);
Windows\Win32\Graphics\Gdi\ArgbBuffer.cs (1)
29public ArgbBuffer(Span<Color> colors) : this(colors.Length)
Windows\Win32\PInvokeCore.GetPaletteEntries.cs (1)
9public static unsafe uint GetPaletteEntries(HPALETTE hpal, Span<PALETTEENTRY> entries)
Windows\Win32\System\Com\ComInterfaceTable.cs (10)
19Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface>(1); 36Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(2); 55Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(3); 76Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(4); 99Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(5); 124Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(6); 154Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(10); 207Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(27); 244private static Span<ComInterfaceEntry> AllocateEntries<T>(int count) 246Span<ComInterfaceEntry> entries = new(
Windows\Win32\System\Com\ComManagedStream.cs (1)
124Span<byte> buffer = new(pv, checked((int)cb));
Windows\Win32\System\Com\SAFEARRAY.cs (1)
70public T GetValue<T>(Span<int> indices)
Windows\Win32\System\Com\SafeArrayScope.cs (2)
209Span<int> indices = [index]; 221Span<int> indices = [index];
Windows\Win32\System\Variant\VARIANT.cs (33)
336Span<VARIANT_BOOL> data = new(psa->pvData, array.Length); 337var result = GetSpan<bool>(array); 348Span<DECIMAL> data = new(psa->pvData, array.Length); 349var result = GetSpan<decimal>(array); 360Span<long> data = new(psa->pvData, array.Length); 361var result = GetSpan<decimal>(array); 372Span<double> data = new(psa->pvData, array.Length); 373var result = GetSpan<DateTime>(array); 384Span<IntPtr> data = new(psa->pvData, array.Length); 385var result = GetSpan<string?>(array); 397Span<IntPtr> data = new(psa->pvData, array.Length); 398var result = GetSpan<object?>(array); 409Span<VARIANT> data = new(psa->pvData, array.Length); 410var result = GetSpan<object?>(array); 461Span<int> indices = stackalloc int[array.Rank]; 462Span<int> lower = stackalloc int[array.Rank]; 463Span<int> upper = stackalloc int[array.Rank]; 475static void InternalTransposeArray(SAFEARRAY* psa, Array array, VARENUM arrayType, Span<int> indices, Span<int> lower, Span<int> upper) 512private static void SetArrayValue(SAFEARRAY* psa, Array array, Span<int> indices, Span<int> lowerBounds, VARENUM arrayType) 514static void SetValue<T>(Array array, T value, Span<int> indices, Span<int> lowerBounds) 518var span = GetSpan<T>(array); 768Span<VARIANT_BOOL> data = new(ca.pElems, (int)ca.cElems); 795Span<long> data = new(ca.pElems, (int)ca.cElems); 807Span<double> data = new(ca.pElems, (int)ca.cElems); 819var data = new Span<FILETIME>(ca.pElems, (int)ca.cElems); 834Span<IntPtr> data = new(ca.pElems, (int)ca.cElems); 846Span<IntPtr> data = new(ca.pElems, (int)ca.cElems); 858Span<VARIANT> data = new(ca.pElems, (int)ca.cElems); 875private static Span<T> GetSpan<T>(Array array)
System.Private.Windows.Core.TestUtilities (1)
ReflectionHelper.cs (1)
63params Span<Type> genericTypes)
System.Private.Windows.GdiPlus (6)
_generated\25\Windows.Win32.float.InlineArrays.g.cs (1)
43 internal unsafe Span<float> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength);
_generated\60\Windows.Win32.PInvokeGdiPlus.gdiplus.dll.g.cs (4)
4538 internal static unsafe winmdroot.Graphics.GdiPlus.Status GdipGetPathTypes(in winmdroot.Graphics.GdiPlus.GpPath path, Span<byte> types) 5014 internal static unsafe winmdroot.Graphics.GdiPlus.Status GdipGetRegionData(ref winmdroot.Graphics.GdiPlus.GpRegion region, Span<byte> buffer, uint* sizeFilled) 6085 internal static unsafe winmdroot.Graphics.GdiPlus.Status GdipPathIterEnumerate(ref winmdroot.Graphics.GdiPlus.GpPathIterator iterator, out int resultCount, Span<winmdroot.Graphics.GdiPlus.PointF> points, Span<byte> types)
Windows\Win32\Graphics\GdiPlus\EncoderParameters.cs (1)
9internal unsafe Span<EncoderParameter> Parameters => Parameter.AsSpan((int)Count);
System.Private.Xml (64)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Xml\Base64Decoder.cs (1)
102private void Decode(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsDecoded, out int bytesDecoded)
System\Xml\BinaryXml\SqlUtils.cs (3)
192Span<char> pszTmp = stackalloc char[s_NUMERIC_MAX_PRECISION + 1]; //Local Character buffer to hold 226Span<char> szResult = stackalloc char[uiResultLen]; 390Span<char> chars = stackalloc char[fractionDigits];
System\Xml\BinaryXml\XmlBinaryReader.cs (1)
2335Span<byte> dstBytes = MemoryMarshal.AsBytes(dstChars);
System\Xml\BinHexDecoder.cs (1)
137Span<byte> bytes,
System\Xml\Cache\XPathDocumentNavigator.cs (1)
898Span<char> buf = stackalloc char[1 + 7 + 1 + 7];
System\Xml\Schema\XsdDateTime.cs (7)
517Span<char> destination = stackalloc char[CharStackBufferSize]; 524public bool TryFormat(Span<char> destination, out int charsWritten) 574Span<char> text = vsb.AppendSpan(s_lzyyyy_MM_dd); 640Span<char> text = vsb.AppendSpan(s_lzHH_mm_ss); 665Span<char> text; 693private static void WriteXDigits(Span<char> text, int start, int value, int digits) 703private static void Write2Digits(Span<char> text, int start, int value)
System\Xml\Schema\XsdDuration.cs (3)
345Span<char> destination = stackalloc char[CharStackBufferSize]; 352public unsafe bool TryFormat(Span<char> destination, out int charsWritten, DurationType durationType = DurationType.Duration) 409Span<char> tmpSpan = stackalloc char[9];
System\Xml\Serialization\CodeGenerator.cs (1)
439_ilGen!.Emit(OpCodes.Newobj, typeof(Span<>).MakeGenericType(elementType).GetConstructor(new Type[] { typeof(void*), typeof(int) })!);
System\Xml\Serialization\Xmlcustomformatter.cs (3)
120internal static bool TryFormatDateTime(DateTime value, Span<char> destination, out int charsWritten) 131internal static bool TryFormatDateOnly(DateOnly value, Span<char> destination, out int charsWritten) 136internal static bool TryFormatTimeOnly(TimeOnly value, Span<char> destination, out int charsWritten)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (4)
3417LocalBuilder paramsRead = ilg.DeclareLocal(typeof(Span<bool>), "paramsRead"); 3425ilg.New(typeof(Span<bool>).GetConstructor(new[] { typeof(bool[]) })!); 3576ilg.Call(typeof(Span<bool>).GetMethod("get_Item")!); 3589ilg.Call(typeof(Span<bool>).GetMethod("get_Item")!);
System\Xml\Serialization\XmlSerializationWriter.cs (3)
128internal static bool TryFormatDateTime(DateTime value, Span<char> destination, out int charsWritten) 158internal static bool TryFormatDateOnly(DateOnly value, Span<char> destination, out int charsWritten) 163internal static bool TryFormatTimeOnly(TimeOnly value, Span<char> destination, out int charsWritten)
System\Xml\XmlConvert.cs (20)
1639internal static bool TryFormat(bool value, Span<char> destination, out int charsWritten) 1647internal static bool TryFormat(char value, Span<char> destination, out int charsWritten) 1656internal static bool TryFormat(decimal value, Span<char> destination, out int charsWritten) 1661internal static bool TryFormat(sbyte value, Span<char> destination, out int charsWritten) 1666internal static bool TryFormat(short value, Span<char> destination, out int charsWritten) 1671internal static bool TryFormat(int value, Span<char> destination, out int charsWritten) 1676internal static bool TryFormat(long value, Span<char> destination, out int charsWritten) 1681internal static bool TryFormat(byte value, Span<char> destination, out int charsWritten) 1686internal static bool TryFormat(ushort value, Span<char> destination, out int charsWritten) 1691internal static bool TryFormat(uint value, Span<char> destination, out int charsWritten) 1696internal static bool TryFormat(ulong value, Span<char> destination, out int charsWritten) 1701internal static bool TryFormat(float value, Span<char> destination, out int charsWritten) 1725internal static bool TryFormat(double value, Span<char> destination, out int charsWritten) 1749internal static bool TryFormat(TimeSpan value, Span<char> destination, out int charsWritten) 1754internal static bool TryFormat(DateTime value, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format, Span<char> destination, out int charsWritten) 1759internal static bool TryFormat(DateTime value, Span<char> destination, out int charsWritten) 1764internal static bool TryFormat(DateTime value, XmlDateTimeSerializationMode dateTimeOption, Span<char> destination, out int charsWritten) 1791internal static bool TryFormat(DateTimeOffset value, Span<char> destination, out int charsWritten) 1797internal static bool TryFormat(DateTimeOffset value, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format, Span<char> destination, out int charsWritten) 1802internal static bool TryFormat(Guid value, Span<char> destination, out int charsWritten)
System\Xml\Xsl\Runtime\NumberFormatter.cs (1)
84Span<char> letters = stackalloc char[MaxAlphabeticLength];
System\Xml\Xsl\Xslt\XsltLoader.cs (1)
956Span<char> characters = stackalloc char[NumCharAttrs];
System.Reflection.Metadata (21)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (2)
251Span<Range> parts = stackalloc Range[5]; 261Span<ushort> versionNumbers = [ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue];
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Reflection\Internal\Utilities\DecimalUtilities.cs (2)
11Span<int> bits = [0, 0, 0, 0]; 22Span<int> bits = [0, 0, 0, 0];
System\Reflection\Metadata\BlobBuilder.cs (1)
53private Span<byte> Span => _buffer.AsSpan(0, Length);
System\Reflection\Metadata\BlobWriterImpl.cs (1)
155internal static int WriteScalarConstant(Span<byte> bytes, object? value)
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (1)
260Span<byte> buffer = stackalloc byte[BlobWriterImpl.MaxScalarConstantSize];
System.Resources.Extensions (1)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
26fixed (byte* ptr = &MemoryMarshal.GetReference((Span<byte>)array))
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
781[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
System.Runtime.InteropServices.JavaScript (37)
_generated\0\JSImports.g.cs (11)
43global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __self_native, __propertyName_native]; 93global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __self_native, __propertyName_native]; 143global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __self_native, __propertyName_native]; 193global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __self_native, __propertyName_native]; 243global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __self_native, __propertyName_native]; 293global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __self_native, __propertyName_native]; 343global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __self_native, __propertyName_native]; 393global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __self_native, __propertyName_native]; 706global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native]; 749global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native]; 802global::System.Span<global::System.Runtime.InteropServices.JavaScript.JSMarshalerArgument> __arguments_buffer = [____arg_exception_native, ____arg_return_native, __moduleName_native, __moduleUrl_native];
System\Runtime\InteropServices\JavaScript\JSFunctionBinding.cs (6)
157public static void InvokeJS(JSFunctionBinding signature, Span<JSMarshalerArgument> arguments) 204internal static unsafe void InvokeJSFunction(JSObject jsFunction, Span<JSMarshalerArgument> arguments) 230internal static unsafe void InvokeJSFunctionCurrent(JSObject jsFunction, Span<JSMarshalerArgument> arguments) 287internal static unsafe void InvokeJSImportImpl(JSFunctionBinding signature, Span<JSMarshalerArgument> arguments) 367internal static unsafe void InvokeJSImportCurrent(JSFunctionBinding signature, Span<JSMarshalerArgument> arguments) 457internal static unsafe void ResolveOrRejectPromise(JSProxyContext targetContext, Span<JSMarshalerArgument> arguments)
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Byte.cs (2)
156public unsafe void ToManaged(out Span<byte> value) 167public unsafe void ToJS(Span<byte> value)
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Double.cs (2)
162public unsafe void ToManaged(out Span<double> value) 173public unsafe void ToJS(Span<double> value)
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Func.cs (8)
23Span<JSMarshalerArgument> arguments = stackalloc JSMarshalerArgument[2]; 54Span<JSMarshalerArgument> arguments = stackalloc JSMarshalerArgument[3]; 91Span<JSMarshalerArgument> arguments = stackalloc JSMarshalerArgument[4]; 133Span<JSMarshalerArgument> arguments = stackalloc JSMarshalerArgument[5]; 261Span<JSMarshalerArgument> arguments = stackalloc JSMarshalerArgument[2]; 298Span<JSMarshalerArgument> arguments = stackalloc JSMarshalerArgument[3]; 339Span<JSMarshalerArgument> arguments = stackalloc JSMarshalerArgument[4]; 385Span<JSMarshalerArgument> arguments = stackalloc JSMarshalerArgument[5];
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Int32.cs (2)
156public unsafe void ToManaged(out Span<int> value) 167public unsafe void ToJS(Span<int> value)
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Object.cs (1)
332else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Span<>))
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Single.cs (2)
162public unsafe void ToManaged(out Span<float> value) 173public unsafe void ToJS(Span<float> value)
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Task.cs (3)
448Span<JSMarshalerArgument> args = stackalloc JSMarshalerArgument[4]; 483Span<JSMarshalerArgument> args = stackalloc JSMarshalerArgument[4]; 517Span<JSMarshalerArgument> args = stackalloc JSMarshalerArgument[4];
System.Runtime.Numerics (371)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T?> scratchBuffer) 52Span<T> span = _span; 68Span<T> span = _span; 107public Span<T> AppendSpan(int length) 112Span<T> span = _span; 125private Span<T> AppendSpanWithGrow(int length) 149public bool TryCopyTo(Span<T> destination, out int itemsWritten)
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
467Span<int> thousandsSepPos = [0, 0, 0, 0];
src\runtime\src\libraries\Common\src\System\Number.NumberBuffer.cs (2)
32public Span<byte> Digits; 43public NumberBuffer(NumberBufferKind kind, Span<byte> digits)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder_1.cs (8)
18private Span<TChar> _chars; 21public ValueStringBuilder(Span<TChar> initialBuffer) 102Span<TChar> slice = _chars.Slice(0, _pos); 123public readonly Span<TChar> RawChars => _chars; 143public bool TryCopyTo(Span<TChar> destination, out int charsWritten) 196Span<TChar> chars = _chars; 247Span<TChar> dst = _chars.Slice(_pos, count); 256public Span<TChar> AppendSpan(int length)
System\Number.BigInteger.cs (43)
89scoped Span<byte> buffer; 260Span<nuint> wholeBlockDestination = bits.AsSpan(0, wholeBlockCount); 347scoped Span<nuint> base1E9; 400Span<nuint> resultBuffer = BigInteger.RentedBuffer.Create(resultLength, out BigInteger.RentedBuffer resultRental); 421static void DivideAndConquer(ReadOnlySpan<nuint> base1E9, int trailingZeroCount, scoped Span<nuint> bits) 432Span<nuint> leading = BigInteger.RentedBuffer.Create(leadingLength, out BigInteger.RentedBuffer leadingBuffer); 447static void Recursive(in PowersOf1e9 powersOf1e9, int powersOf1e9Index, ReadOnlySpan<nuint> base1E9, Span<nuint> bits) 472scoped Span<nuint> buffer = BigInteger.RentedBuffer.Create(bufferLength, out BigInteger.RentedBuffer bufferRental); 477Span<nuint> bitsUpper = bits.Slice(multiplierTrailingZeroCount, buffer2.Length + multiplier.Length); 489static void Naive(ReadOnlySpan<nuint> base1E9, int trailingZeroCount, scoped Span<nuint> bits) 522static int NaiveBase1E9ToBits(ReadOnlySpan<nuint> base1E9, Span<nuint> bits) 544static nuint MultiplyAdd(Span<nuint> bits, nuint multiplier, nuint addValue) 571private static unsafe string? FormatBigIntegerToHex<TChar>(bool targetSpan, BigInteger value, char format, int digits, NumberFormatInfo info, Span<TChar> destination, out int charsWritten, out bool spanSuccess) 578Span<byte> bits = stackalloc byte[64]; // arbitrary threshold 618Span<TChar> chars = sb.AppendSpan((cur + 1) * 2); 657private static unsafe string? FormatBigIntegerToBinary<TChar>(bool targetSpan, BigInteger value, int digits, Span<TChar> destination, out int charsWritten, out bool spanSuccess) 662Span<byte> bytes = stackalloc byte[64]; // arbitrary threshold 765internal static bool TryFormatBigInteger<TChar>(BigInteger value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten) 772private static unsafe string? FormatBigInteger<TChar>(bool targetSpan, BigInteger value, string? formatString, ReadOnlySpan<char> formatSpan, NumberFormatInfo info, Span<TChar> destination, out int charsWritten, out bool spanSuccess) 799spanSuccess = value._sign.TryFormat(Unsafe.BitCast<Span<TChar>, Span<byte>>(destination), out charsWritten, formatSpan, info); 804spanSuccess = value._sign.TryFormat(Unsafe.BitCast<Span<TChar>, Span<char>>(destination), out charsWritten, formatSpan, info); 836Span<nuint> base1E9Buffer = BigInteger.RentedBuffer.Create(base1E9BufferLength, out BigInteger.RentedBuffer base1E9Rental); 903Span<byte> numberBuffer = valueDigits + 1 <= CharStackBufferSize ? 989private static void BigIntegerToBase1E9(ReadOnlySpan<nuint> bits, Span<nuint> base1E9Buffer, out int base1E9Written) 1004static void DivideAndConquer(in PowersOf1e9 powersOf1e9, int powersIndex, ReadOnlySpan<nuint> bits, Span<nuint> base1E9Buffer, out int base1E9Written) 1026Span<nuint> upper = BigInteger.RentedBuffer.Create(upperLength, out BigInteger.RentedBuffer upperBuffer); 1029Span<nuint> lower = BigInteger.RentedBuffer.Create(lowerLength, out BigInteger.RentedBuffer lowerBuffer); 1061static void Naive(ReadOnlySpan<nuint> bits, Span<nuint> base1E9Buffer, out int base1E9Written) 1086static void NaiveDigit(uint digit, Span<nuint> base1E9Buffer, ref int base1E9Written) 1128PowersOf1e9 result = new((Span<nuint>)buffer); 1322public PowersOf1e9(Span<nuint> pow1E9) 1345Span<nuint> dst = pow1E9.Slice(toExclusive, src.Length << 1); 1424public void MultiplyPowerOfTen(ReadOnlySpan<nuint> left, int trailingZeroCount, Span<nuint> bits) 1433Span<nuint> powersOfTen = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer powersOfTenBuffer); 1434scoped Span<nuint> powersOfTen2 = bits; 1464Span<nuint> src = powersOfTen.Slice(0, curLength); 1465Span<nuint> dst = powersOfTen2.Slice(0, curLength += power.Length); 1469Span<nuint> tmp = powersOfTen; 1483Span<nuint> bits2 = bits.Slice(omittedLength, curLength += left.Length); 1551static virtual bool TryParseWholeBlocks(ReadOnlySpan<TChar> input, Span<nuint> destination) 1579public static bool TryParseWholeBlocks(ReadOnlySpan<TChar> input, Span<nuint> destination)
System\Numerics\BigInteger.cs (60)
255Span<int> bits = [0, 0, 0, 0]; 417Span<byte> limbBytes = MemoryMarshal.AsBytes(val.AsSpan(0, wholeLimbCount)); 435Span<nuint> limbSpan = val.AsSpan(0, wholeLimbCount); 577private BigInteger(Span<nuint> value) 920Span<nuint> quotient = RentedBuffer.Create(size, out RentedBuffer quotientBuffer); 940Span<nuint> rest = RentedBuffer.Create(size, out RentedBuffer restBuffer); 943Span<nuint> quotient = RentedBuffer.Create(size, out RentedBuffer quotientBuffer); 1076Span<nuint> bits = RentedBuffer.Create(leftBits.Length, out RentedBuffer bitsBuffer); 1088Span<nuint> bits = RentedBuffer.Create(leftBits.Length, out RentedBuffer bitsBuffer); 1130Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 1196Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 1205Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 1461public bool TryWriteBytes(Span<byte> destination, out int bytesWritten, bool isUnsigned = false, bool isBigEndian = false) 1473internal bool TryWriteOrCountBytes(Span<byte> destination, out int bytesWritten, bool isUnsigned = false, bool isBigEndian = false) 1479/// <summary>Gets the number of bytes that will be output by <see cref="ToByteArray(bool, bool)"/> and <see cref="TryWriteBytes(Span{byte}, out int, bool, bool)"/>.</summary> 1490/// <summary>Mode used to enable sharing <see cref="TryGetBytes(GetBytesMode, Span{byte}, bool, bool, ref int)"/> for multiple purposes.</summary> 1498/// <summary>Shared logic for <see cref="ToByteArray(bool, bool)"/>, <see cref="TryWriteBytes(Span{byte}, out int, bool, bool)"/>, and <see cref="GetByteCount"/>.</summary> 1514private byte[]? TryGetBytes(GetBytesMode mode, Span<byte> destination, bool isUnsigned, bool isBigEndian, ref int bytesWritten) 1651Span<byte> destBytes = destination.Slice(curByte, srcBytes.Length); 1726private int WriteTo(Span<nuint> buffer) 1861public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 1866public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 1885Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 1896Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 1907Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 1918Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 1954Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 1965Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 1974Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 1985Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 2552Span<nuint> z = RentedBuffer.Create(zLen, out RentedBuffer zBuffer); 2612Span<nuint> zd = z.AsSpan(digitShift, bits.Length); 2703Span<nuint> zd = RentedBuffer.Create(zLength, out RentedBuffer zdBuffer); 2743Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 2752Span<nuint> bits = RentedBuffer.Create(value._bits.Length, out RentedBuffer bitsBuffer); 2778Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 2786Span<nuint> bits = RentedBuffer.Create(value._bits.Length, out RentedBuffer bitsBuffer); 2807Span<nuint> bits = RentedBuffer.Create(value._bits.Length, out RentedBuffer bitsBuffer); 2816Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 2857Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 2868Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 2877Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 2888Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 2920Span<nuint> quotient = RentedBuffer.Create(size, out RentedBuffer quotientBuffer); 2941Span<nuint> quotient = RentedBuffer.Create(size, out RentedBuffer quotientBuffer); 2984Span<nuint> bits = RentedBuffer.Create(size, out RentedBuffer bitsBuffer); 3347Span<nuint> zd = RentedBuffer.Create(zLimbCount, out RentedBuffer zdBuffer); 3432Span<uint> words = MemoryMarshal.Cast<nuint, uint>(zd).Slice(0, zWordCount); 3457Span<uint> words = MemoryMarshal.Cast<nuint, uint>(zd).Slice(0, zWordCount); 3498private static void SwapHalvesWithinLimbs(Span<nuint> limbs) 3524Span<nuint> zd = RentedBuffer.Create(zLength, out RentedBuffer zdBuffer); 3635/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 3636bool IBinaryInteger<BigInteger>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 3652Span<byte> dest = destination; 3666Span<byte> dest = destination; 3713/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 3714bool IBinaryInteger<BigInteger>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten) 3730Span<byte> dest = destination; 3744Span<byte> dest = destination; 5290Span<nuint> zd = RentedBuffer.Create(zLength, out RentedBuffer zdBuffer);
System\Numerics\BigInteger.RentedBuffer.cs (3)
28public static Span<nuint> Create(int size, [UnscopedRef] out RentedBuffer rentedBuffer) 33return ((Span<nuint>)rentedBuffer._inline)[..size]; 42Span<nuint> resultBuffer = array.AsSpan(0, size);
System\Numerics\BigIntegerCalculator.AddSub.cs (9)
19private static void CopyTail(ReadOnlySpan<nuint> source, Span<nuint> dest, int start) 24public static void Add(ReadOnlySpan<nuint> left, nuint right, Span<nuint> bits) 32public static void Add(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> bits) 53public static void AddSelf(Span<nuint> left, ReadOnlySpan<nuint> right) 80public static void Subtract(ReadOnlySpan<nuint> left, nuint right, Span<nuint> bits) 89public static void Subtract(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> bits) 109public static void SubtractSelf(Span<nuint> left, ReadOnlySpan<nuint> right) 137private static void Add(ReadOnlySpan<nuint> left, Span<nuint> bits, int startIndex, nuint initialCarry) 184private static void Subtract(ReadOnlySpan<nuint> left, Span<nuint> bits, int startIndex, nuint initialBorrow)
System\Numerics\BigIntegerCalculator.Bitwise.cs (1)
42Span<nuint> result)
System\Numerics\BigIntegerCalculator.DivRem.cs (41)
18public static void Divide(ReadOnlySpan<nuint> left, nuint right, Span<nuint> quotient, out nuint remainder) 26public static void Divide(ReadOnlySpan<nuint> left, nuint right, Span<nuint> quotient) 33private static void DivideCore(ReadOnlySpan<nuint> left, nuint right, Span<nuint> quotient, ref nuint carry) 64public static void Divide(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> quotient, Span<nuint> remainder) 85public static void Divide(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> quotient) 99Span<nuint> leftCopy = BigInteger.RentedBuffer.Create(left.Length, out BigInteger.RentedBuffer leftCopyBuffer); 112public static void Remainder(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> remainder) 131Span<nuint> quotient = BigInteger.RentedBuffer.Create(quotientLength, out BigInteger.RentedBuffer quotientBuffer); 146private static void DivRem(Span<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> quotient) 163Span<nuint> leftCopy = BigInteger.RentedBuffer.Create(left.Length, out BigInteger.RentedBuffer leftCopyBuffer); 167Span<nuint> quotientAllocated = BigInteger.RentedBuffer.Create(quotientLength, out BigInteger.RentedBuffer quotientActualBuffer); 168Span<nuint> quotientActual = quotient.Length > 0 ? quotient : quotientAllocated; 177private static void DivideGrammarSchool(Span<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> quotient) 268private static nuint AddDivisor(Span<nuint> left, ReadOnlySpan<nuint> right) 285private static nuint SubtractDivisor(Span<nuint> left, ReadOnlySpan<nuint> right, nuint q) 313private static void DivideBurnikelZiegler(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> quotient, Span<nuint> remainder) 336Span<nuint> b = BigInteger.RentedBuffer.Create(n, out BigInteger.RentedBuffer bBuffer); 349Span<nuint> a = BigInteger.RentedBuffer.Create(aLength, out BigInteger.RentedBuffer aBuffer); 351static void Normalize(ReadOnlySpan<nuint> src, int sigmaDigit, int sigmaSmall, Span<nuint> bits) 357Span<nuint> dst = bits.Slice(sigmaDigit); 385Span<nuint> r = BigInteger.RentedBuffer.Create(n + 1, out BigInteger.RentedBuffer rBuffer); 387Span<nuint> z = BigInteger.RentedBuffer.Create(2 * n, out BigInteger.RentedBuffer zBuffer); 391Span<nuint> quotientUpper = quotient.Slice((t - 2) * n); 394Span<nuint> q = BigInteger.RentedBuffer.Create(n, out BigInteger.RentedBuffer qBuffer); 426Span<nuint> rt = r.Slice(sigmaDigit); 454private static void BurnikelZieglerFallback(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> quotient, Span<nuint> remainder) 501Span<nuint> r1 = BigInteger.RentedBuffer.Create(left.Length, out BigInteger.RentedBuffer r1Buffer); 524private static void BurnikelZieglerD2n1n(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> quotient, Span<nuint> remainder) 541Span<nuint> r1 = BigInteger.RentedBuffer.Create(right.Length + 1, out BigInteger.RentedBuffer r1Buffer); 549private static void BurnikelZieglerD3n2n(ReadOnlySpan<nuint> left12, ReadOnlySpan<nuint> left3, ReadOnlySpan<nuint> right, Span<nuint> quotient, Span<nuint> remainder) 565Span<nuint> r1 = remainder.Slice(n); 566Span<nuint> d = BigInteger.RentedBuffer.Create(right.Length, out BigInteger.RentedBuffer dBuffer); 591Span<nuint> rr = remainder.Slice(0, d.Length + 1); 607static void MultiplyActual(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> bits)
System\Numerics\BigIntegerCalculator.FastReducer.cs (9)
20private readonly Span<nuint> _q1; 21private readonly Span<nuint> _q2; 23public FastReducer(ReadOnlySpan<nuint> modulus, Span<nuint> r, Span<nuint> mu, Span<nuint> q1, Span<nuint> q2) 45public int Reduce(Span<nuint> value) 71private static int DivMul(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> bits, int k) 95private static int SubMod(Span<nuint> left, ReadOnlySpan<nuint> right, ReadOnlySpan<nuint> modulus, int k)
System\Numerics\BigIntegerCalculator.GcdInv.cs (13)
88public static void Gcd(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> result) 97Span<nuint> rightCopy = BigInteger.RentedBuffer.Create(right.Length, out BigInteger.RentedBuffer rightCopyBuffer); 105private static void Gcd(Span<nuint> left, Span<nuint> right) 111Span<nuint> result = left; //keep result buffer untouched during computation 198Span<nuint> temp = left; 212Span<nuint> temp = left; 250private static int Overwrite(Span<nuint> buffer, ulong value) 385private static int LehmerCore(Span<nuint> x, 386Span<nuint> y, 420Span<uint> x32 = MemoryMarshal.Cast<nuint, uint>(x); 421Span<uint> y32 = MemoryMarshal.Cast<nuint, uint>(y); 453private static int Refresh(Span<nuint> bits, int maxLength)
System\Numerics\BigIntegerCalculator.PowMod.cs (67)
16public static void Pow(nuint value, nuint power, Span<nuint> bits) 21public static void Pow(ReadOnlySpan<nuint> value, nuint power, Span<nuint> bits) 25Span<nuint> temp = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer tempBuffer); 27Span<nuint> valueCopy = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer valueCopyBuffer); 31Span<nuint> result = PowCore(valueCopy, value.Length, temp, power, bits); 39private static Span<nuint> PowCore(Span<nuint> value, int valueLength, Span<nuint> temp, nuint power, Span<nuint> result) 67private static int MultiplySelf(ref Span<nuint> left, int leftLength, ReadOnlySpan<nuint> right, ref Span<nuint> temp) 77Span<nuint> t = left; 84private static int SquareSelf(ref Span<nuint> value, int valueLength, ref Span<nuint> temp) 95Span<nuint> t = value; 252ReadOnlySpan<nuint> modulus, Span<nuint> bits) 258ReadOnlySpan<nuint> modulus, Span<nuint> bits) 267Span<nuint> valueCopy = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer valueCopyBuffer); 283Span<nuint> temp = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer tempBuffer); 292ReadOnlySpan<nuint> modulus, Span<nuint> bits) 298ReadOnlySpan<nuint> modulus, Span<nuint> bits) 307Span<nuint> valueCopy = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer valueCopyBuffer); 323Span<nuint> temp = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer tempBuffer); 339private static void PowCore(Span<nuint> value, int valueLength, 341Span<nuint> temp, Span<nuint> bits) 353Span<nuint> result = PowCore(value, valueLength, power, modulus, bits, 1, temp); 363private static void PowCore(Span<nuint> value, int valueLength, 365Span<nuint> temp, Span<nuint> bits) 377Span<nuint> result = PowCore(value, valueLength, power, modulus, bits, 1, temp); 387private static void PowCoreBarrett(Span<nuint> value, int valueLength, 389Span<nuint> temp, Span<nuint> bits) 392Span<nuint> r = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer rBuffer); 395Span<nuint> mu = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer muBuffer); 398Span<nuint> q1 = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer q1Buffer); 400Span<nuint> q2 = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer q2Buffer); 406Span<nuint> result = PowCore(value, valueLength, power, reducer, bits, 1, temp); 478private static void PowCoreMontgomery(Span<nuint> value, int valueLength, 480Span<nuint> temp, Span<nuint> bits) 488Span<nuint> originalBits = bits; 496Span<nuint> shifted = BigInteger.RentedBuffer.Create(shiftLen, out BigInteger.RentedBuffer shiftedBuffer); 511Span<nuint> rModN = BigInteger.RentedBuffer.Create(k, out BigInteger.RentedBuffer rModNBuffer); 514Span<nuint> oneShifted = BigInteger.RentedBuffer.Create(oneShiftLen, out BigInteger.RentedBuffer oneShiftedBuffer); 553Span<nuint> table = tablePool.AsSpan(0, totalTableLen); 563Span<nuint> prod = BigInteger.RentedBuffer.Create(bufLen, out BigInteger.RentedBuffer prodBuffer); 566Span<nuint> base2 = BigInteger.RentedBuffer.Create(k, out BigInteger.RentedBuffer base2Buffer); 676private static int MontgomeryReduce(Span<nuint> value, ReadOnlySpan<nuint> modulus, nuint n0inv) 718Span<nuint> upper = value.Slice(k, k); 739private static Span<nuint> PowCore(Span<nuint> value, int valueLength, 741Span<nuint> result, int resultLength, 742Span<nuint> temp) 770private static Span<nuint> PowCore(Span<nuint> value, int valueLength, 772Span<nuint> result, int resultLength, 773Span<nuint> temp) 801private static Span<nuint> PowCore(Span<nuint> value, int valueLength, 803Span<nuint> result, int resultLength, 804Span<nuint> temp) 832private static Span<nuint> PowCore(Span<nuint> value, int valueLength, 834Span<nuint> result, int resultLength, 835Span<nuint> temp)
System\Numerics\BigIntegerCalculator.ShiftRot.cs (17)
12public static void RotateLeft(Span<nuint> bits, long rotateLeftAmount) 41private static void RotateLeft(Span<nuint> bits, int digitShift, int smallShift) 56private static void RotateRight(Span<nuint> bits, int digitShift, int smallShift) 71public static void SwapUpperAndLower(Span<nuint> bits, int lowerLength) 78Span<nuint> lower = bits.Slice(0, lowerLength); 79Span<nuint> upper = bits.Slice(lowerLength); 81Span<nuint> lowerDst = bits.Slice(upperLength); 84Span<nuint> tmp = BigInteger.RentedBuffer.Create(tmpLength, out BigInteger.RentedBuffer tmpBuffer); 106public static void SwapUpperAndLower(Span<uint> bits, int lowerLength) 113Span<uint> lower = bits.Slice(0, lowerLength); 114Span<uint> upper = bits.Slice(lowerLength); 116Span<uint> lowerDst = bits.Slice(upperLength); 121Span<nuint> tmpNuint = BigInteger.RentedBuffer.Create(nuintCount, out BigInteger.RentedBuffer tmpBuffer); 122Span<uint> tmp = MemoryMarshal.Cast<nuint, uint>(tmpNuint).Slice(0, tmpLength); 140public static void LeftShiftSelf(Span<nuint> bits, int shift, out nuint carry) 214public static void RightShiftSelf(Span<nuint> bits, int shift, out nuint carry) 228Span<nuint> remaining = bits;
System\Numerics\BigIntegerCalculator.SquMul.cs (69)
27public static void Square(ReadOnlySpan<nuint> value, Span<nuint> bits) 54static void Toom3(ReadOnlySpan<nuint> value, Span<nuint> bits) 74Span<nuint> pAndQAll = pAndQAllFromPool.AsSpan(0, pAndQAllLength); 83Span<nuint> rAndZAll = rAndZAllFromPool.AsSpan(0, rAndZAllLength); 92static void Karatsuba(ReadOnlySpan<nuint> value, Span<nuint> bits) 113Span<nuint> bitsLow = bits.Slice(0, n2); 114Span<nuint> bitsHigh = bits.Slice(n2); 123Span<nuint> fold = BigInteger.RentedBuffer.Create(foldLength, out BigInteger.RentedBuffer foldBuffer); 126Span<nuint> core = BigInteger.RentedBuffer.Create(coreLength, out BigInteger.RentedBuffer coreBuffer); 144static void Naive(ReadOnlySpan<nuint> value, Span<nuint> bits) 204public static void Multiply(ReadOnlySpan<nuint> left, nuint right, Span<nuint> bits) 213public static void Multiply(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> bits) 256static void Toom3(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> bits) 283Span<nuint> pAndQAll = pAndQAllFromPool.AsSpan(0, pAndQAllLength); 293Span<nuint> rAndZAll = rAndZAllFromPool.AsSpan(0, rAndZAllLength); 302static void Toom25(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> bits, int n) 319Span<nuint> z0 = bits.Slice(0, left0.Length + right0.Length); 320Span<nuint> z3 = bits.Slice(n * 3); 330Span<nuint> pAndQAll = pAndQAllFromPool.AsSpan(0, pAndQAllLength); 333Span<nuint> p1 = pAndQAll.Slice(0, pLength); 334Span<nuint> pm1 = pAndQAll.Slice(pLength, pLength); 335Span<nuint> q1 = pAndQAll.Slice(pLength * 2, pLength); 336Span<nuint> qm1 = pAndQAll.Slice(pLength * 3, pLength); 366Span<nuint> cAll = cAllFromPool.AsSpan(0, cAllLength); 369Span<nuint> z1 = cAll.Slice(0, cLength); 370Span<nuint> c1 = z1.Slice(0, p1.Length + q1.Length); 372Span<nuint> z2 = cAll.Slice(cLength, cLength); 373Span<nuint> cm1 = cAll.Slice(cLength * 2, pm1.Length + qm1.Length); 399static void Karatsuba(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> bits, int n) 438Span<nuint> bitsLow = bits.Slice(0, n + n); 439Span<nuint> bitsHigh = bits.Slice(n + n); 452Span<nuint> leftFold = BigInteger.RentedBuffer.Create(foldLength, out BigInteger.RentedBuffer leftFoldBuffer); 454Span<nuint> rightFold = BigInteger.RentedBuffer.Create(foldLength, out BigInteger.RentedBuffer rightFoldBuffer); 463Span<nuint> core = BigInteger.RentedBuffer.Create(coreLength, out BigInteger.RentedBuffer coreBuffer); 483static void RightSmall(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> bits, int n) 497Span<nuint> bitsLow = bits.Slice(0, n + right.Length); 498Span<nuint> bitsHigh = bits.Slice(n); 504Span<nuint> carry = BigInteger.RentedBuffer.Create(carryLength, out BigInteger.RentedBuffer carryBuffer); 506Span<nuint> carryOrig = bitsHigh.Slice(0, right.Length); 518static void Naive(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> bits) 555public static Toom3Data Build(ReadOnlySpan<nuint> value, int n, Span<nuint> buffer) 578Span<nuint> p1 = buffer.Slice(0, pLength); 579Span<nuint> pm1 = buffer.Slice(pLength, pLength); 597Span<nuint> pm2 = buffer.Slice(pLength + pLength, pLength); 634public void MultiplyOther(in Toom3Data right, int n, Span<nuint> bits, Span<nuint> buffer) 657Span<nuint> r0 = bits.Slice(0, p0.Length + q0.Length); 658Span<nuint> rInf = 663Span<nuint> r1 = buffer.Slice(0, p1.Length + q1.Length); 664Span<nuint> rm1 = buffer.Slice(rLength, pm1.Length + qm1.Length); 665Span<nuint> rm2 = buffer.Slice(rLength * 2, pm2.Length + qm2.Length); 688public void Square(int n, Span<nuint> bits, Span<nuint> buffer) 701Span<nuint> r0 = bits.Slice(0, p0.Length << 1); 702Span<nuint> rInf = bits.Slice(4 * n, pInf.Length << 1); 704Span<nuint> r1 = buffer.Slice(0, p1.Length << 1); 705Span<nuint> rm1 = buffer.Slice(rLength, pm1.Length << 1); 706Span<nuint> rm2 = buffer.Slice(rLength * 2, pm2.Length << 1); 733Span<nuint> z1, 735Span<nuint> z2, 738Span<nuint> z3, 740Span<nuint> bits) 804private static void DivideThreeSelf(Span<nuint> bits) 863private static void SubtractCore(ReadOnlySpan<nuint> left, ReadOnlySpan<nuint> right, Span<nuint> core) 936private static void AddSelf(Span<nuint> left, ref int leftSign, ReadOnlySpan<nuint> right, int rightSign) 954private static void AddSelf(Span<nuint> left, ref int leftSign, ReadOnlySpan<nuint> right) 1000private static void SubtractSelf(Span<nuint> left, ref int leftSign, ReadOnlySpan<nuint> right) 1044private static void LeftShiftOne(Span<nuint> bits) 1055private static void RightShiftOne(Span<nuint> bits)
System\Numerics\BigIntegerCalculator.Utils.cs (5)
83private static int Reduce(Span<nuint> bits, ReadOnlySpan<nuint> modulus) 98public static void InitializeForDebug(Span<nuint> bits) 218internal static nuint Mul1(Span<nuint> result, ReadOnlySpan<nuint> left, nuint multiplier) 269internal static nuint MulAdd1(Span<nuint> result, ReadOnlySpan<nuint> left, nuint multiplier) 324internal static nuint SubMul1(Span<nuint> result, ReadOnlySpan<nuint> right, nuint multiplier)
System\Numerics\Complex.cs (13)
2260/// <inheritdoc cref="ISpanFormattable.TryFormat(Span{char}, out int, ReadOnlySpan{char}, IFormatProvider?)" /> 2261public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 2264/// <inheritdoc cref="IUtf8SpanFormattable.TryFormat(Span{byte}, out int, ReadOnlySpan{char}, IFormatProvider?)" /> 2265public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 2268private bool TryFormat<TChar>(Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) 2277? m_real.TryFormat(Unsafe.BitCast<Span<TChar>, Span<byte>>(destination.Slice(1)), out int realChars, format, provider) 2278: m_real.TryFormat(Unsafe.BitCast<Span<TChar>, Span<char>>(destination.Slice(1)), out realChars, format, provider)) 2287? m_imaginary.TryFormat(Unsafe.BitCast<Span<TChar>, Span<byte>>(destination.Slice(2)), out int imaginaryChars, format, provider) 2288: m_imaginary.TryFormat(Unsafe.BitCast<Span<TChar>, Span<char>>(destination.Slice(2)), out imaginaryChars, format, provider))
System\Numerics\NumericsHelpers.cs (2)
105public static void DangerousMakeTwosComplement(Span<nuint> d) 135public static void DangerousMakeOnesComplement(Span<nuint> d)
System.Security.Cryptography (1007)
_generated\0\LibraryImports.g.cs (6)
1497private static unsafe partial global::Interop.BCrypt.NTSTATUS BCryptDeriveKey(global::Microsoft.Win32.SafeHandles.SafeBCryptSecretHandle hSharedSecret, string pwszKDF, ref readonly global::Interop.BCrypt.BCryptBufferDesc pParameterList, global::System.Span<byte> pbDerivedKey, uint cbDerivedKey, out uint pcbResult, uint dwFlags) 1834internal static partial global::Interop.BCrypt.NTSTATUS BCryptFinishHash(global::Microsoft.Win32.SafeHandles.SafeBCryptHashHandle hHash, global::System.Span<byte> pbOutput, int cbOutput, int dwFlags) 4885internal static unsafe partial global::Interop.NCrypt.ErrorCode NCryptEncrypt(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, global::System.ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, global::System.Span<byte> pbOutput, int cbOutput, out int pcbResult, global::Interop.NCrypt.AsymmetricPaddingMode dwFlags) 4924internal static unsafe partial global::Interop.NCrypt.ErrorCode NCryptDecrypt(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, global::System.ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, global::System.Span<byte> pbOutput, int cbOutput, out int pcbResult, global::Interop.NCrypt.AsymmetricPaddingMode dwFlags) 5200internal static partial global::Interop.NCrypt.ErrorCode NCryptExportKey(global::Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle hKey, nint hExportKey, string pszBlobType, nint pParameterList, global::System.Span<byte> pbOutput, int cbOutput, out int pcbResult, int dwFlags) 5516private static partial global::Interop.NCrypt.ErrorCode NCryptDeriveKey(global::Microsoft.Win32.SafeHandles.SafeNCryptSecretHandle hSharedSecret, string pwszKDF, nint pParameterList, global::System.Span<byte> pbDerivedKey, int cbDerivedKey, out int pcbResult, global::Interop.NCrypt.SecretAgreementFlags dwFlags)
Microsoft\Win32\SafeHandles\SafePasswordHandle.cs (1)
52Span<char> dest = new Span<char>((void*)handle, spanLen);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.CryptGetProvParam.cs (1)
53Span<byte> pbData,
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptDecapsulateEncapsulate.cs (3)
36Span<byte> secretKey, 62Span<byte> secretKey, 63Span<byte> cipherText,
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptDeriveKey.cs (2)
18Span<byte> pbDerivedKey, 27Span<byte> destination,
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptEncryptDecrypt.cs (2)
15internal static int BCryptEncrypt(SafeKeyHandle hKey, ReadOnlySpan<byte> input, byte[]? iv, Span<byte> output) 36internal static int BCryptDecrypt(SafeKeyHandle hKey, ReadOnlySpan<byte> input, byte[]? iv, Span<byte> output)
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptEncryptDecrypt.RSA.cs (6)
50Span<byte> destination, 97Span<byte> destination, 147Span<byte> destination) 160Span<byte> destination, 180Span<byte> destination, 195Span<byte> destination,
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptFinishHash.cs (1)
13internal static partial NTSTATUS BCryptFinishHash(SafeBCryptHashHandle hHash, Span<byte> pbOutput, int cbOutput, int dwFlags);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptImportKey.cs (1)
22Span<byte> blob = stackalloc byte[MaxStackKeyBlob];
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptSignHash.cs (4)
29Span<byte> destination, 55Span<byte> destination, 83Span<byte> destination) 120Span<byte> destination)
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.Blobs.cs (1)
85internal static void Consume(ReadOnlySpan<byte> blob, ref int offset, int count, Span<byte> destination)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
43Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.EncryptDecrypt.cs (2)
13internal static unsafe partial ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, Span<byte> pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags); 16internal static unsafe partial ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, ReadOnlySpan<byte> pbInput, int cbInput, void* pPaddingInfo, Span<byte> pbOutput, int cbOutput, out int pcbResult, AsymmetricPaddingMode dwFlags);
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.Keys.cs (1)
35internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, Span<byte> pbOutput, int cbOutput, out int pcbResult, int dwFlags);
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.NCryptDecapsulateEncapsulate.cs (3)
37Span<byte> secretKey, 63Span<byte> secretKey, 64Span<byte> cipherText,
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.NCryptDeriveKeyMaterial.cs (3)
33Span<byte> pbDerivedKey, 58Span<NCryptBuffer> parameters = stackalloc NCryptBuffer[4]; 274Span<byte> destination,
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.SignVerify.cs (1)
16internal static unsafe ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, void* pPaddingInfo, ReadOnlySpan<byte> pbHashValue, Span<byte> pbSignature, out int pcbResult, AsymmetricPaddingMode dwFlags)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeUnicodeStringHandle.cs (1)
38Span<char> dest = new Span<char>(handle.ToPointer(), cch);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\IO\MemoryMappedFiles\MemoryMappedFileMemoryManager.cs (1)
78public override Span<byte> GetSpan()
src\runtime\src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
21public override Span<T> GetSpan()
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AeadCommon.Windows.cs (3)
18Span<byte> ciphertext, 19Span<byte> tag) 63Span<byte> plaintext,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AesGcm.cs (6)
117Span<byte> plaintext, 123Span<byte> ciphertext, 124Span<byte> tag, 197Span<byte> ciphertext, 198Span<byte> tag, 277Span<byte> plaintext,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AesGcm.Windows.cs (3)
29Span<byte> ciphertext, 30Span<byte> tag, 40Span<byte> plaintext,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (1)
60Span<byte> derived = stackalloc byte[expectedOutputSize];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (3)
22Span<byte> destination, 59internal static int ConvertDerToIeee1363(ReadOnlySpan<byte> input, int fieldSizeBits, Span<byte> destination) 85private static void CopySignatureField(ReadOnlySpan<byte> signatureField, Span<byte> response)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (5)
181Span<byte> destination, 185Span<byte> empty = default; 232Span<byte> destination, 244Span<byte> salt = new Span<byte>(pbeParams.rgbSalt, Interop.NCrypt.PBE_PARAMS.RgbSaltSize); 282Span<byte> empty = default;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.SignVerify.cs (2)
50Span<byte> destination, 69public static unsafe bool TrySignHash(this SafeNCryptKeyHandle keyHandle, ReadOnlySpan<byte> hash, Span<byte> signature, AsymmetricPaddingMode paddingMode, void* pPaddingInfo, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngPkcs8.cs (7)
60Span<byte> destination, 90Span<byte> destination, 168Span<byte> decryptedSpan = decrypted; 229Span<byte> decryptedSpan = decrypted; 299Span<char> randomString = stackalloc char[22]; 410private static unsafe void FillRandomAsciiString(Span<char> destination) 413Span<byte> randomKey = stackalloc byte[destination.Length];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (15)
206public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, ReadOnlySpan<byte> context = default) 254protected abstract int SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination); 1181/// <inheritdoc cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{char}, PbeParameters, Span{byte}, out int)"/> 1188Span<byte> destination, 1235Span<byte> destination, 1295Span<byte> destination, 1378public bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 1415protected abstract bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten); 1481public bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) 1536public int ExportCompositeMLDsaPublicKey(Span<byte> destination) 1573public bool TryExportCompositeMLDsaPublicKey(Span<byte> destination, out int bytesWritten) 1661public int ExportCompositeMLDsaPrivateKey(Span<byte> destination) 1698public bool TryExportCompositeMLDsaPrivateKey(Span<byte> destination, out int bytesWritten) 1754protected abstract int ExportCompositeMLDsaPublicKeyCore(Span<byte> destination); 1771protected abstract int ExportCompositeMLDsaPrivateKeyCore(Span<byte> destination);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaCng.Windows.cs (4)
12protected override int SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination) => 16protected override int ExportCompositeMLDsaPrivateKeyCore(Span<byte> destination) => 20protected override int ExportCompositeMLDsaPublicKeyCore(Span<byte> destination) => 24protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) =>
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaImplementation.Windows.cs (4)
66protected override int SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination) => 72protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) => 75protected override int ExportCompositeMLDsaPublicKeyCore(Span<byte> destination) => 78protected override int ExportCompositeMLDsaPrivateKeyCore(Span<byte> destination) =>
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaManaged.cs (9)
204protected override int SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination) 239Span<byte> mldsaSig = destination.Slice(0, AlgorithmDetails.MLDsaAlgorithm.SignatureSizeInBytes); 240Span<byte> tradSig = destination.Slice(AlgorithmDetails.MLDsaAlgorithm.SignatureSizeInBytes); 338protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) 376protected override int ExportCompositeMLDsaPublicKeyCore(Span<byte> destination) 398protected override int ExportCompositeMLDsaPrivateKeyCore(Span<byte> destination) 520internal abstract bool TryExportPublicKey(Span<byte> destination, out int bytesWritten); 521internal abstract bool TryExportPrivateKey(Span<byte> destination, out int bytesWritten); 529Span<byte> destination);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaManaged.ECDsa.cs (3)
178internal override bool TryExportPrivateKey(Span<byte> destination, out int bytesWritten) 273internal override bool TryExportPublicKey(Span<byte> destination, out int bytesWritten) 375Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaManaged.RSA.cs (3)
68Span<byte> destination) 233internal override bool TryExportPublicKey(Span<byte> destination, out int bytesWritten) 244internal override bool TryExportPrivateKey(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (4)
46internal Span<byte> Span { get; private set; } 69Span<byte> toClear = Span.Slice(0, clearSize); 95Span<byte> currentBuffer, 109Span<byte> currentBuffer,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.ImportExport.cs (2)
112Span<byte> destination, 133Span<byte> destination,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.SignVerify.cs (5)
24Span<byte> stackBuf = stackalloc byte[WindowsMaxQSize]; 38Span<byte> destination, 42Span<byte> stackBuf = stackalloc byte[WindowsMaxQSize]; 86Span<byte> stackBuf = stackalloc byte[WindowsMaxQSize]; 112private ReadOnlySpan<byte> AdjustHashSizeIfNecessary(ReadOnlySpan<byte> hash, Span<byte> stackBuf)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanCng.ImportExport.cs (2)
165Span<byte> destination, 186Span<byte> destination,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDsaCng.ImportExport.cs (2)
202Span<byte> destination, 223Span<byte> destination,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDsaCng.SignVerify.cs (2)
32public override bool TrySignHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 43Span<byte> destination,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (3)
93internal static void RngFill(Span<byte> destination) 105internal static bool TryCopyToDestination(this ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 278Span<byte> destination,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (2)
26internal static void ToUnsignedIntegerBytes(this ReadOnlyMemory<byte> memory, Span<byte> destination) 31internal static void ToUnsignedIntegerBytes(this ReadOnlySpan<byte> span, Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (3)
226Span<byte> encryptedSpan = default; 230Span<byte> iv = stackalloc byte[cipher.BlockSize / 8]; 231Span<byte> salt = stackalloc byte[16];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (21)
120public void SignData(ReadOnlySpan<byte> data, Span<byte> destination, ReadOnlySpan<byte> context = default) 302public void SignPreHash(ReadOnlySpan<byte> hash, Span<byte> destination, string hashAlgorithmOid, ReadOnlySpan<byte> context = default) 575public void SignMu(ReadOnlySpan<byte> externalMu, Span<byte> destination) 600protected abstract void SignMuCore(ReadOnlySpan<byte> externalMu, Span<byte> destination); 697public bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) 773public bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 816protected abstract bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten); 980Span<byte> destination, 1040Span<byte> destination, 1059/// <inheritdoc cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{char}, PbeParameters, Span{byte}, out int)"/> 1066Span<byte> destination, 1210public void ExportMLDsaPublicKey(Span<byte> destination) 1252public void ExportMLDsaPrivateKey(Span<byte> destination) 1292public void ExportMLDsaPrivateSeed(Span<byte> destination) 1954protected abstract void SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination); 1996protected abstract void SignPreHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> context, string hashAlgorithmOid, Span<byte> destination); 2028protected abstract void ExportMLDsaPublicKeyCore(Span<byte> destination); 2036protected abstract void ExportMLDsaPrivateKeyCore(Span<byte> destination); 2044protected abstract void ExportMLDsaPrivateSeedCore(Span<byte> destination); 2053Span<byte> publicKey = rented.AsSpan(0, publicKeySizeInBytes); 2214Span<byte> buffer = rent.AsSpan(0, privateKeySize);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaCng.cs (1)
51protected override void SignMuCore(ReadOnlySpan<byte> mu, Span<byte> destination) =>
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaCng.Windows.cs (9)
113protected override void ExportMLDsaPublicKeyCore(Span<byte> destination) => 117protected override void ExportMLDsaPrivateSeedCore(Span<byte> destination) 163protected override void ExportMLDsaPrivateKeyCore(Span<byte> destination) 224protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) 257protected override unsafe void SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination) 301Span<byte> destination) 458private void ExportKey(CngKeyBlobFormat blobFormat, int expectedKeySize, Span<byte> destination) 487Span<byte> destination); 489private void ExportKeyWithEncryptedOnlyExport(KeySelectorFunc keySelector, MLDsaAlgorithm algorithm, Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.cs (2)
37Span<byte> seedSpan = rented.AsSpan(0, alg.PrivateSeedSizeInBytes); 44Span<byte> skSpan = rented.AsSpan(0, alg.PrivateKeySizeInBytes);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.Windows.cs (8)
40protected override void SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination) 57Span<byte> destination) 94protected override void SignMuCore(ReadOnlySpan<byte> externalMu, Span<byte> destination) => 169protected override void ExportMLDsaPublicKeyCore(Span<byte> destination) => 175protected override void ExportMLDsaPrivateKeyCore(Span<byte> destination) 188protected override void ExportMLDsaPrivateSeedCore(Span<byte> destination) 201protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) 222private void ExportKey(string keyBlobType, int expectedKeySize, Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaPkcs8.cs (3)
15Span<byte> destination, 33Span<byte> buffer = rented.AsSpan(0, seedSize); 42Span<byte> buffer = rented.AsSpan(0, privateKeySize);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (19)
109public void Encapsulate(Span<byte> ciphertext, Span<byte> sharedSecret) 173protected abstract void EncapsulateCore(Span<byte> ciphertext, Span<byte> sharedSecret); 201public void Decapsulate(ReadOnlySpan<byte> ciphertext, Span<byte> sharedSecret) 272protected abstract void DecapsulateCore(ReadOnlySpan<byte> ciphertext, Span<byte> sharedSecret); 289public void ExportPrivateSeed(Span<byte> destination) 328protected abstract void ExportPrivateSeedCore(Span<byte> destination); 520public void ExportDecapsulationKey(Span<byte> destination) 559protected abstract void ExportDecapsulationKeyCore(Span<byte> destination); 574public void ExportEncapsulationKey(Span<byte> destination) 611protected abstract void ExportEncapsulationKeyCore(Span<byte> destination); 634public bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) 701public bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 774protected abstract bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten); 815Span<byte> destination, 868Span<byte> destination, 914Span<byte> destination, 1728Span<byte> buffer = rent.AsSpan(0, decapsulationKeySize);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.Windows.cs (1)
17Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemCng.Windows.cs (8)
103protected override void DecapsulateCore(ReadOnlySpan<byte> ciphertext, Span<byte> sharedSecret) 117protected override void EncapsulateCore(Span<byte> ciphertext, Span<byte> sharedSecret) 139protected override void ExportPrivateSeedCore(Span<byte> destination) 155protected override void ExportDecapsulationKeyCore(Span<byte> destination) 171protected override void ExportEncapsulationKeyCore(Span<byte> destination) 180protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) 231private void ExportKey(KeyBlobMagicNumber kind, Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.cs (2)
28Span<byte> buffer = rented.AsSpan(0, size); 35Span<byte> buffer = rented.AsSpan(0, size);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.Windows.cs (8)
79protected override void DecapsulateCore(ReadOnlySpan<byte> ciphertext, Span<byte> sharedSecret) 91protected override void EncapsulateCore(Span<byte> ciphertext, Span<byte> sharedSecret) 107protected override void ExportPrivateSeedCore(Span<byte> destination) 115protected override void ExportDecapsulationKeyCore(Span<byte> destination) 123protected override void ExportEncapsulationKeyCore(Span<byte> destination) 129protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) 163private void ExportKey(KeyBlobMagicNumber kind, Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemPkcs8.cs (3)
15Span<byte> destination, 33Span<byte> buffer = rented.AsSpan(0, seedSize); 42Span<byte> buffer = rented.AsSpan(0, decapsulationKeySize);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (23)
84Span<byte> destination) 101Span<byte> destination) 199Span<byte> buf = stackalloc byte[128]; 346Span<byte> ivDest) 482Span<byte> destination) 484Span<byte> buf = stackalloc byte[128]; 541Span<byte> destination) 567Span<byte> iv = stackalloc byte[16]; 598ref Span<byte> iv) 729ref Span<byte> iv) 850Span<byte> destination) 875Span<byte> dk = stackalloc byte[16]; 884Span<byte> k = dk.Slice(0, 8); 885Span<byte> iv = dk.Slice(8, 8); 902Span<byte> destination) 927Span<byte> iv = stackalloc byte[cipher.BlockSize / 8]; 928Span<byte> key = stackalloc byte[cipher.KeySize / 8]; 961Span<byte> destination) 999Span<byte> tmpEndSpan = tmpEnd.AsSpan(); 1023Span<byte> dk) 1027Span<byte> t = stackalloc byte[20]; 1064Span<byte> salt, 1067Span<byte> iv)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PemKeyHelpers.Factory.cs (2)
85Span<byte> decodedBase64 = decodeBuffer.AsSpan(0, bytesWritten); 150Span<byte> decodedBase64 = decodeBuffer.AsSpan(0, bytesWritten);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (4)
159Span<byte> authSafeSpan = default; 161Span<byte> macSpan = default; 162scoped Span<byte> salt = default; 349public bool TryEncode(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
67public bool TryEncode(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (4)
433Span<byte> encryptedSpan = Span<byte>.Empty; 434Span<byte> iv = stackalloc byte[cipherBlockBytes]; 435Span<byte> salt = stackalloc byte[16];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (3)
131public bool TryEncode(Span<byte> destination, out int bytesWritten) 140Span<byte> destination, 158Span<byte> destination,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (13)
34Span<byte> destination) 50Span<byte> destination) 66Span<byte> destination) 83Span<byte> destination) 108Span<byte> D = stackalloc byte[vBytes]; 145scoped Span<byte> I; 167Span<byte> hashBuf = stackalloc byte[uBytes]; 168Span<byte> bBuf = stackalloc byte[vBytes]; 218Span<byte> I_j = I.Slice(j * vBytes, vBytes); 236private static void AddPlusOne(Span<byte> into, ReadOnlySpan<byte> addend) 250private static void CircularCopy(ReadOnlySpan<byte> bytes, Span<byte> destination) 269private static void CircularCopyUtf16BE(ReadOnlySpan<char> password, Span<byte> destination) 288Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PqcBlobHelpers.cs (3)
119Span<byte> blobBytes = 138Span<char> blobBodyChars = MemoryMarshal.Cast<byte, char>(blobBytes.Slice(index)); 241Span<byte> buffer = (uint)blobSize <= MaxKeyStackSize ?
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (7)
27public override bool TryEncrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) => 31public override bool TryDecrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) => 61Span<byte> paddedMessage = new Span<byte>(rented, 0, modulusSizeInBytes); 119private unsafe bool TryEncryptOrDecrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, bool encrypt, out int bytesWritten) 143Span<byte> paddedMessage = new Span<byte>(rented, 0, modulusSizeInBytes); 254private static unsafe bool TryEncryptOrDecrypt(SafeNCryptKeyHandle key, ReadOnlySpan<byte> input, Span<byte> output, AsymmetricPaddingMode paddingMode, void* paddingInfo, bool encrypt, out int bytesWritten) 283Span<byte> output,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.ImportExport.cs (2)
130Span<byte> destination, 151Span<byte> destination,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.SignVerify.cs (1)
84public override unsafe bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (28)
120Span<byte> destination) 134Span<byte> mInEM = destination.Slice(destination.Length - source.Length); 135Span<byte> ps = destination.Slice(2, destination.Length - source.Length - 3); 148Span<byte> destination, 252Span<byte> destination) 291Span<byte> destination) 297Span<byte> dbMaskSpan = Span<byte>.Empty; 316Span<byte> seed = destination.Slice(1, hLen); 317Span<byte> db = destination.Slice(1 + hLen); 324Span<byte> lHash = db.Slice(0, hLen); 325Span<byte> mDest = db.Slice(db.Length - source.Length); 326Span<byte> ps = db.Slice(hLen, db.Length - hLen - 1 - mDest.Length); 327Span<byte> psEnd = db.Slice(hLen + ps.Length, 1); 358Span<byte> seedMask = stackalloc byte[hLen]; 383internal static unsafe void EncodePss(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> mHash, Span<byte> destination, int keySize) 413Span<byte> em = destination.Slice(destination.Length - emLen, emLen); 417Span<byte> db = em.Slice(0, dbLen); 418Span<byte> hDest = em.Slice(dbLen, hLen); 422Span<byte> dbMask = new Span<byte>(dbMaskRented, 0, dbLen); 429Span<byte> salt = stackalloc byte[sLen]; 520Span<byte> dbMask = new Span<byte>(dbMaskRented, 0, maskedDb.Length); 565Span<byte> hPrime = stackalloc byte[hLen]; 588private static unsafe void Mgf1(IncrementalHash hasher, ReadOnlySpan<byte> mgfSeed, Span<byte> mask) 591Span<byte> writePtr = mask; 593Span<byte> bigEndianCount = stackalloc byte[sizeof(int)]; 615Span<byte> tmp = stackalloc byte[hLen]; 635private static void Xor(Span<byte> a, ReadOnlySpan<byte> b)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (17)
130public void SignData(ReadOnlySpan<byte> data, Span<byte> destination, ReadOnlySpan<byte> context = default) 314public void SignPreHash(ReadOnlySpan<byte> hash, Span<byte> destination, string hashAlgorithmOid, ReadOnlySpan<byte> context = default) 534public bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) 608public bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 651protected virtual unsafe bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) 656Span<byte> privateKey = (stackalloc byte[128])[..privateKeySizeInBytes]; 850Span<byte> destination, 910Span<byte> destination, 929/// <inheritdoc cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{char}, PbeParameters, Span{byte}, out int)"/> 936Span<byte> destination, 1075public void ExportSlhDsaPublicKey(Span<byte> destination) 1126public void ExportSlhDsaPrivateKey(Span<byte> destination) 1783protected abstract void SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination); 1824protected abstract void SignPreHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> context, string hashAlgorithmOid, Span<byte> destination); 1855protected abstract void ExportSlhDsaPublicKeyCore(Span<byte> destination); 1863protected abstract void ExportSlhDsaPrivateKeyCore(Span<byte> destination); 1870Span<byte> publicKey = (stackalloc byte[64])[..publicKeySizeInBytes];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsaCng.cs (5)
65protected override void SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination) => 73protected override void SignPreHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> context, string hashAlgorithmOid, Span<byte> destination) => 81protected override void ExportSlhDsaPublicKeyCore(Span<byte> destination) => 85protected override void ExportSlhDsaPrivateKeyCore(Span<byte> destination) => 89protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) =>
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsaImplementation.cs (1)
28Span<byte> secretKey = (stackalloc byte[128])[..key.Algorithm.PrivateKeySizeInBytes];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsaImplementation.Windows.cs (5)
20protected override void SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination) => 26protected override void SignPreHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> context, string hashAlgorithmOid, Span<byte> destination) => 32protected override void ExportSlhDsaPublicKeyCore(Span<byte> destination) => 35protected override void ExportSlhDsaPrivateKeyCore(Span<byte> destination) => 38protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) =>
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdf.cs (8)
272public static void DeriveBytes(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination) 352public static void DeriveBytes(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination) 429public void DeriveKey(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination) 480public void DeriveKey(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination) 582Span<byte> destination); 589Span<byte> destination); 591private void DeriveKeyCore(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination) 596private void DeriveKeyCore(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationBase.cs (3)
8internal abstract void DeriveBytes(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination); 9internal abstract void DeriveBytes(byte[] label, byte[] context, Span<byte> destination); 10internal abstract void DeriveBytes(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationCng.cs (5)
29internal override void DeriveBytes(byte[] label, byte[] context, Span<byte> destination) 34internal override unsafe void DeriveBytes(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination) 88internal override unsafe void DeriveBytes(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination) 102Span<byte> destination) 117Span<byte> destination)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Utf8DataEncoding.cs (2)
13private readonly Span<byte> _buffer; 15internal Utf8DataEncoding(ReadOnlySpan<char> data, Span<byte> stackBuffer)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519WindowsHelpers.cs (7)
22internal static void ExportKey(ReadOnlySpan<byte> exported, bool privateKey, Span<byte> destination) 105Span<byte> destination = lease.Span.Slice(blobHeaderSize + ElementSize * 2, ElementSize); 114Span<byte> destination = lease.Span.Slice(blobHeaderSize, ElementSize); 123internal static byte FixupPrivateScalar(Span<byte> bytes) 146internal static void RefixPrivateScalar(Span<byte> bytes, byte preservation) 152internal static bool ReducePublicKey(ReadOnlySpan<byte> publicKey, Span<byte> reduced) 203private static void ReducePublicKey(Span<byte> key)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (1)
589Span<byte> earlyBuf = stackalloc byte[0x81];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (2)
1236Span<byte> salt = stackalloc byte[Sha1MacSize]; 1240Span<byte> macKey = stackalloc byte[Sha1MacSize];
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Security\Cryptography\Aes.cs (19)
129public void EncryptKeyWrapPadded(ReadOnlySpan<byte> plaintext, Span<byte> destination) 204/// <paramref name="destination"/> has a <see cref="Span{T}.Length"/> that is 216public int DecryptKeyWrapPadded(ReadOnlySpan<byte> ciphertext, Span<byte> destination) 254public bool TryDecryptKeyWrapPadded(ReadOnlySpan<byte> ciphertext, Span<byte> destination, out int bytesWritten) 355protected virtual unsafe int DecryptKeyWrapPaddedCore(ReadOnlySpan<byte> source, Span<byte> destination) 361Span<byte> decrypt = stackalloc byte[16]; 409protected virtual unsafe void EncryptKeyWrapPaddedCore(ReadOnlySpan<byte> source, Span<byte> destination) 418Span<byte> buf = stackalloc byte[16]; 421Span<byte> keyPart = buf.Slice(8); 450private unsafe void Rfc3394Wrap(ulong iv, ReadOnlySpan<byte> source, Span<byte> destination) 456Span<byte> B = stackalloc byte[16]; 457Span<byte> A = B.Slice(0, 8); 458Span<byte> ALo = A.Slice(4, 4); 466Span<byte> R = destination.Slice(8); 484private unsafe ulong Rfc3394Unwrap(ReadOnlySpan<byte> source, Span<byte> destination) 486Span<byte> B = stackalloc byte[16]; 487Span<byte> A = B.Slice(0, 8); 488Span<byte> ALo = A.Slice(4, 4); 499Span<byte> R = destination.Slice(rOffset);
System\Security\Cryptography\AesCcm.cs (3)
48Span<byte> ciphertext, 49Span<byte> tag, 70Span<byte> plaintext,
System\Security\Cryptography\AesCcm.Windows.cs (3)
25Span<byte> ciphertext, 26Span<byte> tag, 36Span<byte> plaintext,
System\Security\Cryptography\AesCng.Windows.cs (6)
135Span<byte> destination, 153Span<byte> destination, 172Span<byte> destination, 191Span<byte> destination, 210Span<byte> destination, 230Span<byte> destination,
System\Security\Cryptography\AesImplementation.cs (7)
72Span<byte> key = stackalloc byte[KeySize / BitsPerByte]; 97Span<byte> destination, 120Span<byte> destination, 144Span<byte> destination, 169Span<byte> destination, 194Span<byte> destination, 222Span<byte> destination,
System\Security\Cryptography\AsymmetricAlgorithm.cs (18)
145Span<byte> destination, 154Span<byte> destination, 160public virtual bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) => 163public virtual bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) => 425/// <see cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{char}, PbeParameters, Span{byte}, out int)" /> has not been provided. 478/// <see cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{byte}, PbeParameters, Span{byte}, out int)" /> has not been provided. 578public bool TryExportSubjectPublicKeyInfoPem(Span<char> destination, out int charsWritten) 580static bool Export(AsymmetricAlgorithm alg, Span<byte> destination, out int bytesWritten) 627public bool TryExportPkcs8PrivateKeyPem(Span<char> destination, out int charsWritten) 629static bool Export(AsymmetricAlgorithm alg, Span<byte> destination, out int bytesWritten) 665/// An implementation for <see cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{char}, PbeParameters, Span{byte}, out int)" /> 688public bool TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char> password, PbeParameters pbeParameters, Span<char> destination, out int charsWritten) 694Span<byte> destination, 732/// An implementation for <see cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{byte}, PbeParameters, Span{byte}, out int)" /> 750public bool TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters, Span<char> destination, out int charsWritten) 756Span<byte> destination, 774Span<byte> destination, 777private delegate bool TryExport(Span<byte> destination, out int bytesWritten);
System\Security\Cryptography\Base64Transforms.cs (8)
49Span<byte> output = outputBuffer.AsSpan(outputOffset, requiredOutputLength); 155Span<byte> transformBuffer = stackalloc byte[StackAllocSize]; 201Span<byte> transformBuffer = stackalloc byte[StackAllocSize]; 237private Span<byte> AppendInputBuffers(ReadOnlySpan<byte> inputBuffer, Span<byte> transformBuffer) 271private static int GetOutputSize(int bytesToTransform, Span<byte> tmpBuffer) 293private void ConvertFromBase64(Span<byte> transformBuffer, Span<byte> outputBuffer, out int consumed, out int written)
System\Security\Cryptography\BasicSymmetricCipher.cs (2)
30public abstract int Transform(ReadOnlySpan<byte> input, Span<byte> output); 32public abstract int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output);
System\Security\Cryptography\BasicSymmetricCipherBCrypt.cs (2)
38public override int Transform(ReadOnlySpan<byte> input, Span<byte> output) => 41public override int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output)
System\Security\Cryptography\BasicSymmetricCipherCsp.cs (3)
64public override int Transform(ReadOnlySpan<byte> input, Span<byte> output) 69public override int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output) 92private int Transform(ReadOnlySpan<byte> input, Span<byte> output, bool isFinal)
System\Security\Cryptography\BasicSymmetricCipherLiteBCrypt.cs (3)
45public int Transform(ReadOnlySpan<byte> input, Span<byte> output) 83int BCryptTransform(ReadOnlySpan<byte> input, Span<byte> output) 99public int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output)
System\Security\Cryptography\BasicSymmetricCipherLiteNCrypt.cs (3)
55public int Transform(ReadOnlySpan<byte> input, Span<byte> output) 93int NCryptTransform(ReadOnlySpan<byte> input, Span<byte> output) 142public int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output)
System\Security\Cryptography\BasicSymmetricCipherNCrypt.cs (2)
24public sealed override int Transform(ReadOnlySpan<byte> input, Span<byte> output) => _cipher.Transform(input, output); 26public sealed override int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output)
System\Security\Cryptography\CapiHelper.Windows.cs (2)
905Span<byte> output, 944Span<byte> output)
System\Security\Cryptography\ChaCha20Poly1305.cs (3)
63Span<byte> ciphertext, 64Span<byte> tag, 85Span<byte> plaintext,
System\Security\Cryptography\ChaCha20Poly1305.Windows.cs (3)
25Span<byte> ciphertext, 26Span<byte> tag, 36Span<byte> plaintext,
System\Security\Cryptography\CngAlgorithmCore.cs (1)
66Span<byte> keySizeBuffer = stackalloc byte[sizeof(int)];
System\Security\Cryptography\CngAsnFormatter.cs (1)
33Span<char> buffer = charLength <= 256 ?
System\Security\Cryptography\CngKey.EC.cs (2)
85Span<char> nameLower = stackalloc char[MaxCurveNameLength]; 111Span<char> nameLower = stackalloc char[MaxCurveNameLength];
System\Security\Cryptography\CngKey.Export.cs (3)
38Span<byte> destination, 53Span<byte>.Empty, 65Span<byte> destination,
System\Security\Cryptography\ConcurrentSafeKmac.cs (4)
36public int Current(Span<byte> destination) 44public int Finalize(Span<byte> destination) 72Span<byte> hashBuffer = stackalloc byte[MaxKmacStackAlloc]; 101Span<byte> hashBuffer = stackalloc byte[MaxKmacStackAlloc];
System\Security\Cryptography\CryptographicOperations.cs (11)
99public static void ZeroMemory(Span<byte> buffer) 187public static int HashData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> source, Span<byte> destination) 223public static bool TryHashData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 300public static int HashData(HashAlgorithmName hashAlgorithm, Stream source, Span<byte> destination) 496Span<byte> destination) 537Span<byte> destination, 650public static int HmacData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key, Stream source, Span<byte> destination) 843Span<byte> macBuffer = stackalloc byte[MaxStackAlloc]; 853Span<byte> mac = macBuffer.Slice(0, written); 935Span<byte> macBuffer = stackalloc byte[MaxStackAlloc]; 945Span<byte> mac = macBuffer.Slice(0, written);
System\Security\Cryptography\DesImplementation.cs (6)
98Span<byte> destination, 119Span<byte> destination, 141Span<byte> destination, 163Span<byte> destination, 185Span<byte> destination, 210Span<byte> destination,
System\Security\Cryptography\DSA.cs (16)
227Span<byte> signature = stackalloc byte[SignatureStackSize]; 434Span<byte> signature = stackalloc byte[SignatureStackSize]; 446public virtual bool TryCreateSignature(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) 472Span<byte> destination, 502Span<byte> destination, 521Span<byte> destination, 539Span<byte> destination, 582Span<byte> destination, 615Span<byte> destination, 620Span<byte> tmp = stackalloc byte[HashBufferStackSize]; 781Span<byte> tmp = stackalloc byte[HashBufferStackSize]; 881Span<byte> tmp) 924Span<byte> destination, 947Span<byte> destination, 967Span<byte> destination, 975Span<byte> destination,
System\Security\Cryptography\DSACng.ImportExport.cs (2)
51public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 81Span<byte> destination,
System\Security\Cryptography\DSAWrapper.cs (6)
49public override bool TryCreateSignature(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) => 54Span<byte> destination, 71Span<byte> destination, 78Span<byte> destination, 82public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) => 85public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\ECAlgorithm.cs (7)
131Span<byte> destination, 203Span<byte> destination, 256Span<byte> destination, 296Span<byte> destination, 651public virtual unsafe bool TryExportECPrivateKey(Span<byte> destination, out int bytesWritten) 927public bool TryExportECPrivateKeyPem(Span<char> destination, out int charsWritten) 929static bool Export(ECAlgorithm alg, Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\EccKeyFormatHelper.cs (2)
751Span<byte> basePointBytes = stackalloc byte[MaxStackAllocSize]; 779Span<byte> publicKeyBytes = stackalloc byte[MaxStackAllocSize];
System\Security\Cryptography\ECDiffieHellmanCng.cs (2)
207public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 237Span<byte> destination,
System\Security\Cryptography\ECDiffieHellmanPublicKey.ExportParameters.cs (1)
50public virtual bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\ECDiffieHellmanWrapper.cs (5)
68Span<byte> destination, 75Span<byte> destination, 85public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) => 111public override bool TryExportECPrivateKey(Span<byte> destination, out int bytesWritten) => 183public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\ECDsa.cs (24)
141Span<byte> signature = stackalloc byte[SignatureStackBufSize]; 363/// <seealso cref="SignHash(ReadOnlySpan{byte}, Span{byte})" />. 364public int SignHash(ReadOnlySpan<byte> hash, Span<byte> destination, DSASignatureFormat signatureFormat) 397/// the signature. To use a different signature format, use <see cref="SignHash(ReadOnlySpan{byte}, Span{byte}, DSASignatureFormat)" />. 399/// <seealso cref="SignHash(ReadOnlySpan{byte}, Span{byte}, DSASignatureFormat)" />. 400public int SignHash(ReadOnlySpan<byte> hash, Span<byte> destination) 423Span<byte> signature = stackalloc byte[SignatureStackBufSize]; 464Span<byte> destination, 470Span<byte> hashTmp = stackalloc byte[HashBufferStackSize]; 502Span<byte> destination, 535Span<byte> destination, 540Span<byte> hashTmp = stackalloc byte[HashBufferStackSize]; 654/// <seealso cref="SignData(ReadOnlySpan{byte}, Span{byte}, HashAlgorithmName)" /> 657Span<byte> destination, 704/// <see cref="SignData(ReadOnlySpan{byte}, Span{byte}, HashAlgorithmName, DSASignatureFormat)" />. 706/// <seealso cref="SignData(ReadOnlySpan{byte}, Span{byte}, HashAlgorithmName, DSASignatureFormat)" /> 707public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm) 845Span<byte> hashTmp = stackalloc byte[HashBufferStackSize]; 899Span<byte> hashSpan = stackalloc byte[512 / 8]; 998protected virtual bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) 1041public virtual bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) 1067Span<byte> destination, 1097Span<byte> destination, 1201Span<byte> tmp)
System\Security\Cryptography\ECDsaCng.cs (2)
152public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 182Span<byte> destination,
System\Security\Cryptography\ECDsaWrapper.cs (6)
28Span<byte> destination, 99Span<byte> destination, 134Span<byte> destination, 141Span<byte> destination, 151public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) => 172public override bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\HashAlgorithm.cs (2)
53public bool TryComputeHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 261protected virtual bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\HashProvider.cs (3)
36public abstract int FinalizeHashAndReset(Span<byte> destination); 38public abstract int GetCurrentHash(Span<byte> destination); 50public bool TryFinalizeHashAndReset(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\HashProviderCng.cs (2)
78public override int FinalizeHashAndReset(Span<byte> destination) 98public override int GetCurrentHash(Span<byte> destination)
System\Security\Cryptography\HashProviderDispenser.Windows.cs (6)
101Span<byte> destination, 116Span<byte> destination) 146public static void HashDataXof(string hashAlgorithmId, ReadOnlySpan<byte> source, Span<byte> destination) 152public static int HashData(string hashAlgorithmId, ReadOnlySpan<byte> source, Span<byte> destination) 187Span<byte> destination, 295Span<byte> destination)
System\Security\Cryptography\HashStatic.cs (3)
41internal static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 49internal static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 65internal static int HashData(Stream source, Span<byte> destination)
System\Security\Cryptography\Helpers.cs (2)
343internal static unsafe ref byte GetNonNullPinnableReference(Span<byte> buffer) 536Span<byte> message =
System\Security\Cryptography\HKDF.cs (3)
51public static int Extract(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> ikm, ReadOnlySpan<byte> salt, Span<byte> prk) 118public static void Expand(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> prk, Span<byte> output, ReadOnlySpan<byte> info) 175public static void DeriveKey(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> ikm, Span<byte> output, ReadOnlySpan<byte> salt, ReadOnlySpan<byte> info)
System\Security\Cryptography\HKDF.Windows.cs (4)
32Span<byte> prk) 42Span<byte> output, 65Span<byte> output, 120Span<byte> destination,
System\Security\Cryptography\HKDFManagedImplementation.cs (11)
12internal static unsafe void Extract(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> ikm, ReadOnlySpan<byte> salt, Span<byte> prk) 18internal static unsafe void Expand(HashAlgorithmName hashAlgorithmName, int hashLength, ReadOnlySpan<byte> prk, Span<byte> output, ReadOnlySpan<byte> info) 23var counterSpan = new Span<byte>(ref counter); 24Span<byte> t = Span<byte>.Empty; 25Span<byte> remainingOutput = output; 28Span<byte> tempInfoBuffer = stackalloc byte[MaxStackInfoBuffer]; 69Span<byte> lastChunk = stackalloc byte[hashLength]; 85internal static unsafe void DeriveKey(HashAlgorithmName hashAlgorithmName, int hashLength, ReadOnlySpan<byte> ikm, Span<byte> output, ReadOnlySpan<byte> salt, ReadOnlySpan<byte> info) 87Span<byte> prk = stackalloc byte[hashLength]; 94private static void GetHashAndReset(IncrementalHash hmac, Span<byte> output)
System\Security\Cryptography\HMAC.cs (1)
71protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\HMACCommon.cs (3)
128public int FinalizeHashAndReset(Span<byte> destination) => 131public bool TryFinalizeHashAndReset(Span<byte> destination, out int bytesWritten) => 134public int GetCurrentHash(Span<byte> destination) =>
System\Security\Cryptography\HMACMD5.cs (4)
84protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 128public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 147public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 173public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA1.cs (4)
87protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 128public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 146public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 171public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA256.cs (4)
79protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 120public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 138public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 163public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA3_256.cs (4)
114protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 156public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 174public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 199public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA3_384.cs (4)
114protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 156public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 174public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 199public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA3_512.cs (4)
114protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 156public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 174public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 199public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA384.cs (4)
96protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 137public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 155public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 180public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA512.cs (4)
93protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 134public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 152public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 177public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACStatic.cs (5)
31Span<byte> mac = stackalloc byte[THMAC.HashSizeInBytes]; 59internal static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 69internal static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 85internal static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination) 181Span<byte> mac = stackalloc byte[THMAC.HashSizeInBytes];
System\Security\Cryptography\ILiteSymmetricCipher.cs (2)
10int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output); 11int Transform(ReadOnlySpan<byte> input, Span<byte> output);
System\Security\Cryptography\IncrementalHash.cs (13)
146/// <paramref name="destination"/> has a <see cref="Span{T}.Length"/> value less 150public int GetHashAndReset(Span<byte> destination) 159public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 173private int GetHashAndResetCore(Span<byte> destination) 218/// <paramref name="destination"/> has a <see cref="Span{T}.Length"/> value less 222public int GetCurrentHash(Span<byte> destination) 249public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 263private int GetCurrentHashCore(Span<byte> destination) 308VerifyCore(hash, this, static (IncrementalHash ih, Span<byte> buffer) => ih.GetCurrentHashCore(buffer)); 339VerifyCore(hash, this, static (IncrementalHash ih, Span<byte> buffer) => ih.GetHashAndResetCore(buffer)); 474Func<IncrementalHash, Span<byte>, int> getHashCallback) 482Span<byte> computedBuffer = stackalloc byte[MaxStackAlloc]; 495Span<byte> computed = computedBuffer.Slice(0, written);
System\Security\Cryptography\Kmac128.cs (7)
131/// <seealso cref="GetCurrentHash(Span{byte})" /> 132public void GetHashAndReset(Span<byte> destination) 171/// <seealso cref="GetHashAndReset(Span{byte})" /> 172public void GetCurrentHash(Span<byte> destination) 358Span<byte> destination, 459Span<byte> destination, 749Span<byte> destination,
System\Security\Cryptography\Kmac256.cs (7)
131/// <seealso cref="GetCurrentHash(Span{byte})" /> 132public void GetHashAndReset(Span<byte> destination) 171/// <seealso cref="GetHashAndReset(Span{byte})" /> 172public void GetCurrentHash(Span<byte> destination) 358Span<byte> destination, 459Span<byte> destination, 749Span<byte> destination,
System\Security\Cryptography\KmacStatic.cs (2)
165Action<ReadOnlySpan<byte>, TSource, ReadOnlySpan<byte>, Span<byte>> callback) 168Span<byte> hashBuffer = stackalloc byte[MaxStackKmacSize];
System\Security\Cryptography\KmacXof128.cs (7)
131/// <seealso cref="GetCurrentHash(Span{byte})" /> 132public void GetHashAndReset(Span<byte> destination) 171/// <seealso cref="GetHashAndReset(Span{byte})" /> 172public void GetCurrentHash(Span<byte> destination) 358Span<byte> destination, 459Span<byte> destination, 749Span<byte> destination,
System\Security\Cryptography\KmacXof256.cs (7)
131/// <seealso cref="GetCurrentHash(Span{byte})" /> 132public void GetHashAndReset(Span<byte> destination) 171/// <seealso cref="GetHashAndReset(Span{byte})" /> 172public void GetCurrentHash(Span<byte> destination) 358Span<byte> destination, 459Span<byte> destination, 749Span<byte> destination,
System\Security\Cryptography\LiteHash.Windows.cs (10)
116Span<byte> buffer = [0]; 131public unsafe int Current(Span<byte> destination) 144public unsafe int Finalize(Span<byte> destination) 245public unsafe int Finalize(Span<byte> destination) 261public int FinalizeAndReset(Span<byte> destination) => Finalize(destination); 263public void Reset() => Finalize(Span<byte>.Empty); 265public unsafe void Current(Span<byte> destination) 285public unsafe void Read(Span<byte> destination) 358public int Finalize(Span<byte> destination) 431public int Finalize(Span<byte> destination)
System\Security\Cryptography\LiteHashProvider.cs (4)
13internal static int HashStream(string hashAlgorithmId, Stream source, Span<byte> destination) 61Span<byte> destination) 112private static int ProcessStream<T>(T hash, Stream source, Span<byte> destination) where T : ILiteHash 189int Finalize(Span<byte> destination);
System\Security\Cryptography\LiteHashProvider.Xof.cs (2)
13internal static void XofStream(string hashAlgorithmId, Stream source, Span<byte> destination) 35Span<byte> destination)
System\Security\Cryptography\MD5.cs (4)
84public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 102public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 127public static int HashData(Stream source, Span<byte> destination) 218protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\MD5CryptoServiceProvider.cs (2)
26Span<byte> destination = stackalloc byte[HashSizeInBytes]; 56protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\MLDsaOpenSsl.NotSupported.cs (7)
31protected override void SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination) 43protected override void SignPreHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> context, string hashAlgorithmOid, Span<byte> destination) 55protected override void SignMuCore(ReadOnlySpan<byte> externalMu, Span<byte> destination) 67protected override void ExportMLDsaPublicKeyCore(Span<byte> destination) 73protected override void ExportMLDsaPrivateKeyCore(Span<byte> destination) 79protected override void ExportMLDsaPrivateSeedCore(Span<byte> destination) 85protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\MLKemOpenSsl.NotSupported.cs (7)
31protected override void DecapsulateCore(ReadOnlySpan<byte> ciphertext, Span<byte> sharedSecret) 37protected override void EncapsulateCore(Span<byte> ciphertext, Span<byte> sharedSecret) 43protected override void ExportPrivateSeedCore(Span<byte> destination) 49protected override void ExportDecapsulationKeyCore(Span<byte> destination) 55protected override void ExportEncapsulationKeyCore(Span<byte> destination) 61protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\Pbkdf2Implementation.Windows.cs (5)
25Span<byte> destination) 38Span<byte> destination) 45scoped Span<byte> clearSpan; 72Span<byte> hashBuffer = stackalloc byte[512 / 8]; // 64 bytes is SHA512, the largest digest handled. 156Span<BCryptBuffer> buffers = stackalloc BCryptBuffer[3];
System\Security\Cryptography\PemEncoding.cs (10)
144Span<TChar> postebStackBuffer = stackalloc TChar[PostebStackBufferSize]; 183Span<TChar> postebBuffer = postebLength > PostebStackBufferSize 232static ReadOnlySpan<TChar> WritePostEB(ReadOnlySpan<TChar> label, Span<TChar> destination) 458public static bool TryWrite(ReadOnlySpan<char> label, ReadOnlySpan<byte> data, Span<char> destination, out int charsWritten) 520Span<byte> destination, 588private static int WriteCore<TChar, T>(ReadOnlySpan<TChar> label, ReadOnlySpan<byte> data, Span<TChar> destination) 592static int Write(ReadOnlySpan<TChar> str, Span<TChar> dest, int offset) 735static abstract int WriteBase64(ReadOnlySpan<byte> bytes, Span<TChar> destination, int offset); 751public static int WriteBase64(ReadOnlySpan<byte> bytes, Span<char> destination, int offset) 778public static int WriteBase64(ReadOnlySpan<byte> bytes, Span<byte> destination, int offset)
System\Security\Cryptography\PemKeyHelpers.cs (8)
12public delegate bool TryExportKeyAction<T>(T arg, Span<byte> destination, out int bytesWritten); 17Span<byte> destination, 25Span<char> destination, 43Span<byte> writtenSpan = new Span<byte>(buffer, 0, bytesWritten); 61Span<char> destination, 79Span<byte> writtenSpan = new Span<byte>(buffer, 0, bytesWritten); 151Span<byte> decodedBase64 = decodeBuffer.AsSpan(0, bytesWritten); 237Span<byte> decodedBase64 = decodeBuffer.AsSpan(0, bytesWritten);
System\Security\Cryptography\RandomNumberGenerator.cs (17)
56public virtual void GetBytes(Span<byte> data) 79public virtual void GetNonZeroBytes(Span<byte> data) 98public static void Fill(Span<byte> data) 129Span<byte> oneUintBytes = MemoryMarshal.AsBytes(new Span<uint>(ref oneUint)); 178/// <seealso cref="GetHexString(Span{char}, bool)" /> 179public static void GetItems<T>(ReadOnlySpan<T> choices, Span<T> destination) 201/// <seealso cref="GetHexString(Span{char}, bool)" /> 226/// <seealso cref="GetItems{T}(ReadOnlySpan{T}, Span{T})" /> 228/// <seealso cref="GetHexString(Span{char}, bool)" /> 250/// The behavior of this is the same as using <seealso cref="GetItems{T}(ReadOnlySpan{T}, Span{T})" /> and 254public static void GetHexString(Span<char> destination, bool lowercase = false) 289public static void Shuffle<T>(Span<T> values) 306private static unsafe void GetHexStringCore(Span<char> destination, bool lowercase) 311Span<byte> randomBuffer = stackalloc byte[RandomBufferSize]; 319Span<byte> remainingRandom = randomBuffer.Slice(0, Math.Min(RandomBufferSize, needed)); 349private static unsafe void GetItemsCore<T>(ReadOnlySpan<T> choices, Span<T> destination) 360Span<byte> randomBytes = stackalloc byte[512];
System\Security\Cryptography\RandomNumberGeneratorImplementation.cs (5)
19internal static unsafe void FillSpan(Span<byte> data) 40public override unsafe void GetBytes(Span<byte> data) 55public override void GetNonZeroBytes(Span<byte> data) 60internal static void FillNonZeroBytes(Span<byte> data) 76Span<byte> remainder = data.Slice(first0Byte + 1);
System\Security\Cryptography\RC2Implementation.cs (6)
84Span<byte> destination, 108Span<byte> destination, 133Span<byte> destination, 158Span<byte> destination, 183Span<byte> destination, 194Span<byte> destination,
System\Security\Cryptography\Rfc2898DeriveBytes.cs (2)
183internal void GetBytes(Span<byte> destination) 296Span<byte> uiSpan = stackalloc byte[64];
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (7)
115Span<byte> destination, 245/// and use <see cref="Pbkdf2(ReadOnlySpan{byte}, ReadOnlySpan{byte}, Span{byte}, int, HashAlgorithmName)" />. 250Span<byte> destination, 264Span<byte> destination, 281Span<byte> passwordBuffer = maxEncodedSize > MaxPasswordStackSize ? 285Span<byte> passwordBytes = passwordBuffer.Slice(0, passwordBytesWritten); 305Span<byte> destination,
System\Security\Cryptography\RNGCryptoServiceProvider.cs (2)
29public override void GetBytes(Span<byte> data) => _impl.GetBytes(data); 31public override void GetNonZeroBytes(Span<byte> data) => _impl.GetNonZeroBytes(data);
System\Security\Cryptography\RSA.cs (21)
102public virtual bool TryDecrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 117public virtual bool TryEncrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 159/// <seealso cref="Encrypt(ReadOnlySpan{byte}, Span{byte}, RSAEncryptionPadding)" /> 211public int Encrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding) 246/// <seealso cref="Decrypt(ReadOnlySpan{byte}, Span{byte}, RSAEncryptionPadding)" /> 294public int Decrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding) 306protected virtual bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) 341public virtual bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 411public virtual bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 517Span<byte> destination, 619Span<byte> destination, 705public virtual bool TryExportRSAPrivateKey(Span<byte> destination, out int bytesWritten) 717public virtual bool TryExportRSAPublicKey(Span<byte> destination, out int bytesWritten) 723public override unsafe bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) 759public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 804Span<byte> destination, 827Span<byte> destination, 1291public bool TryExportRSAPrivateKeyPem(Span<char> destination, out int charsWritten) 1293static bool Export(RSA alg, Span<byte> destination, out int bytesWritten) 1337public bool TryExportRSAPublicKeyPem(Span<char> destination, out int charsWritten) 1339static bool Export(RSA alg, Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\RSABCrypt.cs (3)
181Span<byte> destination, 215Span<byte> destination, 260Span<byte> destination,
System\Security\Cryptography\RSACng.ImportExport.cs (2)
53public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 83Span<byte> destination,
System\Security\Cryptography\SHA1.cs (4)
77public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 94public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 118public static int HashData(Stream source, Span<byte> destination) 206protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA1CryptoServiceProvider.cs (2)
29Span<byte> destination = stackalloc byte[HashSizeInBytes]; 59protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\SHA1Managed.cs (1)
31protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA256.cs (4)
76public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 94public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 118public static int HashData(Stream source, Span<byte> destination) 206protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA256CryptoServiceProvider.cs (2)
29Span<byte> destination = stackalloc byte[HashSizeInBytes]; 59protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\SHA256Managed.cs (1)
31protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA3_256.cs (4)
105public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 125public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 152public static int HashData(Stream source, Span<byte> destination) 249protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA3_384.cs (4)
105public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 126public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 153public static int HashData(Stream source, Span<byte> destination) 250protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA3_512.cs (4)
105public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 125public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 152public static int HashData(Stream source, Span<byte> destination) 249protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA384.cs (4)
76public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 93public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 117public static int HashData(Stream source, Span<byte> destination) 205protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA384CryptoServiceProvider.cs (2)
29Span<byte> destination = stackalloc byte[HashSizeInBytes]; 59protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\SHA384Managed.cs (1)
31protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA512.cs (4)
76public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 93public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 117public static int HashData(Stream source, Span<byte> destination) 205protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA512CryptoServiceProvider.cs (2)
29Span<byte> destination = stackalloc byte[HashSizeInBytes]; 59protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\SHA512Managed.cs (1)
31protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\Shake128.cs (9)
115/// <seealso cref="GetCurrentHash(Span{byte})" /> 116public void GetHashAndReset(Span<byte> destination) 158/// <seealso cref="GetHashAndReset(Span{byte})" /> 159public void GetCurrentHash(Span<byte> destination) 207/// The platform does not support multiple reads of the hash. <see cref="GetHashAndReset(Span{byte})" /> can be used 210public void Read(Span<byte> destination) 325public static void HashData(ReadOnlySpan<byte> source, Span<byte> destination) 379public static void HashData(Stream source, Span<byte> destination) 470private static void HashDataCore(ReadOnlySpan<byte> source, Span<byte> destination)
System\Security\Cryptography\Shake256.cs (9)
115/// <seealso cref="GetCurrentHash(Span{byte})" /> 116public void GetHashAndReset(Span<byte> destination) 158/// <seealso cref="GetHashAndReset(Span{byte})" /> 159public void GetCurrentHash(Span<byte> destination) 207/// The platform does not support multiple reads of the hash. <see cref="GetHashAndReset(Span{byte})" /> can be used 210public void Read(Span<byte> destination) 325public static void HashData(ReadOnlySpan<byte> source, Span<byte> destination) 379public static void HashData(Stream source, Span<byte> destination) 470private static void HashDataCore(ReadOnlySpan<byte> source, Span<byte> destination)
System\Security\Cryptography\SlhDsaOpenSsl.NotSupported.cs (5)
27protected override void SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination) 39protected override void SignPreHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> context, string hashAlgorithmOid, Span<byte> destination) 51protected override void ExportSlhDsaPublicKeyCore(Span<byte> destination) 57protected override void ExportSlhDsaPrivateKeyCore(Span<byte> destination) 63protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\SP800108HmacCounterKdf.Windows.cs (2)
37Span<byte> destination) 47Span<byte> destination)
System\Security\Cryptography\SP800108HmacCounterKdfImplementationCng.cs (2)
15scoped Span<byte> clearSpan = default; 21Span<byte> buffer = stackalloc byte[512 / 8]; // Largest supported digest is SHA512.
System\Security\Cryptography\SymmetricAlgorithm.cs (19)
558public int DecryptEcb(ReadOnlySpan<byte> ciphertext, Span<byte> destination, PaddingMode paddingMode) 587public bool TryDecryptEcb(ReadOnlySpan<byte> ciphertext, Span<byte> destination, PaddingMode paddingMode, out int bytesWritten) 676public int EncryptEcb(ReadOnlySpan<byte> plaintext, Span<byte> destination, PaddingMode paddingMode) 705public bool TryEncryptEcb(ReadOnlySpan<byte> plaintext, Span<byte> destination, PaddingMode paddingMode, out int bytesWritten) 773Span<byte> decryptBuffer = decryptRent.AsSpan(0, ciphertext.Length); 818Span<byte> destination, 857Span<byte> destination, 971Span<byte> destination, 1010Span<byte> destination, 1190Span<byte> destination, 1249Span<byte> destination, 1422Span<byte> destination, 1481Span<byte> destination, 1515Span<byte> destination, 1539Span<byte> destination, 1570Span<byte> destination, 1596Span<byte> destination, 1624Span<byte> destination, 1657Span<byte> destination,
System\Security\Cryptography\SymmetricPadding.cs (1)
36public static int PadBlock(ReadOnlySpan<byte> block, Span<byte> destination, int paddingSizeInBytes, PaddingMode paddingMode)
System\Security\Cryptography\TripleDESCng.Windows.cs (6)
103Span<byte> destination, 121Span<byte> destination, 140Span<byte> destination, 159Span<byte> destination, 178Span<byte> destination, 198Span<byte> destination,
System\Security\Cryptography\TripleDesImplementation.cs (6)
95Span<byte> destination, 116Span<byte> destination, 138Span<byte> destination, 160Span<byte> destination, 182Span<byte> destination, 207Span<byte> destination,
System\Security\Cryptography\UniversalCryptoDecryptor.cs (4)
26protected override int UncheckedTransformBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer) 68protected override unsafe int UncheckedTransformFinalBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer) 80Span<byte> ciphertext; 112Span<byte> decryptedBytes = ciphertext.Slice(0, decryptWritten);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (2)
26protected override int UncheckedTransformBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer) 31protected override int UncheckedTransformFinalBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer)
System\Security\Cryptography\UniversalCryptoOneShot.cs (9)
17Span<byte> output, 41Span<byte> transformBuffer = output.Slice(0, bytesTransformed); 82Span<byte> stackBuffer = stackalloc byte[MaxInStackDecryptionBuffer]; 91Span<byte> writtenDepadded = stackBuffer.Slice(0, depaddedLength); 142Span<byte> depaddedFinalTransform = stackBuffer.Slice(0, depaddedLength); 168Span<byte> buffer = rentedBuffer.AsSpan(0, input.Length); 169Span<byte> decryptedBuffer = default; 207Span<byte> output, 226Span<byte> paddedOutput = output.Slice(0, padWritten);
System\Security\Cryptography\UniversalCryptoTransform.cs (2)
117protected abstract int UncheckedTransformBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer); 122protected abstract int UncheckedTransformFinalBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer);
System\Security\Cryptography\X25519DiffieHellman.cs (18)
142public void DeriveRawSecretAgreement(X25519DiffieHellman otherParty, Span<byte> destination) 179public void DeriveRawSecretAgreement(ReadOnlySpan<byte> otherPartyPublicKey, Span<byte> destination) 245public void ExportPrivateKey(Span<byte> destination) 290public void ExportPublicKey(Span<byte> destination) 322public bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) 368Span<byte> spki = stackalloc byte[SpkiSizeInBytes]; 399public bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 485Span<byte> destination, 534Span<byte> destination, 583Span<byte> destination, 808protected abstract void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span<byte> destination); 823protected abstract void DeriveRawSecretAgreementCore(ReadOnlySpan<byte> otherPartyPublicKey, Span<byte> destination); 831protected abstract void ExportPrivateKeyCore(Span<byte> destination); 839protected abstract void ExportPublicKeyCore(Span<byte> destination); 858protected abstract bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten); 1430private bool TryExportSubjectPublicKeyInfoCore(Span<byte> destination, out int bytesWritten) 1481private protected bool TryExportPkcs8PrivateKeyImpl(Span<byte> destination, out int bytesWritten) 1502Span<byte> privateKeyBuffer = destination.Slice(pkcs8Preamble.Length, PrivateKeySizeInBytes);
System\Security\Cryptography\X25519DiffieHellmanCng.cs (5)
56protected override unsafe partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span<byte> destination); 59protected override partial void DeriveRawSecretAgreementCore(ReadOnlySpan<byte> otherPartyPublicKey, Span<byte> destination); 62protected override partial void ExportPublicKeyCore(Span<byte> destination); 65protected override partial void ExportPrivateKeyCore(Span<byte> destination); 68protected override partial bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten);
System\Security\Cryptography\X25519DiffieHellmanCng.Windows.cs (11)
40protected override unsafe partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span<byte> destination) 44Span<byte> publicKeyBytes = stackalloc byte[PublicKeySizeInBytes]; 49protected override partial void DeriveRawSecretAgreementCore(ReadOnlySpan<byte> otherPartyPublicKey, Span<byte> destination) 56private void DeriveRawSecretAgreementWithPublicKey(ReadOnlySpan<byte> otherPartyPublicKey, Span<byte> destination) 58scoped Span<byte> reducedPublicKey; 119protected override partial void ExportPublicKeyCore(Span<byte> destination) 125protected override partial void ExportPrivateKeyCore(Span<byte> destination) 139protected override partial bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) 159private static void ExportKeyFromBlob(CngKey key, bool privateKey, Span<byte> destination) 202private void ExportPrivateKeyFromEncryptedPkcs8(Span<byte> destination) 214static (ReadOnlySpan<byte> key, Span<byte> destination, in ValueAlgorithmIdentifierAsn algId, out object? ret) =>
System\Security\Cryptography\X25519DiffieHellmanImplementation.Windows.cs (10)
36protected override void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span<byte> destination) 49Span<byte> publicKeyBytes = stackalloc byte[PublicKeySizeInBytes]; 56protected override void DeriveRawSecretAgreementCore(ReadOnlySpan<byte> otherPartyPublicKey, Span<byte> destination) 64private void DeriveRawSecretAgreementWithKey(ReadOnlySpan<byte> otherPartyPublicKey, Span<byte> destination) 72private void DeriveRawSecretAgreementWithKey(SafeBCryptKeyHandle otherPartyKey, Span<byte> destination) 107protected override void ExportPrivateKeyCore(Span<byte> destination) 113protected override void ExportPublicKeyCore(Span<byte> destination) 125protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten) 180scoped Span<byte> reducedPublicKey; 192private void ExportKey(bool privateKey, Span<byte> destination)
System\Security\Cryptography\X25519DiffieHellmanOpenSsl.NotSupported.cs (5)
22protected override void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span<byte> destination) 28protected override void DeriveRawSecretAgreementCore(ReadOnlySpan<byte> otherPartyPublicKey, Span<byte> destination) 34protected override void ExportPrivateKeyCore(Span<byte> destination) 40protected override void ExportPublicKeyCore(Span<byte> destination) 46protected override bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.cs (1)
299Span<char> buffer = spanLength <= 256 ?
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
688Span<byte> serialNumber = stackalloc byte[8];
System\Security\Cryptography\X509Certificates\FindPal.Windows.cs (1)
357Span<byte> actual = stackalloc byte[MaxStackAllocSize];
System\Security\Cryptography\X509Certificates\PublicKey.cs (1)
189public bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\X509Certificates\WindowsHelpers.cs (3)
98Span<byte> decoded = stackalloc byte[MaxStackAllocSize]; 144Span<byte> decoded = stackalloc byte[MaxStackAllocSize]; 191Span<byte> decoded = stackalloc byte[MaxStackAllocSize];
System\Security\Cryptography\X509Certificates\WindowsInterop.crypt32.cs (1)
32Span<char> buffer = cchCount <= 256 ? stackalloc char[cchCount] : new char[cchCount];
System\Security\Cryptography\X509Certificates\X500DistinguishedNameBuilder.cs (1)
229Span<char> fixupTwoLetterCode = ['\0', '\0'];
System\Security\Cryptography\X509Certificates\X509Certificate.cs (2)
443Span<byte> destination, 465Span<byte> buffer = stackalloc byte[64]; // Largest supported hash size is 512 bits
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (4)
1066Span<byte> publicKeysBuffer = stackalloc byte[MaxPublicKeySize * 2]; 1067Span<byte> pk1 = publicKeysBuffer.Slice(0, publicKey.Algorithm.PublicKeySizeInBytes); 1068Span<byte> pk2 = publicKeysBuffer.Slice(pk1.Length, publicKey.Algorithm.PublicKeySizeInBytes); 1616public bool TryExportCertificatePem(Span<char> destination, out int charsWritten)
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (5)
524public bool TryExportPkcs7Pem(Span<char> destination, out int charsWritten) 602public bool TryExportCertificatePems(Span<char> destination, out int charsWritten) 604Span<char> buffer = destination; 732Span<byte> thumbprint = maxDecodedLength > MaxThumbprintStackAlloc ? 783Span<byte> thumbprintBuffer = stackalloc byte[MaxThumbprintStackAlloc];
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Windows.cs (1)
239Span<char> szPassword = stackalloc char[MaxStackPasswordLength + 1];
System\Security\Cryptography\X509Certificates\X509Pal.Windows.X500DistinguishedName.cs (2)
31Span<char> buffer = cchDecoded <= 256 ? stackalloc char[cchDecoded] : new char[cchDecoded]; 83Span<char> buffer = spanLength <= 256 ? stackalloc char[spanLength] : new char[spanLength];
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (2)
172Span<byte> sha1 = stackalloc byte[SHA1.HashSizeInBytes]; 209Span<byte> hash = stackalloc byte[512 / 8]; // Largest known hash is 512-bits.
System\Security\Cryptography\XmlKeyHelper.cs (2)
106Span<byte> valBuf = stackalloc byte[sizeof(int)]; 140Span<char> base64 = stackalloc char[StackChars];
System.Security.Cryptography.Cose (34)
src\runtime\src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
21public override Span<T> GetSpan()
System\Security\Cryptography\Cose\CoseHeaderMap.cs (2)
117public int GetValueAsBytes(CoseHeaderLabel label, Span<byte> destination) => _headerParameters[label].GetValueAsBytes(destination); 332internal static int Encode(CoseHeaderMap? map, Span<byte> destination, bool isProtected = false, CoseAlgorithm? algHeaderValueToSlip = null)
System\Security\Cryptography\Cose\CoseHeaderValue.cs (1)
209public int GetValueAsBytes(Span<byte> destination)
System\Security\Cryptography\Cose\CoseHelpers.cs (5)
63Span<byte> buffer = stackalloc byte[1 + sizeof(ushort)]; 71Span<byte> buffer = stackalloc byte[1 + sizeof(uint)]; 79Span<byte> buffer = stackalloc byte[1 + sizeof(ulong)]; 199internal static int WriteHeaderMap(Span<byte> buffer, CborWriter writer, CoseHeaderMap? headerMap, bool isProtected, CoseAlgorithm? algHeaderValueToSlip) 228internal static void WriteSignature(Span<byte> buffer, ReadOnlySpan<byte> toBeSigned, CborWriter writer, CoseSigner signer)
System\Security\Cryptography\Cose\CoseKey.cs (4)
190internal int Sign(ReadOnlySpan<byte> toBeSigned, Span<byte> destination) 205Span<byte> mldsaSignature = destination.Slice(0, _mldsaKey.Algorithm.SignatureSizeInBytes); 215private static int SignHashWithECDsa(ECDsa key, ReadOnlySpan<byte> hash, Span<byte> destination) 226private static int SignHashWithRSA(RSA key, ReadOnlySpan<byte> hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, Span<byte> destination)
System\Security\Cryptography\Cose\CoseMessage.cs (4)
430Span<byte> buffer, 508internal static int CreateToBeSigned(Span<byte> destination, SigStructureContext context, ReadOnlySpan<byte> bodyProtected, ReadOnlySpan<byte> signProtected, ReadOnlySpan<byte> associatedData, ReadOnlySpan<byte> content) 649public int Encode(Span<byte> destination) 668public abstract bool TryEncode(Span<byte> destination, out int bytesWritten);
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (7)
312public static bool TrySignDetached(ReadOnlySpan<byte> detachedContent, Span<byte> destination, CoseSigner signer, out int bytesWritten, CoseHeaderMap? protectedHeaders = null, CoseHeaderMap? unprotectedHeaders = null, ReadOnlySpan<byte> associatedData = default) 340public static bool TrySignEmbedded(ReadOnlySpan<byte> embeddedContent, Span<byte> destination, CoseSigner signer, out int bytesWritten, CoseHeaderMap? protectedHeaders = null, CoseHeaderMap? unprotectedHeaders = null, ReadOnlySpan<byte> associatedData = default) 343private static bool TrySign(ReadOnlySpan<byte> content, Span<byte> destination, CoseSigner signer, CoseHeaderMap? protectedHeaders, CoseHeaderMap? unprotectedHeaders, out int bytesWritten, ReadOnlySpan<byte> associatedData, bool isDetached) 365Span<byte> buffer, 440Span<byte> buffer, 571public override bool TryEncode(Span<byte> destination, out int bytesWritten) 782Span<byte> bufferSpan = buffer;
System\Security\Cryptography\Cose\CoseSign1Message.cs (5)
249public static bool TrySignDetached(ReadOnlySpan<byte> detachedContent, Span<byte> destination, CoseSigner signer, out int bytesWritten, ReadOnlySpan<byte> associatedData = default) 271public static bool TrySignEmbedded(ReadOnlySpan<byte> embeddedContent, Span<byte> destination, CoseSigner signer, out int bytesWritten, ReadOnlySpan<byte> associatedData = default) 274private static bool TrySign(ReadOnlySpan<byte> content, Span<byte> destination, CoseSigner signer, out int bytesWritten, ReadOnlySpan<byte> associatedData, bool isDetached) 306private static int CreateCoseSign1Message(ReadOnlySpan<byte> contentBytes, Stream? contentStream, Span<byte> buffer, CoseSigner signer, ReadOnlySpan<byte> associatedData, bool isDetached) 1002public override bool TryEncode(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\Cose\HashToBeSignedBuilder.cs (2)
31internal override void WithDataAndResetAfterOperation(Span<byte> arg, ToBeSignedOperation operation) 37Span<byte> hash = stackalloc byte[_incrementalHash.HashLengthInBytes];
System\Security\Cryptography\Cose\PureDataToBeSignedBuilder.cs (1)
35internal override void WithDataAndResetAfterOperation(Span<byte> arg, ToBeSignedOperation operation)
System\Security\Cryptography\Cose\ToBeSignedBuilder.cs (2)
13internal delegate void ToBeSignedOperation(Span<byte> arg, ReadOnlySpan<byte> data); 31internal abstract void WithDataAndResetAfterOperation(Span<byte> arg, ToBeSignedOperation operation);
System.Security.Cryptography.Pkcs (91)
Internal\Cryptography\Pal\AnyOS\AsnHelpers.cs (1)
116Span<byte> salt = stackalloc byte[KeyLengths.Rc4Max_128Bit / 8];
Internal\Cryptography\Pal\Windows\HeapBlockRetainer.cs (1)
51var ascii = new Span<byte>((byte*)pb, length);
Internal\Cryptography\Pal\Windows\HelpersWindows.cs (4)
190Span<char> name = nc <= 128 ? stackalloc char[128] : new char[nc]; 366Span<byte> stackSpan = stackalloc byte[ 410Span<byte> asciiStringBuf = stackSpan; 434ref Span<byte> buf,
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.CryptGetProvParam.cs (1)
53Span<byte> pbData,
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
43Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
21public override Span<T> GetSpan()
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (1)
60Span<byte> derived = stackalloc byte[expectedOutputSize];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (4)
46internal Span<byte> Span { get; private set; } 69Span<byte> toClear = Span.Slice(0, clearSize); 95Span<byte> currentBuffer, 109Span<byte> currentBuffer,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (2)
93internal static void RngFill(Span<byte> destination) 105internal static bool TryCopyToDestination(this ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (3)
226Span<byte> encryptedSpan = default; 230Span<byte> iv = stackalloc byte[cipher.BlockSize / 8]; 231Span<byte> salt = stackalloc byte[16];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (23)
84Span<byte> destination) 101Span<byte> destination) 199Span<byte> buf = stackalloc byte[128]; 346Span<byte> ivDest) 482Span<byte> destination) 484Span<byte> buf = stackalloc byte[128]; 541Span<byte> destination) 567Span<byte> iv = stackalloc byte[16]; 598ref Span<byte> iv) 729ref Span<byte> iv) 850Span<byte> destination) 875Span<byte> dk = stackalloc byte[16]; 884Span<byte> k = dk.Slice(0, 8); 885Span<byte> iv = dk.Slice(8, 8); 902Span<byte> destination) 927Span<byte> iv = stackalloc byte[cipher.BlockSize / 8]; 928Span<byte> key = stackalloc byte[cipher.KeySize / 8]; 961Span<byte> destination) 999Span<byte> tmpEndSpan = tmpEnd.AsSpan(); 1023Span<byte> dk) 1027Span<byte> t = stackalloc byte[20]; 1064Span<byte> salt, 1067Span<byte> iv)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (4)
159Span<byte> authSafeSpan = default; 161Span<byte> macSpan = default; 162scoped Span<byte> salt = default; 349public bool TryEncode(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
67public bool TryEncode(Span<byte> destination, out int bytesWritten)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (4)
433Span<byte> encryptedSpan = Span<byte>.Empty; 434Span<byte> iv = stackalloc byte[cipherBlockBytes]; 435Span<byte> salt = stackalloc byte[16];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (3)
131public bool TryEncode(Span<byte> destination, out int bytesWritten) 140Span<byte> destination, 158Span<byte> destination,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (13)
34Span<byte> destination) 50Span<byte> destination) 66Span<byte> destination) 83Span<byte> destination) 108Span<byte> D = stackalloc byte[vBytes]; 145scoped Span<byte> I; 167Span<byte> hashBuf = stackalloc byte[uBytes]; 168Span<byte> bBuf = stackalloc byte[vBytes]; 218Span<byte> I_j = I.Slice(j * vBytes, vBytes); 236private static void AddPlusOne(Span<byte> into, ReadOnlySpan<byte> addend) 250private static void CircularCopy(ReadOnlySpan<byte> bytes, Span<byte> destination) 269private static void CircularCopyUtf16BE(ReadOnlySpan<char> password, Span<byte> destination) 288Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length));
System\Security\Cryptography\Pkcs\CmsHash.cs (4)
25internal abstract bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten); 45internal override bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 75internal override bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 104internal override bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\Pkcs\CmsSignature.cs (1)
171Span<byte> ieeeSignature)
System\Security\Cryptography\Pkcs\CmsSignature.DSA.cs (1)
81Span<byte> ieee = new Span<byte>(rented, 0, bufSize);
System\Security\Cryptography\Pkcs\CmsSignature.ECDsa.cs (1)
86Span<byte> ieee = new Span<byte>(rented, 0, bufSize);
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (1)
151public bool TryEncode(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (3)
181Span<byte> stackSpan = stackalloc byte[512 / 8]; 486Span<byte> thumbprint = stackalloc byte[20]; 514Span<byte> thumbprint = stackalloc byte[512 / 8];
System\Security\Cryptography\Pkcs\Rfc3161TimestampTokenInfo.cs (1)
213public bool TryEncode(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\Pkcs\SignerInfo.cs (4)
672Span<byte> encoded = encodedLength <= 256 711Span<byte> contentHash = stackalloc byte[512 / 8]; 752Span<byte> attrHash = stackalloc byte[512 / 8]; 809Span<byte> contentHash = stackalloc byte[512 / 8];
System.Security.Cryptography.ProtectedData (7)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
43Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit
System\Security\Cryptography\ProtectedData.cs (6)
104Span<byte> destination, 144Span<byte> destination, 257Span<byte> destination, 297Span<byte> destination, 328Span<byte> outputSpan = default) 354Span<byte> interopSpan = default;
System.Security.Cryptography.Xml (8)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
System.Security.Principal.Windows (3)
_generated\0\LibraryImports.g.cs (1)
422global::System.Span<global::Interop.Advapi32.MARSHALLED_UNICODE_STRING.Marshaller.Native> __names_native__nativeSpan = __names_native__marshaller.GetUnmanagedValuesDestination();
System\Security\Principal\SID.cs (2)
447Span<int> subAuthorities = stackalloc int[MaxSubAuthorities]; 716Span<char> result = stackalloc char[189];
System.ServiceModel.NetFramingBase (2)
System\ServiceModel\Channels\Connection.cs (1)
240public override int Read(Span<byte> buffer)
System\ServiceModel\Channels\FramingEncoders.cs (1)
19var span = bytes.Span;
System.ServiceProcess.ServiceController (7)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\ServiceProcess\ServiceBase.cs (1)
585Span<SERVICE_TABLE_ENTRY> entries = new Span<SERVICE_TABLE_ENTRY>((void*)entriesPointer, services.Length + 1);
System.Speech (1)
src\runtime\src\libraries\Common\src\Interop\Windows\WinMm\Interop.waveOutGetDevCaps.cs (1)
60Span<char> szPnameSpan = szPname;
System.Text.Encoding.CodePages (2)
System\Text\BaseCodePageEncoding.netcoreapp.cs (2)
14private static unsafe void ReadCodePageIndex(Stream stream, Span<byte> codePageIndex) 53Span<byte> pCodePageIndex = new Span<byte>(&codePageIndex, sizeof(CodePageIndex));
System.Text.Encodings.Web (51)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (1)
69Span<uint> thisAllowedCharactersBitmap = new Span<uint>(pBitmap, BitmapLengthInDWords);
System\Text\Encodings\Web\DefaultHtmlEncoder.cs (6)
35private protected override OperationStatus EncodeCore(ReadOnlySpan<char> source, Span<char> destination, out int charsConsumed, out int charsWritten, bool isFinalBlock) 38private protected override OperationStatus EncodeUtf8Core(ReadOnlySpan<byte> utf8Source, Span<byte> utf8Destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) 67internal override int EncodeUtf8(Rune value, Span<byte> destination) 99static int TryEncodeScalarAsHex(object @this, uint scalarValue, Span<byte> destination) 133internal override int EncodeUtf16(Rune value, Span<char> destination) 165static int TryEncodeScalarAsHex(object @this, uint scalarValue, Span<char> destination)
System\Text\Encodings\Web\DefaultJavaScriptEncoder.cs (6)
47private protected override OperationStatus EncodeCore(ReadOnlySpan<char> source, Span<char> destination, out int charsConsumed, out int charsWritten, bool isFinalBlock) 50private protected override OperationStatus EncodeUtf8Core(ReadOnlySpan<byte> utf8Source, Span<byte> utf8Destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) 113internal override int EncodeUtf8(Rune value, Span<byte> destination) 129static int TryEncodeScalarAsHex(object @this, Rune value, Span<byte> destination) 164internal override int EncodeUtf16(Rune value, Span<char> destination) 180static int TryEncodeScalarAsHex(object @this, Rune value, Span<char> destination)
System\Text\Encodings\Web\DefaultUrlEncoder.cs (4)
110private protected override OperationStatus EncodeCore(ReadOnlySpan<char> source, Span<char> destination, out int charsConsumed, out int charsWritten, bool isFinalBlock) 113private protected override OperationStatus EncodeUtf8Core(ReadOnlySpan<byte> utf8Source, Span<byte> utf8Destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) 142internal override int EncodeUtf8(Rune value, Span<byte> destination) 171internal override int EncodeUtf16(Rune value, Span<char> destination)
System\Text\Encodings\Web\OptimizedInboxTextEncoder.Ascii.cs (1)
40Span<char> tempBuffer = stackalloc char[8] { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' };
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (5)
73Span<byte> allowedAsciiBytes = stackalloc byte[128]; 74Span<char> allowedAsciiChars = stackalloc char[128]; 102Span<char> destination = new Span<char>(buffer, bufferLength); 133public OperationStatus Encode(ReadOnlySpan<char> source, Span<char> destination, out int charsConsumed, out int charsWritten, bool isFinalBlock) 252public OperationStatus EncodeUtf8(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock)
System\Text\Encodings\Web\ScalarEscaperBase.cs (2)
11internal abstract int EncodeUtf16(Rune value, Span<char> destination); 12internal abstract int EncodeUtf8(Rune value, Span<byte> destination);
System\Text\Encodings\Web\TextEncoder.cs (12)
42private unsafe bool TryEncodeUnicodeScalar(uint unicodeScalar, Span<char> buffer, out int charsWritten) 50private bool TryEncodeUnicodeScalarUtf8(uint unicodeScalar, Span<char> utf16ScratchBuffer, Span<byte> utf8Destination, out int bytesWritten) 166Span<char> destBuffer = stringBuilder.AppendSpan(Math.Max(remainingInput.Length, minBufferBumpEachIteration)); 279Span<byte> utf8Destination, 324Span<byte> utf8Destination, 333Span<char> utf16ScratchBuffer = stackalloc char[TempUtf16CharBufferLength]; 409Span<char> destination, 452private protected virtual OperationStatus EncodeCore(ReadOnlySpan<char> source, Span<char> destination, out int charsConsumed, out int charsWritten, bool isFinalBlock) 522Span<char> scratchBuffer = rentedArray; 576internal static bool TryCopyCharacters(string source, Span<char> destination, out int numberOfCharactersWritten) 596internal static bool TryWriteScalarAsChar(int unicodeScalar, Span<char> destination, out int numberOfCharactersWritten)
System.Text.Json (295)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (2)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\runtime\src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = MinimumBufferSize)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
src\runtime\src\libraries\System.Text.Json\Common\JsonCamelCaseNamingPolicy.cs (1)
28private static void FixCasing(Span<char> chars)
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
73Span<T> span = CollectionsMarshal.AsSpan(items); 78Span<(TKey, int)> keys = span.Length <= StackallocThreshold
src\runtime\src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
46Span<char> destination = initialBufferLength <= JsonConstants.StackallocCharThreshold 175void WriteChar(char value, ref Span<char> destination) 185void ExpandBuffer(ref Span<char> destination)
System\Text\Json\Document\JsonDocument.cs (1)
312Span<byte> otherUtf8Text = length <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\Document\JsonDocument.MetadataDb.cs (5)
271Span<byte> destination = _data.AsSpan(index + SizeOrLengthOffset); 280Span<byte> dataPos = _data.AsSpan(index + NumberOfRowsOffset); 293Span<byte> dataPos = _data.AsSpan(index + SizeOrLengthOffset); 308Span<byte> data = _data.AsSpan(0, Length); 377Span<int> newDbInts = MemoryMarshal.Cast<byte, int>(newDatabase.AsSpan());
System\Text\Json\Document\JsonDocument.Parse.cs (1)
648Span<byte> rentedSpan = rented.AsSpan(0, length);
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (4)
32Span<byte> utf8Name = stackalloc byte[JsonConstants.StackallocByteThreshold]; 78Span<byte> utf8Name = default; 142Span<byte> utf8UnescapedStack = stackalloc byte[JsonConstants.StackallocByteThreshold]; 187Span<byte> utf8Unescaped = remaining <= utf8UnescapedStack.Length ?
System\Text\Json\JsonEncodedText.cs (1)
83Span<byte> utf8Bytes = expectedByteCount <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\JsonHelpers.cs (2)
206Span<char> charBuffer = utf8Key.Length <= JsonConstants.StackallocCharThreshold ? 211Span<char> decodedKey = charBuffer[0..charsWritten];
System\Text\Json\JsonHelpers.Escaping.cs (2)
40Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 68Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\Nodes\JsonArray.cs (1)
252Span<char> chars = stackalloc char[JsonConstants.MaximumFormatUInt32Length];
System\Text\Json\Reader\JsonReaderHelper.cs (3)
182Span<byte> sourceUnescaped = stackalloc byte[JsonConstants.MaximumEscapedDateTimeOffsetParseLength]; 230Span<byte> sourceUnescaped = stackalloc byte[JsonConstants.MaximumEscapedDateTimeOffsetParseLength]; 280Span<byte> utf8Unescaped = stackalloc byte[JsonConstants.MaximumEscapedGuidLength];
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (16)
18Span<byte> utf8Unescaped = utf8Source.Length <= JsonConstants.StackallocByteThreshold ? 48Span<byte> utf8Unescaped = length <= JsonConstants.StackallocByteThreshold ? 75Span<byte> utf8Unescaped = length <= JsonConstants.StackallocByteThreshold ? 100Span<byte> utf8Unescaped = utf8Source.Length <= JsonConstants.StackallocByteThreshold ? 131Span<byte> utf8Unescaped = length <= JsonConstants.StackallocByteThreshold ? 135Span<byte> utf8Escaped = length <= JsonConstants.StackallocByteThreshold ? 173Span<byte> utf8Unescaped1 = utf8Source1.Length <= JsonConstants.StackallocByteThreshold ? 177Span<byte> utf8Unescaped2 = utf8Source2.Length <= JsonConstants.StackallocByteThreshold ? 206public static bool TryDecodeBase64InPlace(Span<byte> utf8Unescaped, [NotNullWhen(true)] out byte[]? bytes) 222Span<byte> byteSpan = utf8Unescaped.Length <= JsonConstants.StackallocByteThreshold ? 270public static int TranscodeHelper(ReadOnlySpan<byte> utf8Unescaped, Span<char> destination) 334internal static int GetUtf8FromText(ReadOnlySpan<char> text, Span<byte> dest) 356internal static void Unescape(ReadOnlySpan<byte> source, Span<byte> destination, out int written) 367internal static void Unescape(ReadOnlySpan<byte> source, Span<byte> destination, int idx, out int written) 380internal static bool TryUnescape(ReadOnlySpan<byte> source, Span<byte> destination, out int written) 391private static bool TryUnescape(ReadOnlySpan<byte> source, Span<byte> destination, int idx, out int written)
System\Text\Json\Reader\Utf8JsonReader.cs (1)
538scoped Span<byte> otherUtf8Text;
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (1)
542Span<byte> readSoFar = stackalloc byte[JsonConstants.MaximumLiteralLength];
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (11)
69public readonly int CopyString(Span<byte> utf8Destination) 79internal readonly int CopyValue(Span<byte> utf8Destination) 133public readonly int CopyString(Span<char> destination) 143internal readonly unsafe int CopyValue(Span<char> destination) 156Span<byte> unescapedBuffer = valueLength <= JsonConstants.StackallocByteThreshold ? 171Span<byte> intermediate = valueLength <= JsonConstants.StackallocByteThreshold ? 195private readonly unsafe bool TryCopyEscapedString(Span<byte> destination, out int bytesWritten) 208Span<byte> intermediate = sequenceLength <= JsonConstants.StackallocByteThreshold ? 1257Span<byte> stackSpan = stackalloc byte[JsonConstants.MaximumEscapedDateTimeOffsetParseLength]; 1302Span<byte> stackSpan = stackalloc byte[JsonConstants.MaximumEscapedDateTimeOffsetParseLength]; 1348Span<byte> stackSpan = stackalloc byte[JsonConstants.MaximumEscapedGuidLength];
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (1)
25Span<char> buffer = stackalloc char[MaxEscapedCharacterLength];
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (3)
45Span<byte> stackSpan = stackalloc byte[MaxEscapedFormatLength]; 67Span<byte> buffer = stackalloc byte[FormatLength]; 75Span<byte> buffer = stackalloc byte[FormatLength];
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
244Span<char> charBuffer = bufferLength <= JsonConstants.StackallocCharThreshold
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (6)
55Span<byte> byteBuffer = bufferLength <= JsonConstants.StackallocByteThreshold 79Span<byte> buffer = stackalloc byte[MaxFormatLength]; 92Span<byte> buffer = stackalloc byte[MaxFormatLength]; 134Span<byte> buffer = stackalloc byte[MaxFormatLength + 2]; 160scoped Span<byte> buffer; 228Span<byte> destination,
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (5)
52Span<byte> buffer = bufferLength <= JsonConstants.StackallocByteThreshold 72Span<byte> buffer = stackalloc byte[MaxFormatLength]; 85Span<byte> buffer = stackalloc byte[MaxFormatLength]; 111Span<byte> buffer = stackalloc byte[MaxFormatLength + 2]; 132Span<byte> destination,
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (3)
49Span<byte> stackSpan = stackalloc byte[MaximumEscapedTimeOnlyFormatLength]; 81Span<byte> output = stackalloc byte[MaximumTimeOnlyFormatLength]; 91Span<byte> output = stackalloc byte[MaximumTimeOnlyFormatLength];
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (3)
49Span<byte> stackSpan = stackalloc byte[MaximumEscapedTimeSpanFormatLength]; 79Span<byte> output = stackalloc byte[MaximumTimeSpanFormatLength]; 89Span<byte> output = stackalloc byte[MaximumTimeSpanFormatLength];
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (5)
52Span<byte> buffer = bufferLength <= JsonConstants.StackallocByteThreshold 72Span<byte> buffer = stackalloc byte[MaxFormatLength]; 85Span<byte> buffer = stackalloc byte[MaxFormatLength]; 111Span<byte> buffer = stackalloc byte[MaxFormatLength + 2]; 132Span<byte> destination,
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (3)
41Span<byte> utf8Buffer = bufferLength <= JsonConstants.StackallocByteThreshold 108Span<byte> span = stackalloc byte[MaximumFormattedVersionLength]; 127Span<byte> span = stackalloc byte[MaximumFormattedVersionLength];
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
387Span<byte> utf8 = 418Span<byte> utf8 =
System\Text\Json\Serialization\JsonSerializer.Write.Pipe.cs (1)
283Span<byte> dest = utf8Json.GetSpan(1);
System\Text\Json\Serialization\JsonSerializer.Write.Stream.cs (1)
427Span<byte> dest = bufferWriter.GetSpan(1);
System\Text\Json\ThrowHelper.Serialization.cs (1)
382Span<char> builder = stackalloc char[MaxLength + 3];
System\Text\Json\Writer\JsonWriterHelper.cs (4)
14public static void WriteIndentation(Span<byte> buffer, int indent, byte indentByte) 278internal static OperationStatus ToUtf8(ReadOnlySpan<char> source, Span<byte> destination, out int written) 316Span<byte> quotedValue = quotedLength > JsonConstants.StackallocByteThreshold 343scoped Span<byte> escapedValue;
System\Text\Json\Writer\JsonWriterHelper.Date.cs (5)
15public static unsafe void WriteDateTimeTrimmed(Span<byte> buffer, DateTime value, out int bytesWritten) 17Span<byte> tempSpan = stackalloc byte[JsonConstants.MaximumFormatDateTimeOffsetLength]; 24public static unsafe void WriteDateTimeOffsetTrimmed(Span<byte> buffer, DateTimeOffset value, out int bytesWritten) 26Span<byte> tempSpan = stackalloc byte[JsonConstants.MaximumFormatDateTimeOffsetLength]; 43public static void TrimDateTimeOffset(Span<byte> buffer, out int bytesWritten)
System\Text\Json\Writer\JsonWriterHelper.Escaping.cs (8)
87private static void EscapeString(ReadOnlySpan<byte> value, Span<byte> destination, JavaScriptEncoder encoder, ref int consumed, ref int written, bool isFinalBlock) 107public static void EscapeString(ReadOnlySpan<byte> value, Span<byte> destination, int indexOfFirstByteToEscape, JavaScriptEncoder? encoder, out int written) 110public static void EscapeString(ReadOnlySpan<byte> value, Span<byte> destination, int indexOfFirstByteToEscape, JavaScriptEncoder? encoder, out int consumed, out int written, bool isFinalBlock = true) 159private static void EscapeNextBytes(byte value, Span<byte> destination, ref int written) 205private static void EscapeString(ReadOnlySpan<char> value, Span<char> destination, JavaScriptEncoder encoder, ref int consumed, ref int written, bool isFinalBlock) 225public static void EscapeString(ReadOnlySpan<char> value, Span<char> destination, int indexOfFirstByteToEscape, JavaScriptEncoder? encoder, out int written) 228public static void EscapeString(ReadOnlySpan<char> value, Span<char> destination, int indexOfFirstByteToEscape, JavaScriptEncoder? encoder, out int consumed, out int written, bool isFinalBlock = true) 277private static void EscapeNextChars(char value, Span<char> destination, ref int written)
System\Text\Json\Writer\Utf8JsonWriter.cs (12)
58private Span<byte> PartialStringDataRaw => _partialStringData; 140Span<byte> partialStringDataBytes = PartialStringDataRaw; 168Span<byte> partialStringDataBytes = PartialStringDataRaw; 196Span<byte> partialStringDataBytes = PartialStringDataRaw; 643Span<byte> output = _memory.Span; 722Span<byte> output = _memory.Span; 868Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 1017Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 1081Span<byte> output = _memory.Span; 1162Span<byte> output = _memory.Span; 1174private void WriteNewLine(Span<byte> output) 1185private void WriteIndentation(Span<byte> buffer, int indent)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (6)
143Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 166Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 221Span<byte> output = _memory.Span; 256Span<byte> output = _memory.Span; 295Span<byte> output = _memory.Span; 345Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (7)
150Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 173Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 226Span<byte> output = _memory.Span; 259Span<byte> output = _memory.Span; 297Span<byte> output = _memory.Span; 345Span<byte> output = _memory.Span; 381Span<byte> buffer = stackalloc byte[JsonConstants.MaximumFormatDateTimeOffsetLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (7)
149Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 172Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 225Span<byte> output = _memory.Span; 258Span<byte> output = _memory.Span; 296Span<byte> output = _memory.Span; 344Span<byte> output = _memory.Span; 380Span<byte> buffer = stackalloc byte[JsonConstants.MaximumFormatDateTimeOffsetLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (7)
149Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 172Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 225Span<byte> output = _memory.Span; 255Span<byte> output = _memory.Span; 290Span<byte> output = _memory.Span; 335Span<byte> output = _memory.Span; 368Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatDecimalLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (7)
153Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 176Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 229Span<byte> output = _memory.Span; 259Span<byte> output = _memory.Span; 294Span<byte> output = _memory.Span; 339Span<byte> output = _memory.Span; 373Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatDoubleLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (7)
153Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 176Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 229Span<byte> output = _memory.Span; 259Span<byte> output = _memory.Span; 294Span<byte> output = _memory.Span; 339Span<byte> output = _memory.Span; 372Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatSingleLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (2)
123Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 146Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (7)
149Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 172Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 225Span<byte> output = _memory.Span; 259Span<byte> output = _memory.Span; 298Span<byte> output = _memory.Span; 347Span<byte> output = _memory.Span; 384Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatGuidLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (5)
87Span<byte> output = _memory.Span; 118Span<byte> output = _memory.Span; 160Span<byte> output = _memory.Span; 191Span<byte> output = _memory.Span; 220private void TranscodeAndWrite(ReadOnlySpan<char> escapedPropertyName, Span<byte> output)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (8)
268Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 291Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 345Span<byte> output = _memory.Span; 375Span<byte> output = _memory.Span; 408Span<byte> output = _memory.Span; 438Span<byte> output = _memory.Span; 483Span<byte> output = _memory.Span; 515Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatBooleanLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (7)
222Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 245Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 298Span<byte> output = _memory.Span; 328Span<byte> output = _memory.Span; 363Span<byte> output = _memory.Span; 408Span<byte> output = _memory.Span; 444Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatInt64Length];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (27)
115scoped Span<char> escapedPropertyName; 170Span<byte> output = _memory.Span; 201Span<byte> output = _memory.Span; 274scoped Span<byte> escapedPropertyName; 330Span<byte> output = _memory.Span; 359Span<byte> output = _memory.Span; 388Span<byte> output = _memory.Span; 903Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 926Span<char> escapedValue = length <= JsonConstants.StackallocCharThreshold ? 949Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 972Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 1069scoped Span<char> escapedValue; 1089scoped Span<char> escapedPropertyName; 1129scoped Span<byte> escapedValue; 1149scoped Span<byte> escapedPropertyName; 1189scoped Span<byte> escapedValue; 1209scoped Span<char> escapedPropertyName; 1249scoped Span<char> escapedValue; 1269scoped Span<byte> escapedPropertyName; 1369Span<byte> output = _memory.Span; 1403Span<byte> output = _memory.Span; 1440Span<byte> output = _memory.Span; 1476Span<byte> output = _memory.Span; 1515Span<byte> output = _memory.Span; 1564Span<byte> output = _memory.Span; 1616Span<byte> output = _memory.Span; 1667Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (7)
231Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 254Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 307Span<byte> output = _memory.Span; 337Span<byte> output = _memory.Span; 372Span<byte> output = _memory.Span; 417Span<byte> output = _memory.Span; 453Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatUInt64Length];
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (2)
74Span<byte> output = _memory.Span; 114Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (4)
91Span<byte> output = _memory.Span; 125Span<byte> output = _memory.Span; 204Span<byte> output = _memory.Span; 231Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (2)
51Span<byte> output = _memory.Span; 79Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (2)
52Span<byte> output = _memory.Span; 80Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (3)
51Span<byte> output = _memory.Span; 75Span<byte> output = _memory.Span; 99Span<byte> utf8Number = stackalloc byte[JsonConstants.MaximumFormatDecimalLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (4)
55Span<byte> output = _memory.Span; 79Span<byte> output = _memory.Span; 101private static bool TryFormatDouble(double value, Span<byte> destination, out int bytesWritten) 147Span<byte> utf8Number = stackalloc byte[JsonConstants.MaximumFormatDoubleLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (4)
55Span<byte> output = _memory.Span; 79Span<byte> output = _memory.Span; 101private static bool TryFormatSingle(float value, Span<byte> destination, out int bytesWritten) 147Span<byte> utf8Number = stackalloc byte[JsonConstants.MaximumFormatSingleLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (2)
56Span<byte> output = _memory.Span; 81Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (2)
51Span<byte> output = _memory.Span; 80Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (2)
128private void Base64EncodeAndWrite(ReadOnlySpan<byte> bytes, Span<byte> output) 130Span<byte> destination = output.Slice(BytesPending);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (2)
75Span<byte> output = _memory.Span; 99Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (3)
180Span<byte> output = _memory.Span; 203Span<byte> utf8Json = 268Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (3)
64Span<byte> output = _memory.Span; 88Span<byte> output = _memory.Span; 112Span<byte> utf8Number = stackalloc byte[JsonConstants.MaximumFormatInt64Length];
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (6)
129Span<byte> output = _memory.Span; 157Span<byte> output = _memory.Span; 190Span<char> escapedValue = length <= JsonConstants.StackallocCharThreshold ? 277Span<byte> output = _memory.Span; 307Span<byte> output = _memory.Span; 341Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (11)
71Span<char> combinedBuffer = ['\0', '\0']; 142Span<char> escapedValue = length <= JsonConstants.StackallocCharThreshold ? 175Span<byte> output = _memory.Span; 239Span<byte> combinedBuffer = [0, 0, 0, 0]; 308Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 341Span<byte> output = _memory.Span; 406Span<byte> combinedBuffer = [0, 0, 0]; 454Span<byte> output = _memory.Span; 485Span<byte> output = _memory.Span; 514Span<byte> output = _memory.Span; 538private static int ConcatInto<T>(ReadOnlySpan<T> srcLeft, ReadOnlySpan<T> srcRight, Span<T> dest)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (3)
66Span<byte> output = _memory.Span; 90Span<byte> output = _memory.Span; 114Span<byte> utf8Number = stackalloc byte[JsonConstants.MaximumFormatUInt64Length];
System.Text.Json.SourceGeneration (14)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T?> scratchBuffer) 52Span<T> span = _span; 68Span<T> span = _span; 107public Span<T> AppendSpan(int length) 112Span<T> span = _span; 125private Span<T> AppendSpanWithGrow(int length) 149public bool TryCopyTo(Span<T> destination, out int itemsWritten)
src\runtime\src\libraries\System.Text.Json\Common\JsonCamelCaseNamingPolicy.cs (1)
28private static void FixCasing(Span<char> chars)
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
73Span<T> span = CollectionsMarshal.AsSpan(items); 78Span<(TKey, int)> keys = span.Length <= StackallocThreshold
src\runtime\src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
46Span<char> destination = initialBufferLength <= JsonConstants.StackallocCharThreshold 175void WriteChar(char value, ref Span<char> destination) 185void ExpandBuffer(ref Span<char> destination)
System.Text.RegularExpressions (55)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T?> scratchBuffer) 52Span<T> span = _span; 68Span<T> span = _span; 107public Span<T> AppendSpan(int length) 112Span<T> span = _span; 125private Span<T> AppendSpanWithGrow(int length) 149public bool TryCopyTo(Span<T> destination, out int itemsWritten)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Text\RegularExpressions\Regex.Replace.cs (1)
676Span<ReadOnlyMemory<char>> span = segments.AsSpan();
System\Text\RegularExpressions\RegexCharClass.cs (8)
519public static bool TryGetOnlyCategories(string set, Span<UnicodeCategory> categories, out int numCategories, out bool negated) 697public static int GetSetChars(string set, Span<char> chars) 800Span<UnicodeCategory> categories1 = stackalloc UnicodeCategory[16], categories2 = stackalloc UnicodeCategory[16]; 920Span<UnicodeCategory> categories1 = stackalloc UnicodeCategory[16], categories2 = stackalloc UnicodeCategory[16]; 1027public static bool SetContainsAsciiOrdinalIgnoreCaseCharacter(string set, Span<char> twoChars) 1642Span<char> headerSpan = vsb.AppendSpan(SetStartIndex); 1885Span<char> scratch = stackalloc char[32]; 1982Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
System\Text\RegularExpressions\RegexCompiler.cs (5)
1933Span<char> setChars = stackalloc char[SetCharsSize]; 5456Span<char> setChars = stackalloc char[128]; 5527Span<char> setChars = stackalloc char[128]; // arbitrary cut-off that accommodates all of ASCII and doesn't take too long to compute 5954Span<UnicodeCategory> categories = [default]; // handle the case of one and only one category 5972Span<char> setChars = ['\0', '\0', '\0'];
System\Text\RegularExpressions\RegexFindOptimizations.cs (2)
128Span<char> scratch = stackalloc char[5]; // max efficiently optimized by IndexOfAny today without SearchValues, which isn't used for RTL 349Span<char> scratch = stackalloc char[64];
System\Text\RegularExpressions\RegexNode.cs (4)
1401Span<char> scratchChar = ['\0']; 1576Span<char> setChars = stackalloc char[SetCharsSize]; 1691Span<char> setChars = stackalloc char[128]; 3110Span<char> twoChars = ['\0', '\0'];
System\Text\RegularExpressions\RegexParser.cs (1)
55private RegexParser(string pattern, RegexOptions options, CultureInfo culture, Hashtable caps, int capsize, Hashtable? capnames, Span<int> optionSpan)
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (3)
73Span<char> setChars = stackalloc char[MaxPrefixes]; // limit how many chars we get from a set based on the max prefixes we care about 553Span<char> scratch = stackalloc char[128]; 1235Span<char> chars = stackalloc char[5]; // maximum number of chars optimized by IndexOfAny
System\Text\RegularExpressions\RegexReplacement.cs (1)
262Span<int> span = state.offsetAndCounts.AsSpan();
System\Text\RegularExpressions\RegexWriter.cs (2)
36private RegexWriter(RegexTree tree, Span<int> emittedSpan, Span<int> intStackSpan)
System\Text\RegularExpressions\Symbolic\MintermClassifier.cs (1)
54Span<object> charRangesPerMinterm = arrayPoolArray.AsSpan(0, minterms.Length);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (2)
379Span<bool> categoryCodes = stackalloc bool[UnicodeCategoryCount]; 477BDD MapCategoryCodeSetToCondition(Span<bool> catCodes)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (2)
127private Span<int> GetDeltasFor(MatchingState<TSet> state) 141private Span<int[]?> GetNfaDeltasFor(MatchingState<TSet> state)
System\Text\StructListBuilder.cs (1)
27public Span<T> AsSpan() => _array.AsSpan(0, _count);
System.Text.RegularExpressions.Generator (53)
RegexGenerator.Emitter.cs (6)
682Span<UnicodeCategory> categories = stackalloc UnicodeCategory[5]; // arbitrary limit to keep names from being too unwieldy 1873Span<char> setChars = stackalloc char[SetCharsSize]; 5100Span<char> setChars = stackalloc char[128]; 5252Span<UnicodeCategory> categories = stackalloc UnicodeCategory[30]; // number of UnicodeCategory values (though it's unheard of to have a set with all of them) 5271Span<char> setChars = stackalloc char[3]; 5694Span<UnicodeCategory> categories = stackalloc UnicodeCategory[1];
src\runtime\src\libraries\Common\src\Polyfills\EncodingPolyfills.cs (4)
29public static int GetBytes(this Encoding encoding, string str, Span<byte> bytes) 34public static unsafe int GetBytes(this Encoding encoding, ReadOnlySpan<char> chars, Span<byte> bytes) 43public static unsafe int GetChars(this Encoding encoding, ReadOnlySpan<byte> bytes, Span<char> chars) 60public static bool TryGetChars(this Encoding encoding, ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T?> scratchBuffer) 52Span<T> span = _span; 68Span<T> span = _span; 107public Span<T> AppendSpan(int length) 112Span<T> span = _span; 125private Span<T> AppendSpanWithGrow(int length) 149public bool TryCopyTo(Span<T> destination, out int itemsWritten)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (9)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 226Span<char> result = (bytes.Length > 16) ? 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (8)
519public static bool TryGetOnlyCategories(string set, Span<UnicodeCategory> categories, out int numCategories, out bool negated) 697public static int GetSetChars(string set, Span<char> chars) 800Span<UnicodeCategory> categories1 = stackalloc UnicodeCategory[16], categories2 = stackalloc UnicodeCategory[16]; 920Span<UnicodeCategory> categories1 = stackalloc UnicodeCategory[16], categories2 = stackalloc UnicodeCategory[16]; 1027public static bool SetContainsAsciiOrdinalIgnoreCaseCharacter(string set, Span<char> twoChars) 1642Span<char> headerSpan = vsb.AppendSpan(SetStartIndex); 1885Span<char> scratch = stackalloc char[32]; 1982Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (2)
128Span<char> scratch = stackalloc char[5]; // max efficiently optimized by IndexOfAny today without SearchValues, which isn't used for RTL 349Span<char> scratch = stackalloc char[64];
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (4)
1401Span<char> scratchChar = ['\0']; 1576Span<char> setChars = stackalloc char[SetCharsSize]; 1691Span<char> setChars = stackalloc char[128]; 3110Span<char> twoChars = ['\0', '\0'];
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (1)
55private RegexParser(string pattern, RegexOptions options, CultureInfo culture, Hashtable caps, int capsize, Hashtable? capnames, Span<int> optionSpan)
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (3)
73Span<char> setChars = stackalloc char[MaxPrefixes]; // limit how many chars we get from a set based on the max prefixes we care about 553Span<char> scratch = stackalloc char[128]; 1235Span<char> chars = stackalloc char[5]; // maximum number of chars optimized by IndexOfAny
Stubs.cs (2)
41Span<char> span = length <= 256 ? stackalloc char[length] : new char[length]; 72internal delegate void SpanAction<T, in TArg>(Span<T> span, TArg arg);
System.Threading.AccessControl (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
43Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit
System.Web.HttpUtility (22)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (8)
75public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 85public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 185public static void EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> utf8Destination, Casing casing = Casing.Upper) 202public static void EncodeToUtf16(ReadOnlySpan<byte> source, Span<char> destination, Casing casing = Casing.Upper) 274public static bool TryDecodeFromUtf8(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 286public static bool TryDecodeFromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed) 454private static bool TryDecodeFromUtf8_Scalar(ReadOnlySpan<byte> utf8Source, Span<byte> destination, out int bytesProcessed) 489private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> source, Span<byte> destination, out int charsProcessed)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
17private Span<char> _chars; 20public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 146Span<char> chars = _chars; 201Span<char> dst = _chars.Slice(_pos, count); 222public Span<char> AppendSpan(int length)
System\Web\HttpUtility.cs (1)
206Span<byte> bytes = stackalloc byte[StackallocThreshold];
System\Web\Util\HttpEncoder.cs (7)
212Span<byte> decodedBytes = count <= StackallocThreshold ? stackalloc byte[StackallocThreshold] : new byte[count]; 464Span<byte> byteSpan = stackalloc byte[StackallocThreshold]; 620private readonly Span<char> _charBuffer; 624private readonly Span<byte> _byteBuffer; 639internal UrlDecoder(Span<char> charBuffer, Span<byte> byteBuffer, Encoding encoding) 678Span<char> chars = _charBuffer.Slice(0, _numChars);
System.Windows.Forms (50)
System\Windows\Forms\ActiveX\AxHost.VBFormat.cs (1)
51Span<char> buffer = new(lpBuffer, cb / sizeof(char));
System\Windows\Forms\ActiveX\DataStreamFromComStream.cs (2)
59Span<byte> span = new(buffer, index, count); 71public override int Read(Span<byte> buffer)
System\Windows\Forms\Control.cs (1)
2264Span<char> buffer = stackalloc char[PInvokeCore.MaxClassName];
System\Windows\Forms\Controls\ComboBox\ComboBox.AutoCompleteDropDownFinder.cs (1)
39Span<char> buffer = stackalloc char[AutoCompleteClassName.Length + 2];
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (1)
1317Span<SYSTEMTIME> times = [(SYSTEMTIME)min, (SYSTEMTIME)max];
System\Windows\Forms\Controls\Labels\LinkArea.LinkAreaConverter.cs (1)
62Span<int> values = stackalloc int[2];
System\Windows\Forms\Controls\Labels\LinkConverter.cs (1)
58Span<int> values = stackalloc int[2];
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (2)
39Span<Range> rgbs = stackalloc Range[4]; 41Span<int> rgb = stackalloc int[3];
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (7)
335internal void FillMonthDayStates(Span<uint> monthDayStates, SelectionRange displayRange) 1079private void WriteBoldDates(Span<int> boldDates) 1250Span<SYSTEMTIME> times = stackalloc SYSTEMTIME[2]; 1738Span<SYSTEMTIME> times = [(SYSTEMTIME)minDate, (SYSTEMTIME)maxDate]; 1815Span<uint> monthDayStates = stackalloc uint[monthsCount]; 1884Span<SYSTEMTIME> times = [(SYSTEMTIME)lower, (SYSTEMTIME)upper]; 2120Span<int> boldDates = new((int*)nmmcds->prgDayState, nmmcds->cDayState);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (1)
286Span<char> name = stackalloc char[20];
System\Windows\Forms\Controls\MonthCalendar\SelectionRangeConverter.cs (1)
62Span<DateTime> values = stackalloc DateTime[2];
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (1)
497Span<(Color OldColor, Color NewColor)> map =
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
663Span<Point> arrow = stackalloc Point[3];
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (1)
834Span<char> charSpan = stackalloc char[1];
System\Windows\Forms\Dialogs\CommonDialogs\ColorDialog.cs (2)
82Span<COLORREF> customColors = _customColors; 168Span<COLORREF> customColors = stackalloc COLORREF[16];
System\Windows\Forms\Help\Help.cs (1)
224Span<char> buffer = stackalloc char[(int)PInvokeCore.MAX_PATH + 1];
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanelCellPositionTypeConverter.cs (1)
46Span<int> values = stackalloc int[2];
System\Windows\Forms\Printing\PageSetupDialog.cs (1)
285Span<char> buffer = stackalloc char[2];
System\Windows\Forms\Rendering\ControlPaint.cs (13)
203Span<RGBQUAD> colors = new(bi + sizeof(BITMAPINFOHEADER), (int)entryCount); 204Span<PALETTEENTRY> entries = stackalloc PALETTEENTRY[(int)entryCount]; 616Span<int> allData = buffer; 617Span<int> topLineLefts = allData[..topWidth]; 619Span<int> topLineRights = allData[..topWidth]; 621Span<int> leftLineTops = allData[..leftWidth]; 623Span<int> leftLineBottoms = allData[..leftWidth]; 625Span<int> bottomLineLefts = allData[..bottomWidth]; 627Span<int> bottomLineRights = allData[..bottomWidth]; 629Span<int> rightLineTops = allData[..rightWidth]; 631Span<int> rightLineBottoms = allData[..rightWidth]; 1488Span<(Color OldColor, Color NewColor)> map = 1643Span<float> array =
System\Windows\Forms\SendKeys\SendKeys.cs (5)
309private static unsafe void GetKeyboardState(Span<byte> keystate) 337Span<byte> keystate = stackalloc byte[256]; 636Span<INPUT> currentInput = stackalloc INPUT[2]; 859Span<INPUT> keyboardInput = stackalloc INPUT[2]; 933Span<byte> oldState = stackalloc byte[256];
System\Windows\Forms\VisualStyles\VisualStyleInformation.cs (3)
42Span<char> filename = stackalloc char[512]; 64Span<char> colorScheme = stackalloc char[512]; 86Span<char> size = stackalloc char[512];
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (2)
517Span<char> filename = stackalloc char[512]; 646Span<char> aString = stackalloc char[512];
System.Windows.Forms.Design (7)
System\ComponentModel\Design\ByteViewer.cs (5)
126Span<char> hexChars = stackalloc char[8]; 183private void DrawDump(Graphics g, ReadOnlySpan<byte> lineBuffer, int line, Span<char> charsBuffer) 186Span<char> charsToDraw = charsBuffer[..lineBuffer.Length]; 203private void DrawHex(Graphics g, ReadOnlySpan<byte> lineBuffer, int line, Span<char> charsBuffer) 410Span<char> text = charsBuffer.Slice(0, bufferSize + 1);
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (1)
305Span<char> chars = stackalloc char[prefix.Length + 36];
System\Windows\Forms\Design\DesignerUtils.cs (1)
662Span<byte> alphaValues = stackalloc byte[256];
System.Windows.Forms.Primitives (77)
_generated\106\Windows.Win32.IAccessible.g.cs (1)
82 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\12\Windows.Win32.byte.InlineArrays.g.cs (2)
43 internal unsafe Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength); 89 internal unsafe Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength);
_generated\120\Windows.Win32.IEnumConnections.g.cs (1)
56 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.System.Com.CONNECTDATA> rgcd, out uint pcFetched)
_generated\123\Windows.Win32.IEnumOLEVERB.g.cs (1)
56 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.System.Ole.OLEVERB> rgelt, uint* pceltFetched)
_generated\125\Windows.Win32.IEnumVARIANT.g.cs (1)
55 internal unsafe winmdroot.Foundation.HRESULT Next(Span<winmdroot.System.Variant.VARIANT> rgVar, out uint pCeltFetched)
_generated\136\Windows.Win32.IFontDisp.g.cs (1)
75 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\141\Windows.Win32.IHTMLCurrentStyle.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\142\Windows.Win32.IHTMLDataTransfer.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\143\Windows.Win32.IHTMLDocument.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\144\Windows.Win32.IHTMLDocument2.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\145\Windows.Win32.IHTMLDocument3.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\146\Windows.Win32.IHTMLDocument4.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\147\Windows.Win32.IHTMLDOMNode.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\148\Windows.Win32.IHTMLElement.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\149\Windows.Win32.IHTMLElement2.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\150\Windows.Win32.IHTMLElement3.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\151\Windows.Win32.IHTMLElementCollection.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\152\Windows.Win32.IHTMLEventObj.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\153\Windows.Win32.IHTMLFiltersCollection.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\154\Windows.Win32.IHTMLFormElement.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\155\Windows.Win32.IHTMLFrameBase.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\156\Windows.Win32.IHTMLFramesCollection2.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\157\Windows.Win32.IHTMLImageElementFactory.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\158\Windows.Win32.IHTMLImgElement.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\159\Windows.Win32.IHTMLLocation.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\160\Windows.Win32.IHTMLMimeTypesCollection.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\161\Windows.Win32.IHTMLOpsProfile.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\162\Windows.Win32.IHTMLOptionElement.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\163\Windows.Win32.IHTMLOptionElementFactory.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\164\Windows.Win32.IHTMLPluginsCollection.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\165\Windows.Win32.IHTMLRect.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\166\Windows.Win32.IHTMLRectCollection.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\167\Windows.Win32.IHTMLRenderStyle.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\168\Windows.Win32.IHTMLRuleStyle.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\169\Windows.Win32.IHTMLScreen.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\170\Windows.Win32.IHTMLSelectionObject.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\171\Windows.Win32.IHTMLStyle.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\172\Windows.Win32.IHTMLStyleSheet.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\173\Windows.Win32.IHTMLStyleSheetRule.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\174\Windows.Win32.IHTMLStyleSheetRulesCollection.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\175\Windows.Win32.IHTMLStyleSheetsCollection.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\176\Windows.Win32.IHTMLWindow2.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\177\Windows.Win32.IHTMLWindow3.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\178\Windows.Win32.IHTMLWindow4.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\19\Windows.Win32.char.InlineArrays.g.cs (5)
44 internal unsafe Span<char> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength); 108 internal unsafe Span<char> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength); 172 internal unsafe Span<char> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength); 236 internal unsafe Span<char> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength); 300 internal unsafe Span<char> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength);
_generated\196\Windows.Win32.int.InlineArrays.g.cs (1)
43 internal unsafe Span<int> AsSpan() => MemoryMarshal.CreateSpan(ref Value[0], SpanLength);
_generated\215\Windows.Win32.IOmHistory.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\216\Windows.Win32.IOmNavigator.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\251\Windows.Win32.ITextDocument.g.cs (1)
75 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\252\Windows.Win32.ITextFont.g.cs (1)
75 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\253\Windows.Win32.ITextPara.g.cs (1)
75 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\256\Windows.Win32.ITextRange.g.cs (1)
75 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\258\Windows.Win32.ITextSelection.g.cs (1)
75 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\259\Windows.Win32.ITextStoryRanges.g.cs (1)
75 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\279\Windows.Win32.IWebBrowser.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\280\Windows.Win32.IWebBrowser2.g.cs (1)
86 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\281\Windows.Win32.IWebBrowserApp.g.cs (1)
74 internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
_generated\414\Windows.Win32.PInvoke.GDI32.dll.g.cs (1)
355 internal static unsafe uint GetSystemPaletteEntries(winmdroot.Graphics.Gdi.HDC hdc, uint iStart, Span<winmdroot.Graphics.Gdi.PALETTEENTRY> pPalEntries)
_generated\425\Windows.Win32.PInvoke.USER32.dll.g.cs (2)
773 internal static unsafe int DrawTextEx(winmdroot.Graphics.Gdi.HDC hdc, ref Span<char>lpchText, int cchText, ref winmdroot.Foundation.RECT lprc, winmdroot.Graphics.Gdi.DRAW_TEXT_FORMAT format, winmdroot.Graphics.Gdi.DRAWTEXTPARAMS? lpdtp) 1478 internal static unsafe winmdroot.Foundation.BOOL GetKeyboardState(Span<byte> lpKeyState)
_generated\479\Windows.Win32.System_Com_IEnumConnections_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Com.IEnumConnections.Interface @this, Span<winmdroot.System.Com.CONNECTDATA> rgcd, out uint pcFetched)
_generated\490\Windows.Win32.System_Ole_IEnumOLEVERB_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Ole.IEnumOLEVERB.Interface @this, Span<winmdroot.System.Ole.OLEVERB> rgelt, uint* pceltFetched)
_generated\491\Windows.Win32.System_Ole_IEnumVARIANT_Extensions.g.cs (1)
24 internal static unsafe winmdroot.Foundation.HRESULT Next(this winmdroot.System.Ole.IEnumVARIANT.Interface @this, Span<winmdroot.System.Variant.VARIANT> rgVar, out uint pCeltFetched)
_generated\616\Windows.Win32.VariableLengthInlineArray.g.cs (1)
41 internal Span<T> AsSpan(int length)
Interop\Richedit\Interop.CHARFORMAT2W.cs (1)
39private Span<char> szFaceName
System\ComponentModel\TypeConverterHelper.cs (1)
28public static bool TryParseAsSpan<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(ITypeDescriptorContext? context, CultureInfo? culture, ReadOnlySpan<char> text, Span<T> output)
System\Windows\Forms\PaddingConverter.cs (1)
36Span<int> values = stackalloc int[4];
Windows\Win32\PInvoke.GetThemeDocumentationProperty.cs (1)
10Span<char> buffer = stackalloc char[512];
Windows\Win32\UI\Controls\LVITEMW.cs (1)
25Span<char> targetSpan = new(pszText, cchTextMax);
Windows\Win32\UI\Shell\NOTIFYICONDATAW.cs (3)
25private Span<char> szTip 36private Span<char> szInfo 47private Span<char> szInfoTitle