551 instantiations of Span
BuildValidator (3)
CompilationDiff.cs (3)
331writeAllBytes(pdbFilePath, new Span<byte>(buildInfo.PdbMetadataReader.MetadataPointer, buildInfo.PdbMetadataReader.MetadataLength)); 439var originalPdbSpan = new Span<byte>(originalInfo.PdbMetadataReader.MetadataPointer, originalInfo.PdbMetadataReader.MetadataLength); 440var rebuildPdbSpan = new Span<byte>(rebuildInfo.PdbMetadataReader.MetadataPointer, rebuildInfo.PdbMetadataReader.MetadataLength);
GenerateDocumentationAndConfigFiles (9)
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));
Interop.FunctionalTests (3)
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);
Metrics (9)
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));
Metrics.Legacy (9)
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.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
UserJwtsTests.cs (1)
687var buffer = new Span<byte>(new byte[key.Length]);
Microsoft.AspNetCore.Components.Server (1)
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.Server.Tests (1)
Circuits\RenderBatchWriterTest.cs (1)
279return new Span<byte>(ms.ToArray(), 0, (int)ms.Length);
Microsoft.AspNetCore.DataProtection (7)
KeyManagement\KeyRingBasedDataProtector.cs (1)
299var span = new Span<byte>(ptr, sizeof(Guid));
Managed\AesGcmAuthenticatedEncryptor.cs (6)
122var nonce = new Span<byte>(ciphertext.Array, nonceOffset, NONCE_SIZE_IN_BYTES); 123var tag = new Span<byte>(ciphertext.Array, tagOffset, TAG_SIZE_IN_BYTES); 124var encrypted = new Span<byte>(ciphertext.Array, encryptedDataOffset, plaintextBytes); 195var nonce = new Span<byte>(retVal, nonceOffset, NONCE_SIZE_IN_BYTES); 196var tag = new Span<byte>(retVal, tagOffset, TAG_SIZE_IN_BYTES); 197var encrypted = new Span<byte>(retVal, encryptedDataOffset, plaintext.Count);
Microsoft.AspNetCore.Http.Connections.Common (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
118_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.OpenApi (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
118_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.Server.HttpSys (7)
RequestProcessing\Response.cs (3)
539unknownHeaders = new Span<HTTP_UNKNOWN_HEADER>(unknownAlloc, numUnknownHeaders); 570knownHeaderInfo = new Span<HTTP_RESPONSE_INFO>(responseAlloc, numKnownMultiHeaders); 584var nativeHeaderValues = new Span<HTTP_KNOWN_HEADER>(headerAlloc, headerValues.Count);
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);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
843return new Span<T>(_pointer, _length);
Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks (1)
RequestHeaderBenchmarks.cs (1)
57var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8);
Microsoft.AspNetCore.Server.HttpSys.Tests (13)
RequestHeaderTests.cs (13)
23var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 64var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 105var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 124var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 143var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 190var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 212var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 234var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 255var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 275var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 297var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 319var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 340var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8);
Microsoft.AspNetCore.Server.IIS (5)
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);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
287return new Span<byte>(NativeRequest->pRawUrl, NativeRequest->RawUrlLength); 843return new Span<T>(_pointer, _length);
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\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.Core.Tests (20)
AsciiDecoding.cs (5)
28var span = new Span<byte>(byteArray); 64Assert.Throws<InvalidOperationException>(() => new Span<byte>(byteRange).GetAsciiString()); 75var span = new Span<byte>(expectedByteRange); 97var span = new Span<byte>(expectedByteRange); 125var span = new Span<byte>(byteArray);
BufferWriterTests.cs (6)
51writer.Write(new Span<byte>(array, 0, 0)); 52writer.Write(new Span<byte>(array, array.Length, 0)); 56writer.Write(new Span<byte>(array, offset, length)); 64writer.Write(new Span<byte>(array, 0, array.Length)); 80writer.Write(new Span<byte>(array, offset, length)); 98writer.Write(new Span<byte>(array, 0, array.Length));
src\Shared\test\Shared.Tests\runtime\Http3\VariableLengthIntegerHelperTests.cs (8)
251Span<byte> span = new Span<byte>(); 266Span<byte> span = new Span<byte>(new byte[1]); 282Span<byte> span = new Span<byte>(new byte[2]); 295Span<byte> span = new Span<byte>(new byte[1]); 310Span<byte> span = new Span<byte>(new byte[4]); 323Span<byte> span = new Span<byte>(new byte[1]); 338Span<byte> span = new Span<byte>(new byte[8]); 351Span<byte> span = new Span<byte>(new byte[1]);
VariableIntHelperTests.cs (1)
26var outputBuffer = new Span<byte>(new byte[8]);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (6)
Mocks\NullParser.cs (6)
26handler.OnHeader(new Span<byte>(_hostHeaderName), new Span<byte>(_hostHeaderValue)); 27handler.OnHeader(new Span<byte>(_acceptHeaderName), new Span<byte>(_acceptHeaderValue)); 28handler.OnHeader(new Span<byte>(_connectionHeaderName), new Span<byte>(_connectionHeaderValue));
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (3)
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\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.Shared.Tests (11)
PathNormalizerTests.cs (1)
83var length = PathNormalizer.RemoveDotSegments(new Span<byte>(data));
runtime\Http3\VariableLengthIntegerHelperTests.cs (8)
251Span<byte> span = new Span<byte>(); 266Span<byte> span = new Span<byte>(new byte[1]); 282Span<byte> span = new Span<byte>(new byte[2]); 295Span<byte> span = new Span<byte>(new byte[1]); 310Span<byte> span = new Span<byte>(new byte[4]); 323Span<byte> span = new Span<byte>(new byte[1]); 338Span<byte> span = new Span<byte>(new byte[8]); 351Span<byte> span = new Span<byte>(new byte[1]);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
287return new Span<byte>(NativeRequest->pRawUrl, NativeRequest->RawUrlLength); 843return new Span<T>(_pointer, _length);
Microsoft.AspNetCore.SignalR.Common (2)
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
118_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
118_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
118_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.AspNetCore.WebUtilities.Tests (3)
HttpRequestStreamReaderTest.cs (3)
272var span = new Span<char>(chars); 291var span = new Span<char>(chars); 459var res = httpRequestStreamReader.Read(new Span<char>(new char[10], 0, 1));
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\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\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.BannedApiAnalyzers (9)
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\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.PerformanceSensitiveAnalyzers (9)
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.PublicApiAnalyzers (9)
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\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)
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));
Storage\SQLite\v2\Interop\SqlConnection.cs (1)
346ThrowIfNotOk(NativeMethods.sqlite3_blob_read(blob, new Span<byte>(bytes, start: 0, length), offset: 0));
Microsoft.DotNet.XUnitAssert.Tests (2)
SpanExtensions.cs (2)
9 return new Span<T>(values); 14 return new Span<char>((value ?? string.Empty).ToCharArray());
Microsoft.Extensions.AI.OpenAI (1)
src\Shared\ServerSentEvents\ArrayBuffer.cs (1)
90public readonly Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
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\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));
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\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));
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.Data.Common (1)
System\Data\SQLTypes\SQLBytes.cs (1)
199Read(offset, new Span<byte>(ref b));
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Activity.cs (1)
2085ActivityTraceId.SetToRandomBytes(new Span<byte>(&id, sizeof(ulong)));
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\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
87Span = new Span<byte>(rented, 0, length)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (4)
115new Span<byte>(bytes, byteIndex, bytes.Length - byteIndex), 123new Span<byte>(bytes, byteCount), 150new Span<char>(chars, charIndex, chars.Length - charIndex), 158new Span<char>(chars, charCount),
System.Formats.Cbor (1)
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)
131return Read(new Span<byte>(ref b)) == 1 ? b : -1;
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.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\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.Mail (1)
System\Net\DelegatedStream.cs (1)
153return ReadInternal(new Span<byte>(ref b)) != 0 ? b : -1;
System.Net.Ping (2)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
31_bytes = new Span<byte>(_arrayToReturnToPool);
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
465new Span<byte>(&ipHeader, sizeof(IpHeader)).CopyTo(result);
System.Net.ServerSentEvents (1)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System.Net.WebClient (1)
src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (1)
51buffer.Slice(0, toCopy).CopyTo(new Span<byte>(_currentChunk._buffer, _currentChunk._freeOffset, toCopy));
System.Private.CoreLib (169)
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\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
31_bytes = new Span<byte>(_arrayToReturnToPool);
src\libraries\System.Private.CoreLib\src\System\Array.cs (8)
1482new Span<T>(array).Fill(value); 1513new Span<T>(ref first, count).Fill(value); 2498var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2547var span = new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), length); 2571var spanKeys = new Span<TKey>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(keys), index), length); 2572var spanItems = new Span<TValue>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(items), index), length); 2589var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 3060new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (1)
816var dst = new Span<char>(ref result.GetRawStringData(), result.Length);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (1)
1131ArraySortHelper<T>.Sort(new Span<T>(_items, 0, _size), comparison);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
2362ToBase64CharsLargeNoLineBreaks(bytes, new Span<char>(ref result.GetRawStringData(), result.Length), result.Length);
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\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
1949WriteMultipleFoundFlagsNames(names, foundItems, new Span<char>(ref result.GetRawStringData(), result.Length));
src\libraries\System.Private.CoreLib\src\System\Exception.cs (1)
152Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length);
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\libraries\System.Private.CoreLib\src\System\Globalization\IcuLocaleData.cs (1)
3864var s = new Span<char>(ref result.GetRawStringData(), buffer.Length);
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\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (3)
330Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 349Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 381s.AsSpan(0, i).CopyTo(new Span<char>(pResult, result.Length));
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (1)
281decimalSeparator.CopyTo(new Span<TChar>(p, decimalSeparator.Length));
src\libraries\System.Private.CoreLib\src\System\Guid.cs (3)
518Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 604Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 1238bool result = TryFormatCore(new Span<char>(ref guidString.GetRawStringData(), guidString.Length), out int bytesWritten, format);
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\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)); 1119buffer.Span.CopyTo(new Span<byte>(_buffer, _writePos, buffer.Length));
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (1)
109ref entry, _entry, _currentPath, _rootDirectory, _originalRootDirectory, new Span<char>(_pathBuffer));
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (2)
361new Span<byte>(_buffer, _position, n).CopyTo(buffer); 658buffer.CopyTo(new Span<byte>(_buffer, _position, buffer.Length));
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\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\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (3)
357return ReadSpan(new Span<char>(buffer, index, count)); 391new Span<char>(_charBuffer, _charPos, n).CopyTo(buffer.Slice(charsRead)); 1239new Span<char>(_charBuffer, _charPos, n).CopyTo(buffer.Span.Slice(charsRead));
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
792source.Span.Slice(copied, n).CopyTo(new Span<char>(_charBuffer, _charPos, n));
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\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (2)
166buffer.CopyTo(new Span<char>(array)); 370buffer.CopyTo(new Span<char>(array));
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (1)
339return ReadCore(new Span<byte>(buffer, offset, count));
src\libraries\System.Private.CoreLib\src\System\Memory.cs (1)
349return new Span<T>(ref refToReturn, lengthOfUnderlyingSpan);
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); 3697return new Span<T>(array); 3715return new Span<T>(array, start, length); 3724return new Span<T>(segment.Array, segment.Offset, segment.Count); 3744return new Span<T>(segment.Array, segment.Offset + start, segment.Count - start); 3780return new Span<T>(segment.Array, segment.Offset + start, length); 3792return new Span<T>(segment.Array, segment.Offset + start, length);
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (14)
308var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 336var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 680var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 739var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 794var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 851var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 910var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 971var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1026var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1083var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1144var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1205var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1262var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1319var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize));
src\libraries\System.Private.CoreLib\src\System\Random.cs (2)
352Shuffle(new Span<T>(ref MemoryMarshal.GetArrayDataReference(values), values.Length)); 402GetItems(choices, new Span<char>(ref destination.GetRawStringData(), destination.Length));
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (2)
320copyOfArgs = new(ref Unsafe.AsRef<object?>(pArgStorage), _argCount); 351copyOfArgs = new(ref Unsafe.AsRef<object?>(pStorage), _argCount);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Constructor.cs (1)
29Span<object?> copyOfArgs = new(ref Unsafe.AsRef<object?>(pStorage), argCount);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (8)
78Span<object?> copyOfArgs = new(ref copyOfArg); 81Span<bool> shouldCopyBack = new(ref copyBack); 205copyOfArgs = new(ref Unsafe.AsRef<object?>(pArgStorage), _argCount); 207shouldCopyBack = new Span<bool>(pArgStorage + _argCount, _argCount); 240copyOfArgs = new(ref Unsafe.AsRef<object?>(pStorage), _argCount); 244shouldCopyBack = new Span<bool>(pStorage + _argCount * 2, _argCount); 292Span<object?> copyOfArgs = new(ref copyOfArg, 1); 295Span<bool> shouldCopyBack = new(ref copyBack, 1); // Not used for setters
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (2)
373copyOfArgs = new(ref Unsafe.AsRef<object?>(pArgStorage), _argCount); 404copyOfArgs = new(ref Unsafe.AsRef<object?>(pStorage), _argCount);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (1)
39span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(items), size);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (1)
868Span<InternalComInterfaceDispatch> dispatches = new Span<InternalComInterfaceDispatch>(pDispatches, numSections);
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)); 957s.CopyTo(new Span<char>((char*)ptr, s.Length)); 975int nbWritten = Encoding.UTF8.GetBytes(s, new Span<byte>(pbMem, nb)); 998s.CopyTo(new Span<char>((char*)ptr, s.Length)); 1016int nbWritten = Encoding.UTF8.GetBytes(s, new Span<byte>(pbMem, nb)); 1229s.CopyTo(new Span<char>((char*)bstr, s.Length)); // AllocBSTR already included the null terminator
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
39int convertedBytes = Encoding.UTF8.GetBytes(s, new Span<byte>(buffer, bufferLength));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\AnsiStringMarshaller.cs (2)
28Span<byte> buffer = new(mem, exactByteCount); 85buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (2)
61=> new Span<TUnmanagedElement>(unmanaged, numElements); 150_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
99managed.CopyTo(new Span<char>(ptrToFirstChar, managed.Length));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (1)
84public Span<T> AsSpan() => new(_data, _numElements);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (2)
62=> new Span<TUnmanagedElement>(unmanaged, numElements); 151_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (2)
72=> new Span<TUnmanagedElement>(unmanaged, numElements); 122_span = new Span<TUnmanagedElement>(_allocatedMemory, managed.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (2)
66=> new Span<TUnmanagedElement>(unmanaged, numElements); 149_span = new Span<TUnmanagedElement>(_allocatedMemory, managed.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (2)
29Span<byte> buffer = new(mem, exactByteCount); 89buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (3)
36return new Span<byte>( 152return new Span<TTo>( 227new Span<T>(ref Unsafe.AsRef(in reference), length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (1)
222ReadSpan(byteOffset, new Span<T>(array, index, count));
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
90int charsWritten = Ordinal.ToUpperOrdinal(value, new Span<char>(ref upperCase.GetRawStringData(), upperCase.Length));
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (7)
290return new Span<char>((byte*)buffer.DangerousGetHandle(), (int)(buffer.ByteLength / 2)); 323span.Slice(0, length).CopyTo(new Span<char>((void*)ptr, length)); 334new Span<char>((void*)ptr, length).Clear(); 379Span<char> resultSpan = new Span<char>((void*)ptr, byteLength / sizeof(char)); 385Marshal.GetAnsiStringBytes(span, new Span<byte>((void*)ptr, byteLength)); 397new Span<byte>((void*)ptr, byteLength).Clear(); 464new Span<byte>((void*)handle, _byteLength).Clear();
src\libraries\System.Private.CoreLib\src\System\Span.cs (4)
210public static implicit operator Span<T>(T[]? array) => new Span<T>(array); 216new Span<T>(segment.Array, segment.Offset, segment.Count); 400return new Span<T>(ref Unsafe.Add(ref _reference, (nint)(uint)start /* force zero-extension */), _length - start); 428return new Span<T>(ref Unsafe.Add(ref _reference, (nint)(uint)start /* force zero-extension */), length);
src\libraries\System.Private.CoreLib\src\System\String.cs (1)
344action(new Span<char>(ref result.GetRawStringData(), length), state);
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); 1109separator.CopyTo(new Span<char>(ref dest, separator.Length)); 1137new Span<char>(ref result._firstChar, count).Fill(paddingChar); 1156new Span<char>(ref Unsafe.Add(ref result._firstChar, oldLength), count).Fill(paddingChar); 1420Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length);
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (1)
210bytes.CopyTo(MemoryMarshal.AsBytes(new Span<int>(ref _leftoverBytes)));
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\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (4)
500bytes: new Span<byte>(pOriginalBytes, originalByteCount).Slice(bytesWrittenSoFar), 532Span<byte> bytes = new Span<byte>(pOriginalBytes, originalByteCount).Slice(bytesWrittenSoFar); 1096chars: new Span<char>(pOriginalChars, originalCharCount).Slice(charsWrittenSoFar), 1134Span<char> chars = new Span<char>(pOriginalChars, originalCharCount).Slice(charsWrittenSoFar);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (4)
372CopyTo(startIndex, new Span<char>(ref result.GetRawStringData(), result.Length), result.Length); 852value.CopyTo(startIndex, new Span<char>(m_ChunkChars, m_ChunkLength, length), length); 881CopyTo(sourceIndex, new Span<char>(destination).Slice(destinationIndex), count); 2523get => new Span<char>(m_ChunkChars, m_ChunkLength, m_ChunkChars.Length - m_ChunkLength);
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\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
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (2)
1150Span<uint> left = new Span<uint>(pLeft, (Size / sizeof(uint)) - (LeadingZeroCountAsInt32(quotient) / 32)); 1162Span<uint> right = new Span<uint>(pRight, (Size / sizeof(uint)) - (LeadingZeroCountAsInt32(divisor) / 32));
src\System\Reflection\Emit\DynamicILGenerator.cs (3)
897m_code = new Span<byte>(code, codeSize).ToArray(); 914m_exceptions = new Span<byte>(exceptions, exceptionsSize).ToArray(); 929m_localSignature = new Span<byte>(localSignature, signatureSize).ToArray();
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (3)
69new Span<ushort>(ref Unsafe.As<byte, ushort>(ref dst), array.Length)); 74new Span<uint>(ref Unsafe.As<byte, uint>(ref dst), array.Length)); 79new Span<ulong>(ref Unsafe.As<byte, ulong>(ref dst), array.Length));
src\System\StubHelpers.cs (1)
450Span<char> native = new Span<char>((char*)nativeHome, length);
src\System\Text\StringBuilder.CoreCLR.cs (2)
36new Span<char>(newBuffer, newLength).CopyTo(m_ChunkChars); 107CopyTo(0, new Span<char>((char*)dest, charLen), charLen);
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (2)
172Read(new Span<byte>(buffer, offset, count)); 231if (Read(new Span<byte>(ref b)) == 0)
System\Xml\EncodingStreamWrapper.cs (1)
585Read(new Span<byte>(buffer, offset, count));
System.Private.Windows.Core (24)
System\IO\BinaryReaderExtensions.cs (1)
122Span<byte> arrayData = new(a, array.Length * sizeof(T));
System\IO\StreamExtensions.cs (1)
53Span<byte> span = new(buffer, size);
Windows\Win32\Foundation\GlobalBuffer.cs (1)
43_buffer = new((byte*)_pointer, (int)length);
Windows\Win32\Graphics\Gdi\ArgbBuffer.cs (1)
26_bufferScope = new BufferScope<ARGB>(new Span<ARGB>(s, StackSpace), length);
Windows\Win32\System\Com\ComInterfaceTable.cs (1)
247Span<ComInterfaceEntry> entries = new(
Windows\Win32\System\Com\ComManagedStream.cs (1)
121Span<byte> buffer = new(pv, checked((int)cb));
Windows\Win32\System\Variant\VARIANT.cs (18)
751return new Span<sbyte>(ca.pElems, (int)ca.cElems).ToArray(); 753return new Span<byte>(ca.pElems, (int)ca.cElems).ToArray(); 755return new Span<short>(ca.pElems, (int)ca.cElems).ToArray(); 757return new Span<ushort>(ca.pElems, (int)ca.cElems).ToArray(); 760Span<VARIANT_BOOL> data = new(ca.pElems, (int)ca.cElems); 772return new Span<int>(ca.pElems, (int)ca.cElems).ToArray(); 776return new Span<uint>(ca.pElems, (int)ca.cElems).ToArray(); 778return new Span<long>(ca.pElems, (int)ca.cElems).ToArray(); 780return new Span<ulong>(ca.pElems, (int)ca.cElems).ToArray(); 782return new Span<float>(ca.pElems, (int)ca.cElems).ToArray(); 784return new Span<double>(ca.pElems, (int)ca.cElems).ToArray(); 787Span<long> data = new(ca.pElems, (int)ca.cElems); 799Span<double> data = new(ca.pElems, (int)ca.cElems); 811var data = new Span<FILETIME>(ca.pElems, (int)ca.cElems); 822return new Span<Guid>(ca.pElems, (int)ca.cElems).ToArray(); 826Span<IntPtr> data = new(ca.pElems, (int)ca.cElems); 838Span<IntPtr> data = new(ca.pElems, (int)ca.cElems); 850Span<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)
18new 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)
103actualLength = deflate.TryReadAll(new Span<byte>(decompressed.Pointer, decompressed.Size));
System.Runtime.Numerics (1)
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.Cose (1)
src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
23return new Span<T>(_pointer, _length);
System.Security.Cryptography.Pkcs (5)
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyTrans.cs (1)
209return new Span<byte>(cek, 0, cekLength).ToArray();
src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
23return new Span<T>(_pointer, _length);
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
87Span = 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.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\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\ReadBufferState.cs (2)
144new Span<byte>(oldBuffer, 0, oldMaxCount).Clear(); 181new 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)
2104Span<int> boldDates = new((int*)nmmcds->prgDayState, nmmcds->cDayState);
System\Windows\Forms\Rendering\ControlPaint.cs (1)
175Span<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 (4)
Interop\Richedit\Interop.CHARFORMAT2W.cs (1)
41get { fixed (char* c = _szFaceName) { return new Span<char>(c, (int)PInvokeCore.LF_FACESIZE); } }
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); } }
System.Windows.Forms.Primitives.Tests (2)
Interop\Ole32\CADWORDTests.cs (1)
43Span<uint> elements = new(ca.pElems, values.Length);
Interop\Ole32\CALPOLESTRTests.cs (1)
43Span<IntPtr> elements = new(ca.pElems, values.Length);
Test.Utilities (9)
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));
Text.Analyzers (9)
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));
6819 references to Span
aspire (1)
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
Aspire.Dashboard (4)
Otlp\Model\OtlpApplication.cs (1)
277Span<char> chars = stackalloc char[32];
Otlp\Model\OtlpHelpers.cs (1)
162private 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 ?
Aspire.Hosting (5)
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
src\Shared\CompareHelpers.cs (1)
23var requestBytesSpan = (requestByteCount <= StackAllocThreshold ?
Utils\PasswordGenerator.cs (3)
45Span<char> chars = length <= 128 ? stackalloc char[length] : new char[length]; 48var currentChars = chars; 82private 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\Aspire.Hosting\Utils\PasswordGenerator.cs (3)
45Span<char> chars = length <= 128 ? stackalloc char[length] : new char[length]; 48var currentChars = chars; 82private static void GenerateRequiredValues(ref Span<char> destination, int minValues, string choices)
BuildValidator (3)
CompilationDiff.cs (3)
364static void writeAllBytes(string filePath, Span<byte> span) 439var originalPdbSpan = new Span<byte>(originalInfo.PdbMetadataReader.MetadataPointer, originalInfo.PdbMetadataReader.MetadataLength); 440var rebuildPdbSpan = new Span<byte>(rebuildInfo.PdbMetadataReader.MetadataPointer, rebuildInfo.PdbMetadataReader.MetadataLength);
GenerateDocumentationAndConfigFiles (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
http2cat (55)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (16)
188var buffer = _headerEncodingBuffer.AsSpan(); 256var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 289var buffer = _headerEncodingBuffer.AsSpan(); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 329var buffer = _headerEncodingBuffer.AsSpan(); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 333var payload = buffer.Slice(extendedHeaderLength); 373var buffer = _headerEncodingBuffer.AsSpan(); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 423internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 735var payload = new byte[priorityFrame.PayloadLength].AsSpan(); 806var buffer = outputWriter.GetSpan(4);
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\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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\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) =>
IIS.FunctionalTests (55)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (16)
188var buffer = _headerEncodingBuffer.AsSpan(); 256var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 289var buffer = _headerEncodingBuffer.AsSpan(); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 329var buffer = _headerEncodingBuffer.AsSpan(); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 333var payload = buffer.Slice(extendedHeaderLength); 373var buffer = _headerEncodingBuffer.AsSpan(); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 423internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 735var payload = new byte[priorityFrame.PayloadLength].AsSpan(); 806var buffer = outputWriter.GetSpan(4);
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\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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\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) =>
IIS.LongTests (55)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (16)
188var buffer = _headerEncodingBuffer.AsSpan(); 256var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 289var buffer = _headerEncodingBuffer.AsSpan(); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 329var buffer = _headerEncodingBuffer.AsSpan(); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 333var payload = buffer.Slice(extendedHeaderLength); 373var buffer = _headerEncodingBuffer.AsSpan(); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 423internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 735var payload = new byte[priorityFrame.PayloadLength].AsSpan(); 806var buffer = outputWriter.GetSpan(4);
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\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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\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) =>
IIS.NewHandler.FunctionalTests (55)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (16)
188var buffer = _headerEncodingBuffer.AsSpan(); 256var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 289var buffer = _headerEncodingBuffer.AsSpan(); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 329var buffer = _headerEncodingBuffer.AsSpan(); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 333var payload = buffer.Slice(extendedHeaderLength); 373var buffer = _headerEncodingBuffer.AsSpan(); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 423internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 735var payload = new byte[priorityFrame.PayloadLength].AsSpan(); 806var buffer = outputWriter.GetSpan(4);
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\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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\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) =>
IIS.NewShim.FunctionalTests (55)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (16)
188var buffer = _headerEncodingBuffer.AsSpan(); 256var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 289var buffer = _headerEncodingBuffer.AsSpan(); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 329var buffer = _headerEncodingBuffer.AsSpan(); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 333var payload = buffer.Slice(extendedHeaderLength); 373var buffer = _headerEncodingBuffer.AsSpan(); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 423internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 735var payload = new byte[priorityFrame.PayloadLength].AsSpan(); 806var buffer = outputWriter.GetSpan(4);
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\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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\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) =>
IIS.ShadowCopy.Tests (10)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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\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) =>
IISExpress.FunctionalTests (55)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (16)
188var buffer = _headerEncodingBuffer.AsSpan(); 256var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 289var buffer = _headerEncodingBuffer.AsSpan(); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 329var buffer = _headerEncodingBuffer.AsSpan(); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 333var payload = buffer.Slice(extendedHeaderLength); 373var buffer = _headerEncodingBuffer.AsSpan(); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 423internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 735var payload = new byte[priorityFrame.PayloadLength].AsSpan(); 806var buffer = outputWriter.GetSpan(4);
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\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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\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) =>
illink (7)
InMemory.FunctionalTests (36)
ChunkedResponseTests.cs (1)
877var span = response.BodyWriter.GetSpan(4096);
Http2\Http2StreamTests.cs (2)
4125var span = response.BodyWriter.GetSpan(); 4443var span = response.BodyWriter.GetSpan(4096);
Http2\Http2TestBase.cs (13)
629protected Task StartStreamAsync(int streamId, Span<byte> headerData, bool endStream) 660var buffer = _headerEncodingBuffer.AsSpan(); 661var extendedHeader = buffer.Slice(0, extendedHeaderLength); 663var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 666var padding = buffer.Slice(extendedHeaderLength + length, padLength); 702var buffer = _headerEncodingBuffer.AsSpan(); 703var extendedHeader = buffer.Slice(0, extendedHeaderLength); 706var payload = buffer.Slice(extendedHeaderLength); 748var buffer = _headerEncodingBuffer.AsSpan(); 749var extendedHeader = buffer.Slice(0, extendedHeaderLength); 753var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 756var padding = buffer.Slice(extendedHeaderLength + length, padLength); 1117var payload = new byte[priorityFrame.PayloadLength].AsSpan();
Http3\WebTransport\WebTransportTestUtilities.cs (1)
135public Span<byte> GetSpan(int sizeHint = 0)
ResponseTests.cs (3)
1567var span = httpContext.Response.BodyWriter.GetSpan(5); 1648var span = httpContext.Response.BodyWriter.GetSpan(5); 3865var span = response.BodyWriter.GetSpan(4096);
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = 0)
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\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (5)
728await SendAsync(Span<byte>.Empty); 785_headerHandler.DecodedHeaders[((Span<byte>)knownHeader.Name).GetAsciiString()] = HttpUtilities.GetAsciiOrUTF8String((ReadOnlySpan<byte>)knownHeader.Value); 790_headerHandler.DecodedHeaders[((Span<byte>)H3StaticTable.Get(index).Name).GetAsciiString()] = value.GetAsciiOrUTF8String(); 873var buffer = pw.GetSpan(sizeHint: 8); 911internal static void WriteSettings(List<Http3PeerSetting> settings, Span<byte> destination)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
58public override Span<byte> GetSpan(int sizeHint = 0) => _output.GetSpan(sizeHint);
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (2)
36var buffer = headerEncodingBuffer.AsSpan(); 70public static void WriteStartStream(this PipeWriter writer, int streamId, Span<byte> headerData, bool endStream, Http2Frame frame = null)
Interop.FunctionalTests (5)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
100public override Span<byte> GetSpan()
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)
Metrics (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Metrics.Legacy (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Microsoft.AspNetCore.App.Analyzers (1)
Infrastructure\VirtualChars\VirtualChar.cs (1)
150Span<char> chars = stackalloc char[2];
Microsoft.AspNetCore.Authentication.Certificate (2)
X509CertificateExtensions.cs (2)
21Span<byte> subject = certificate.SubjectName.RawData; 22Span<byte> issuer = certificate.IssuerName.RawData;
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
UserJwtsTests.cs (1)
687var buffer = new Span<byte>(new byte[key.Length]);
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)
PersistentStateValueProvider.cs (4)
169Span<byte> keyHash = stackalloc byte[SHA256.HashSizeInBytes]; 175Span<byte> keyBuffer = stackalloc byte[1024]; 176var currentBuffer = keyBuffer; 250private 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\Shared\PooledArrayBufferWriter.cs (2)
134public Span<T> GetSpan(int sizeHint = 0) 168var previousBuffer = oldBuffer.AsSpan(0, _index);
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 (12)
Builder\ResourceCollectionUrlEndpoint.cs (6)
77Span<byte> hash = stackalloc byte[32]; 114Span<byte> buffer = stackalloc byte[1024]; 116Span<byte> result = stackalloc byte[incrementalHash.HashLengthInBytes]; 125Span<char> fingerprintSpan = stackalloc char[(incrementalHash.HashLengthInBytes * 4 / 3) + 3]; 131private static void AppendToHash(IncrementalHash incrementalHash, Span<byte> buffer, ref byte[]? rented, string value) 177Span<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)
131var componentIdsInDepthOrder = bufSizeRequired < 1024
Rendering\TypeNameHash.cs (2)
21Span<byte> typeNameBytes = stackalloc byte[MaxStackBufferSize]; 29Span<byte> typeNameHashBytes = stackalloc byte[SHA256.HashSizeInBytes];
src\Shared\Components\ServerComponentInvocationSequence.cs (1)
15Span<byte> bytes = stackalloc byte[16];
Microsoft.AspNetCore.Components.Forms (3)
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.Forms.Tests (5)
ReverseStringBuilderTest.cs (5)
12Span<char> initialBuffer = stackalloc char[128]; 27using var builder = new ReverseStringBuilder(Span<char>.Empty); 41Span<char> initialBuffer = stackalloc char[128]; 60Span<char> initialBuffer = stackalloc char[128]; 80Span<char> initialBuffer = stackalloc char[8];
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\Shared\Components\ServerComponentInvocationSequence.cs (1)
15Span<byte> bytes = stackalloc byte[16];
src\Shared\PooledArrayBufferWriter.cs (2)
134public Span<T> GetSpan(int sizeHint = 0) 168var previousBuffer = oldBuffer.AsSpan(0, _index);
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
372var span = array.AsSpan();
src\SignalR\common\Shared\BinaryMessageFormatter.cs (2)
13Span<byte> lenBuffer = stackalloc byte[5]; 20public static int WriteLengthPrefix(long length, Span<byte> output)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
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\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\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\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReaderExtensions.cs (1)
76Span<byte> tempSpan = new Span<byte>(&buffer, sizeof(T));
Microsoft.AspNetCore.Components.Server.Tests (10)
Circuits\RenderBatchWriterTest.cs (10)
24var bytes = Serialize(new RenderBatch()); 46var bytes = Serialize(new RenderBatch( 73var bytes = Serialize(new RenderBatch( 100var bytes = Serialize(new RenderBatch( 158var bytes = Serialize(new RenderBatch( 197var bytes = Serialize(new RenderBatch( 273private Span<byte> Serialize(RenderBatch renderBatch) 283static string[] ReadStringTable(Span<byte> data) 307static void AssertBinaryContents(Span<byte> data, int startIndex, params object[] entries) 355static int ReadInt(Span<byte> bytes, int startOffset)
Microsoft.AspNetCore.Components.Web (3)
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 (40)
KeyManagement\KeyRingBasedDataProtector.cs (3)
299var span = new Span<byte>(ptr, sizeof(Guid)); 372Span<int> purposeLengthsPool = targetLength <= 32 ? stackalloc int[targetLength] : (lease = ArrayPool<int>.Shared.Rent(targetLength)).AsSpan(0, targetLength); 385var targetSpan = targetArr.AsSpan();
Managed\AesGcmAuthenticatedEncryptor.cs (8)
119validationSubkey: Span<byte>.Empty /* filling in derivedKey only */ ); 122var nonce = new Span<byte>(ciphertext.Array, nonceOffset, NONCE_SIZE_IN_BYTES); 123var tag = new Span<byte>(ciphertext.Array, tagOffset, TAG_SIZE_IN_BYTES); 124var encrypted = new Span<byte>(ciphertext.Array, encryptedDataOffset, plaintextBytes); 192validationSubkey: Span<byte>.Empty /* filling in derivedKey only */ ); 195var nonce = new Span<byte>(retVal, nonceOffset, NONCE_SIZE_IN_BYTES); 196var tag = new Span<byte>(retVal, tagOffset, TAG_SIZE_IN_BYTES); 197var encrypted = new Span<byte>(retVal, encryptedDataOffset, plaintext.Count);
Managed\IManagedGenRandom.cs (1)
13void GenRandom(Span<byte> target);
Managed\ManagedAuthenticatedEncryptor.cs (17)
198Span<byte> decryptedKdk = _keyDerivationKey.Length <= 256 206var validationSubkey = _validationAlgorithmSubkeyLengthInBytes <= 128 211Span<byte> decryptionSubkey = 253var ciphertext = protectedPayload.Array.AsSpan(ciphertextOffset, macOffset - ciphertextOffset); 254var iv = protectedPayload.Array.AsSpan(ivOffset, _symmetricAlgorithmBlockSizeInBytes); 301var plainTextSpan = plaintext.AsSpan(); 309Span<byte> decryptedKdk = _keyDerivationKey.Length <= 256 318Span<byte> validationSubkey = _validationAlgorithmSubkeyLengthInBytes <= 128 327Span<byte> encryptionSubkey = _symmetricAlgorithmSubkeyLengthInBytes <= 128 341Span<byte> keyModifier = keyModifierLength <= 128 380var outputSpan = outputArray.AsSpan(); 391var iv = outputSpan.Slice(start: keyModifierLength, length: ivLength); 413var ivAndCipherTextSpan = outputSpan.Slice(start: keyModifierLength, length: ivLength + cipherTextLength); 414var macDestinationSpan = outputSpan.Slice(keyModifierLength + ivLength + cipherTextLength, macLength); 491Span<byte> correctHash = hashSize <= 128 498var hashSource = payloadArray!.AsSpan(ivOffset, macOffset - ivOffset); 525var payloadMacSpan = payloadArray!.AsSpan(macOffset, eofOffset - macOffset);
Managed\ManagedGenRandomImpl.cs (1)
21public void GenRandom(Span<byte> target) => RandomNumberGenerator.Fill(target);
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (8)
34public static void DeriveKeys(ReadOnlySpan<byte> kdk, ReadOnlySpan<byte> label, ReadOnlySpan<byte> contextHeader, ReadOnlySpan<byte> contextData, Span<byte> operationSubkey, Span<byte> validationSubkey) 47Span<byte> operationSubkey, 48Span<byte> validationSubkey, 63Span<byte> prfOutput = prfOutputSizeInBytes <= 128 73Span<byte> prfInput = prfInputLength <= 128 121var destination = operationSubkey.Slice(operationSubKeyIndex, bytesToWrite); 128var destination = validationSubkey.Slice(validationSubKeyIndex, leftOverBytes);
src\Shared\Encoding\Int7BitEncodingUtils.cs (2)
31public static int Write7BitEncodedInt(this Span<byte> target, int value) 34public static int Write7BitEncodedInt(this Span<byte> target, uint uValue)
Microsoft.AspNetCore.DataProtection.Abstractions (2)
src\Shared\WebEncoders\WebEncoders.cs (2)
172Span<char> bufferSpan = buffer.AsSpan(i, count); 405public static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
Microsoft.AspNetCore.DataProtection.Tests (2)
SequentialGenRandom.cs (1)
32public void GenRandom(Span<byte> target)
SP800_108\SP800_108Tests.cs (1)
166ManagedSP800_108_CTR_HMACSHA512.DeriveKeys(kdk, labelSegment, contextHeader, contextSegment, derivedSubkeySegment, validationSubkey: Span<byte>.Empty /* filling in derivedSubkeySegment only */);
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\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\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\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
Microsoft.AspNetCore.Http.Connections (5)
Internal\HttpConnectionManager.cs (1)
111Span<byte> buffer = stackalloc byte[16];
src\Shared\WebEncoders\WebEncoders.cs (2)
172Span<char> bufferSpan = buffer.AsSpan(i, count); 405public static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
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\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
111var destination = GetBuffer(); 140private Span<byte> GetBuffer() 172var destination = GetBuffer();
Microsoft.AspNetCore.Http.Extensions (13)
src\Components\Endpoints\src\FormMapping\Converters\CollectionConverter.cs (1)
160Span<char> computedPrefix = stackalloc char[16];
src\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
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.Http.Extensions.Tests (1)
RequestDelegateFactoryTests.cs (1)
903Span<byte> Method2() => "hello world"u8.ToArray();
Microsoft.AspNetCore.HttpLogging (11)
BufferingStream.cs (1)
124public Span<byte> GetSpan(int sizeHint = 0)
src\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
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.Identity.FunctionalTests (6)
src\Identity\Extensions.Core\src\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)
src\Identity\Extensions.Core\src\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)
Microsoft.AspNetCore.Localization (1)
CookieRequestCultureProvider.cs (1)
72Span<Range> parts = stackalloc Range[3];
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
src\Shared\PooledArrayBufferWriter.cs (2)
134public Span<T> GetSpan(int sizeHint = 0) 168var previousBuffer = oldBuffer.AsSpan(0, _index);
Microsoft.AspNetCore.OpenApi (5)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
111var destination = GetBuffer(); 140private Span<byte> GetBuffer() 172var destination = GetBuffer();
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.OutputCaching.Microbenchmarks (2)
EndToEndBenchmarks.cs (2)
97var span = destination.GetSpan(bytes); 279public override Span<byte> GetSpan(int sizeHint = 0) => _buffer;
Microsoft.AspNetCore.Razor.Runtime (1)
Runtime\TagHelpers\TagHelperRunner.cs (1)
26var tagHelpers = CollectionsMarshal.AsSpan(executionContext.TagHelperList);
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)
157Span<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.Routing.Microbenchmarks (4)
Matching\FastPathTokenizerEmptyBenchmark.cs (1)
27Span<PathSegment> segments = stackalloc PathSegment[MaxCount];
Matching\FastPathTokenizerLargeBenchmark.cs (1)
31Span<PathSegment> segments = stackalloc PathSegment[MaxCount];
Matching\FastPathTokenizerPlaintextBenchmark.cs (1)
27Span<PathSegment> segments = stackalloc PathSegment[MaxCount];
Matching\FastPathTokenizerSmallBenchmark.cs (1)
27Span<PathSegment> segments = stackalloc PathSegment[MaxCount];
Microsoft.AspNetCore.Routing.Tests (8)
Matching\FastPathTokenizerTest.cs (8)
14Span<PathSegment> segments = stackalloc PathSegment[1]; 27Span<PathSegment> segments = stackalloc PathSegment[1]; 40Span<PathSegment> segments = stackalloc PathSegment[1]; 54Span<PathSegment> segments = stackalloc PathSegment[3]; 70Span<PathSegment> segments = stackalloc PathSegment[3]; 86Span<PathSegment> segments = stackalloc PathSegment[3]; 102Span<PathSegment> segments = stackalloc PathSegment[3]; 118Span<PathSegment> segments = stackalloc PathSegment[3];
Microsoft.AspNetCore.Server.HttpSys (39)
IHttpSysRequestPropertyFeature.cs (1)
35bool TryGetTlsClientHello(Span<byte> tlsClientHelloBytesDestination, out int bytesReturned);
RequestProcessing\Request.cs (1)
61var rawUrlInBytes = requestContext.GetRawUrlInBytes();
RequestProcessing\RequestContext.cs (1)
229Span<byte> destination,
RequestProcessing\RequestContext.FeatureCollection.cs (1)
758public bool TryGetTlsClientHello(Span<byte> tlsClientHelloBytesDestination, out int bytesReturned)
RequestProcessing\Response.cs (4)
278Span<HTTP_DATA_CHUNK> dataChunks, 487Span<HTTP_UNKNOWN_HEADER> unknownHeaders = default; 488Span<HTTP_RESPONSE_INFO> knownHeaderInfo = default; 584var nativeHeaderValues = new Span<HTTP_KNOWN_HEADER>(headerAlloc, headerValues.Count);
RequestProcessing\ResponseBody.cs (7)
144Span<GCHandle> pinnedBuffers = default; 147BuildDataChunks(ref allocator, endOfRequest, data, out var dataChunks, out pinnedBuffers); 190private unsafe void BuildDataChunks(scoped ref UnmanagedBufferAllocator allocator, bool endOfRequest, ArraySegment<byte> data, out Span<HTTP_DATA_CHUNK> dataChunks, out Span<GCHandle> pins) 276Span<HTTP_DATA_CHUNK> chunks, 286Span<HTTP_DATA_CHUNK> chunks, 299private static void FreeDataBuffers(Span<GCHandle> pinnedBuffers)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
100public override Span<byte> GetSpan()
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\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
283internal Span<byte> GetRawUrlInBytes() 510internal void GetUnknownKeys(Span<string> destination) 527private void PopulateUnknownKeys(HTTP_REQUEST_V1* request, long fixup, Span<string> destination) 841public override Span<T> GetSpan()
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (4)
11public static Span<byte> GetPath(Span<byte> raw) 73private static int FindHttpOrHttps(Span<byte> raw) 133private static int Find(Span<byte> raw, int begin, byte target)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
278private int GetKnownHeadersKeys(Span<string> observedHeaders)
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (7)
21public static string DecodeAndUnescapePath(Span<byte> rawUrlBytes) 24var rawPath = RawUrlHelper.GetPath(rawUrlBytes); 38var unescapedPath = Unescape(rawPath); 50private static Span<byte> Unescape(Span<byte> rawPath) 102private static bool DecodeCore(ref int reader, ref int writer, int end, Span<byte> buffer) 238private static void Copy(int begin, int end, ref int writer, Span<byte> buffer)
src\Shared\PathNormalizer\PathNormalizer.cs (2)
15public static int RemoveDotSegments(Span<byte> src) 26var currentSrc = src[readPointer..];
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.Server.HttpSys.FunctionalTests (54)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (16)
188var buffer = _headerEncodingBuffer.AsSpan(); 256var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 289var buffer = _headerEncodingBuffer.AsSpan(); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 329var buffer = _headerEncodingBuffer.AsSpan(); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 333var payload = buffer.Slice(extendedHeaderLength); 373var buffer = _headerEncodingBuffer.AsSpan(); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 423internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 735var payload = new byte[priorityFrame.PayloadLength].AsSpan(); 806var buffer = outputWriter.GetSpan(4);
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\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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)
Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks (9)
RequestHeaderBenchmarks.cs (9)
57var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 60var remainingMemory = SetUnknownHeaders(nativeMemory, ref requestStructure, GenerateUnknownHeaders(unknowHeaderCount)); 69private unsafe Span<byte> SetHostHeader(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure) 72var dataDestination = nativeMemory[Marshal.SizeOf<HTTP_REQUEST_V1>()..]; 85private unsafe Span<byte> SetUnknownHeaders(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure, IReadOnlyCollection<(string Key, string Value)> headerNames) 87var unknownHeaderStructureDestination = nativeMemory[Marshal.SizeOf<HTTP_REQUEST_V1>()..]; 95var dataDestination = unknownHeaderStructureDestination[(unknownHeadersSize * headerNames.Count)..];
Microsoft.AspNetCore.Server.HttpSys.Tests (32)
RequestHeaderTests.cs (32)
23var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 44Span<byte> nativeMemory = buffer.Span; 64var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 85Span<byte> nativeMemory = buffer.Span; 105var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 124var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 143var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 146var remainingMemory = SetUnknownHeaders(nativeMemory, ref requestStructure, new[] { (CustomHeader1, "1"), (CustomHeader2, null) }); 167Span<byte> nativeMemory = buffer.Span; 170var remainingMemory = SetUnknownHeaders(nativeMemory, ref requestStructure, new[] { (CustomHeader1, "1"), (CustomHeader2, null) }); 190var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 212var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 234var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 255var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 275var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 297var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 319var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 340var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 356private static unsafe Span<byte> SetHostAndContentTypeHeaders(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure) 359var dataDestination = nativeMemory.Slice(Marshal.SizeOf<HTTP_REQUEST_V1>()); 380private static unsafe Span<byte> SetInvalidHostHeader(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure) 383var dataDestination = nativeMemory.Slice(Marshal.SizeOf<HTTP_REQUEST_V1>()); 400private static unsafe Span<byte> SetUnknownHeaders(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure, IReadOnlyCollection<(string Key, string Value)> headerNames) 402var unknownHeaderStructureDestination = nativeMemory.Slice(Marshal.SizeOf<HTTP_REQUEST_V1>()); 410var dataDestination = unknownHeaderStructureDestination.Slice(unknownHeadersSize * headerNames.Count); 438private static unsafe Span<byte> SetInvalidUnknownHeaders(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure, IReadOnlyCollection<string> headerNames) 440var unknownHeaderStructureDestination = nativeMemory.Slice(Marshal.SizeOf<HTTP_REQUEST_V1>()); 450var dataDestination = unknownHeaderStructureDestination.Slice(unknownHeadersSize * headerNames.Count);
Microsoft.AspNetCore.Server.IIS (31)
Core\IISHttpContext.cs (1)
322var rawUrlInBytes = GetRawUrlInBytes();
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
100public override Span<byte> GetSpan()
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\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
283internal Span<byte> GetRawUrlInBytes() 510internal void GetUnknownKeys(Span<string> destination) 527private void PopulateUnknownKeys(HTTP_REQUEST_V1* request, long fixup, Span<string> destination) 841public override Span<T> GetSpan()
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (4)
11public static Span<byte> GetPath(Span<byte> raw) 73private static int FindHttpOrHttps(Span<byte> raw) 133private static int Find(Span<byte> raw, int begin, byte target)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
278private int GetKnownHeadersKeys(Span<string> observedHeaders)
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (7)
21public static string DecodeAndUnescapePath(Span<byte> rawUrlBytes) 24var rawPath = RawUrlHelper.GetPath(rawUrlBytes); 38var unescapedPath = Unescape(rawPath); 50private static Span<byte> Unescape(Span<byte> rawPath) 102private static bool DecodeCore(ref int reader, ref int writer, int end, Span<byte> buffer) 238private static void Copy(int begin, int end, ref int writer, Span<byte> buffer)
src\Shared\PathNormalizer\PathNormalizer.cs (2)
15public static int RemoveDotSegments(Span<byte> src) 26var currentSrc = src[readPointer..];
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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.Server.Kestrel.Core (148)
Internal\Http\ChunkWriter.cs (2)
11public static int BeginChunkBytes(int dataCount, Span<byte> span) 150var span = start.Span;
Internal\Http\Http1Connection.cs (10)
290public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine) 297var target = startLine[targetStart..]; 340private void OnOriginFormTarget(TargetOffsetPathLength targetPath, Span<byte> target) 381private void ParseTarget(TargetOffsetPathLength targetPath, Span<byte> target) 420var path = target[..pathLength]; 430private int ParseQuery(TargetOffsetPathLength targetPath, Span<byte> target) 433var query = target[targetPath.Length..]; 452private void OnAuthorityFormTarget(HttpMethod method, Span<byte> target) 523private void OnAbsoluteFormTarget(TargetOffsetPathLength targetPath, Span<byte> target) 525Span<byte> query = target[targetPath.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)
186var startLine = MemoryMarshal.CreateSpan(ref MemoryMarshal.GetReference(requestLine), queryEnd); 428Span<byte> headerSpan = headerLength <= 256 ? stackalloc byte[256] : array = ArrayPool<byte>.Shared.Rent(headerLength);
Internal\Http\HttpProtocol.cs (2)
1400public void ThrowRequestTargetRejected(Span<byte> target) 1504public 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)
434Span<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)
1196Span<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\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\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
100public override Span<byte> GetSpan()
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\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\Shared\PathNormalizer\PathNormalizer.cs (2)
15public static int RemoveDotSegments(Span<byte> src) 26var currentSrc = src[readPointer..];
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\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
41public static bool TryWriteFrameEnvelope(Http3FrameType frameType, long payloadLength, Span<byte> buffer, out int bytesWritten)
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\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\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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\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\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.Core.Tests (80)
AsciiDecoding.cs (6)
28var span = new Span<byte>(byteArray); 36static void Test(Span<byte> asciiBytes) 75var span = new Span<byte>(expectedByteRange); 97var span = new Span<byte>(expectedByteRange); 125var span = new Span<byte>(byteArray); 133static void Test(Span<byte> asciiBytes)
BitShifterTests.cs (3)
16Span<byte> dirtySpan = new byte[] { 0xff, 0xff, 0xff, 0xff }; 28Span<byte> dirtySpan = new byte[] { 0xff, 0xff, 0xff, 0xff }; 40Span<byte> dirtySpan = new byte[] { 0xff, 0xff, 0xff, 0xff };
ChunkWriterTests.cs (1)
41Span<byte> span = new byte[10];
ConcurrentPipeWriterTests.cs (1)
447public override Span<byte> GetSpan(int sizeHint = 0)
Http2\Http2HPackEncoderTests.cs (12)
18Span<byte> buffer = new byte[1024 * 16]; 39Span<byte> buffer = new byte[1024 * 16]; 63Span<byte> buffer = new byte[1024 * 16]; 207Span<byte> buffer = new byte[1024 * 16]; 352Span<byte> buffer = new byte[1024 * 16]; 378Span<byte> buffer = new byte[1024 * 16]; 536Span<byte> payload = new byte[1024]; 571Span<byte> buffer = new byte[1024 * 16]; 602Span<byte> buffer = new byte[1024 * 16]; 617Span<byte> buffer = new byte[1024 * 16]; 632Span<byte> buffer = new byte[1024 * 16]; 647Span<byte> buffer = new byte[1024 * 16];
Http3\Http3QPackEncoderTests.cs (7)
15Span<byte> buffer = new byte[1024 * 16]; 32Span<byte> buffer = new byte[1024 * 16]; 63Span<byte> buffer = new byte[1024 * 16]; 79Span<byte> buffer = new byte[1024 * 16]; 98Span<byte> buffer = new byte[1024 * 16]; 117Span<byte> buffer = new byte[1024 * 16]; 136Span<byte> buffer = new byte[1024 * 16];
HttpParserTests.cs (9)
915public void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded) 925public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine) 929var customMethod = startLine[..versionAndMethod.MethodEnd]; 931var target = startLine[targetStart..]; 932var path = target[..targetPath.Length]; 933var query = target[targetPath.Length..];
HttpRequestHeadersTests.cs (16)
550var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 551var prevSpan = Encoding.UTF8.GetBytes(headerValueUtf16Latin1CrossOver).AsSpan(); 564var headerNameBytes = Encoding.ASCII.GetBytes((string)headerName).AsSpan(); 565var nextSpan = Encoding.Latin1.GetBytes(headerValueUtf16Latin1CrossOver).AsSpan(); 609var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 610var latinValueSpan = Encoding.Latin1.GetBytes(headerValueUtf16Latin1CrossOver).AsSpan(); 656var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 657var valueSpan = Encoding.ASCII.GetBytes(valueString).AsSpan(); 747var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 748var prevSpan = Encoding.UTF8.GetBytes(HeaderValue).AsSpan(); 795var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 796var prevSpan1 = Encoding.UTF8.GetBytes(HeaderValue1).AsSpan(); 797var prevSpan2 = Encoding.UTF8.GetBytes(HeaderValue2).AsSpan(); 849var headerName = Encoding.ASCII.GetBytes(prevName).AsSpan(); 850var prevSpan = Encoding.UTF8.GetBytes(prevValue).AsSpan(); 861var nextSpan = Encoding.UTF8.GetBytes(nextValue).AsSpan();
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\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
58public override Span<byte> GetSpan(int sizeHint = 0) => _output.GetSpan(sizeHint);
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (2)
36var buffer = headerEncodingBuffer.AsSpan(); 70public static void WriteStartStream(this PipeWriter writer, int streamId, Span<byte> headerData, bool endStream, Http2Frame frame = null)
src\Shared\test\Shared.Tests\runtime\Http2\HPackIntegerTest.cs (3)
16Span<byte> actualResult = new byte[64]; 28Span<byte> actualResult = new byte[expectedResult.Length - 1]; 58Span<byte> integerBytes = stackalloc byte[5];
src\Shared\test\Shared.Tests\runtime\Http3\QPackDecoderTest.cs (2)
165Span<byte> buffer = new byte[1024 * 1024]; 346Span<byte> chunk = encoded.AsSpan(i, resolvedSize);
src\Shared\test\Shared.Tests\runtime\Http3\VariableLengthIntegerHelperTests.cs (8)
251Span<byte> span = new Span<byte>(); 266Span<byte> span = new Span<byte>(new byte[1]); 282Span<byte> span = new Span<byte>(new byte[2]); 295Span<byte> span = new Span<byte>(new byte[1]); 310Span<byte> span = new Span<byte>(new byte[4]); 323Span<byte> span = new Span<byte>(new byte[1]); 338Span<byte> span = new Span<byte>(new byte[8]); 351Span<byte> span = new Span<byte>(new byte[1]);
TestHelpers\AssertExtensions.cs (1)
11public static void Equal(byte[] expected, Span<byte> actual)
VariableIntHelperTests.cs (1)
26var outputBuffer = new Span<byte>(new byte[8]);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (30)
Http1ConnectionBenchmark.cs (1)
111public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine)
HttpParserBenchmark.cs (2)
101public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine) 138public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine)
KnownStringsBenchmark.cs (9)
30Span<byte> data = _methodGet; 38Span<byte> data = _methodConnect; 46Span<byte> data = _methodDelete; 53Span<byte> data = _methodHead; 61Span<byte> data = _methodPatch; 68Span<byte> data = _methodPost; 75Span<byte> data = _methodPut; 83Span<byte> data = _methodOptions; 91Span<byte> data = _methodTrace;
Mocks\NullParser.cs (1)
36Span<byte> startLine = _startLine;
Mocks\NullPipeWriter.cs (1)
38public override Span<byte> GetSpan(int sizeHint = 0)
ResponseHeadersWritingBenchmark.cs (1)
201public override Span<byte> GetSpan(int sizeHint = 0) => _memory.Span;
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = 0)
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\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (5)
728await SendAsync(Span<byte>.Empty); 785_headerHandler.DecodedHeaders[((Span<byte>)knownHeader.Name).GetAsciiString()] = HttpUtilities.GetAsciiOrUTF8String((ReadOnlySpan<byte>)knownHeader.Value); 790_headerHandler.DecodedHeaders[((Span<byte>)H3StaticTable.Get(index).Name).GetAsciiString()] = value.GetAsciiOrUTF8String(); 873var buffer = pw.GetSpan(sizeHint: 8); 911internal static void WriteSettings(List<Http3PeerSetting> settings, Span<byte> destination)
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (2)
36var buffer = headerEncodingBuffer.AsSpan(); 70public static void WriteStartStream(this PipeWriter writer, int streamId, Span<byte> headerData, bool endStream, Http2Frame frame = null)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (5)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
100public override Span<byte> GetSpan()
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)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (7)
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = 0)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
100public override Span<byte> GetSpan()
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\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.Shared.Tests (105)
PropertyHelperTest.cs (1)
740public Span<bool> Span => throw new NotImplementedException();
runtime\Http2\HPackIntegerTest.cs (3)
16Span<byte> actualResult = new byte[64]; 28Span<byte> actualResult = new byte[expectedResult.Length - 1]; 58Span<byte> integerBytes = stackalloc byte[5];
runtime\Http3\QPackDecoderTest.cs (2)
165Span<byte> buffer = new byte[1024 * 1024]; 346Span<byte> chunk = encoded.AsSpan(i, resolvedSize);
runtime\Http3\VariableLengthIntegerHelperTests.cs (8)
251Span<byte> span = new Span<byte>(); 266Span<byte> span = new Span<byte>(new byte[1]); 282Span<byte> span = new Span<byte>(new byte[2]); 295Span<byte> span = new Span<byte>(new byte[1]); 310Span<byte> span = new Span<byte>(new byte[4]); 323Span<byte> span = new Span<byte>(new byte[1]); 338Span<byte> span = new Span<byte>(new byte[8]); 351Span<byte> span = new Span<byte>(new byte[1]);
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
540private Span<KeyValuePair<TKey, TValue>> ArrayStorageSpan
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\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
283internal Span<byte> GetRawUrlInBytes() 510internal void GetUnknownKeys(Span<string> destination) 527private void PopulateUnknownKeys(HTTP_REQUEST_V1* request, long fixup, Span<string> destination) 841public override Span<T> GetSpan()
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (4)
11public static Span<byte> GetPath(Span<byte> raw) 73private static int FindHttpOrHttps(Span<byte> raw) 133private static int Find(Span<byte> raw, int begin, byte target)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
278private int GetKnownHeadersKeys(Span<string> observedHeaders)
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (7)
21public static string DecodeAndUnescapePath(Span<byte> rawUrlBytes) 24var rawPath = RawUrlHelper.GetPath(rawUrlBytes); 38var unescapedPath = Unescape(rawPath); 50private static Span<byte> Unescape(Span<byte> rawPath) 102private static bool DecodeCore(ref int reader, ref int writer, int end, Span<byte> buffer) 238private static void Copy(int begin, int end, ref int writer, Span<byte> buffer)
src\Shared\PathNormalizer\PathNormalizer.cs (2)
15public static int RemoveDotSegments(Span<byte> src) 26var currentSrc = src[readPointer..];
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\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
41public static bool TryWriteFrameEnvelope(Http3FrameType frameType, long payloadLength, Span<byte> buffer, out int bytesWritten)
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\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\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var buffer = bufferWriter.Span; 198var dest = buffer.Span; 220var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
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\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\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\Shared\WebEncoders\WebEncoders.cs (2)
172Span<char> bufferSpan = buffer.AsSpan(i, count); 405public static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
773Span<bool> isStreaming = args.Length <= MaxStackSize
Microsoft.AspNetCore.SignalR.Client.Tests (3)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
Microsoft.AspNetCore.SignalR.Common (7)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
111var destination = GetBuffer(); 140private Span<byte> GetBuffer() 172var destination = GetBuffer();
Microsoft.AspNetCore.SignalR.Common.Tests (3)
Internal\Protocol\Utf8BufferTextWriterTests.cs (1)
384public Span<byte> GetSpan(int sizeHint = 0)
src\SignalR\common\Shared\BinaryMessageFormatter.cs (2)
13Span<byte> lenBuffer = stackalloc byte[5]; 20public static int WriteLengthPrefix(long length, Span<byte> output)
Microsoft.AspNetCore.SignalR.Core (1)
Internal\Utf8HashLookup.cs (1)
82var chars = count <= StackAllocThreshold ?
Microsoft.AspNetCore.SignalR.Microbenchmarks (4)
Shared\TestPipeWriter.cs (1)
24public override Span<byte> GetSpan(int sizeHint = 0)
src\SignalR\common\Shared\BinaryMessageFormatter.cs (2)
13Span<byte> lenBuffer = stackalloc byte[5]; 20public static int WriteLengthPrefix(long length, Span<byte> output)
src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
Microsoft.AspNetCore.SignalR.Protocols.Json (5)
src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
111var destination = GetBuffer(); 140private Span<byte> GetBuffer() 172var destination = GetBuffer();
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (5)
Protocol\MessagePackHubProtocolWorker.cs (1)
372var span = array.AsSpan();
src\SignalR\common\Shared\BinaryMessageFormatter.cs (2)
13Span<byte> lenBuffer = stackalloc byte[5]; 20public static int WriteLengthPrefix(long length, Span<byte> output)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (7)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
111var destination = GetBuffer(); 140private Span<byte> GetBuffer() 172var destination = GetBuffer();
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (4)
RedisHubLifetimeManager.cs (2)
819Span<byte> buffer = stackalloc byte[16]; 823Span<char> base64 = stackalloc char[24];
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
413Span<PreconditionState> states = [ifMatchState, ifNoneMatchState, ifModifiedSinceState, ifUnmodifiedSinceState];
Microsoft.AspNetCore.StaticAssets.Tests (1)
StaticAssetsIntegrationTests.cs (1)
479private static void CreateTestManifest(string appName, string webRoot, params Span<TestResource> resources)
Microsoft.AspNetCore.TestHost (1)
ResponseBodyPipeWriter.cs (1)
93public override Span<byte> GetSpan(int sizeHint = 0)
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\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
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 (22)
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\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\Shared\WebEncoders\WebEncoders.cs (2)
172Span<char> bufferSpan = buffer.AsSpan(i, count); 405public static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
Microsoft.AspNetCore.WebUtilities.Tests (2)
HttpRequestStreamReaderTest.cs (2)
272var span = new Span<char>(chars); 291var span = new Span<char>(chars);
Microsoft.Build.Framework (19)
ArraySortHelper.cs (19)
310int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 669public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 687private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 707private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 720internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 731private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 777private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 822private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 840private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, int lo, IComparer<TKey> comparer) 869private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 895public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 942private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 960private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 973private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1018private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1077private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1094private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, int lo) 1122private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1235public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
Microsoft.CodeAnalysis (50)
CodeAnalysisEventSource.Common.cs (4)
48Span<EventData> data = stackalloc EventData[] 77Span<EventData> data = stackalloc EventData[] 138Span<EventData> data = 165Span<EventData> data =
CodeGen\PrivateImplementationDetails.cs (2)
573Span<byte> hash = stackalloc byte[sizeof(ulong) * 2]; 595static void toHex(ReadOnlySpan<byte> source, Span<char> destination)
CommandLine\CommandLineParser.cs (1)
599Span<char> lineBuffer = stackalloc char[256];
CryptographicHashProvider.cs (1)
261Span<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\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\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\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)
125/// <see cref="Span{T}" /> is a commonly used ref-like type.
Text\SourceText.cs (3)
645var charSpan = charBuffer.AsSpan(0, charsToCopy); 651var shortSpan = MemoryMarshal.Cast<char, short>(charSpan); 668Span<byte> destination = stackalloc byte[128 / 8];
Microsoft.CodeAnalysis.Analyzers (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Microsoft.CodeAnalysis.AnalyzerUtilities (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Microsoft.CodeAnalysis.BannedApiAnalyzers (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Microsoft.CodeAnalysis.CodeStyle (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Microsoft.CodeAnalysis.Collections.Package (27)
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
Internal\BitHelper.cs (4)
21private readonly Span<int> _span; 23internal BitHelper(Span<int> span, bool clear) 39Span<int> span = _span; 53Span<int> span = _span;
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.CodeAnalysis.CSharp.CodeStyle (6)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
44nameof(Span<>),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
200convertedType.Name == nameof(Span<>) && 209type.Name == nameof(Span<>) && 983Name: nameof(Span<>) or nameof(ReadOnlySpan<>),
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
161sliceLikeMethod.ContainingType.GetMembers(nameof(Span<>.Slice))
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
200Span<byte> array = stackalloc byte[length];
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
14613.. string.IsNullOrEmpty(pathMapArgument) ? default(Span<string>) : [pathMapArgument]
Microsoft.CodeAnalysis.CSharp.Features (6)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
44nameof(Span<>),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
200convertedType.Name == nameof(Span<>) && 209type.Name == nameof(Span<>) && 983Name: nameof(Span<>) or nameof(ReadOnlySpan<>),
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
161sliceLikeMethod.ContainingType.GetMembers(nameof(Span<>.Slice))
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
200Span<byte> array = stackalloc byte[length];
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
SemanticSearch\CSharpSemanticSearchServiceTests.cs (1)
339var actualTrace = exception.StackTrace.JoinText().Split([Environment.NewLine], StringSplitOptions.None).AsSpan();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Symbols\Source\NullablePublicAPITests.cs (4)
3258var indexers = root.DescendantNodes().OfType<ElementAccessExpressionSyntax>().ToArray().AsSpan(); 3263void verifyAnnotation(Span<ElementAccessExpressionSyntax> indexers, PublicNullableAnnotation firstAnnotation, PublicNullableAnnotation secondAnnotation) 3310var elementAccesses = root.DescendantNodes().OfType<ElementAccessExpressionSyntax>().ToArray().AsSpan(); 3314void verifyAnnotation(Span<ElementAccessExpressionSyntax> indexers, PublicNullableAnnotation annotation)
Microsoft.CodeAnalysis.Extensions.Package (29)
Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
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\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\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)
744Name: nameof(Span<>),
Microsoft.CodeAnalysis.InteractiveHost (27)
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\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\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];
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Protocol\Internal\Converters\ImageElementConverter.cs (1)
24Span<char> scratchChars = stackalloc char[64];
Protocol\Internal\Converters\ImageIdConverter.cs (1)
23Span<char> scratchChars = stackalloc char[64];
Protocol\Internal\Converters\VSInternalExtensionUtilities.cs (1)
80internal static ReadOnlySpan<char> GetStringSpan(this ref readonly Utf8JsonReader reader, Span<char> scratchChars)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Microsoft.CodeAnalysis.PublicApiAnalyzers (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Microsoft.CodeAnalysis.Remote.Workspaces (3)
RemoteHostAssetReader.cs (1)
131Span<byte> checksumBytes = stackalloc byte[Checksum.HashSize];
RemoteHostAssetWriter.cs (2)
175var span = _pipeWriter.GetSpan(1); 185var span = _pipeWriter.GetSpan(sizeof(int));
Microsoft.CodeAnalysis.ResxSourceGenerator (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Microsoft.CodeAnalysis.Threading.Package (27)
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\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\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];
Microsoft.CodeAnalysis.Workspaces (72)
src\Compilers\Core\Portable\CodeAnalysisEventSource.Common.cs (4)
48Span<EventData> data = stackalloc EventData[] 77Span<EventData> data = stackalloc EventData[] 138Span<EventData> data = 165Span<EventData> data =
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Storage\SQLite\Interop\NativeMethods.cs (1)
118public static Result sqlite3_blob_read(SafeSqliteBlobHandle blob, Span<byte> bytes, int offset)
Storage\SQLite\v2\Interop\SqlConnection.cs (1)
313Span<byte> bytes = stackalloc byte[Checksum.HashSize];
Storage\SQLite\v2\Interop\SqlStatement.cs (1)
81Span<byte> bytes = stackalloc byte[utf8ByteCount];
Storage\SQLite\v2\SQLitePersistentStorage.Accessor.cs (1)
240Span<byte> checksumBytes = stackalloc byte[Checksum.HashSize];
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 (12)
41Span<byte> hash = stackalloc byte[XXHash128SizeBytes]; 56Span<byte> hash = stackalloc byte[XXHash128SizeBytes]; 63Span<byte> destination = stackalloc byte[XXHash128SizeBytes]; 73Span<byte> hash = stackalloc byte[XXHash128SizeBytes]; 112Span<byte> destination = stackalloc byte[XXHash128SizeBytes]; 125Span<Checksum> hashes = stackalloc Checksum[checksumsCount]; 134Span<Checksum> checksumsSpan = stackalloc Checksum[maxStackAllocCount]; 144var hashSpan = checksumsSpan.Slice(0, count); 148Span<byte> hash = stackalloc byte[XXHash128SizeBytes]; 156var hashes = ImmutableCollectionsMarshal.AsArray(checksums).AsSpan(); 163var source = ImmutableCollectionsMarshal.AsArray(bytes).AsSpan(); 165Span<byte> destination = stackalloc byte[XXHash128SizeBytes];
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (27)
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\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\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];
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
ChecksumTests.cs (6)
57Span<Checksum> builder = stackalloc Checksum[10]; 67var toValidate = builder.Slice(0, i); 71void AssertEqual(Checksum desiredResult, Span<Checksum> toValidate) 86Span<Checksum> builder = stackalloc Checksum[70]; 92var toValidate = builder.Slice(0, i); 96void AssertEqual(Checksum desiredResult, Span<Checksum> toValidate)
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) 482Span<T> retSpan = mutableBuffer.Span; 485Span<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.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)
31public static Span<byte> ReadExactly(this Stream stream, int n)
Microsoft.DotNet.XUnitAssert.Tests (17)
Sdk\CollectionTrackerTests.cs (9)
80 var span = new[] { 42, 2112 }.AsSpan(); 92 var span = new[] { 42, 2112 }.AsSpan(); 104 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan(); 116 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan(); 128 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan(); 231 var span = new object[0].AsSpan(); 239 var span = new object[0].AsSpan(); 251 var span = new object[] { 1, 2.3M, "Hello, world!" }.AsSpan(); 263 var span = new object[] { 1, 2.3M, "Hello, world!", 42, 2112, new object() }.AsSpan();
SpanAssertsTests.cs (6)
172 var ex = Record.Exception(() => Assert.Contains(new int[] { 3, 4 }.Spanify(), Span<int>.Empty)); 186 Assert.Contains(Span<int>.Empty, new int[] { 3, 4 }.Spanify()); 187 Assert.Contains(Span<int>.Empty, Span<int>.Empty); 397 Assert.DoesNotContain(new int[] { 3, 4 }.Spanify(), Span<int>.Empty); 405 var ex = Record.Exception(() => Assert.DoesNotContain(Span<int>.Empty, data.ToArray().Spanify()));
SpanExtensions.cs (2)
7 public static Span<T> Spanify<T>(this T[]? values) 12 public static Span<char> Spanify(this string? value)
Microsoft.Extensions.AI.Abstractions (1)
Embeddings\BinaryEmbedding.cs (1)
100Span<byte> utf8 = tmpArray.AsSpan(0, length);
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceEmbeddingGenerator.cs (1)
148Span<int> ints = MemoryMarshal.Cast<float, int>(vector.AsSpan());
Microsoft.Extensions.AI.OpenAI (5)
src\Shared\ServerSentEvents\ArrayBuffer.cs (2)
90public readonly Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 95public readonly Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\Shared\ServerSentEvents\Helpers.cs (2)
52Span<byte> buffer = writer.GetSpan(value.Length); 66Span<byte> buffer = writer.GetSpan(maxByteCount);
src\Shared\ServerSentEvents\PooledByteBufferWriter.cs (1)
24public Span<byte> GetSpan(int sizeHint = 0)
Microsoft.Extensions.Caching.Hybrid (7)
Internal\DefaultHybridCache.StampedeStateT.cs (4)
556Span<byte> byteBuffer = maxBytes <= 128 ? stackalloc byte[128] : (leasedBytes = ArrayPool<byte>.Shared.Rent(maxBytes)); 557Span<char> charBuffer = maxChars <= 128 ? stackalloc char[128] : (leasedChars = ArrayPool<char>.Shared.Rent(maxChars)); 601static 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)
170Span<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)
95public override int Redact(ReadOnlySpan<char> source, Span<char> destination) 127private 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.DependencyInjection.Abstractions (6)
ActivatorUtilities.cs (6)
69Span<object?> values = maxArgs <= StackAllocatedObjects.MaxStackAllocArgCount / 2 ? 73Span<object?> ctorArgs = values.Slice(0, maxArgs); 74Span<object?> bestCtorArgs = values.Slice(maxArgs, maxArgs); 203static void InitializeCtorArgValues(ref Span<object?> ctorArgs, int _) 796private readonly Span<object?> _parameterValues; 797public ConstructorMatcher(ConstructorInfoEx constructor, Span<object?> parameterValues)
Microsoft.Extensions.Diagnostics (2)
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.FileProviders.Physical (1)
PollingWildCardChangeToken.cs (1)
136Span<byte> currentHash = stackalloc byte[256 / 8];
Microsoft.Extensions.Http.Diagnostics (5)
Logging\Internal\HttpHeadersRedactor.cs (1)
131Span<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)
2482Span<uint> resultBuffer = stackalloc uint[1];
Microsoft.Extensions.Logging.Abstractions (7)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
Microsoft.Extensions.Logging.Console (4)
SimpleConsoleFormatter.cs (1)
101Span<char> span = stackalloc char[10];
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\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = MinimumBufferSize)
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 (23)
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 (1)
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)
411internal 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 (129)
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)
883public override OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, out int idsConsumed, out int charsWritten) 895public OperationStatus Decode(IEnumerable<int> ids, Span<char> destination, bool considerSpecialTokens, out int idsConsumed, out int charsWritten) 910Span<char> buffer = destination; 976private OperationStatus DecodeByteLevel(IEnumerable<int> ids, Span<char> destination, bool considerSpecialTokens, out int idsConsumed, out int charsWritten) 982Span<char> vocabBuffer = stackalloc char[128]; 985Span<byte> utf8bytes = stackalloc byte[256]; 994Span<char> buffer = destination; 1040Span<byte> current = utf8bytes.Slice(incompleteUtf8BytesInBufferIndex + incompleteUtf8BytesInBuffer); 1192Span<char> buffer = stackalloc char[256]; 1312scoped Span<char> token; 1313scoped Span<int> mapping = Span<int>.Empty; 1425scoped Span<char> token; 1426scoped Span<int> mapping = Span<int>.Empty; 1505scoped Span<char> token; 1506scoped 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 (2)
25Span<(int Index, int Rank)> byteIndicesAndRanks = requiredLength <= 64 ? 35int GetRank(Span<(int Index, int Rank)> byteIndicesAndRanks, int startIndex, int skip = 0)
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)
894var labelsSpan = MemoryMarshal.Cast<long, byte>(labels); 906var featureSpan = MemoryMarshal.Cast<float, byte>(row.Item2); 1476public void Score(in VBuffer<byte> image, Span<float> classProbabilities)
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)
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);
PresentationCore.Tests (5)
System\Windows\Media\Imaging\WriteableBitmap.Tests.cs (5)
94Span<byte> smallRect = GC.AllocateUninitializedArray<byte>(tileSize * tileSize * channels, pinned: true); 159Span<uint> bigRect = GC.AllocateUninitializedArray<uint>(width * height, pinned: true); 194/// <summary>Retrieves the data pointer of the underlying <see cref="Span{T}"/> data reference.</summary> 195/// <param name="span">The <see cref="Span{T}"/> to retrieve a pointer to.</param> 199public static nint AsNativePointer<T>(this Span<T> span) => (nint)Unsafe.AsPointer(ref MemoryMarshal.GetReference(span));
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)
12000Span<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 (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Shared (11)
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 (3)
34Span<byte> buffer = writer.GetSpan(MaxDecimalDigits); 52Span<byte> buffer = writer.GetSpan(value.Length); 66Span<byte> buffer = writer.GetSpan(maxByteCount);
ServerSentEvents\PooledByteBufferWriter.cs (1)
24public Span<byte> GetSpan(int sizeHint = 0)
Sockets.FunctionalTests (2)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
58public override Span<byte> GetSpan(int sizeHint = 0) => _output.GetSpan(sizeHint);
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (1)
162public override Span<byte> GetSpan(int sizeHint = 0)
System.Collections (4)
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)
1391Span<int> span = stackalloc int[StackAllocThreshold];
System.Collections.Immutable (20)
System\Collections\Frozen\FrozenDictionary.cs (1)
382public void CopyTo(Span<KeyValuePair<TKey, TValue>> destination)
System\Collections\Frozen\FrozenHashTable.cs (3)
47public static FrozenHashTable Create(Span<int> hashCodes, bool hashCodesAreUnique = false) 60Span<int> bucketStarts = arrayPoolBuckets.AsSpan(0, numBuckets); 61Span<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); 1013/// Copies the current contents to the specified <see cref="Span{T}"/>. 1015/// <param name="destination">The <see cref="Span{T}"/> to copy to.</param> 1016public 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.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\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.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 = stackalloc int[4]; 930Span<uint> rgulNumeric = [_data1, _data2, _data3, _data4]; 932Span<char> pszTmp = stackalloc char[s_NUMERIC_MAX_PRECISION + 1]; //Local Character buffer to hold 1158public int WriteTdsValue(Span<uint> destination) 1289Span<uint> rglData1 = [x._data1, x._data2, x._data3, x._data4]; 1290Span<uint> rglData2 = [y._data1, y._data2, y._data3, y._data4]; 1338Span<uint> rguiTemp = rglData2; 1481Span<uint> rgulRes = stackalloc uint[x_culNumeMultRes]; //new [] are already initialized to zero 1709Span<uint> rgulData1 = [x._data1, x._data2, x._data3, x._data4]; 1710Span<uint> rgulData2 = [y._data1, y._data2, y._data3, y._data4]; 1713Span<uint> rgulR = stackalloc uint[s_cNumeMax + 1]; 1714Span<uint> rgulQ = stackalloc uint[s_cNumeMax]; 1857private static void ZeroToMaxLen(Span<uint> rgulData, int cUI4sCur) 1931private static bool FGt10_38(Span<uint> rglData) 2088Span<uint> rgulU = [_data1, _data2, _data3, _data4]; 2119Span<uint> rguiData = [_data1, _data2, _data3, _data4]; 2164Span<uint> rguiData = [_data1, _data2, _data3, _data4]; 2224Span<uint> rguiData = [_data1, _data2, _data3, _data4]; 2458Span<uint> rgulD, // Out | Destination number 2474Span<uint> rgulD, // Out | Number 2499Span<uint> piulD, // InOut| D 2531Span<uint> rgulU, // InOut| U 2595Span<uint> rgulD, // InOut | D 2597Span<uint> rgulQ, // Out | Q 2599Span<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.Diagnostics.DiagnosticSource (41)
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (2)
121private Span<ulong> _bitMap; 123public BitMapper(Span<ulong> bitMap)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
System\Diagnostics\Activity.cs (8)
243Span<char> flagsChars = stackalloc char[2]; 275Span<char> flagsChars = stackalloc char[2]; 1895Span<byte> span = stackalloc byte[sizeof(ulong) * 2]; 1965Span<ulong> span = stackalloc ulong[2]; 1997public void CopyTo(Span<byte> destination) 2006internal static void SetToRandomBytes(Span<byte> outBytes) 2023internal static void SetSpanFromHexChars(ReadOnlySpan<char> charData, Span<byte> outBytes) 2179public 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) 200Span<KeyValuePair<string, object?>> tags = _tags; 217Span<KeyValuePair<string, object?>> tags = _overflowTags is not null ? _overflowTags : _tags;
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)
419Span<char> stackBuffer = stackalloc char[128];
System.Drawing.Common (22)
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.Common.Tests (3)
System\Drawing\Imaging\Effects\EffectsTests.cs (3)
183Span<byte> buffer = stackalloc byte[256]; 225Span<byte> buffer = stackalloc byte[257]; 241Span<float> buffer = stackalloc float[25];
System.Drawing.Primitives (1)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
61Span<Range> tokens = stackalloc Range[5];
System.Formats.Asn1 (63)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (4)
46internal Span<byte> Span { get; private set; } 67Span<byte> toClear = Span.Slice(0, clearSize); 93Span<byte> currentBuffer, 107Span<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 (9)
52internal static int GetBytes(this Encoding encoding, ReadOnlySpan<char> chars, Span<byte> bytes) 84protected abstract int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool write); 85protected abstract int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool write); 108return GetBytes(chars, Span<byte>.Empty, write: false); 143return GetChars(bytes, Span<char>.Empty, write: false); 254protected override int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool write) 282protected override int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool write) 321protected override int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool write) 356protected override int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool write)
System\Formats\Asn1\AsnDecoder.BitString.cs (11)
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,
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 (8)
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,
System\Formats\Asn1\AsnDecoder.Oid.cs (2)
182Span<byte> writeSpan = tmpBytes; 183Span<byte> accumValueBytes = stackalloc byte[sizeof(long)];
System\Formats\Asn1\AsnDecoder.Text.cs (7)
147Span<byte> destination, 244Span<char> destination, 339Span<byte> destination, 389Span<char> destination, 486Span<char> destination, 647Span<byte> destination, 715Span<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 (25)
src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
21public override Span<T> GetSpan()
System\Formats\Cbor\CborHelpers.netcoreapp.cs (5)
16public static int GetBytes(Encoding encoding, ReadOnlySpan<char> source, Span<byte> destination) 22public static int GetChars(Encoding encoding, ReadOnlySpan<byte> source, Span<char> destination) 37public static void GetBitsFromDecimal(decimal d, Span<int> destination) 56public static unsafe void WriteSingleBigEndian(Span<byte> destination, float value) 60public 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)
188public int Encode(Span<byte> destination) 206public 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)
149Span<int> buf = stackalloc int[4]; 161Span<int> buf = stackalloc int[4];
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 (48)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
System\Formats\Tar\SeekableSubReadStream.cs (1)
43public override int Read(Span<byte> destination)
System\Formats\Tar\SubReadStream.cs (1)
105public override int Read(Span<byte> destination)
System\Formats\Tar\TarHeader.Read.cs (3)
24Span<byte> buffer = stackalloc byte[TarHelpers.RecordSize]; 585Span<byte> span = (ulong)size <= 256 ? 656Span<byte> span = (ulong)size <= 256 ?
System\Formats\Tar\TarHeader.Write.cs (34)
36private void WriteWithSeekableDataStream(TarEntryFormat format, Stream archiveStream, Span<byte> buffer) 68private void WriteWithUnseekableDataStream(TarEntryFormat format, Stream destinationStream, Span<byte> buffer, bool shouldAdvanceToEnd) 172private void WriteV7FieldsToBuffer(Span<byte> buffer) 182private void WriteUstarFieldsToBuffer(Span<byte> buffer) 195internal void WriteAsPaxGlobalExtendedAttributes(Stream archiveStream, Span<byte> buffer, int globalExtendedAttributesEntryNumber) 220internal void WriteAsV7(Stream archiveStream, Span<byte> buffer) 247internal void WriteAsUstar(Stream archiveStream, Span<byte> buffer) 276internal void WriteAsPax(Stream archiveStream, Span<byte> buffer) 370internal void WriteAsGnu(Stream archiveStream, Span<byte> buffer) 483private void WriteGnuFieldsToBuffer(Span<byte> buffer) 495private void WriteAsPaxExtendedAttributes(Stream archiveStream, Span<byte> buffer, Dictionary<string, string> extendedAttributes, bool isGea, int globalExtendedAttributesEntryNumber) 526private void WritePaxFieldsToBuffer(Span<byte> buffer) 537private void WriteFieldsToBuffer(TarEntryFormat format, Span<byte> buffer) 558private int WriteName(Span<byte> buffer) 580private int WriteUstarName(Span<byte> buffer) 591Span<byte> encodingBuffer = stackalloc byte[MaxPathName]; 646private int WriteCommonFields(Span<byte> buffer, TarEntryType actualEntryType) 717private static int WritePosixMagicAndVersion(Span<byte> buffer) 725private static int WriteGnuMagicAndVersion(Span<byte> buffer) 733private int WritePosixAndGnuSharedFields(Span<byte> buffer) 787private int WriteGnuFields(Span<byte> buffer) 818Span<byte> zeros = stackalloc byte[TarHelpers.RecordSize]; 870Span<byte> span = stackalloc byte[512]; 1020private static int WriteChecksum(int checksum, Span<byte> buffer) 1026Span<byte> converted = stackalloc byte[FieldLengths.Checksum]; 1030Span<byte> destination = buffer.Slice(FieldLocations.Checksum, FieldLengths.Checksum); 1057private static int WriteLeftAlignedBytesAndGetChecksum(ReadOnlySpan<byte> bytesToWrite, Span<byte> destination) 1071private static int WriteRightAlignedBytesAndGetChecksum(ReadOnlySpan<byte> bytesToWrite, Span<byte> destination) 1099private int FormatNumeric(int value, Span<byte> destination) 1124private int FormatNumeric(long value, Span<byte> destination) 1150private static int FormatOctal(long value, Span<byte> destination) 1153Span<byte> digits = stackalloc byte[32]; // longer than any possible octal formatting of a ulong 1169private int WriteAsTimestamp(DateTimeOffset timestamp, Span<byte> destination) 1182private static int WriteAsUtf8String(ReadOnlySpan<char> text, Span<byte> buffer)
System\Formats\Tar\TarWriter.cs (2)
296Span<byte> buffer = stackalloc byte[TarHelpers.RecordSize]; 361Span<byte> emptyRecord = stackalloc byte[TarHelpers.RecordSize];
System.IO.Compression (3)
artifacts\obj\System.IO.Compression\Debug\net10.0\System.IO.Compression.notsupported.cs (3)
45public override int Read(System.Span<byte> buffer) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Compression); } 81public override int Read(System.Span<byte> buffer) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Compression); } 176public override int Read(System.Span<byte> buffer) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_Compression); }
System.IO.Compression.Brotli (7)
artifacts\obj\System.IO.Compression.Brotli\Debug\net10.0\System.IO.Compression.Brotli.notsupported.cs (7)
18public System.Buffers.OperationStatus Decompress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesConsumed, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.IOCompressionBrotli_PlatformNotSupported); } 20public static bool TryDecompress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.IOCompressionBrotli_PlatformNotSupported); } 27public System.Buffers.OperationStatus Compress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) { throw new System.PlatformNotSupportedException(System.SR.IOCompressionBrotli_PlatformNotSupported); } 29public System.Buffers.OperationStatus Flush(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.IOCompressionBrotli_PlatformNotSupported); } 31public static bool TryCompress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.IOCompressionBrotli_PlatformNotSupported); } 32public static bool TryCompress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten, int quality, int window) { throw new System.PlatformNotSupportedException(System.SR.IOCompressionBrotli_PlatformNotSupported); } 56public override int Read(System.Span<byte> buffer) { throw new System.PlatformNotSupportedException(System.SR.IOCompressionBrotli_PlatformNotSupported); }
System.IO.FileSystem.Watcher (7)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
System.IO.Hashing (28)
System\IO\Hashing\Crc32.cs (4)
75protected override void GetCurrentHashCore(Span<byte> destination) 85protected override void GetHashAndResetCore(Span<byte> destination) 136public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 158public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination)
System\IO\Hashing\Crc64.cs (4)
74protected override void GetCurrentHashCore(Span<byte> destination) 83protected override void GetHashAndResetCore(Span<byte> destination) 134public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 156public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination)
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (6)
75protected abstract void GetCurrentHashCore(Span<byte> destination); 161public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 186public int GetCurrentHash(Span<byte> destination) 223public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 248public int GetHashAndReset(Span<byte> destination) 282protected 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.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 = stackalloc byte[1]; 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 (1)
artifacts\obj\System.IO.Pipes\Debug\net10.0\System.IO.Pipes.notsupported.cs (1)
153public override int Read(System.Span<byte> buffer) { throw new System.PlatformNotSupportedException(System.SR.Pipes_PlatformNotSupported); }
System.IO.Ports (1)
System\IO\Ports\SerialStream.Unix.cs (1)
781Span<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)
80private 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.Expressions (1)
System\Linq\Expressions\Compiler\ILGen.cs (1)
978Span<int> bits = stackalloc int[4];
System.Memory (27)
artifacts\obj\System.Memory\Debug\net10.0\System.Memory.Forwards.cs (1)
18[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
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\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.HttpListener (6)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
79Span<Range> parts = stackalloc Range[3];
System.Net.Mail (29)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
System\Net\Base64Stream.cs (2)
81public unsafe int DecodeBytes(Span<byte> buffer) 174protected 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)
240internal 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)
52protected override int ReadInternal(Span<byte> buffer) 125public int DecodeBytes(Span<byte> buffer) { throw new NotImplementedException(); }
System\Net\Mime\IEncodableStream.cs (1)
10int DecodeBytes(Span<byte> buffer);
System\Net\Mime\MimeBasePart.cs (1)
101Span<Range> subStrings = stackalloc Range[6];
System\Net\Mime\QEncodedStream.cs (2)
65public unsafe int DecodeBytes(Span<byte> buffer) 219protected override int ReadInternal(Span<byte> buffer)
System\Net\Mime\QuotedPrintableStream.cs (2)
94public unsafe int DecodeBytes(Span<byte> buffer) 333protected override int ReadInternal(Span<byte> buffer)
System.Net.Ping (19)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (6)
17Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 32public static 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\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\libraries\Common\src\System\Text\ValueUtf8Converter.cs (3)
16private Span<byte> _bytes; 18public ValueUtf8Converter(Span<byte> initialBuffer) 24public Span<byte> ConvertAndTerminateString(ReadOnlySpan<char> value)
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
302Span<byte> socketAddress = stackalloc byte[SocketAddress.GetMaximumAddressSize(address.AddressFamily)];
System.Net.Primitives (9)
artifacts\obj\System.Net.Primitives\Debug\net10.0\System.Net.Primitives.notsupported.cs (9)
274public bool TryFormat(System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); } 275public bool TryFormat(System.Span<byte> utf8Destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); } 276bool System.ISpanFormattable.TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); } 277bool System.IUtf8SpanFormattable.TryFormat(System.Span<byte> utf8Destination, out int bytesWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); } 284public bool TryWriteBytes(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); } 324bool System.ISpanFormattable.TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); } 325bool System.IUtf8SpanFormattable.TryFormat(System.Span<byte> utf8Destination, out int bytesWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); } 331public bool TryFormat(System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); } 332public bool TryFormat(System.Span<byte> utf8Destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); }
System.Net.Quic (1)
artifacts\obj\System.Net.Quic\Debug\net10.0\System.Net.Quic.notsupported.cs (1)
132public override int Read(System.Span<byte> buffer) { throw new System.PlatformNotSupportedException(System.SR.SystemNetQuic_PlatformNotSupported); }
System.Net.Security (2)
artifacts\obj\System.Net.Security\Debug\net10.0\System.Net.Security.notsupported.cs (2)
59public System.Net.Security.NegotiateAuthenticationStatusCode UnwrapInPlace(System.Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSecurity_PlatformNotSupported); } 326public override int Read(System.Span<byte> buffer) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSecurity_PlatformNotSupported); }
System.Net.ServerSentEvents (6)
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 (9)
artifacts\obj\System.Net.Sockets\Debug\net10.0\System.Net.Sockets.notsupported.cs (9)
149public override int Read(System.Span<byte> buffer) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSockets_PlatformNotSupported); } 369public int GetRawSocketOption(int optionLevel, int optionName, System.Span<byte> optionValue) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSockets_PlatformNotSupported); } 387public int Receive(System.Span<byte> buffer) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSockets_PlatformNotSupported); } 388public int Receive(System.Span<byte> buffer, System.Net.Sockets.SocketFlags socketFlags) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSockets_PlatformNotSupported); } 389public int Receive(System.Span<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, out System.Net.Sockets.SocketError errorCode) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSockets_PlatformNotSupported); } 401public int ReceiveFrom(System.Span<byte> buffer, ref System.Net.EndPoint remoteEP) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSockets_PlatformNotSupported); } 402public int ReceiveFrom(System.Span<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSockets_PlatformNotSupported); } 403public int ReceiveFrom(System.Span<byte> buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.SocketAddress receivedAddress) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSockets_PlatformNotSupported); } 411public int ReceiveMessageFrom(System.Span<byte> buffer, ref System.Net.Sockets.SocketFlags socketFlags, ref System.Net.EndPoint remoteEP, out System.Net.Sockets.IPPacketInformation ipPacketInformation) { throw new System.PlatformNotSupportedException(System.SR.SystemNetSockets_PlatformNotSupported); }
System.Net.WebClient (6)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
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)
176Span<char> url = (uint)lengthRequired <= 256 ? stackalloc char[256] : new char[lengthRequired];
System.Net.WebSockets.Client (1)
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
490Span<byte> bytes = stackalloc byte[24 /* Base64 guid length */ + wsServerGuidBytes.Length];
System.Numerics.Tensors (495)
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)
202ReadOnlySpan<T> x, Span<bool> destination) 227static void Vectorized_Size1(ReadOnlySpan<T> x, Span<bool> destination) 335static void Vectorized_Size2(ReadOnlySpan<T> x, Span<bool> destination) 452static void Vectorized_Size4(ReadOnlySpan<T> x, Span<bool> destination) 581static 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)
49ReadOnlySpan<T> x, Span<T> destination1, Span<T> destination2) 176ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination1, Span<T> destination2) 365ReadOnlySpan<T> x, T y, Span<T> destination1, Span<T> destination2) 547T 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)
63void FlattenTo(scoped Span<T> destination); 114bool TryFlattenTo(scoped Span<T> destination);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (4)
351/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.FlattenTo(Span{T})" /> 352public void FlattenTo(scoped Span<T> destination) 430/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.TryFlattenTo(Span{T})" /> 431public bool TryFlattenTo(scoped Span<T> destination)
System\Numerics\Tensors\netcore\Tensor.cs (26)
241Span<T> dstSpan = MemoryMarshal.CreateSpan(ref destination._reference, (int)totalLength); 253Span<NRange> ranges = TensorOperation.RentedBuffer.CreateUninitialized(destination.Rank, out TensorOperation.RentedBuffer<NRange> rentedBuffer); 438Span<T> span = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape.LinearLength); 461Span<T> span = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape.LinearLength); 1367scoped Span<nint> newLengths = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 1368scoped Span<nint> newStrides = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 1641Span<T> ospan = MemoryMarshal.CreateSpan(ref output.AsTensorSpan()._reference, (int)output.FlattenedLength); 1681Span<T> ospan = MemoryMarshal.CreateSpan(ref destination._reference, (int)destination._shape.LinearLength); 1745Span<NRange> srcIndexes = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<NRange> srcIndexesRentedBuffer); 1746Span<NRange> dstIndexes = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<NRange> dstIndexesRentedBuffer); 1850scoped Span<NRange> sliceDims = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<NRange> lengthsRentedBuffer); 1896scoped Span<nint> lengths = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 1897scoped Span<nint> strides = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 1963scoped Span<nint> lengths = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 1964scoped Span<nint> strides = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2030scoped Span<nint> lengths = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2031scoped Span<nint> strides = TensorOperation.RentedBuffer.CreateUninitialized(rank, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2241/// <param name="tensor">The <see cref="Span{T}"/> you want to represent as a string.</param> 2259scoped Span<nint> lengths = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2260scoped Span<nint> strides = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2335scoped Span<nint> newLengths = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2341Span<nint> newStrides = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2372scoped Span<nint> newLengths = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2378Span<nint> newStrides = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer); 2409scoped Span<nint> newLengths = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> lengthsRentedBuffer); 2415Span<nint> newStrides = TensorOperation.RentedBuffer.CreateUninitialized(tensor.Rank + 1, out TensorOperation.RentedBuffer<nint> stridesRentedBuffer);
System\Numerics\Tensors\netcore\Tensor_1.cs (4)
175/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.FlattenTo(Span{T})" /> 176public void FlattenTo(scoped Span<T> destination) 270/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.TryFlattenTo(Span{T})" /> 271public bool TryFlattenTo(scoped Span<T> destination) => AsReadOnlyTensorSpan().TryFlattenTo(destination);
System\Numerics\Tensors\netcore\TensorOperation.cs (165)
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 _, 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); 386public static void Invoke(Span<T> destination) 400public static void Invoke(ReadOnlySpan<T> source, Span<T> destination) 421public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 429public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 458public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 476public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 505public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 520public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 535public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 550public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 566public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 576public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 591public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 606public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 621public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 636public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 652public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 665public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 681public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 694public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 709public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 724public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 740public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 750public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 766public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 776public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 791public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 806public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 822public static void Invoke(ReadOnlySpan<TFrom> x, Span<TTo> destination) 838public static void Invoke(ReadOnlySpan<TFrom> x, Span<TTo> destination) 854public static void Invoke(ReadOnlySpan<TFrom> x, Span<TTo> destination) 870public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 880public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 895public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 910public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 929public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<(T, T, T)> destination) 946public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 961public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 978public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 988public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 997public static void Invoke(T x, ReadOnlySpan<T> y, Span<T> destination) 1012public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1027public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1042public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1057public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1072public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1087public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1102public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1117public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1132public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1149public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1159public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1168public static void Invoke(T x, ReadOnlySpan<T> y, Span<T> destination) 1183public static void Invoke(ReadOnlySpan<T> x, Span<int> destination) 1198public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1215public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1225public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1235public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1250public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1265public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1280public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1295public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1310public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1337public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1347public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1374public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1384public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1411public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1421public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1448public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1458public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1485public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1495public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1522public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1532public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1559public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1569public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1596public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1606public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1622public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1632public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1647public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1662public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1677public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1694public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1704public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1714public static void Invoke(T x, ReadOnlySpan<T> y, Span<T> destination) 1744public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1759public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1774public static void Invoke(ReadOnlySpan<T> x, int y, Span<T> destination) 1788public static void Invoke(ReadOnlySpan<T> x, int y, Span<T> destination) 1802public static void Invoke(ReadOnlySpan<T> x, int y, Span<T> destination) 1818public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1828public static void Invoke(ReadOnlySpan<T> x, Tuple<int, MidpointRounding> y, Span<T> destination) 1843public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1858public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1873public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1888public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1922public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1940public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 1957public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 1967public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1977public static void Invoke(T x, ReadOnlySpan<T> y, Span<T> destination) 2007public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 2020public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 2052public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2067public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2082public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2097public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2112public static void Invoke(ReadOnlySpan<T> x, Span<T> destination) 2128public static void Invoke(ReadOnlySpan<T> x, T y, Span<T> destination) 2138public static void Invoke(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 2154public static void Invoke(Span<T> destination, T value) 2171public static void Invoke(ReadOnlySpan<bool> x, ReadOnlySpan<T> y, Span<T> destination) 2190public static void Invoke(ReadOnlySpan<bool> x, T y, Span<T> destination) 2217public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2225public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2254public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2272public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2306public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2314public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2343public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2361public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2395public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2403public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2432public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2450public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2484public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2492public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2521public static void Invoke(ReadOnlySpan<T> left, T right, Span<bool> destination) 2539public static void Invoke(ReadOnlySpan<T> left, ReadOnlySpan<T> right, Span<bool> destination) 2571static abstract void Invoke(ReadOnlySpan<T1> x, T2 y, Span<TResult> destination); 2577static abstract void Invoke(T1 x, ReadOnlySpan<T2> y, Span<TResult> destination); 2583static abstract void Invoke(ReadOnlySpan<T1> x, ReadOnlySpan<T2> y, Span<TResult> destination); 2594static abstract void Invoke(Span<T> destination); 2600static abstract void Invoke(Span<TResult> destination, T x); 2606static abstract void Invoke(ReadOnlySpan<T> x, Span<TResult> destination); 2617public static Span<T> Create<T>(int rank, ReadOnlySpan<nint> strides, out nint linearOffset, [UnscopedRef] out RentedBuffer<T> rentedBuffer) 2620Span<T> output = RentedBuffer<T>.Create(rank, out rentedBuffer); 2627public static Span<T> CreateUninitialized<T>(int rank, [UnscopedRef] out RentedBuffer<T> rentedBuffer) 2636public static Span<T> Create(int rank, [UnscopedRef] out RentedBuffer<T> rentedBuffer) 2643Span<T> resultBuffer = rentedBuffer._array.AsSpan(0, rank); 2652return ((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)
24public 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)
21public static void BitDecrement<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.BitIncrement.cs (1)
21public 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)
32public static void Clamp<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> min, ReadOnlySpan<T> max, Span<T> destination) 61public static void Clamp<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> min, T max, Span<T> destination) 90public static void Clamp<T>(ReadOnlySpan<T> x, T min, ReadOnlySpan<T> max, Span<T> destination) 119public static void Clamp<T>(T x, ReadOnlySpan<T> min, ReadOnlySpan<T> max, Span<T> destination) 146public static void Clamp<T>(ReadOnlySpan<T> x, T min, T max, Span<T> destination) 178public static void Clamp<T>(T x, ReadOnlySpan<T> min, T max, Span<T> destination) 205public 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)
15private 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)
29public 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)
22public static void IsCanonical<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsComplexNumber.cs (1)
22public static void IsComplexNumber<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsEvenInteger.cs (1)
23public static void IsEvenInteger<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsFinite.cs (1)
22public static void IsFinite<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsImaginaryNumber.cs (1)
22public static void IsImaginaryNumber<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsInfinity.cs (1)
22public static void IsInfinity<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsInteger.cs (1)
21public static void IsInteger<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNaN.cs (1)
22public static void IsNaN<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNegative.cs (1)
21public static void IsNegative<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNegativeInfinity.cs (1)
22public static void IsNegativeInfinity<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNormal.cs (1)
21public static void IsNormal<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsOddInteger.cs (1)
23public static void IsOddInteger<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsPositive.cs (1)
21public static void IsPositive<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsPositiveInfinity.cs (1)
22public static void IsPositiveInfinity<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsPow2.cs (1)
21public static void IsPow2<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsRealNumber.cs (1)
22public static void IsRealNumber<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsSubnormal.cs (1)
22public static void IsSubnormal<T>(ReadOnlySpan<T> x, Span<bool> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.IsZero.cs (1)
21public 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)
60public static void Max<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 90public 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)
59public static void MaxNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 89public static void MaxNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Min.cs (2)
58public static void Min<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 88public 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)
59public static void MinNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 89public 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)
32/// Behaves the same as either <see cref="MultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, ReadOnlySpan{T}, Span{T})"/> or 33/// <see cref="FusedMultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, ReadOnlySpan{T}, Span{T})"/> depending on the current machine's capabilities. 36public static void MultiplyAddEstimate<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> addend, Span<T> destination) 65/// Behaves the same as either <see cref="MultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, T, Span{T})"/> or 66/// <see cref="FusedMultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, T, Span{T})"/> depending on the current machine's capabilities. 69public static void MultiplyAddEstimate<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T addend, Span<T> destination) 97/// Behaves the same as either <see cref="MultiplyAdd{T}(ReadOnlySpan{T}, T, ReadOnlySpan{T}, Span{T})"/> or 98/// <see cref="FusedMultiplyAdd{T}(ReadOnlySpan{T}, T, ReadOnlySpan{T}, Span{T})"/> depending on the current machine's capabilities. 101public 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)
24public static void Round<T>(ReadOnlySpan<T> x, Span<T> destination) 46public static void Round<T>(ReadOnlySpan<T> x, MidpointRounding mode, Span<T> destination) 92public static void Round<T>(ReadOnlySpan<T> x, int digits, Span<T> destination) where T : IFloatingPoint<T> => 109public 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 (3)
21public static void ShiftLeft<T>(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination) 36public static void ShiftRightArithmetic<T>(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination) 51public 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)
23public 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)
84scoped Span<nint> destinationLengths; 85scoped Span<nint> destinationStrides; 98destinationLengths = ((Span<nint>)_inlineLengths)[..rank]; 99destinationStrides = ((Span<nint>)_inlineStrides)[..rank]; 166scoped Span<int> stridesOrder; 176stridesOrder = ((Span<int>)stridesOrderBuffer)[..rank]; 289scoped Span<nint> destinationLengths; 290scoped Span<nint> destinationStrides; 303destinationLengths = ((Span<nint>)_inlineLengths)[..rank]; 304destinationStrides = ((Span<nint>)_inlineStrides)[..rank]; 412public nint AdjustToNextIndex(in TensorShape destinationShape, nint linearOffset, Span<nint> indexes) 477public nint AdjustToPreviousIndex(in TensorShape destinationShape, nint linearOffset, Span<nint> indexes) 542public static bool AdjustToNextIndex(Span<NRange> ranges, int dimension, ReadOnlySpan<nint> lengths) 711scoped Span<nint> lengths; 721lengths = ((Span<nint>)lengthsBuffer)[..rank]; 751scoped Span<nint> intermediateLengths = default; 778intermediateLengths = ((Span<nint>)intermediateLengthsBuffer)[..rank]; 1041scoped Span<nint> intermediateLengths; 1045scoped Span<nint> intermediateStrides; 1058intermediateLengths = ((Span<nint>)intermediateLengthsBuffer)[..rank]; 1061intermediateStrides = ((Span<nint>)intermediateStridesBuffer)[..rank];
System\Numerics\Tensors\netcore\TensorSpan_1.cs (7)
77public TensorSpan(Span<T> span) 85public TensorSpan(Span<T> span, scoped ReadOnlySpan<nint> lengths) 89public TensorSpan(Span<T> span, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) 250/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.FlattenTo(Span{T})" /> 251public void FlattenTo(scoped Span<T> destination) 317/// <inheritdoc cref="IReadOnlyTensor{TSelf, T}.TryFlattenTo(Span{T})" /> 318public bool TryFlattenTo(scoped Span<T> destination) => AsReadOnlyTensorSpan().TryFlattenTo(destination);
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (7)
16private static void ValidateInputOutputSpanNonOverlapping<T>(ReadOnlySpan<T> input, Span<T> destination) 29private static void ValidateOutputSpansNonOverlapping<T>(int inputLength, Span<T> destination1, Span<T> destination2) 49private static unsafe Span<TTo> Rename<TFrom, TTo>(Span<TFrom> span) 53return Unsafe.BitCast<Span<TFrom>, Span<TTo>>(span);
System\Numerics\Tensors\TensorPrimitives.Single.cs (28)
29public static void Abs(ReadOnlySpan<float> x, Span<float> destination) => 48public static void Add(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 65public static void Add(ReadOnlySpan<float> x, float y, Span<float> destination) => 86public static void AddMultiply(ReadOnlySpan<float> x, ReadOnlySpan<float> y, ReadOnlySpan<float> multiplier, Span<float> destination) => 106public static void AddMultiply(ReadOnlySpan<float> x, ReadOnlySpan<float> y, float multiplier, Span<float> destination) => 126public static void AddMultiply(ReadOnlySpan<float> x, float y, ReadOnlySpan<float> multiplier, Span<float> destination) => 150public static void Cosh(ReadOnlySpan<float> x, Span<float> destination) => 225public static void Divide(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 242public static void Divide(ReadOnlySpan<float> x, float y, Span<float> destination) => 289public static void Exp(ReadOnlySpan<float> x, Span<float> destination) => 378public static void Log(ReadOnlySpan<float> x, Span<float> destination) => 401public static void Log2(ReadOnlySpan<float> x, Span<float> destination) => 442public static void Max(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 478public static void MaxMagnitude(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 519public static void Min(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 560public static void MinMagnitude(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 579public static void Multiply(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 597public static void Multiply(ReadOnlySpan<float> x, float y, Span<float> destination) => 618public static void MultiplyAdd(ReadOnlySpan<float> x, ReadOnlySpan<float> y, ReadOnlySpan<float> addend, Span<float> destination) => 639public static void MultiplyAdd(ReadOnlySpan<float> x, ReadOnlySpan<float> y, float addend, Span<float> destination) => 659public static void MultiplyAdd(ReadOnlySpan<float> x, float y, ReadOnlySpan<float> addend, Span<float> destination) => 675public static void Negate(ReadOnlySpan<float> x, Span<float> destination) => 798public static void Sigmoid(ReadOnlySpan<float> x, Span<float> destination) 829public static void Sinh(ReadOnlySpan<float> x, Span<float> destination) => 848public static void SoftMax(ReadOnlySpan<float> x, Span<float> destination) 883public static void Subtract(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 900public static void Subtract(ReadOnlySpan<float> x, float y, Span<float> destination) => 982public static void Tanh(ReadOnlySpan<float> x, Span<float> destination) =>
System.Private.CoreLib (1197)
src\libraries\Common\src\Interop\Interop.Utils.cs (1)
22Span<char> buffer = stackalloc char[InitialSize];
src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (1)
24Span<uint> groups = stackalloc uint[InitialGroupsLength];
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (1)
33internal ReadOnlySpan<char> GetName(Span<char> buffer)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
38Span<byte> spanBuffer = stackalloc byte[StackBufferSize];
src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
43Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit
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\libraries\Common\src\System\HexConverter.cs (7)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 114private static void EncodeToUtf16_Vector128(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 260public static bool TryDecodeFromUtf16_Vector128(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
467Span<int> thousandsSepPos = stackalloc int[4];
src\libraries\Common\src\System\Number.NumberBuffer.cs (2)
32public Span<byte> Digits; 43public NumberBuffer(NumberBufferKind kind, Span<byte> digits)
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\libraries\Common\src\System\Sha1ForNonSecretPurposes.cs (1)
78public void Finish(Span<byte> output)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (3)
16private Span<byte> _bytes; 18public ValueUtf8Converter(Span<byte> initialBuffer) 24public Span<byte> ConvertAndTerminateString(ReadOnlySpan<char> value)
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\libraries\System.Private.CoreLib\src\System\Array.cs (7)
2475Span<T> keysSpan = UnsafeArrayAsSpan<T>(keys, adjustedIndex, length); 2498var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2547var span = new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), length); 2571var spanKeys = new Span<TKey>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(keys), index), length); 2572var spanItems = new Span<TValue>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(items), index), length); 2589var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 3059private static Span<T> UnsafeArrayAsSpan<T>(Array array, int adjustedIndex, int length) =>
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (14)
41public static bool TryWriteBytes(Span<byte> destination, bool value) 69public static bool TryWriteBytes(Span<byte> destination, char value) 97public static bool TryWriteBytes(Span<byte> destination, short value) 125public static bool TryWriteBytes(Span<byte> destination, int value) 153public static bool TryWriteBytes(Span<byte> destination, long value) 181public static bool TryWriteBytes(Span<byte> destination, Int128 value) 211public static bool TryWriteBytes(Span<byte> destination, ushort value) 241public static bool TryWriteBytes(Span<byte> destination, uint value) 271public static bool TryWriteBytes(Span<byte> destination, ulong value) 301public static bool TryWriteBytes(Span<byte> destination, UInt128 value) 329public static unsafe bool TryWriteBytes(Span<byte> destination, Half value) 357public static bool TryWriteBytes(Span<byte> destination, float value) 385public static bool TryWriteBytes(Span<byte> destination, double value) 816var dst = new Span<char>(ref result.GetRawStringData(), result.Length);
src\libraries\System.Private.CoreLib\src\System\Boolean.cs (1)
95public bool TryFormat(Span<char> destination, out int charsWritten)
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\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteBigEndian.cs (26)
21public static void WriteDoubleBigEndian(Span<byte> destination, double value) 44public static void WriteHalfBigEndian(Span<byte> destination, Half value) 67public static void WriteInt16BigEndian(Span<byte> destination, short value) 90public static void WriteInt32BigEndian(Span<byte> destination, int value) 113public static void WriteInt64BigEndian(Span<byte> destination, long value) 136public static void WriteInt128BigEndian(Span<byte> destination, Int128 value) 159public static void WriteIntPtrBigEndian(Span<byte> destination, nint value) 182public static void WriteSingleBigEndian(Span<byte> destination, float value) 206public static void WriteUInt16BigEndian(Span<byte> destination, ushort value) 230public static void WriteUInt32BigEndian(Span<byte> destination, uint value) 254public static void WriteUInt64BigEndian(Span<byte> destination, ulong value) 278public static void WriteUInt128BigEndian(Span<byte> destination, UInt128 value) 302public static void WriteUIntPtrBigEndian(Span<byte> destination, nuint value) 325public static bool TryWriteDoubleBigEndian(Span<byte> destination, double value) 346public static bool TryWriteHalfBigEndian(Span<byte> destination, Half value) 367public static bool TryWriteInt16BigEndian(Span<byte> destination, short value) 388public static bool TryWriteInt32BigEndian(Span<byte> destination, int value) 409public static bool TryWriteInt64BigEndian(Span<byte> destination, long value) 430public static bool TryWriteInt128BigEndian(Span<byte> destination, Int128 value) 451public static bool TryWriteIntPtrBigEndian(Span<byte> destination, nint value) 472public static bool TryWriteSingleBigEndian(Span<byte> destination, float value) 494public static bool TryWriteUInt16BigEndian(Span<byte> destination, ushort value) 516public static bool TryWriteUInt32BigEndian(Span<byte> destination, uint value) 538public static bool TryWriteUInt64BigEndian(Span<byte> destination, ulong value) 560public static bool TryWriteUInt128BigEndian(Span<byte> destination, UInt128 value) 582public static bool TryWriteUIntPtrBigEndian(Span<byte> destination, nuint value)
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteLittleEndian.cs (26)
21public static void WriteDoubleLittleEndian(Span<byte> destination, double value) 44public static void WriteHalfLittleEndian(Span<byte> destination, Half value) 67public static void WriteInt16LittleEndian(Span<byte> destination, short value) 90public static void WriteInt32LittleEndian(Span<byte> destination, int value) 113public static void WriteInt64LittleEndian(Span<byte> destination, long value) 136public static void WriteInt128LittleEndian(Span<byte> destination, Int128 value) 159public static void WriteIntPtrLittleEndian(Span<byte> destination, nint value) 182public static void WriteSingleLittleEndian(Span<byte> destination, float value) 206public static void WriteUInt16LittleEndian(Span<byte> destination, ushort value) 230public static void WriteUInt32LittleEndian(Span<byte> destination, uint value) 254public static void WriteUInt64LittleEndian(Span<byte> destination, ulong value) 278public static void WriteUInt128LittleEndian(Span<byte> destination, UInt128 value) 302public static void WriteUIntPtrLittleEndian(Span<byte> destination, nuint value) 325public static bool TryWriteDoubleLittleEndian(Span<byte> destination, double value) 346public static bool TryWriteHalfLittleEndian(Span<byte> destination, Half value) 367public static bool TryWriteInt16LittleEndian(Span<byte> destination, short value) 388public static bool TryWriteInt32LittleEndian(Span<byte> destination, int value) 409public static bool TryWriteInt64LittleEndian(Span<byte> destination, long value) 430public static bool TryWriteInt128LittleEndian(Span<byte> destination, Int128 value) 451public static bool TryWriteIntPtrLittleEndian(Span<byte> destination, nint value) 472public static bool TryWriteSingleLittleEndian(Span<byte> destination, float value) 494public static bool TryWriteUInt16LittleEndian(Span<byte> destination, ushort value) 516public static bool TryWriteUInt32LittleEndian(Span<byte> destination, uint value) 538public static bool TryWriteUInt64LittleEndian(Span<byte> destination, ulong value) 560public static bool TryWriteUInt128LittleEndian(Span<byte> destination, UInt128 value) 582public static bool TryWriteUIntPtrLittleEndian(Span<byte> destination, nuint value)
src\libraries\System.Private.CoreLib\src\System\Buffers\MemoryManager.cs (1)
21public abstract Span<T> GetSpan();
src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (2)
158internal Span<char> Format(Span<char> destination)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Decoder.cs (2)
32public static OperationStatus DecodeFromUtf8(ReadOnlySpan<byte> utf8, Span<byte> bytes, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) => 64public static OperationStatus DecodeFromUtf8InPlace(Span<byte> buffer, out int bytesWritten) =>
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Encoder.cs (2)
34public static OperationStatus EncodeToUtf8(ReadOnlySpan<byte> bytes, Span<byte> utf8, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) => 66public static OperationStatus EncodeToUtf8InPlace(Span<byte> buffer, int dataLength, out int bytesWritten) =>
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (8)
17internal static unsafe OperationStatus DecodeFrom<TBase64Decoder, T>(TBase64Decoder decoder, ReadOnlySpan<T> source, Span<byte> bytes, 266static OperationStatus InvalidDataFallback(TBase64Decoder decoder, ReadOnlySpan<T> source, Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock) 317internal static unsafe OperationStatus DecodeFromUtf8InPlace<TBase64Decoder>(TBase64Decoder decoder, Span<byte> buffer, out int bytesWritten, bool ignoreWhiteSpace) 449internal static OperationStatus DecodeWithWhiteSpaceBlockwise<TBase64Decoder>(TBase64Decoder decoder, ReadOnlySpan<byte> source, Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock = true) 453Span<byte> buffer = stackalloc byte[BlockSize]; 566private static OperationStatus DecodeWithWhiteSpaceFromUtf8InPlace<TBase64Decoder>(TBase64Decoder decoder, Span<byte> source, ref int destIndex, uint sourceIndex) 570Span<byte> buffer = stackalloc byte[BlockSize]; 1466Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock = true)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64EncoderHelper.cs (2)
17Span<T> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) 586internal static unsafe OperationStatus EncodeToUtf8InPlace<TBase64Encoder>(TBase64Encoder encoder, Span<byte> buffer, int dataLength, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64Helper.cs (1)
250Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock = true)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlDecoder.cs (13)
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, 206ReadOnlySpan<ushort> source, Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock = true) 210Span<ushort> buffer = stackalloc ushort[BlockSize]; 332public static int DecodeFromChars(ReadOnlySpan<char> source, Span<byte> destination) 359public static bool TryDecodeFromChars(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 383Span<byte> destination = (uint)upperBound <= MaxStackallocThreshold 605public OperationStatus DecodeWithWhiteSpaceBlockwiseWrapper<TBase64Decoder>(TBase64Decoder decoder, ReadOnlySpan<byte> utf8, Span<byte> bytes, 853public OperationStatus DecodeWithWhiteSpaceBlockwiseWrapper<TBase64Decoder>(TBase64Decoder decoder, ReadOnlySpan<ushort> source, Span<byte> bytes,
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlEncoder.cs (7)
30Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) => 67public static int EncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> destination) 106public static OperationStatus EncodeToChars(ReadOnlySpan<byte> source, Span<char> destination, 118public static int EncodeToChars(ReadOnlySpan<byte> source, Span<char> destination) 180public static bool TryEncodeToChars(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 195public static bool TryEncodeToUtf8(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 213public static bool TryEncodeToUtf8InPlace(Span<byte> buffer, int dataLength, out int bytesWritten)
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\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\FormattingHelpers.cs (2)
11public static bool TryFormat<T>(T value, Span<byte> utf8Destination, out int bytesWritten, StandardFormat format) where T : IUtf8SpanFormattable 13scoped Span<char> formatText = default;
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\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\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\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\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\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\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\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Number.cs (1)
32Span<byte> digits = number.Digits;
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) 368/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 369bool IBinaryInteger<byte>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 386/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 387bool IBinaryInteger<byte>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Char.cs (6)
178bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) 192bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 1314/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 1315bool IBinaryInteger<char>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 1327/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 1328bool IBinaryInteger<char>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (15)
98BinaryPrimitives.ReverseEndianness(array, MemoryMarshal.Cast<byte, int>((Span<byte>)_array)); 120MemoryMarshal.Cast<byte, int>((Span<byte>)_array)[(int)index] &= ReverseIfBE((1 << (int)extraBits) - 1); 252BinaryPrimitives.ReverseEndianness(values, MemoryMarshal.Cast<byte, int>((Span<byte>)_array)); 440Span<int> thisRemaining = MemoryMarshal.Cast<byte, int>(((Span<byte>)thisArray).Slice(i, roundedBytesRemaining)); 441Span<int> valueRemaining = MemoryMarshal.Cast<byte, int>(((Span<byte>)valueArray).Slice(i, roundedBytesRemaining)); 516Span<int> intSpan = MemoryMarshal.Cast<byte, int>((Span<byte>)_array); 579Span<int> intSpan = MemoryMarshal.Cast<byte, int>((Span<byte>)_array); 680Span<int> source = MemoryMarshal.Cast<byte, int>((Span<byte>)_array).Slice(0, intLength); 732Span<int> in32Span = MemoryMarshal.Cast<byte, int>((Span<byte>)_array);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (53)
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
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\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (4)
1582Span<int> span = stackalloc int[StackAllocThreshold]; 1650Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1655Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1738Span<int> span = stackalloc int[StackAllocThreshold];
src\libraries\System.Private.CoreLib\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\libraries\System.Private.CoreLib\src\System\Convert.Base64.cs (1)
31private static bool TryDecodeFromUtf16(ReadOnlySpan<char> utf16, Span<byte> bytes, out int consumed, out int written)
src\libraries\System.Private.CoreLib\src\System\Convert.cs (11)
2300Span<char> chars = stackalloc char[22]; // max length of a ulong in octal 2429public static unsafe bool TryToBase64Chars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten, Base64FormattingOptions options = Base64FormattingOptions.None) 2473private static void ToBase64CharsLargeNoLineBreaks(ReadOnlySpan<byte> bytes, Span<char> chars, int charLengthRequired) 2659public static bool TryFromBase64String(string s, Span<byte> bytes, out int bytesWritten) 2669public static bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 2673Span<char> tempBuffer = stackalloc char[4]; // Note: The tempBuffer size could be made larger than 4 but the size must be a multiple of 4. 2763private static void CopyToTempBufferWithoutWhiteSpace(ReadOnlySpan<char> chars, Span<char> tempBuffer, out int consumed, out int charsWritten) 2971public static OperationStatus FromHexString(string source, Span<byte> destination, out int charsConsumed, out int bytesWritten) 2990public static OperationStatus FromHexString(ReadOnlySpan<char> source, Span<byte> destination, out int charsConsumed, out int bytesWritten) 3095public static bool TryToHexString(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 3172public static bool TryToHexStringLower(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten)
src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (3)
784public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 788public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 791private bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format, IFormatProvider? provider = null)
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (2)
1773public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 1777public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) =>
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\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) 1144/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 1145bool IFloatingPoint<decimal>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 1158/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 1159bool IFloatingPoint<decimal>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 1172/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 1173bool IFloatingPoint<decimal>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 1201/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 1202bool IFloatingPoint<decimal>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
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\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (4)
483Span<int> refObjPosition = stackalloc int[EtwAPIMaxRefObjCount]; 484Span<object?> dataRefObj = eightObjectStack; 523Span<object?> newDataRefObj = new object?[dataRefObj.Length * 2]; 527Span<int> newRefObjPosition = new int[refObjPosition.Length * 2];
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
5632Span<char> ulongHexScratch = stackalloc char[16]; // long enough for ulong.MaxValue formatted as hex
src\libraries\System.Private.CoreLib\src\System\Double.cs (10)
375public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 381public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 722/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 723bool IFloatingPoint<double>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 735/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 736bool IFloatingPoint<double>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 748/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 749bool IFloatingPoint<double>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 761/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 762bool IFloatingPoint<double>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Enum.cs (12)
1553private static unsafe bool TryFormatNumberAsHex<TStorage>(ref byte data, Span<char> destination, out int charsWritten) where TStorage : struct 1687bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) 1747public static unsafe bool TryFormat<TEnum>(TEnum value, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.EnumFormat)] ReadOnlySpan<char> format = default) where TEnum : struct 1803internal static unsafe bool TryFormatUnconstrained<TEnum>(TEnum value, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.EnumFormat)] ReadOnlySpan<char> format = default) 1856private static bool TryFormatPrimitiveDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten) 1891private static bool TryFormatPrimitiveNonDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format) 1942Span<int> foundItems = stackalloc int[64]; 1961private static bool TryFormatFlagNames<TStorage>(EnumInfo<TStorage> enumInfo, TStorage resultValue, Span<char> destination, out int charsWritten, ref bool isDestinationTooSmall) 1986Span<int> foundItems = stackalloc int[64]; 2061private static bool TryFindFlagsNames<TStorage>(TStorage resultValue, string[] names, TStorage[] values, int index, Span<int> foundItems, out int resultLength, out int foundItemsCount) 2107private static void WriteMultipleFoundFlagsNames(string[] names, ReadOnlySpan<int> foundItems, Span<char> destination) 2116Span<char> afterSeparator = destination.Slice(2); // done before copying ", " to eliminate those two bounds checks
src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Windows.cs (1)
36Span<char> span = stackalloc char[128];
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\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (1)
182Span<char> modifiedPattern = stackalloc char[s.Length + 2];
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\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\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\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (2)
156Span<byte> span = (uint)sortKeyLength <= 512 ? 423private unsafe int NlsGetSortKey(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options)
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Utf8.cs (2)
82scoped Span<char> sourceUtf16; 113scoped Span<char> prefixUtf16;
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (1)
738Span<char> normalizedName = stackalloc char[name.Length];
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\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\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (2)
5871Span<char> result = new char[i + 1]; 5898Span<char> result = new char[Value.Length - i];
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\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\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Nls.cs (1)
192Span<Range> names = stackalloc Range[5];
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\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\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\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (1)
686internal static int ToUpperOrdinal(ReadOnlySpan<char> source, Span<char> destination)
src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (2)
148public static void ToUpperInvariantMode(this ReadOnlySpan<char> source, Span<char> destination) 156internal static void ToUpperOrdinal(ReadOnlySpan<char> source, Span<char> destination)
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (6)
211internal void ChangeCaseToLower(ReadOnlySpan<char> source, Span<char> destination) 218internal void ChangeCaseToUpper(ReadOnlySpan<char> source, Span<char> destination) 225private unsafe void ChangeCaseCommon<TConversion>(ReadOnlySpan<char> source, Span<char> destination) where TConversion : struct 330Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 349Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 660Span<char> dst = stackalloc char[2];
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (4)
51internal static 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\libraries\System.Private.CoreLib\src\System\Guid.cs (13)
518Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 604Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 950Span<byte> destUtf8Span = new byte[srcUtf8Span.Length]; 1022public bool TryWriteBytes(Span<byte> destination) 1041public bool TryWriteBytes(Span<byte> destination, bool bigEndian, out int bytesWritten) 1244public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format = default) => 1247bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format, IFormatProvider? provider) => 1251public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format = default) => 1254bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format, IFormatProvider? provider) => 1267private bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format) where TChar : unmanaged, IUtfChar<TChar> 1314internal unsafe bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, int flags) where TChar : unmanaged, IUtfChar<TChar> 1439private bool TryFormatX<TChar>(Span<TChar> dest, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1489static void WriteHex(Span<TChar> dest, int offset, int val, bool appendComma = true)
src\libraries\System.Private.CoreLib\src\System\Half.cs (10)
543public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 549public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 1365/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 1366bool IFloatingPoint<Half>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 1379/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 1380bool IFloatingPoint<Half>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 1393/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 1394bool IFloatingPoint<Half>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 1406/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 1407bool IFloatingPoint<Half>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
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\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) 936/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 937bool IBinaryInteger<Int128>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 949/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 950bool IBinaryInteger<Int128>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
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) 465/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 466bool IBinaryInteger<short>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 478/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 479bool IBinaryInteger<short>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
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) 504/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 505bool IBinaryInteger<int>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 517/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 518bool IBinaryInteger<int>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
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) 501/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 502bool IBinaryInteger<long>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 514/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 515bool IBinaryInteger<long>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (6)
211public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 215public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 506/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 507bool IBinaryInteger<nint>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 519/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 520bool IBinaryInteger<nint>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
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 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\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) */]; 359Span<byte> buffer = stackalloc byte[128];
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\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (1)
36Span<byte> path = (uint)totalByteCount <= 256 ? stackalloc byte[totalByteCount] : new byte[totalByteCount];
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\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\libraries\System.Private.CoreLib\src\System\IO\File.cs (3)
1463Span<byte> buffer = stackalloc byte[512]; 1525Span<byte> bytes = (uint)bytesNeeded <= 1024 ? stackalloc byte[1024] : (rentedBytes = ArrayPool<byte>.Shared.Rent(bytesNeeded)); 1544Span<byte> toStore = bytes.Slice(0, preambleSize + encoded);
src\libraries\System.Private.CoreLib\src\System\IO\FileStream.cs (2)
285public override int Read(Span<byte> buffer) => _strategy.Read(buffer); 616internal int BaseRead(Span<byte> buffer) => base.Read(buffer);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (1)
345public override int Read(Span<byte> buffer)
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\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
106Span<byte> path = (uint)totalByteCount <= 256 ? stackalloc byte[totalByteCount] : new byte[totalByteCount];
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\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.cs (1)
67public static int Read(SafeFileHandle handle, Span<byte> buffer, long fileOffset)
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (4)
25internal static unsafe int ReadAtOffset(SafeFileHandle handle, Span<byte> buffer, long fileOffset) 64Span<Interop.Sys.IOVector> vectors = buffers.Count <= IovStackThreshold ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[buffers.Count]; 170Span<Interop.Sys.IOVector> vectors = buffersCount <= IovStackThreshold ? 191Span<Interop.Sys.IOVector> left = vectors.Slice(buffersOffset);
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\libraries\System.Private.CoreLib\src\System\IO\Strategies\DerivedFileStreamStrategy.cs (1)
79public override int Read(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
209public sealed override int Read(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (6)
780public virtual int Read(Span<byte> buffer) 817public void ReadExactly(Span<byte> buffer) => 878public int ReadAtLeast(Span<byte> buffer, int minimumBytes, bool throwOnEndOfStream = true) 886private int ReadAtLeastCore(Span<byte> buffer, int minimumBytes, bool throwOnEndOfStream) 1047public override int Read(Span<byte> buffer) => 0; 1195public override int Read(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (6)
360public override int Read(Span<char> buffer) => 364private int ReadSpan(Span<char> buffer) 441public override int ReadBlock(Span<char> buffer) 668private int ReadBuffer(Span<char> userBuffer, out bool readToUserBuffer) 1425public override int Read(Span<char> buffer) => 0; 1434public override int ReadBlock(Span<char> buffer) => 0;
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
300scoped Span<byte> byteBuffer;
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\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\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (1)
463Span<int> bits = stackalloc int[4];
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (2)
342public override int Read(Span<byte> buffer) 357internal int ReadCore(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStreamWrapper.cs (1)
75public override int Read(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\ISpanFormattable.cs (1)
20bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider);
src\libraries\System.Private.CoreLib\src\System\IUtf8SpanFormattable.cs (1)
19bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider);
src\libraries\System.Private.CoreLib\src\System\Marvin.OrdinalIgnoreCase.cs (1)
86Span<char> scratch = (uint)count <= 64 ? stackalloc char[64] : (borrowedArr = ArrayPool<char>.Shared.Rent(count));
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\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> => 701public static int IndexOf<T>(this Span<T> span, T value) where T : IEquatable<T>? => 711public static int IndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 721public static int LastIndexOf<T>(this Span<T> span, T value) where T : IEquatable<T>? => 731public static int LastIndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 743public static int IndexOfAnyExcept<T>(this Span<T> span, T value) where T : IEquatable<T>? => 756public static int IndexOfAnyExcept<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 770public static int IndexOfAnyExcept<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 782public static int IndexOfAnyExcept<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 795public static int IndexOfAnyExcept<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 1321public static int LastIndexOfAnyExcept<T>(this Span<T> span, T value) where T : IEquatable<T>? => 1334public static int LastIndexOfAnyExcept<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 1348public static int LastIndexOfAnyExcept<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 1360public static int LastIndexOfAnyExcept<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 1373public static int LastIndexOfAnyExcept<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 1895public static int IndexOfAnyInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 1960public static int IndexOfAnyExceptInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 2025public static int LastIndexOfAnyInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 2090public static int LastIndexOfAnyExceptInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 2166public static bool SequenceEqual<T>(this Span<T> span, ReadOnlySpan<T> other) where T : IEquatable<T>? => 2173public static int SequenceCompareTo<T>(this Span<T> span, ReadOnlySpan<T> other) where T : IComparable<T>? => 2588public static int IndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 2600public static int IndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 2610public static int IndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 2620public static int IndexOfAny<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 2630public static int IndexOfAny(this Span<char> span, SearchValues<string> values) => 3018public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 3030public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 3040public static int LastIndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 3050public static int LastIndexOfAny<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 3444public static bool SequenceEqual<T>(this Span<T> span, ReadOnlySpan<T> other, IEqualityComparer<T>? comparer = null) => 3553public static bool StartsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 3593public static bool EndsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 3683public static void Reverse<T>(this Span<T> span) 3695public static Span<T> AsSpan<T>(this T[]? array) 3713public static Span<T> AsSpan<T>(this T[]? array, int start, int length) 3722public static Span<T> AsSpan<T>(this ArraySegment<T> segment) 3739public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start) 3754public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Index startIndex) 3773public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start, int length) 3789public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Range range) 3922public static void CopyTo<T>(this T[]? source, Span<T> destination) 4076public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other) => 4084public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other, out int elementOffset) => 4137/// Searches an entire sorted <see cref="Span{T}"/> for a value 4141/// <param name="span">The sorted <see cref="Span{T}"/> to search.</param> 4147/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 4154public static int BinarySearch<T>(this Span<T> span, IComparable<T> comparable) => 4158/// Searches an entire sorted <see cref="Span{T}"/> for a value 4163/// <param name="span">The sorted <see cref="Span{T}"/> to search.</param> 4169/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 4177this Span<T> span, TComparable comparable) 4182/// Searches an entire sorted <see cref="Span{T}"/> for the specified <paramref name="value"/> 4187/// <param name="span">The sorted <see cref="Span{T}"/> to search.</param> 4194/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 4202this Span<T> span, T value, TComparer comparer) 4284/// Sorts the elements in the entire <see cref="Span{T}" /> using the <see cref="IComparable{T}" /> implementation 4285/// of each element of the <see cref= "Span{T}" /> 4288/// <param name="span">The <see cref="Span{T}"/> to sort.</param> 4292public static void Sort<T>(this Span<T> span) => 4296/// Sorts the elements in the entire <see cref="Span{T}" /> using the <typeparamref name="TComparer" />. 4300/// <param name="span">The <see cref="Span{T}"/> to sort.</param> 4312public static void Sort<T, TComparer>(this Span<T> span, TComparer comparer) where TComparer : IComparer<T>? 4321/// Sorts the elements in the entire <see cref="Span{T}" /> using the specified <see cref="Comparison{T}" />. 4324/// <param name="span">The <see cref="Span{T}"/> to sort.</param> 4327public static void Sort<T>(this Span<T> span, Comparison<T> comparison) 4340/// based on the keys in the first <see cref="Span{TKey}" /> using the <see cref="IComparable{T}" /> 4353public static void Sort<TKey, TValue>(this Span<TKey> keys, Span<TValue> items) => 4358/// based on the keys in the first <see cref="Span{TKey}" /> using the specified comparer. 4376public static void Sort<TKey, TValue, TComparer>(this Span<TKey> keys, Span<TValue> items, TComparer comparer) where TComparer : IComparer<TKey>? 4389/// based on the keys in the first <see cref="Span{TKey}" /> using the specified comparison. 4400public static void Sort<TKey, TValue>(this Span<TKey> keys, Span<TValue> items, Comparison<TKey> comparison) 4421public static unsafe void Replace<T>(this Span<T> span, T oldValue, T newValue) where T : IEquatable<T>? 4487public static unsafe void Replace<T>(this Span<T> span, T oldValue, T newValue, IEqualityComparer<T>? comparer = null) 4541static void ReplaceDefaultComparer(Span<T> span, T oldValue, T newValue) 4555static void ReplaceComparer(Span<T> span, T oldValue, T newValue, IEqualityComparer<T>? comparer) 4580public static unsafe void Replace<T>(this ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue) where T : IEquatable<T>? 4664public static unsafe void Replace<T>(this ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue, IEqualityComparer<T>? comparer = null) 4736static void ReplaceDefaultComparer(ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue) 4747static void ReplaceComparer(ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue, IEqualityComparer<T>? comparer) 4772public static void ReplaceAny<T>(this ReadOnlySpan<T> source, Span<T> destination, SearchValues<T> values, T newValue) where T : IEquatable<T>? 4798public static void ReplaceAny<T>(this Span<T> span, SearchValues<T> values, T newValue) where T : IEquatable<T>? 4822public static void ReplaceAnyExcept<T>(this ReadOnlySpan<T> source, Span<T> destination, SearchValues<T> values, T newValue) where T : IEquatable<T>? 4847public static void ReplaceAnyExcept<T>(this Span<T> span, SearchValues<T> values, T newValue) where T : IEquatable<T>? 4863public static int CommonPrefixLength<T>(this Span<T> span, ReadOnlySpan<T> other) => 4873public static int CommonPrefixLength<T>(this Span<T> span, ReadOnlySpan<T> other, IEqualityComparer<T>? comparer) => 5004/// or when <see cref="SplitAny(ReadOnlySpan{char}, Span{Range}, ReadOnlySpan{char}, StringSplitOptions)"/> 5054public static int Split(this ReadOnlySpan<char> source, Span<Range> destination, char separator, StringSplitOptions options = StringSplitOptions.None) 5088public static int Split(this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<char> separator, StringSplitOptions options = StringSplitOptions.None) 5144public static int SplitAny(this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<char> separators, StringSplitOptions options = StringSplitOptions.None) 5185public static int SplitAny(this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<string> separators, StringSplitOptions options = StringSplitOptions.None) 5209ReadOnlySpan<char> source, Span<Range> destination, 5282Span<Range> destinationMinusOne = destination.Slice(0, destination.Length - 1); 5366public static int Count<T>(this Span<T> span, T value) where T : IEquatable<T>? => 5500public static int Count<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 5633public static bool TryWrite(this Span<char> destination, [InterpolatedStringHandlerArgument(nameof(destination))] ref TryWriteInterpolatedStringHandler handler, out int charsWritten) 5653public static bool TryWrite(this Span<char> destination, IFormatProvider? provider, [InterpolatedStringHandlerArgument(nameof(destination), nameof(provider))] ref TryWriteInterpolatedStringHandler handler, out int charsWritten) => 5671public static bool TryWrite<TArg0>(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0) 5693public static bool TryWrite<TArg0, TArg1>(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0, TArg1 arg1) 5717public static bool TryWrite<TArg0, TArg1, TArg2>(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0, TArg1 arg1, TArg2 arg2) 5737public static bool TryWrite(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, params object?[] args) 5756public static bool TryWrite(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, params ReadOnlySpan<object?> args) 5769private 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) 6012private readonly Span<char> _destination; 6029/// <summary>Creates a handler used to write an interpolated string into a <see cref="Span{Char}"/>.</summary> 6035public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, Span<char> destination, out bool shouldAppend) 6044/// <summary>Creates a handler used to write an interpolated string into a <see cref="Span{Char}"/>.</summary> 6051public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, Span<char> destination, IFormatProvider? provider, out bool shouldAppend)
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (6)
197public static int ToLower(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo? culture) 223public static int ToLowerInvariant(this ReadOnlySpan<char> source, Span<char> destination) 249public static int ToUpper(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo? culture) 275public static int ToUpperInvariant(this ReadOnlySpan<char> source, Span<char> destination) 382public static SpanRuneEnumerator EnumerateRunes(this Span<char> span) 409public static SpanLineEnumerator EnumerateLines(this Span<char> span)
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\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\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (1)
56private static unsafe uint Dragon4(ulong mantissa, int exponent, uint mantissaHighBitIdx, bool hasUnequalMargins, int cutoffNumber, bool isSignificantDigits, Span<byte> buffer, out int decimalExponent)
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (33)
324public static unsafe bool TryFormatDecimal<TChar>(decimal value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 503public static bool TryFormatFloat<TNumber, TChar>(TNumber value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten) 610private static bool TryCopyTo<TChar>(string source, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 617if (source.TryCopyTo(Unsafe.BitCast<Span<TChar>, Span<char>>(destination))) 628return Encoding.UTF8.TryGetBytes(source, Unsafe.BitCast<Span<TChar>, Span<byte>>(destination), out charsWritten); 699public static bool TryFormatInt32<TChar>(int value, int hexMask, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 711static unsafe bool TryFormatInt32Slow(int value, int hexMask, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 813public static bool TryFormatUInt32<TChar>(uint value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 825static unsafe bool TryFormatUInt32Slow(uint value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 929public static bool TryFormatInt64<TChar>(long value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 943static unsafe bool TryFormatInt64Slow(long value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1045public static bool TryFormatUInt64<TChar>(ulong value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1057static unsafe bool TryFormatUInt64Slow(ulong value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1162public static bool TryFormatInt128<TChar>(Int128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1176static unsafe bool TryFormatInt128Slow(Int128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1280public static bool TryFormatUInt128<TChar>(UInt128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1292static unsafe bool TryFormatUInt128Slow(UInt128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1400internal static unsafe bool TryNegativeInt32ToDecStr<TChar>(int value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1449internal static unsafe bool TryInt32ToHexStr<TChar>(int value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1505private static unsafe bool TryUInt32ToBinaryStr<TChar>(uint value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1724internal static unsafe bool TryUInt32ToDecStr<TChar>(uint value, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1744internal static unsafe bool TryUInt32ToDecStr<TChar>(uint value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1833internal static unsafe bool TryNegativeInt64ToDecStr<TChar>(long value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1882internal static unsafe bool TryInt64ToHexStr<TChar>(long value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1954private static unsafe bool TryUInt64ToBinaryStr<TChar>(ulong value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2152internal static unsafe bool TryUInt64ToDecStr<TChar>(ulong value, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2173internal static unsafe bool TryUInt64ToDecStr<TChar>(ulong value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2261private static unsafe bool TryNegativeInt128ToDecStr<TChar>(Int128 value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2314private static unsafe bool TryInt128ToHexStr<TChar>(Int128 value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2377private static unsafe bool TryUInt128ToBinaryStr<TChar>(Int128 value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2514private static unsafe bool TryUInt128ToDecStr<TChar>(UInt128 value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
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\libraries\System.Private.CoreLib\src\System\Numerics\IBinaryInteger.cs (6)
183/// <summary>Gets the number of bytes that will be written as part of <see cref="TryWriteLittleEndian(Span{byte}, out int)" />.</summary> 184/// <returns>The number of bytes that will be written as part of <see cref="TryWriteLittleEndian(Span{byte}, out int)" />.</returns> 195bool TryWriteBigEndian(Span<byte> destination, out int bytesWritten); 201bool TryWriteLittleEndian(Span<byte> destination, out int bytesWritten); 231int WriteBigEndian(Span<byte> destination) 268int WriteLittleEndian(Span<byte> destination)
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\libraries\System.Private.CoreLib\src\System\Numerics\INumberBase.cs (6)
309scoped Span<char> utf16Text; 443scoped Span<char> utf16Text; 486bool 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\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\libraries\System.Private.CoreLib\src\System\Numerics\Vector_1.cs (9)
123public Vector(Span<T> values) : this((ReadOnlySpan<T>)values) 667public void CopyTo(Span<byte> destination) 683public void CopyTo(Span<T> destination) 788public bool TryCopyTo(Span<byte> destination) 805public bool TryCopyTo(Span<T> destination) 895/// <inheritdoc cref="ISimdVector{TSelf, T}.CopyTo(TSelf, Span{T})" /> 896static void ISimdVector<Vector<T>, T>.CopyTo(Vector<T> vector, Span<T> destination) => vector.CopyTo(destination); 1218/// <inheritdoc cref="ISimdVector{TSelf, T}.TryCopyTo(TSelf, Span{T})" /> 1219static bool ISimdVector<Vector<T>, T>.TryCopyTo(Vector<T> vector, Span<T> destination) => vector.TryCopyTo(destination);
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\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (4)
1018/// <summary>Copies the vector to the given <see cref="Span{T}" />. The length of the destination span must be at least 3.</summary> 1022public readonly void CopyTo(Span<float> destination) 1032/// <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> 1036public readonly bool TryCopyTo(Span<float> destination)
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\libraries\System.Private.CoreLib\src\System\OperatingSystem.cs (1)
108Span<char> stackBuffer = stackalloc char[128];
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\libraries\System.Private.CoreLib\src\System\Random.cs (7)
180public virtual void NextBytes(Span<byte> buffer) => _impl.NextBytes(buffer); 193public void GetItems<T>(ReadOnlySpan<T> choices, Span<T> destination) 213Span<byte> randomBytes = stackalloc byte[512]; 364public void Shuffle<T>(Span<T> values) 387/// <seealso cref="GetItems{T}(ReadOnlySpan{T}, Span{T})" /> 422public void GetHexString(Span<char> destination, bool lowercase = false) => 566public override void NextBytes(Span<byte> buffer) => LocalRandom.NextBytes(buffer);
src\libraries\System.Private.CoreLib\src\System\Random.ImplBase.cs (1)
34public abstract void NextBytes(Span<byte> buffer);
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\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\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (1)
238Span<T> memoryManagerSpan = Unsafe.As<MemoryManager<T>>(tmpObject).GetSpan();
src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (2)
307public void CopyTo(Span<T> destination) 331public bool TryCopyTo(Span<T> destination)
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (1)
327Span<byte> utf8Bytes = stackalloc byte[4];
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyNameHelpers.StrongName.cs (1)
22Span<byte> hash = stackalloc byte[20];
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (12)
202public object Invoke(Span<object?> arguments) 243internal object InvokeWithFewArgs(Span<object?> arguments) 248Span<object?> copyOfArgs = ((Span<object?>)stackArgStorage._args).Slice(0, _argCount); 249scoped Span<bool> shouldCopyBack = ((Span<bool>)stackArgStorage._shouldCopyBack).Slice(0, _argCount); 282return InvokeDirectByRefWithFewArgs(((Span<object?>)stackStorage._args).Slice(0, _argCount)); 285internal unsafe object InvokeDirectByRefWithFewArgs(Span<object?> copyOfArgs) 305internal unsafe object InvokeWithManyArgs(Span<object?> arguments) 307Span<object?> copyOfArgs; 354scoped Span<bool> shouldCopyBack = stackalloc bool[_argCount]; 389internal void CopyBack(Span<object?> dest, ReadOnlySpan<object?> copyOfParameters, ReadOnlySpan<bool> shouldCopyBack)
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (3)
16internal delegate object? InvokeFunc_ObjSpanArgs(object? obj, Span<object?> arguments); 94Type[] delegateParameters = [typeof(object), typeof(Span<object>)]; 330s_Span_get_Item ??= typeof(Span<object>).GetProperty("Item")!.GetGetMethod()!;
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Constructor.cs (2)
26scoped Span<bool> shouldCopyBack = stackalloc bool[argCount]; 29Span<object?> copyOfArgs = new(ref Unsafe.AsRef<object?>(pStorage), argCount);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (15)
78Span<object?> copyOfArgs = new(ref copyOfArg); 81Span<bool> shouldCopyBack = new(ref copyBack); 121Span<object?> copyOfArgs = ((Span<object?>)stackArgStorage._args).Slice(0, _argCount); 122Span<bool> shouldCopyBack = ((Span<bool>)stackArgStorage._shouldCopyBack).Slice(0, _argCount); 153internal unsafe object? InvokeDirectByRefWithFewArgs(object? obj, Span<object?> copyOfArgs, BindingFlags invokeAttr) 191Span<object?> copyOfArgs; 194Span<bool> shouldCopyBack; 292Span<object?> copyOfArgs = new(ref copyOfArg, 1); 295Span<bool> shouldCopyBack = new(ref copyBack, 1); // Not used for setters 324internal void CopyBack(object?[] dest, Span<object?> copyOfParameters, Span<bool> shouldCopyBack) 347Span<object?> copyOfParameters, 348Span<bool> shouldCopyBack,
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (14)
239public object? Invoke(object? obj, Span<object?> arguments) 296internal object? InvokeWithFewArgs(object? obj, Span<object?> arguments) 301Span<object?> copyOfArgs = ((Span<object?>)stackArgStorage._args).Slice(0, _argCount); 302scoped Span<bool> shouldCopyBack = ((Span<bool>)stackArgStorage._shouldCopyBack).Slice(0, _argCount); 335return InvokeDirectByRefWithFewArgs(obj, ((Span<object?>)stackStorage._args).Slice(0, _argCount)); 338internal unsafe object? InvokeDirectByRefWithFewArgs(object? obj, Span<object?> copyOfArgs) 358internal unsafe object? InvokeWithManyArgs(object? obj, Span<object?> arguments) 360Span<object?> copyOfArgs; 407scoped Span<bool> shouldCopyBack = stackalloc bool[_argCount]; 442internal void CopyBack(Span<object?> dest, Span<object?> copyOfParameters, Span<bool> shouldCopyBack)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (1)
605Span<int> bits = stackalloc int[4];
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\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (8)
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. 52/// <see cref="BitArray.Length"/>. The returned span's <see cref="Span{Byte}.Length"/> will be the smallest number 58/// The length of the <see cref="BitArray"/> should not be changed while the resulting <see cref="Span{Byte}"/> 63public static Span<byte> AsBytes(BitArray? array) =>
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (3)
827Span<IntPtr> runtimeDefinedVtable = stackalloc IntPtr[3]; 868Span<InternalComInterfaceDispatch> dispatches = new Span<InternalComInterfaceDispatch>(pDispatches, numSections); 872Span<IntPtr> dispatchVtables = dispatches[i].Vtables;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
53internal static unsafe void GetAnsiStringBytes(ReadOnlySpan<char> chars, Span<byte> bytes)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\AnsiStringMarshaller.cs (2)
28Span<byte> buffer = new(mem, exactByteCount); 67public void FromManaged(string? managed, Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (7)
59/// <returns>The <see cref="Span{TUnmanagedElement}"/> of unmanaged elements.</returns> 60public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 81/// <returns>The <see cref="Span{T}"/> of managed elements.</returns> 82public static Span<T> GetManagedValuesDestination(T[]? managed) 117private Span<TUnmanagedElement> _span; 128public void FromManaged(T[]? array, Span<TUnmanagedElement> buffer) 164public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
64public void FromManaged(string? managed, Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (1)
84public Span<T> AsSpan() => new(_data, _numElements);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (7)
60/// <returns>The <see cref="Span{TUnmanagedElement}"/> of unmanaged elements.</returns> 61public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 82/// <returns>The <see cref="Span{T}"/> of managed elements.</returns> 83public static Span<IntPtr> GetManagedValuesDestination(T*[]? managed) 118private Span<TUnmanagedElement> _span; 129public void FromManaged(T*[]? array, Span<TUnmanagedElement> buffer) 165public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (5)
71public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 88private Span<TUnmanagedElement> _span; 99public void FromManaged(ReadOnlySpan<T> managed, Span<TUnmanagedElement> buffer) 136public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span; 212public Span<T> GetManagedValuesDestination(int numElements)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (17)
12/// Supports marshalling a <see cref="Span{T}"/> from managed value 18/// A <see cref="Span{T}"/> marshalled with this marshaller will match the semantics of <see cref="MemoryMarshal.GetReference{T}(Span{T})"/>. 22[CustomMarshaller(typeof(Span<>), MarshalMode.Default, typeof(SpanMarshaller<,>))] 23[CustomMarshaller(typeof(Span<>), MarshalMode.ManagedToUnmanagedIn, typeof(SpanMarshaller<,>.ManagedToUnmanagedIn))] 34public static TUnmanagedElement* AllocateContainerForUnmanagedElements(Span<T> managed, out int numElements) 56public static ReadOnlySpan<T> GetManagedValuesSource(Span<T> managed) 65public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 74public static Span<T> AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) 87public static Span<T> GetManagedValuesDestination(Span<T> managed) 114private Span<T> _managedArray; 116private Span<TUnmanagedElement> _span; 127public void FromManaged(Span<T> managed, Span<TUnmanagedElement> buffer) 163public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span; 192public static ref T GetPinnableReference(Span<T> managed)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (2)
29Span<byte> buffer = new(mem, exactByteCount); 69public void FromManaged(string? managed, Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (11)
14/// <see cref="Span{T}"/>, and <see cref="ReadOnlySpan{T}"/>. 30public static unsafe Span<byte> AsBytes<T>(Span<T> span) 80public static ref T GetReference<T>(Span<T> span) => ref span._reference; 93internal 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); 114public static unsafe Span<TTo> Cast<TFrom, TTo>(Span<TFrom> span) 226public static Span<T> CreateSpan<T>(scoped ref T reference, int length) => 507public static unsafe void Write<T>(Span<byte> destination, in T value) 526public static unsafe bool TryWrite<T>(Span<byte> destination, in T value) 549public static unsafe ref T AsRef<T>(Span<byte> span)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (10)
860public 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); 863public 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); 1040/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 1041bool IFloatingPoint<NFloat>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 1064/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 1065bool IFloatingPoint<NFloat>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 1088/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 1089bool IFloatingPoint<NFloat>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 1112/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 1113bool IFloatingPoint<NFloat>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ObjectiveC\ObjectiveCMarshal.PlatformNotSupported.cs (2)
80/// The memory it points at is defined by the length in the <see cref="Span{IntPtr}"/> and 93out Span<IntPtr> taggedMemory)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (1)
231public void ReadSpan<T>(ulong byteOffset, Span<T> buffer)
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\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\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (2)
712public static void CopyTo<T>(this Vector128<T> vector, Span<T> destination) 4027public static bool TryCopyTo<T>(this Vector128<T> vector, Span<T> destination)
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\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (2)
728public static void CopyTo<T>(this Vector256<T> vector, Span<T> destination) 3991public static bool TryCopyTo<T>(this Vector256<T> vector, Span<T> destination)
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\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (2)
638public static void CopyTo<T>(this Vector512<T> vector, Span<T> destination) 3968public static bool TryCopyTo<T>(this Vector512<T> vector, Span<T> destination)
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\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (2)
678public static void CopyTo<T>(this Vector64<T> vector, Span<T> destination) 3915public static bool TryCopyTo<T>(this Vector64<T> vector, Span<T> destination)
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\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (1)
114Span<Range> components = stackalloc Range[4];
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) 426/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 427bool IBinaryInteger<sbyte>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 440/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 441bool IBinaryInteger<sbyte>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.cs (2)
140Span<char> copy = stackalloc char[4]; 265Span<bool> seenValues = range <= 256 ? stackalloc bool[256] : new bool[range];
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 = stackalloc char[2];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
172Span<char> upperCase = stackalloc char[MaxInputLength].Slice(0, span.Length);
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\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (3)
58Span<string> normalizedValues = new string[uniqueValues.Count]; 98static Span<string> RemoveUnreachableValues(Span<string> values, HashSet<string> unreachableValues)
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (10)
43Span<char> span = AcquireSpan(ref bufferToRelease); 112Span<char> span = AcquireSpan(ref bufferToRelease); 139Span<char> span = AcquireSpan(ref bufferToRelease); 193Span<char> span = AcquireSpan(ref bufferToRelease); 238Span<char> span = AcquireSpan(ref bufferToRelease); 270Span<char> span = AcquireSpan(ref bufferToRelease); 281private unsafe Span<char> AcquireSpan(ref SafeBuffer? bufferToRelease) 319Span<char> span = AcquireSpan(ref bufferToRelease); 357Span<char> span = AcquireSpan(ref bufferToRelease).Slice(0, _decryptedLength); 379Span<char> resultSpan = new Span<char>((void*)ptr, byteLength / sizeof(char));
src\libraries\System.Private.CoreLib\src\System\Single.cs (10)
370public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 376public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 717/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 718bool IFloatingPoint<float>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 731/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 732bool IFloatingPoint<float>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 745/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 746bool IFloatingPoint<float>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 758/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 759bool IFloatingPoint<float>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Span.cs (22)
119/// <summary>Creates a new <see cref="Span{T}"/> of length 1 around the specified reference.</summary> 170/// Gets a value indicating whether this <see cref="Span{T}"/> is empty. 183public static bool operator !=(Span<T> left, Span<T> right) => !(left == right); 208/// Defines an implicit conversion of an array to a <see cref="Span{T}"/> 210public static implicit operator Span<T>(T[]? array) => new Span<T>(array); 213/// Defines an implicit conversion of a <see cref="ArraySegment{T}"/> to a <see cref="Span{T}"/> 215public static implicit operator Span<T>(ArraySegment<T> segment) => 219/// Returns an empty <see cref="Span{T}"/> 221public static Span<T> Empty => default; 226/// <summary>Enumerates the elements of a <see cref="Span{T}"/>.</summary> 230private readonly Span<T> _span; 237internal Enumerator(Span<T> span) 325public void CopyTo(Span<T> destination) 349public bool TryCopyTo(Span<T> destination) 364public static bool operator ==(Span<T> left, Span<T> right) => 369/// Defines an implicit conversion of a <see cref="Span{T}"/> to a <see cref="ReadOnlySpan{T}"/> 371public static implicit operator ReadOnlySpan<T>(Span<T> span) => 375/// For <see cref="Span{Char}"/>, returns a new instance of string that represents the characters pointed to by the span. 395public Span<T> Slice(int start) 412public Span<T> Slice(int start, int length)
src\libraries\System.Private.CoreLib\src\System\SpanDebugView.cs (1)
12public SpanDebugView(Span<T> span)
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (1)
1063Span<char> scratch = (uint)length < 256 ?
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\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); 1420Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length);
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\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (18)
25/// <remarks>In-place conversion is prohibited, please use <see cref="ToUpperInPlace(Span{byte}, out int)"/> for that.</remarks> 27public static OperationStatus ToUpper(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 38/// <remarks>In-place conversion is prohibited, please use <see cref="ToUpperInPlace(Span{char}, out int)"/> for that.</remarks> 40public static OperationStatus ToUpper(ReadOnlySpan<char> source, Span<char> destination, out int charsWritten) 52public static OperationStatus ToUpper(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 64public static OperationStatus ToUpper(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 75/// <remarks>In-place conversion is prohibited, please use <see cref="ToLowerInPlace(Span{byte}, out int)"/> for that.</remarks> 77public static OperationStatus ToLower(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 88/// <remarks>In-place conversion is prohibited, please use <see cref="ToLowerInPlace(Span{char}, out int)"/> for that.</remarks> 90public static OperationStatus ToLower(ReadOnlySpan<char> source, Span<char> destination, out int charsWritten) 102public static OperationStatus ToLower(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 114public static OperationStatus ToLower(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 124public static OperationStatus ToLowerInPlace(Span<byte> value, out int bytesWritten) 134public static OperationStatus ToLowerInPlace(Span<char> value, out int charsWritten) 144public static OperationStatus ToUpperInPlace(Span<byte> value, out int bytesWritten) 154public static OperationStatus ToUpperInPlace(Span<char> value, out int charsWritten) 157private static unsafe OperationStatus ChangeCase<TFrom, TTo, TCasing>(ReadOnlySpan<TFrom> source, Span<TTo> destination, out int destinationElementsWritten) 192private static unsafe OperationStatus ChangeCase<T, TCasing>(Span<T> buffer, out int elementsWritten)
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\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (7)
314public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes) 326public override unsafe bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 381private protected sealed override int GetBytesWithFallback(ReadOnlySpan<char> chars, int originalCharsLength, Span<byte> bytes, int originalBytesLength, EncoderNLS? encoder, bool throwForDestinationOverflow = true) 605public override unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 617public override unsafe bool TryGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten) 670private protected sealed override int GetCharsWithFallback(ReadOnlySpan<byte> bytes, int originalBytesLength, Span<char> chars, int originalCharsLength, DecoderNLS? decoder, bool throwForDestinationOverflow = true) 778internal sealed override OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (2)
196public virtual unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool flush) 302public virtual unsafe void Convert(ReadOnlySpan<byte> bytes, Span<char> chars, bool flush, out int bytesUsed, out int charsUsed, out bool completed)
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\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (4)
233Span<byte> combinedBuffer = stackalloc byte[4]; 277internal int DrainLeftoverDataForGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int bytesConsumed) 289Span<byte> combinedBuffer = stackalloc byte[4]; 376private static int ConcatInto(ReadOnlySpan<byte> srcLeft, ReadOnlySpan<byte> srcRight, Span<byte> dest)
src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (2)
193public virtual unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool flush) 301public virtual unsafe void Convert(ReadOnlySpan<char> chars, Span<byte> bytes, bool flush, out int charsUsed, out int bytesUsed, out bool completed)
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\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (1)
312internal bool TryDrainLeftoverDataForGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsConsumed, out int bytesWritten)
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\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (6)
79internal virtual OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten) 512/// after data has been drained, then to call <see cref="GetBytesWithFallback(ReadOnlySpan{char}, int, Span{byte}, int, EncoderNLS, bool)"/>. 532Span<byte> bytes = new Span<byte>(pOriginalBytes, originalByteCount).Slice(bytesWrittenSoFar); 586private protected virtual unsafe int GetBytesWithFallback(ReadOnlySpan<char> chars, int originalCharsLength, Span<byte> bytes, int originalBytesLength, EncoderNLS? encoder, bool throwForDestinationOverflow = true) 1134Span<char> chars = new Span<char>(pOriginalChars, originalCharCount).Slice(charsWrittenSoFar); 1187private protected virtual unsafe int GetCharsWithFallback(ReadOnlySpan<byte> bytes, int originalBytesLength, Span<char> chars, int originalCharsLength, DecoderNLS? decoder, bool throwForDestinationOverflow = true)
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (5)
226public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes) 238public override unsafe bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 521public override unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 533public override unsafe bool TryGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten) 659internal sealed override OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (10)
230Span<char> original = stackalloc char[MaxUtf16CharsPerRune]; 231Span<char> modified = stackalloc char[MaxUtf16CharsPerRune]; 751public int EncodeToUtf16(Span<char> destination) 769public int EncodeToUtf8(Span<byte> destination) 936bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 939bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 1056public bool TryEncodeToUtf16(Span<char> destination, out int charsWritten) 1063private static bool TryEncodeToUtf16(Rune value, Span<char> destination, out int charsWritten) 1100public bool TryEncodeToUtf8(Span<byte> destination, out int bytesWritten) 1107private static bool TryEncodeToUtf8(Rune value, Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (6)
884public void CopyTo(int sourceIndex, Span<char> destination, int count) 1416Span<char> buffer = stackalloc char[string.StackallocCharBufferSizeLimit]; 2234Span<char> span = chunk.m_ChunkChars.AsSpan(curInChunk, endInChunk - curInChunk); 2520private Span<char> RemainingCurrentChunk 2903Span<char> destination = _stringBuilder.RemainingCurrentChunk; 2974Span<char> destination = _stringBuilder.RemainingCurrentChunk;
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\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\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\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\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (1)
3507Span<object?> continuations = CollectionsMarshal.AsSpan(list);
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (4)
239Span<SafeWaitHandle?> safeWaitHandles, 240Span<IntPtr> unsafeWaitHandles) 325Span<IntPtr> unsafeWaitHandles = stackalloc IntPtr[waitHandles.Length]; 387Span<IntPtr> unsafeWaitHandles = stackalloc IntPtr[safeWaitHandles.Length];
src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (3)
957public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 961public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 964private bool TryFormatCore<TChar>(Span<TChar> destination, out int written, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] ReadOnlySpan<char> format, IFormatProvider? provider) where TChar : unmanaged, IUtfChar<TChar>
src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (2)
865public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null) 869public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null)
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (12)
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) 946/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 947bool IBinaryInteger<UInt128>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 959/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 960bool IBinaryInteger<UInt128>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten) 1092static uint AddDivisor(Span<uint> left, ReadOnlySpan<uint> right) 1150Span<uint> left = new Span<uint>(pLeft, (Size / sizeof(uint)) - (LeadingZeroCountAsInt32(quotient) / 32)); 1162Span<uint> right = new Span<uint>(pRight, (Size / sizeof(uint)) - (LeadingZeroCountAsInt32(divisor) / 32)); 1164Span<uint> rawBits = stackalloc uint[Size / sizeof(uint)]; 1166Span<uint> bits = rawBits.Slice(0, left.Length - right.Length + 1); 1262static uint SubtractDivisor(Span<uint> left, ReadOnlySpan<uint> right, ulong q)
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) 397/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 398bool IBinaryInteger<ushort>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 410/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 411bool IBinaryInteger<ushort>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
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) 435/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 436bool IBinaryInteger<uint>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 448/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 449bool IBinaryInteger<uint>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
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) 434/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 435bool IBinaryInteger<ulong>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 447/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 448bool IBinaryInteger<ulong>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (6)
207public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 211public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 438/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 439bool IBinaryInteger<nuint>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 451/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 452bool IBinaryInteger<nuint>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Version.cs (12)
173Span<char> dest = stackalloc char[(4 * Number.Int32NumberBufferLength) + 3]; // at most 4 Int32s and 3 periods 182public bool TryFormat(Span<char> destination, out int charsWritten) => 185public bool TryFormat(Span<char> destination, int fieldCount, out int charsWritten) => 192public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten) => 200public bool TryFormat(Span<byte> utf8Destination, int fieldCount, out int bytesWritten) => 203private bool TryFormatCore<TChar>(Span<TChar> destination, int fieldCount, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 252((uint)value).TryFormat(Unsafe.BitCast<Span<TChar>, Span<char>>(destination), out valueCharsWritten) : 253((uint)value).TryFormat(Unsafe.BitCast<Span<TChar>, Span<byte>>(destination), out valueCharsWritten, default, CultureInfo.InvariantCulture); 269bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 274bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) =>
src\System\Collections\Generic\ArraySortHelper.CoreCLR.cs (3)
11void Sort(Span<TKey> keys, IComparer<TKey>? comparer); 45void Sort(Span<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer);
src\System\Reflection\Associates.cs (1)
53scoped Span<IntPtr> genericArgumentHandles = default;
src\System\Reflection\RuntimeAssembly.cs (1)
50public override int Read(Span<byte> buffer) => ReadCore(buffer);
src\System\RuntimeHandles.cs (4)
183internal static ReadOnlySpan<IntPtr> CopyRuntimeTypeHandles(RuntimeTypeHandle[]? inHandles, Span<IntPtr> stackScratch) 190Span<IntPtr> outHandles = inHandles.Length <= stackScratch.Length ? 539private static partial Interop.BOOL GetFields(MethodTable* pMT, Span<IntPtr> data, ref int usedCount); 541internal static bool GetFields(RuntimeType type, Span<IntPtr> buffer, out int count)
src\System\RuntimeType.CoreCLR.cs (7)
338list = GetListByName(string.Empty, Span<byte>.Empty, listType, cacheType); 346Span<byte> utf8Name = (uint)cUtf8Name > MAXNAMELEN ? new byte[cUtf8Name] : stackalloc byte[cUtf8Name]; 355private unsafe T[] GetListByName(string name, Span<byte> utf8Name, MemberListType listType, CacheType cacheType) 642Span<bool> overrides = (uint)numVirtuals > 512 ? new bool[numVirtuals] : stackalloc bool[numVirtuals]; 841Span<IntPtr> result = stackalloc IntPtr[64]; 1227Span<bool> usedSlots = (uint)numVirtuals > 128 ? new bool[numVirtuals] : stackalloc bool[numVirtuals]; 1251Span<bool> usedSlots,
src\System\StubHelpers.cs (1)
450Span<char> native = new Span<char>((char*)nativeHome, length);
System.Private.CoreLib.Generators (8)
src\libraries\System.Private.CoreLib\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 (24)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
System\Runtime\Serialization\DataContract.cs (1)
1659Span<char> formatted = stackalloc char[Globals.SerializationNamespace.Length];
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (1)
174public 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 (1)
215private unsafe void ToSpan(Span<char> chars)
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 = stackalloc int[4]; 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 = stackalloc int[4]; 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.Uri (31)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (2)
39Span<byte> numbers = stackalloc byte[NumberOfLabels]; 220Span<long> parts = stackalloc long[3]; // One part per octet. Final octet doesn't have a terminator, so is stored in currentValue.
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
311internal static void Parse<TChar>(ReadOnlySpan<TChar> address, scoped Span<ushort> numbers, out ReadOnlySpan<TChar> scopeId)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
System\IPv4AddressHelper.cs (2)
30Span<byte> numbers = 41Span<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)
96Span<byte> maxUtf8EncodedSpan = stackalloc byte[4];
System\Uri.cs (6)
1043Span<char> slashSpan = result.AsSpan(0, count); 1382return string.Create(3, (byte)character, (Span<char> chars, byte b) => 1573public bool TryFormat(Span<char> destination, out int charsWritten) 1641bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 2758private bool TryRecreateParts(scoped Span<char> span, out int charsWritten, UriComponents parts, ushort nonCanonical, UriFormat formatAs) 4567private static int Compress(Span<char> span, UriParser syntax)
System\UriExt.cs (2)
625public static bool TryUnescapeDataString(ReadOnlySpan<char> charsToUnescape, Span<char> destination, out int charsWritten) 719public static bool TryEscapeDataString(ReadOnlySpan<char> charsToEscape, Span<char> destination, out int charsWritten) =>
System\UriHelper.cs (2)
135public static bool TryEscapeDataString(ReadOnlySpan<char> charsToEscape, Span<char> destination, out int charsWritten) 257Span<byte> utf8Bytes = stackalloc byte[4];
System\ValueStringBuilderExtensions.cs (1)
14Span<char> chars = _chars;
System.Private.Windows.Core (87)
System\BufferScope.cs (8)
11/// were a <see cref="Span{T}"/>. 21private Span<T> _span; 33public BufferScope(Span<T> initialBuffer) 58public BufferScope(Span<T> initialBuffer, int minimumLength) 106public readonly Span<T> this[Range range] => _span[range]; 108public readonly Span<T> Slice(int start, int length) => _span.Slice(start, length); 114public readonly Span<T> AsSpan() => _span; 116public static implicit operator Span<T>(BufferScope<T> scope) => scope._span;
System\IO\BinaryReaderExtensions.cs (4)
122Span<byte> arrayData = new(a, array.Length * sizeof(T)); 133Span<ushort> ushorts = MemoryMarshal.Cast<byte, ushort>(arrayData); 138Span<int> ints = MemoryMarshal.Cast<byte, int>(arrayData); 143Span<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)
53Span<byte> span = new(buffer, size);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (1)
54Span<int> ints = stackalloc int[4];
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (3)
350Span<char> fileBuffer = new( 395Span<char> span = buffer.AsCharSpan(); 414Span<byte> span = buffer.AsSpan();
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
209Span<char> fileName = stackalloc char[(int)PInvokeCore.MAX_PATH + 1];
System\Private\Windows\Ole\DataFormatsCore.cs (1)
94Span<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)
10/// Fast stack based <see cref="Span{T}"/> writer. 12internal unsafe ref struct SpanWriter<T>(Span<T> span) where T : unmanaged, IEquatable<T> 14private Span<T> _unwritten = span; 15public Span<T> Span { get; } = span; 100private static void UncheckedSlice(ref Span<T> span, int start, int length)
System\Text\ValueStringBuilder.cs (6)
23private Span<char> _chars; 34public ValueStringBuilder(Span<char> initialBuffer) 118public readonly Span<char> RawChars => _chars; 139public bool TryCopyTo(Span<char> destination, out int charsWritten) 267Span<char> dst = _chars.Slice(_pos, count); 284Span<char> dst = _chars.Slice(_pos, length);
Windows\Win32\Foundation\GlobalBuffer.cs (3)
15private Span<byte> _buffer; 49public readonly Span<byte> AsSpan() => _buffer; 51public readonly Span<char> AsCharSpan() => MemoryMarshal.Cast<byte, char>(_buffer);
Windows\Win32\Graphics\Gdi\ArgbBuffer.cs (1)
30public 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)
20Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface>(1); 37Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(2); 56Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(3); 77Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(4); 100Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(5); 125Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(6); 155Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(10); 208Span<ComInterfaceEntry> entries = AllocateEntries<TComInterface1>(27); 245private static Span<ComInterfaceEntry> AllocateEntries<T>(int count) 247Span<ComInterfaceEntry> entries = new(
Windows\Win32\System\Com\ComManagedStream.cs (1)
121Span<byte> buffer = new(pv, checked((int)cb));
Windows\Win32\System\Com\SAFEARRAY.cs (1)
71public T GetValue<T>(Span<int> indices)
Windows\Win32\System\Com\SafeArrayScope.cs (2)
210Span<int> indices = [index]; 222Span<int> indices = [index];
Windows\Win32\System\Variant\VARIANT.cs (33)
328Span<VARIANT_BOOL> data = new(psa->pvData, array.Length); 329var result = GetSpan<bool>(array); 340Span<DECIMAL> data = new(psa->pvData, array.Length); 341var result = GetSpan<decimal>(array); 352Span<long> data = new(psa->pvData, array.Length); 353var result = GetSpan<decimal>(array); 364Span<double> data = new(psa->pvData, array.Length); 365var result = GetSpan<DateTime>(array); 376Span<IntPtr> data = new(psa->pvData, array.Length); 377var result = GetSpan<string?>(array); 389Span<IntPtr> data = new(psa->pvData, array.Length); 390var result = GetSpan<object?>(array); 401Span<VARIANT> data = new(psa->pvData, array.Length); 402var result = GetSpan<object?>(array); 453Span<int> indices = stackalloc int[array.Rank]; 454Span<int> lower = stackalloc int[array.Rank]; 455Span<int> upper = stackalloc int[array.Rank]; 467static void InternalTransposeArray(SAFEARRAY* psa, Array array, VARENUM arrayType, Span<int> indices, Span<int> lower, Span<int> upper) 504private static void SetArrayValue(SAFEARRAY* psa, Array array, Span<int> indices, Span<int> lowerBounds, VARENUM arrayType) 506static void SetValue<T>(Array array, T value, Span<int> indices, Span<int> lowerBounds) 510var span = GetSpan<T>(array); 760Span<VARIANT_BOOL> data = new(ca.pElems, (int)ca.cElems); 787Span<long> data = new(ca.pElems, (int)ca.cElems); 799Span<double> data = new(ca.pElems, (int)ca.cElems); 811var data = new Span<FILETIME>(ca.pElems, (int)ca.cElems); 826Span<IntPtr> data = new(ca.pElems, (int)ca.cElems); 838Span<IntPtr> data = new(ca.pElems, (int)ca.cElems); 850Span<VARIANT> data = new(ca.pElems, (int)ca.cElems); 867private static Span<T> GetSpan<T>(Array array)
System.Private.Windows.GdiPlus (1)
Windows\Win32\Graphics\GdiPlus\EncoderParameters.cs (1)
9internal unsafe Span<EncoderParameter> Parameters => Parameter.AsSpan((int)Count);
System.Private.Xml (58)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public 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)
489Span<char> destination = stackalloc char[CharStackBufferSize]; 496public bool TryFormat(Span<char> destination, out int charsWritten) 546Span<char> text = vsb.AppendSpan(s_lzyyyy_MM_dd); 612Span<char> text = vsb.AppendSpan(s_lzHH_mm_ss); 637Span<char> text; 665private static void WriteXDigits(Span<char> text, int start, int value, int digits) 675private static void Write2Digits(Span<char> text, int start, int value)
System\Xml\Schema\XsdDuration.cs (3)
345Span<char> destination = stackalloc char[CharStackBufferSize]; 352public 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 (1)
108internal static bool TryFormatDateTime(DateTime value, Span<char> destination, out int charsWritten)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (4)
3415LocalBuilder paramsRead = ilg.DeclareLocal(typeof(Span<bool>), "paramsRead"); 3423ilg.New(typeof(Span<bool>).GetConstructor(new[] { typeof(bool[]) })!); 3574ilg.Call(typeof(Span<bool>).GetMethod("get_Item")!); 3587ilg.Call(typeof(Span<bool>).GetMethod("get_Item")!);
System\Xml\Serialization\XmlSerializationWriter.cs (1)
128internal static bool TryFormatDateTime(DateTime 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 (18)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
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\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
System\Reflection\Internal\Utilities\DecimalUtilities.cs (2)
11Span<int> bits = stackalloc int[4]; 22Span<int> bits = stackalloc int[4];
System\Reflection\Internal\Utilities\StreamExtensions.cs (1)
50internal static int TryReadAll(this Stream stream, Span<byte> buffer)
System\Reflection\Metadata\BlobBuilder.cs (1)
53private Span<byte> Span => _buffer.AsSpan(0, Length);
System.Resources.Extensions (1)
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
26fixed (byte* ptr = &MemoryMarshal.GetReference((Span<byte>)array))
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
770[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
System.Runtime.InteropServices.JavaScript (7)
artifacts\obj\System.Runtime.InteropServices.JavaScript\Debug\net10.0\System.Runtime.InteropServices.JavaScript.notsupported.cs (7)
156public static void InvokeJS(JSFunctionBinding signature, Span<JSMarshalerArgument> arguments) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 300public void ToManaged(out Span<byte> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 301public void ToJS(Span<byte> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 304public void ToManaged(out Span<int> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 305public void ToJS(Span<int> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 306public void ToManaged(out Span<double> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 307public void ToJS(Span<double> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); }
System.Runtime.Numerics (273)
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
467Span<int> thousandsSepPos = stackalloc int[4];
src\libraries\Common\src\System\Number.NumberBuffer.cs (2)
32public Span<byte> Digits; 43public NumberBuffer(NumberBufferKind kind, Span<byte> digits)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
src\libraries\System.Private.CoreLib\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\Number.BigInteger.cs (33)
82scoped Span<byte> buffer; 246Span<uint> wholeBlockDestination = bits.AsSpan(0, wholeBlockCount); 323scoped Span<uint> base1E9; 375Span<uint> resultBuffer = ( 402static void DivideAndConquer(ReadOnlySpan<uint> base1E9, int trailingZeroCount, scoped Span<uint> bits) 408Span<uint> powersOf1e9Buffer = ( 420Span<uint> leading = ( 443static void Recursive(in PowersOf1e9 powersOf1e9, int powersOf1e9Index, ReadOnlySpan<uint> base1E9, Span<uint> bits) 467scoped Span<uint> buffer = ( 476Span<uint> bitsUpper = bits.Slice(multiplierTrailingZeroCount, buffer2.Length + multiplier.Length); 492static void Naive(ReadOnlySpan<uint> base1E9, int trailingZeroCount, scoped Span<uint> bits) 520static int NaiveBase1E9ToBits(ReadOnlySpan<uint> base1E9, Span<uint> bits) 537static uint MultiplyAdd(Span<uint> bits, uint multiplier, uint addValue) 551private static string? FormatBigIntegerToHex(bool targetSpan, BigInteger value, char format, int digits, NumberFormatInfo info, Span<char> destination, out int charsWritten, out bool spanSuccess) 557Span<byte> bits = stackalloc byte[64]; // arbitrary threshold 596Span<char> chars = sb.AppendSpan((cur + 1) * 2); 634private static string? FormatBigIntegerToBinary(bool targetSpan, BigInteger value, int digits, Span<char> destination, out int charsWritten, out bool spanSuccess) 638Span<byte> bytes = stackalloc byte[64]; // arbitrary threshold 738internal static bool TryFormatBigInteger(BigInteger value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<char> destination, out int charsWritten) 747NumberFormatInfo info, Span<char> destination, out int charsWritten, out bool spanSuccess) 794Span<uint> base1E9Buffer = cuMax < BigIntegerCalculator.StackAllocThreshold ? 872Span<byte> numberBuffer = valueDigits + 1 <= CharStackBufferSize ? 1053public PowersOf1e9(Span<uint> pow1E9) 1072Span<uint> dst = pow1E9.Slice(toExclusive, src.Length << 1); 1112public void MultiplyPowerOfTen(ReadOnlySpan<uint> left, int trailingZeroCount, Span<uint> bits) 1123Span<uint> powersOfTen = ( 1127scoped Span<uint> powersOfTen2 = bits; 1157Span<uint> src = powersOfTen.Slice(0, curLength); 1158Span<uint> dst = powersOfTen2.Slice(0, curLength += power.Length); 1165Span<uint> tmp = powersOfTen; 1179Span<uint> bits2 = bits.Slice(omittedLength, curLength += left.Length); 1235static virtual bool TryParseWholeBlocks(ReadOnlySpan<TChar> input, Span<uint> destination) 1265public static bool TryParseWholeBlocks(ReadOnlySpan<TChar> input, Span<uint> destination)
System\Numerics\BigInteger.cs (61)
227Span<int> bits = stackalloc int[4]; 375Span<byte> uintBytes = MemoryMarshal.AsBytes(val.AsSpan(0, wholeUInt32Count)); 544private BigInteger(Span<uint> value) 777Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 807Span<uint> rest = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 813Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 930Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 943Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 998Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1058Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1069Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1274public bool TryWriteBytes(Span<byte> destination, out int bytesWritten, bool isUnsigned = false, bool isBigEndian = false) 1285internal bool TryWriteOrCountBytes(Span<byte> destination, out int bytesWritten, bool isUnsigned = false, bool isBigEndian = false) 1291/// <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> 1298TryGetBytes(GetBytesMode.Count, default(Span<byte>), isUnsigned, IsBigEndian, ref count); 1302/// <summary>Mode used to enable sharing <see cref="TryGetBytes(GetBytesMode, Span{byte}, bool, bool, ref int)"/> for multiple purposes.</summary> 1310/// <summary>Shared logic for <see cref="ToByteArray(bool, bool)"/>, <see cref="TryWriteBytes(Span{byte}, out int, bool, bool)"/>, and <see cref="GetByteCount"/>.</summary> 1326private byte[]? TryGetBytes(GetBytesMode mode, Span<byte> destination, bool isUnsigned, bool isBigEndian, ref int bytesWritten) 1460Span<byte> destBytes = destination.Slice(curByte, srcBytes.Length); 1542private int WriteTo(Span<uint> buffer) 1666public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 1686Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1698Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1710Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1722Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1764Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1776Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1786Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1798Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 2375Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2382Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2389Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2431Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2438Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2445Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2482Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2489Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2496Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2536Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 2543Span<uint> zd = ((uint)zl <= BigIntegerCalculator.StackAllocThreshold 2597Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 2625Span<uint> zd = ((uint)zl <= BigIntegerCalculator.StackAllocThreshold 2739Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2751Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2761Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2773Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2786Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2828Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2854Span<uint> quotient = ((uint)size < BigIntegerCalculator.StackAllocThreshold 2904Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 3138private bool GetPartsForBitManipulation(Span<uint> xd) 3306Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold) 3317Span<uint> zd = (zl <= BigIntegerCalculator.StackAllocThreshold) 3461Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold) 3472Span<uint> zd = (zl <= BigIntegerCalculator.StackAllocThreshold) 3660/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 3661bool IBinaryInteger<BigInteger>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 3762/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 3763bool IBinaryInteger<BigInteger>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten) 5322Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 5341Span<uint> zd = ((uint)zl <= BigIntegerCalculator.StackAllocThreshold
System\Numerics\BigIntegerCalculator.AddSub.cs (9)
14private static void CopyTail(ReadOnlySpan<uint> source, Span<uint> dest, int start) 19public static void Add(ReadOnlySpan<uint> left, uint right, Span<uint> bits) 27public static void Add(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits) 59public static void AddSelf(Span<uint> left, ReadOnlySpan<uint> right) 90public static void Subtract(ReadOnlySpan<uint> left, uint right, Span<uint> bits) 99public static void Subtract(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits) 132public static void SubtractSelf(Span<uint> left, ReadOnlySpan<uint> right) 168private static void Add(ReadOnlySpan<uint> left, Span<uint> bits, ref uint resultPtr, int startIndex, long initialCarry) 215private static void Subtract(ReadOnlySpan<uint> left, Span<uint> bits, ref uint resultPtr, int startIndex, long initialCarry)
System\Numerics\BigIntegerCalculator.DivRem.cs (40)
19public static void Divide(ReadOnlySpan<uint> left, uint right, Span<uint> quotient, out uint remainder) 27public static void Divide(ReadOnlySpan<uint> left, uint right, Span<uint> quotient) 34private static void Divide(ReadOnlySpan<uint> left, uint right, Span<uint> quotient, ref ulong carry) 68public static void Divide(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> quotient, Span<uint> remainder) 89public static void Divide(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> quotient) 105Span<uint> leftCopy = (left.Length <= StackAllocThreshold ? 121public static void Remainder(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> remainder) 141Span<uint> quotient = (quotientLength <= StackAllocThreshold ? 159private static void DivRem(Span<uint> left, ReadOnlySpan<uint> right, Span<uint> quotient) 178Span<uint> leftCopy = (left.Length <= StackAllocThreshold ? 184scoped Span<uint> quotientActual; 208private static void DivideGrammarSchool(Span<uint> left, ReadOnlySpan<uint> right, Span<uint> quotient) 293private static uint AddDivisor(Span<uint> left, ReadOnlySpan<uint> right) 312private static uint SubtractDivisor(Span<uint> left, ReadOnlySpan<uint> right, ulong q) 355private static void DivideBurnikelZiegler(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> quotient, Span<uint> remainder) 384Span<uint> b = (n <= StackAllocThreshold ? 398Span<uint> a = (aLength <= StackAllocThreshold ? 403static void Normalize(ReadOnlySpan<uint> src, int sigmaDigit, int sigmaSmall, Span<uint> bits) 409Span<uint> dst = bits.Slice(sigmaDigit); 438Span<uint> r = ((n + 1) <= StackAllocThreshold ? 443Span<uint> z = (2 * n <= StackAllocThreshold ? 449Span<uint> quotientUpper = quotient.Slice((t - 2) * n); 453Span<uint> q = (n <= StackAllocThreshold ? 489Span<uint> rt = r.Slice(sigmaDigit); 518private static void BurnikelZieglerFallback(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> quotient, Span<uint> remainder) 566Span<uint> r1 = (left.Length <= StackAllocThreshold ? 592private static void BurnikelZieglerD2n1n(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> quotient, Span<uint> remainder) 610Span<uint> r1 = ((right.Length + 1) <= StackAllocThreshold ? 621private static void BurnikelZieglerD3n2n(ReadOnlySpan<uint> left12, ReadOnlySpan<uint> left3, ReadOnlySpan<uint> right, Span<uint> quotient, Span<uint> remainder) 637Span<uint> r1 = remainder.Slice(n); 639Span<uint> d = (right.Length <= StackAllocThreshold ? 666Span<uint> rr = remainder.Slice(0, d.Length + 1); 683static void MultiplyActual(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits)
System\Numerics\BigIntegerCalculator.FastReducer.cs (9)
20private readonly Span<uint> _q1; 21private readonly Span<uint> _q2; 23public FastReducer(ReadOnlySpan<uint> modulus, Span<uint> r, Span<uint> mu, Span<uint> q1, Span<uint> q2) 44public int Reduce(Span<uint> value) 68private static int DivMul(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits, int k) 102private static int SubMod(Span<uint> left, ReadOnlySpan<uint> right, ReadOnlySpan<uint> modulus, int k)
System\Numerics\BigIntegerCalculator.GcdInv.cs (11)
57public static void Gcd(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> result) 67Span<uint> rightCopy = (right.Length <= StackAllocThreshold ? 78private static void Gcd(Span<uint> left, Span<uint> right) 84Span<uint> result = left; //keep result buffer untouched during computation 161Span<uint> temp = left; 175Span<uint> temp = left; 203private static int Overwrite(Span<uint> buffer, ulong value) 275private static int LehmerCore(Span<uint> x, 276Span<uint> y, 304private static int Refresh(Span<uint> bits, int maxLength)
System\Numerics\BigIntegerCalculator.PowMod.cs (57)
16public static void Pow(uint value, uint power, Span<uint> bits) 21public static void Pow(ReadOnlySpan<uint> value, uint power, Span<uint> bits) 26Span<uint> temp = (bits.Length <= StackAllocThreshold ? 32Span<uint> valueCopy = (bits.Length <= StackAllocThreshold ? 38Span<uint> result = PowCore(valueCopy, value.Length, temp, power, bits); 48private static Span<uint> PowCore(Span<uint> value, int valueLength, Span<uint> temp, uint power, Span<uint> result) 70private static int MultiplySelf(ref Span<uint> left, int leftLength, ReadOnlySpan<uint> right, ref Span<uint> temp) 87Span<uint> t = left; 93private static int SquareSelf(ref Span<uint> value, int valueLength, ref Span<uint> temp) 104Span<uint> t = value; 203ReadOnlySpan<uint> modulus, Span<uint> bits) 209ReadOnlySpan<uint> modulus, Span<uint> bits) 219Span<uint> valueCopy = (size <= StackAllocThreshold ? 238Span<uint> temp = (bits.Length <= StackAllocThreshold ? 252ReadOnlySpan<uint> modulus, Span<uint> bits) 258ReadOnlySpan<uint> modulus, Span<uint> bits) 268Span<uint> valueCopy = (size <= StackAllocThreshold ? 287Span<uint> temp = (bits.Length <= StackAllocThreshold ? 308private static void PowCore(Span<uint> value, int valueLength, 310Span<uint> temp, Span<uint> bits) 318Span<uint> result = PowCore(value, valueLength, power, modulus, bits, 1, temp); 326Span<uint> r = ((uint)size <= StackAllocThreshold ? 333Span<uint> mu = ((uint)size <= StackAllocThreshold ? 340Span<uint> q1 = ((uint)size <= StackAllocThreshold ? 346Span<uint> q2 = ((uint)size <= StackAllocThreshold ? 356Span<uint> result = PowCore(value, valueLength, power, reducer, bits, 1, temp); 369private static void PowCore(Span<uint> value, int valueLength, 371Span<uint> temp, Span<uint> bits) 378Span<uint> result = PowCore(value, valueLength, power, modulus, bits, 1, temp); 386Span<uint> r = ((uint)size <= StackAllocThreshold ? 393Span<uint> mu = ((uint)size <= StackAllocThreshold ? 400Span<uint> q1 = ((uint)size <= StackAllocThreshold ? 406Span<uint> q2 = ((uint)size <= StackAllocThreshold ? 416Span<uint> result = PowCore(value, valueLength, power, reducer, bits, 1, temp); 429private static Span<uint> PowCore(Span<uint> value, int valueLength, 431Span<uint> result, int resultLength, 432Span<uint> temp) 459private static Span<uint> PowCore(Span<uint> value, int valueLength, 461Span<uint> result, int resultLength, 462Span<uint> temp) 488private static Span<uint> PowCore(Span<uint> value, int valueLength, 490Span<uint> result, int resultLength, 491Span<uint> temp) 518private static Span<uint> PowCore(Span<uint> value, int valueLength, 520Span<uint> result, int resultLength, 521Span<uint> temp)
System\Numerics\BigIntegerCalculator.SquMul.cs (19)
21public static void Square(ReadOnlySpan<uint> value, Span<uint> bits) 89Span<uint> bitsLow = bits.Slice(0, n2); 90Span<uint> bitsHigh = bits.Slice(n2); 100Span<uint> fold = ((uint)foldLength <= StackAllocThreshold ? 107Span<uint> core = ((uint)coreLength <= StackAllocThreshold ? 131public static void Multiply(ReadOnlySpan<uint> left, uint right, Span<uint> bits) 159public static void Multiply(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits) 217Span<uint> bitsLow = bits.Slice(0, n + right.Length); 218Span<uint> bitsHigh = bits.Slice(n); 225Span<uint> carry = ((uint)carryLength <= StackAllocThreshold ? 229Span<uint> carryOrig = bits.Slice(n, right.Length); 247static void MultiplyKaratsuba(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits, int n) 269Span<uint> bitsLow = bits.Slice(0, n + n); 270Span<uint> bitsHigh = bits.Slice(n + n); 284Span<uint> leftFold = ((uint)foldLength <= StackAllocThreshold ? 290Span<uint> rightFold = ((uint)foldLength <= StackAllocThreshold ? 303Span<uint> core = ((uint)coreLength <= StackAllocThreshold ? 331static void Naive(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits) 362private static void SubtractCore(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> core)
System\Numerics\BigIntegerCalculator.Utils.cs (2)
66private static int Reduce(Span<uint> bits, ReadOnlySpan<uint> modulus) 80public static void InitializeForDebug(Span<uint> bits)
System\Numerics\Complex.cs (13)
2199/// <inheritdoc cref="ISpanFormattable.TryFormat(Span{char}, out int, ReadOnlySpan{char}, IFormatProvider?)" /> 2200public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 2203/// <inheritdoc cref="IUtf8SpanFormattable.TryFormat(Span{byte}, out int, ReadOnlySpan{char}, IFormatProvider?)" /> 2204public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 2207private bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) where TChar : unmanaged, IBinaryInteger<TChar> 2216m_real.TryFormat(Unsafe.BitCast<Span<TChar>, Span<char>>(destination.Slice(1)), out realChars, format, provider) : 2217m_real.TryFormat(Unsafe.BitCast<Span<TChar>, Span<byte>>(destination.Slice(1)), out realChars, format, provider)) 2227m_imaginary.TryFormat(Unsafe.BitCast<Span<TChar>, Span<char>>(destination.Slice(2)), out imaginaryChars, format, provider) : 2228m_imaginary.TryFormat(Unsafe.BitCast<Span<TChar>, Span<byte>>(destination.Slice(2)), out imaginaryChars, format, provider))
System\Numerics\NumericsHelpers.cs (1)
100public static void DangerousMakeTwosComplement(Span<uint> d)
System.Security.Cryptography (329)
artifacts\obj\System.Security.Cryptography\Debug\net10.0\System.Security.Cryptography.notsupported.cs (329)
57public int DecryptKeyWrapPadded(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 58protected virtual int DecryptKeyWrapPaddedCore(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 61public void EncryptKeyWrapPadded(System.ReadOnlySpan<byte> plaintext, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 62protected virtual void EncryptKeyWrapPaddedCore(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 64public bool TryDecryptKeyWrapPadded(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 77public void Decrypt(System.ReadOnlySpan<byte> nonce, System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> tag, System.Span<byte> plaintext, System.ReadOnlySpan<byte> associatedData = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 80public void Encrypt(System.ReadOnlySpan<byte> nonce, System.ReadOnlySpan<byte> plaintext, System.Span<byte> ciphertext, System.Span<byte> tag, System.ReadOnlySpan<byte> associatedData = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 103protected override bool TryDecryptCbcCore(System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 104protected override bool TryDecryptCfbCore(System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, int feedbackSizeInBits, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 105protected override bool TryDecryptEcbCore(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 106protected override bool TryEncryptCbcCore(System.ReadOnlySpan<byte> plaintext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 107protected override bool TryEncryptCfbCore(System.ReadOnlySpan<byte> plaintext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, int feedbackSizeInBits, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 108protected override bool TryEncryptEcbCore(System.ReadOnlySpan<byte> plaintext, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 151public void Decrypt(System.ReadOnlySpan<byte> nonce, System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> tag, System.Span<byte> plaintext, System.ReadOnlySpan<byte> associatedData = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 154public void Encrypt(System.ReadOnlySpan<byte> nonce, System.ReadOnlySpan<byte> plaintext, System.Span<byte> ciphertext, System.Span<byte> tag, System.ReadOnlySpan<byte> associatedData = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 252public virtual bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 253public virtual bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 254public bool TryExportEncryptedPkcs8PrivateKeyPem(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 255public bool TryExportEncryptedPkcs8PrivateKeyPem(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 256public virtual bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 257public bool TryExportPkcs8PrivateKeyPem(System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 258public virtual bool TryExportSubjectPublicKeyInfo(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 259public bool TryExportSubjectPublicKeyInfoPem(System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 309public void Decrypt(System.ReadOnlySpan<byte> nonce, System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> tag, System.Span<byte> plaintext, System.ReadOnlySpan<byte> associatedData = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 312public void Encrypt(System.ReadOnlySpan<byte> nonce, System.ReadOnlySpan<byte> plaintext, System.Span<byte> ciphertext, System.Span<byte> tag, System.ReadOnlySpan<byte> associatedData = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 601public bool TryExportCompositeMLDsaPrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 603public bool TryExportCompositeMLDsaPublicKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 605public bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 606public bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 607public bool TryExportEncryptedPkcs8PrivateKey(string password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 608public bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 609protected abstract bool TryExportPkcs8PrivateKeyCore(System.Span<byte> destination, out int bytesWritten); 610public bool TryExportSubjectPublicKeyInfo(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 611public bool TrySignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, out int bytesWritten, System.ReadOnlySpan<byte> context = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 612protected abstract bool TrySignDataCore(System.ReadOnlySpan<byte> data, System.ReadOnlySpan<byte> context, System.Span<byte> destination, out int bytesWritten); 671public static int HashData(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 673public static int HashData(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 679public static int HmacData(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 681public static int HmacData(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 685public static bool TryHashData(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 686public static bool TryHmacData(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 687public static void ZeroMemory(System.Span<byte> buffer) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 860public virtual bool TryCreateSignature(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 861public bool TryCreateSignature(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 862protected virtual bool TryCreateSignatureCore(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 863public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 864public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 865public override bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 866public override bool TryExportSubjectPublicKeyInfo(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 867protected virtual bool TryHashData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 868public virtual bool TrySignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 869public bool TrySignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 870protected virtual bool TrySignDataCore(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 907protected override bool TryCreateSignatureCore(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 908public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 909public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 910public override bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1040public virtual bool TryExportECPrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1041public bool TryExportECPrivateKeyPem(System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1042public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1043public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1044public override bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1045public override bool TryExportSubjectPublicKeyInfo(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1168public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1169public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1170public override bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1244public virtual bool TryExportSubjectPublicKeyInfo(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1272public int SignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1273public int SignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1280public int SignHash(System.ReadOnlySpan<byte> hash, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1281public int SignHash(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1284protected virtual bool TryHashData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1285public virtual bool TrySignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1286public bool TrySignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1287protected virtual bool TrySignDataCore(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1288public virtual bool TrySignHash(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1289public bool TrySignHash(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1290protected virtual bool TrySignHashCore(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1339public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1340public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1341public override bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1342public override bool TrySignHash(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1343protected override bool TrySignHashCore(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1453public bool TryComputeHash(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1454protected virtual bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1482public static void DeriveKey(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, System.ReadOnlySpan<byte> ikm, System.Span<byte> output, System.ReadOnlySpan<byte> salt, System.ReadOnlySpan<byte> info) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1484public static void Expand(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, System.ReadOnlySpan<byte> prk, System.Span<byte> output, System.ReadOnlySpan<byte> info) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1486public static int Extract(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, System.ReadOnlySpan<byte> ikm, System.ReadOnlySpan<byte> salt, System.Span<byte> prk) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1504protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1525public static int HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1529public static int HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1539public static bool TryHashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1540protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1558public static int HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1560public static int HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1566public static bool TryHashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1567protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1582public static int HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1584public static int HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1590public static bool TryHashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1591protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1608public static int HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1610public static int HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1616public static bool TryHashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1617protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1633public static int HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1635public static int HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1641public static bool TryHashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1642protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1658public static int HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1660public static int HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1666public static bool TryHashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1667protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1683public static int HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1685public static int HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1691public static bool TryHashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1692protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1709public static int HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1711public static int HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1717public static bool TryHashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1718protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1749public int GetCurrentHash(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1751public int GetHashAndReset(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1752public bool TryGetCurrentHash(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1753public bool TryGetHashAndReset(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1789public void GetCurrentHash(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1791public void GetHashAndReset(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1795public static void HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination, System.ReadOnlySpan<byte> customizationString = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1797public static void HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, System.ReadOnlySpan<byte> customizationString = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1812public void GetCurrentHash(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1814public void GetHashAndReset(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1818public static void HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination, System.ReadOnlySpan<byte> customizationString = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1820public static void HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, System.ReadOnlySpan<byte> customizationString = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1835public void GetCurrentHash(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1837public void GetHashAndReset(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1841public static void HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination, System.ReadOnlySpan<byte> customizationString = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1843public static void HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, System.ReadOnlySpan<byte> customizationString = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1858public void GetCurrentHash(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1860public void GetHashAndReset(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1864public static void HashData(System.ReadOnlySpan<byte> key, System.IO.Stream source, System.Span<byte> destination, System.ReadOnlySpan<byte> customizationString = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1866public static void HashData(System.ReadOnlySpan<byte> key, System.ReadOnlySpan<byte> source, System.Span<byte> destination, System.ReadOnlySpan<byte> customizationString = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1891public static int HashData(System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1895public static int HashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1901public static bool TryHashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1913protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1930public void ExportMLDsaPrivateSeed(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1931protected abstract void ExportMLDsaPrivateSeedCore(System.Span<byte> destination); 1933public void ExportMLDsaPublicKey(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1934protected abstract void ExportMLDsaPublicKeyCore(System.Span<byte> destination); 1936public void ExportMLDsaSecretKey(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1937protected abstract void ExportMLDsaSecretKeyCore(System.Span<byte> destination); 1963public void SignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.ReadOnlySpan<byte> context = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1964protected abstract void SignDataCore(System.ReadOnlySpan<byte> data, System.ReadOnlySpan<byte> context, System.Span<byte> destination); 1965public bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1966public bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1967public bool TryExportEncryptedPkcs8PrivateKey(string password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1968public bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 1969protected abstract bool TryExportPkcs8PrivateKeyCore(System.Span<byte> destination, out int bytesWritten); 1970public bool TryExportSubjectPublicKeyInfo(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2001protected override void ExportMLDsaPrivateSeedCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2002protected override void ExportMLDsaPublicKeyCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2003protected override void ExportMLDsaSecretKeyCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2004protected override void SignDataCore(System.ReadOnlySpan<byte> data, System.ReadOnlySpan<byte> context, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2005protected override bool TryExportPkcs8PrivateKeyCore(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2020protected override void ExportMLDsaPrivateSeedCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2021protected override void ExportMLDsaPublicKeyCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2022protected override void ExportMLDsaSecretKeyCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2023protected override void SignDataCore(System.ReadOnlySpan<byte> data, System.ReadOnlySpan<byte> context, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2024protected override bool TryExportPkcs8PrivateKeyCore(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2034public void Decapsulate(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> sharedSecret) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2035protected abstract void DecapsulateCore(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> sharedSecret); 2039public void Encapsulate(System.Span<byte> ciphertext, System.Span<byte> sharedSecret) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2040protected abstract void EncapsulateCore(System.Span<byte> ciphertext, System.Span<byte> sharedSecret); 2042public void ExportDecapsulationKey(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2043protected abstract void ExportDecapsulationKeyCore(System.Span<byte> destination); 2045public void ExportEncapsulationKey(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2046protected abstract void ExportEncapsulationKeyCore(System.Span<byte> destination); 2056public void ExportPrivateSeed(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2057protected abstract void ExportPrivateSeedCore(System.Span<byte> destination); 2080public bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2081public bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2082public bool TryExportEncryptedPkcs8PrivateKey(string password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2083public bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2084protected abstract bool TryExportPkcs8PrivateKeyCore(System.Span<byte> destination, out int bytesWritten); 2085public bool TryExportSubjectPublicKeyInfo(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2112protected override void DecapsulateCore(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> sharedSecret) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2114protected override void EncapsulateCore(System.Span<byte> ciphertext, System.Span<byte> sharedSecret) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2115protected override void ExportDecapsulationKeyCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2116protected override void ExportEncapsulationKeyCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2117protected override void ExportPrivateSeedCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2119protected override bool TryExportPkcs8PrivateKeyCore(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2131protected override void DecapsulateCore(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> sharedSecret) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2134protected override void EncapsulateCore(System.Span<byte> ciphertext, System.Span<byte> sharedSecret) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2135protected override void ExportDecapsulationKeyCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2136protected override void ExportEncapsulationKeyCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2137protected override void ExportPrivateSeedCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2138protected override bool TryExportPkcs8PrivateKeyCore(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2242public static bool TryWrite(System.ReadOnlySpan<char> label, System.ReadOnlySpan<byte> data, System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2243public static bool TryWriteUtf8(System.ReadOnlySpan<byte> utf8Label, System.ReadOnlySpan<byte> data, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2272public static void Fill(System.Span<byte> data) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2276public virtual void GetBytes(System.Span<byte> data) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2278public static void GetHexString(System.Span<char> destination, bool lowercase = false) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2282public static void GetItems<T>(System.ReadOnlySpan<T> choices, System.Span<T> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2284public virtual void GetNonZeroBytes(System.Span<byte> data) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2286public static void Shuffle<T>(System.Span<T> values) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2343public static void Pbkdf2(System.ReadOnlySpan<byte> password, System.ReadOnlySpan<byte> salt, System.Span<byte> destination, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2345public static void Pbkdf2(System.ReadOnlySpan<char> password, System.ReadOnlySpan<byte> salt, System.Span<byte> destination, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2393public override void GetBytes(System.Span<byte> data) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2395public override void GetNonZeroBytes(System.Span<byte> data) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2413public int Decrypt(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.RSAEncryptionPadding padding) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2419public int Encrypt(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.RSAEncryptionPadding padding) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2446public int SignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2449public int SignHash(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2451public virtual bool TryDecrypt(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.RSAEncryptionPadding padding, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2452public virtual bool TryEncrypt(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.RSAEncryptionPadding padding, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2453public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2454public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2455public override bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2456public virtual bool TryExportRSAPrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2457public bool TryExportRSAPrivateKeyPem(System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2458public virtual bool TryExportRSAPublicKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2459public bool TryExportRSAPublicKeyPem(System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2460public override bool TryExportSubjectPublicKeyInfo(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2461protected virtual bool TryHashData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2462public virtual bool TrySignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2463public virtual bool TrySignHash(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2492public override bool TryDecrypt(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.RSAEncryptionPadding padding, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2493public override bool TryEncrypt(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.Security.Cryptography.RSAEncryptionPadding padding, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2494public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2495public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2496public override bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2497public override bool TrySignHash(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2746public static int HashData(System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2748public static int HashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2751public static bool TryHashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2763protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2775protected sealed override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2788public static int HashData(System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2790public static int HashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2793public static bool TryHashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2805protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2817protected sealed override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2830public static int HashData(System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2832public static int HashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2835public static bool TryHashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2847protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2859protected sealed override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2870public static int HashData(System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2872public static int HashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2875public static bool TryHashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2886public static int HashData(System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2888public static int HashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2891public static bool TryHashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2902public static int HashData(System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2904public static int HashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2907public static bool TryHashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2920public static int HashData(System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2922public static int HashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2925public static bool TryHashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2937protected override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2949protected sealed override bool TryHashFinal(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2960public void GetCurrentHash(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2962public void GetHashAndReset(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2965public static void HashData(System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2967public static void HashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2971public void Read(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2983public void GetCurrentHash(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2985public void GetHashAndReset(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2988public static void HashData(System.IO.Stream source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2990public static void HashData(System.ReadOnlySpan<byte> source, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2994public void Read(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3029public void ExportSlhDsaPublicKey(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3030protected abstract void ExportSlhDsaPublicKeyCore(System.Span<byte> destination); 3032public void ExportSlhDsaSecretKey(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3033protected abstract void ExportSlhDsaSecretKeyCore(System.Span<byte> destination); 3055public void SignData(System.ReadOnlySpan<byte> data, System.Span<byte> destination, System.ReadOnlySpan<byte> context = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3056protected abstract void SignDataCore(System.ReadOnlySpan<byte> data, System.ReadOnlySpan<byte> context, System.Span<byte> destination); 3058public void SignPreHash(System.ReadOnlySpan<byte> hash, System.Span<byte> destination, string hashAlgorithmOid, System.ReadOnlySpan<byte> context = default(System.ReadOnlySpan<byte>)) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3059protected abstract void SignPreHashCore(System.ReadOnlySpan<byte> hash, System.ReadOnlySpan<byte> context, string hashAlgorithmOid, System.Span<byte> destination); 3060public bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3061public bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3062public bool TryExportEncryptedPkcs8PrivateKey(string password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3063public bool TryExportPkcs8PrivateKey(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3064protected virtual bool TryExportPkcs8PrivateKeyCore(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3065public bool TryExportSubjectPublicKeyInfo(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3112protected override void ExportSlhDsaPublicKeyCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3113protected override void ExportSlhDsaSecretKeyCore(System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3114protected override void SignDataCore(System.ReadOnlySpan<byte> data, System.ReadOnlySpan<byte> context, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3115protected override void SignPreHashCore(System.ReadOnlySpan<byte> hash, System.ReadOnlySpan<byte> context, string hashAlgorithmOid, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3126public static void DeriveBytes(System.ReadOnlySpan<byte> key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.ReadOnlySpan<byte> label, System.ReadOnlySpan<byte> context, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3128public static void DeriveBytes(System.ReadOnlySpan<byte> key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.ReadOnlySpan<char> label, System.ReadOnlySpan<char> context, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3131public void DeriveKey(System.ReadOnlySpan<byte> label, System.ReadOnlySpan<byte> context, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3133public void DeriveKey(System.ReadOnlySpan<char> label, System.ReadOnlySpan<char> context, System.Span<byte> destination) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3172public int DecryptCbc(System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.PKCS7) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3175public int DecryptCfb(System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.None, int feedbackSizeInBits = 8) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3178public int DecryptEcb(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3183public int EncryptCbc(System.ReadOnlySpan<byte> plaintext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.PKCS7) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3186public int EncryptCfb(System.ReadOnlySpan<byte> plaintext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.None, int feedbackSizeInBits = 8) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3189public int EncryptEcb(System.ReadOnlySpan<byte> plaintext, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3197public bool TryDecryptCbc(System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, out int bytesWritten, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.PKCS7) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3198protected virtual bool TryDecryptCbcCore(System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3199public bool TryDecryptCfb(System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, out int bytesWritten, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.None, int feedbackSizeInBits = 8) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3200protected virtual bool TryDecryptCfbCore(System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, int feedbackSizeInBits, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3201public bool TryDecryptEcb(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3202protected virtual bool TryDecryptEcbCore(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3203public bool TryEncryptCbc(System.ReadOnlySpan<byte> plaintext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, out int bytesWritten, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.PKCS7) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3204protected virtual bool TryEncryptCbcCore(System.ReadOnlySpan<byte> plaintext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3205public bool TryEncryptCfb(System.ReadOnlySpan<byte> plaintext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, out int bytesWritten, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.None, int feedbackSizeInBits = 8) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3206protected virtual bool TryEncryptCfbCore(System.ReadOnlySpan<byte> plaintext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, int feedbackSizeInBits, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3207public bool TryEncryptEcb(System.ReadOnlySpan<byte> plaintext, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3208protected virtual bool TryEncryptEcbCore(System.ReadOnlySpan<byte> plaintext, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3255protected override bool TryDecryptCbcCore(System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3256protected override bool TryDecryptCfbCore(System.ReadOnlySpan<byte> ciphertext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, int feedbackSizeInBits, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3257protected override bool TryDecryptEcbCore(System.ReadOnlySpan<byte> ciphertext, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3258protected override bool TryEncryptCbcCore(System.ReadOnlySpan<byte> plaintext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3259protected override bool TryEncryptCfbCore(System.ReadOnlySpan<byte> plaintext, System.ReadOnlySpan<byte> iv, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, int feedbackSizeInBits, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3260protected override bool TryEncryptEcbCore(System.ReadOnlySpan<byte> plaintext, System.Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3435public bool TryExportSubjectPublicKeyInfo(System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3669public virtual bool TryGetCertHash(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Span<byte> destination, out int bytesWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3800public bool TryExportCertificatePem(System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3850public bool TryExportCertificatePems(System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 3853public bool TryExportPkcs7Pem(System.Span<char> destination, out int charsWritten) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); }
System.Security.Cryptography.Cose (34)
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)
407Span<byte> buffer, 485internal static int CreateToBeSigned(Span<byte> destination, SigStructureContext context, ReadOnlySpan<byte> bodyProtected, ReadOnlySpan<byte> signProtected, ReadOnlySpan<byte> associatedData, ReadOnlySpan<byte> content) 611public int Encode(Span<byte> destination) 630public 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)
26internal override void WithDataAndResetAfterOperation(Span<byte> arg, ToBeSignedOperation operation) 32Span<byte> hash = stackalloc byte[_incrementalHash.HashLengthInBytes];
System\Security\Cryptography\Cose\PureDataToBeSignedBuilder.cs (1)
30internal 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); 30internal abstract void WithDataAndResetAfterOperation(Span<byte> arg, ToBeSignedOperation operation);
System.Security.Cryptography.Pkcs (80)
Internal\Cryptography\Pal\AnyOS\AsnHelpers.cs (1)
116Span<byte> salt = stackalloc byte[KeyLengths.Rc4Max_128Bit / 8];
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
21public override Span<T> GetSpan()
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (1)
60Span<byte> derived = stackalloc byte[expectedOutputSize];
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (4)
46internal Span<byte> Span { get; private set; } 67Span<byte> toClear = Span.Slice(0, clearSize); 93Span<byte> currentBuffer, 107Span<byte> currentBuffer,
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (2)
79internal static void RngFill(Span<byte> destination) 91internal static bool TryCopyToDestination(this ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten)
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (3)
195Span<byte> encryptedSpan = default; 199Span<byte> iv = stackalloc byte[cipher.BlockSize / 8]; 200Span<byte> salt = stackalloc byte[16];
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (22)
73Span<byte> destination) 171Span<byte> buf = stackalloc byte[128]; 318Span<byte> ivDest) 454Span<byte> destination) 456Span<byte> buf = stackalloc byte[128]; 513Span<byte> destination) 536Span<byte> iv = stackalloc byte[16]; 567ref Span<byte> iv) 688ref Span<byte> iv) 809Span<byte> destination) 834Span<byte> dk = stackalloc byte[16]; 843Span<byte> k = dk.Slice(0, 8); 844Span<byte> iv = dk.Slice(8, 8); 861Span<byte> destination) 885Span<byte> iv = stackalloc byte[cipher.BlockSize / 8]; 886Span<byte> key = stackalloc byte[cipher.KeySize / 8]; 919Span<byte> destination) 957Span<byte> tmpEndSpan = tmpEnd.AsSpan(); 981Span<byte> dk) 985Span<byte> t = stackalloc byte[20]; 1022Span<byte> salt, 1025Span<byte> iv)
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\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
67public bool TryEncode(Span<byte> destination, out int bytesWritten)
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (4)
372Span<byte> encryptedSpan = Span<byte>.Empty; 373Span<byte> iv = stackalloc byte[cipherBlockBytes]; 374Span<byte> salt = stackalloc byte[16];
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\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)
169Span<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\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 (5)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
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.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 (49)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public 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)
30Span<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 (289)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
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\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = MinimumBufferSize)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
src\libraries\System.Text.Json\Common\JsonCamelCaseNamingPolicy.cs (1)
28private static void FixCasing(Span<char> chars)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
73Span<T> span = CollectionsMarshal.AsSpan(items); 78Span<(TKey, int)> keys = span.Length <= StackallocThreshold
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
38Span<char> destination = initialBufferLength <= JsonConstants.StackallocCharThreshold 144void WriteChar(char value, ref Span<char> destination) 154void 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)
278Span<byte> destination = _data.AsSpan(index + SizeOrLengthOffset); 287Span<byte> dataPos = _data.AsSpan(index + NumberOfRowsOffset); 300Span<byte> dataPos = _data.AsSpan(index + SizeOrLengthOffset); 315Span<byte> data = _data.AsSpan(0, Length); 384Span<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)
231Span<char> charBuffer = utf8Key.Length <= JsonConstants.StackallocCharThreshold ? 236Span<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)
111Span<byte> sourceUnescaped = stackalloc byte[JsonConstants.MaximumEscapedDateTimeOffsetParseLength]; 159Span<byte> sourceUnescaped = stackalloc byte[JsonConstants.MaximumEscapedDateTimeOffsetParseLength]; 182Span<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 ? 284public static int TranscodeHelper(ReadOnlySpan<byte> utf8Unescaped, Span<char> destination) 391internal static int GetUtf8FromText(ReadOnlySpan<char> text, Span<byte> dest) 444internal static void Unescape(ReadOnlySpan<byte> source, Span<byte> destination, out int written) 455internal static void Unescape(ReadOnlySpan<byte> source, Span<byte> destination, int idx, out int written) 468internal static bool TryUnescape(ReadOnlySpan<byte> source, Span<byte> destination, out int written) 479private 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 int CopyValue(Span<char> destination) 156Span<byte> unescapedBuffer = valueLength <= JsonConstants.StackallocByteThreshold ? 171Span<byte> intermediate = valueLength <= JsonConstants.StackallocByteThreshold ? 195private readonly 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)
44Span<byte> byteBuffer = bufferLength <= JsonConstants.StackallocByteThreshold 68Span<byte> buffer = stackalloc byte[MaxFormatLength]; 81Span<byte> buffer = stackalloc byte[MaxFormatLength]; 118Span<byte> buffer = stackalloc byte[MaxFormatLength + 2]; 141scoped Span<byte> buffer; 209Span<byte> destination,
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (5)
41Span<byte> buffer = bufferLength <= JsonConstants.StackallocByteThreshold 61Span<byte> buffer = stackalloc byte[MaxFormatLength]; 74Span<byte> buffer = stackalloc byte[MaxFormatLength]; 95Span<byte> buffer = stackalloc byte[MaxFormatLength + 2]; 113Span<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)
41Span<byte> buffer = bufferLength <= JsonConstants.StackallocByteThreshold 61Span<byte> buffer = stackalloc byte[MaxFormatLength]; 74Span<byte> buffer = stackalloc byte[MaxFormatLength]; 95Span<byte> buffer = stackalloc byte[MaxFormatLength + 2]; 113Span<byte> destination,
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (3)
45Span<char> charBuffer = stackalloc char[MaximumEscapedVersionLength]; 91Span<byte> span = stackalloc byte[MaximumVersionLength]; 114Span<byte> span = stackalloc byte[MaximumVersionLength];
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
387Span<byte> utf8 = 418Span<byte> utf8 =
System\Text\Json\ThrowHelper.Serialization.cs (1)
360Span<char> builder = stackalloc char[MaxLength + 3];
System\Text\Json\Writer\JsonWriterHelper.cs (2)
13public static void WriteIndentation(Span<byte> buffer, int indent, byte indentByte) 290internal static OperationStatus ToUtf8(ReadOnlySpan<char> source, Span<byte> destination, out int written)
System\Text\Json\Writer\JsonWriterHelper.Date.cs (5)
15public static void WriteDateTimeTrimmed(Span<byte> buffer, DateTime value, out int bytesWritten) 17Span<byte> tempSpan = stackalloc byte[JsonConstants.MaximumFormatDateTimeOffsetLength]; 24public static 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; 596Span<byte> output = _memory.Span; 675Span<byte> output = _memory.Span; 821Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 970Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 1034Span<byte> output = _memory.Span; 1115Span<byte> output = _memory.Span; 1127private void WriteNewLine(Span<byte> output) 1138private 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; 159Span<byte> output = _memory.Span; 192Span<char> escapedValue = length <= JsonConstants.StackallocCharThreshold ? 275Span<byte> output = _memory.Span; 305Span<byte> output = _memory.Span; 339Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (11)
71Span<char> combinedBuffer = stackalloc char[2]; 142Span<char> escapedValue = length <= JsonConstants.StackallocCharThreshold ? 175Span<byte> output = _memory.Span; 239Span<byte> combinedBuffer = stackalloc byte[4]; 308Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 341Span<byte> output = _memory.Span; 406Span<byte> combinedBuffer = stackalloc byte[3]; 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 (12)
src\libraries\System.Private.CoreLib\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\libraries\System.Text.Json\Common\JsonCamelCaseNamingPolicy.cs (1)
28private static void FixCasing(Span<char> chars)
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
38Span<char> destination = initialBufferLength <= JsonConstants.StackallocCharThreshold 144void WriteChar(char value, ref Span<char> destination) 154void ExpandBuffer(ref Span<char> destination)
System.Text.RegularExpressions (49)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
src\libraries\System.Private.CoreLib\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\Text\RegularExpressions\Regex.Replace.cs (1)
221Span<ReadOnlyMemory<char>> span = segments.AsSpan();
System\Text\RegularExpressions\RegexCharClass.cs (6)
646public static bool TryGetOnlyCategories(string set, Span<UnicodeCategory> categories, out int numCategories, out bool negated) 824public static int GetSetChars(string set, Span<char> chars) 1061public static bool SetContainsAsciiOrdinalIgnoreCaseCharacter(string set, Span<char> twoChars) 1655Span<char> headerSpan = vsb.AppendSpan(SetStartIndex); 1893Span<char> scratch = stackalloc char[32]; 1989Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
System\Text\RegularExpressions\RegexCompiler.cs (4)
5142Span<char> setChars = stackalloc char[128]; 5213Span<char> setChars = stackalloc char[128]; // arbitrary cut-off that accomodates all of ASCII and doesn't take too long to compute 5640Span<UnicodeCategory> categories = stackalloc UnicodeCategory[1]; // handle the case of one and only one category 5658Span<char> setChars = stackalloc char[3];
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 (3)
1234Span<char> scratchChar = stackalloc char[1]; 1453Span<char> setChars = stackalloc char[128]; 2525Span<char> twoChars = stackalloc char[2];
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]; 1211Span<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 (44)
RegexGenerator.Emitter.cs (6)
557Span<UnicodeCategory> categories = stackalloc UnicodeCategory[5]; // arbitrary limit to keep names from being too unwieldy 1707Span<char> setChars = stackalloc char[SetCharsSize]; 1786Span<char> setChars = stackalloc char[SetCharsSize]; // needs to be same size as detection check in caller 4981Span<char> setChars = stackalloc char[128]; 5133Span<UnicodeCategory> categories = stackalloc UnicodeCategory[30]; // number of UnicodeCategory values (though it's unheard of to have a set with all of them) 5152Span<char> setChars = stackalloc char[3];
src\libraries\Common\src\System\HexConverter.cs (6)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 185Span<char> result = bytes.Length > 16 ? 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
src\libraries\System.Private.CoreLib\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\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (6)
646public static bool TryGetOnlyCategories(string set, Span<UnicodeCategory> categories, out int numCategories, out bool negated) 824public static int GetSetChars(string set, Span<char> chars) 1061public static bool SetContainsAsciiOrdinalIgnoreCaseCharacter(string set, Span<char> twoChars) 1655Span<char> headerSpan = vsb.AppendSpan(SetStartIndex); 1893Span<char> scratch = stackalloc char[32]; 1989Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
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\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (3)
1234Span<char> scratchChar = stackalloc char[1]; 1453Span<char> setChars = stackalloc char[128]; 2525Span<char> twoChars = stackalloc char[2];
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\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]; 1211Span<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.Web.HttpUtility (20)
src\libraries\Common\src\System\HexConverter.cs (5)
74public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 84public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 165public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 244public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 357private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (7)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 251public Span<char> AppendSpan(int length)
System\Web\HttpUtility.cs (1)
206Span<byte> bytes = stackalloc byte[StackallocThreshold];
System\Web\Util\HttpEncoder.cs (7)
211Span<byte> decodedBytes = count <= StackallocThreshold ? stackalloc byte[StackallocThreshold] : new byte[count]; 463Span<byte> byteSpan = stackalloc byte[StackallocThreshold]; 619private readonly Span<char> _charBuffer; 623private readonly Span<byte> _byteBuffer; 638internal UrlDecoder(Span<char> charBuffer, Span<byte> byteBuffer, Encoding encoding) 677Span<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)
2250Span<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)
1319Span<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)
339internal void FillMonthDayStates(Span<uint> monthDayStates, SelectionRange displayRange) 1085private void WriteBoldDates(Span<int> boldDates) 1256Span<SYSTEMTIME> times = stackalloc SYSTEMTIME[2]; 1742Span<SYSTEMTIME> times = [(SYSTEMTIME)minDate, (SYSTEMTIME)maxDate]; 1819Span<uint> monthDayStates = stackalloc uint[monthsCount]; 1888Span<SYSTEMTIME> times = [(SYSTEMTIME)lower, (SYSTEMTIME)upper]; 2104Span<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)
665Span<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)
175Span<RGBQUAD> colors = new(bi + sizeof(BITMAPINFOHEADER), (int)entryCount); 176Span<PALETTEENTRY> entries = stackalloc PALETTEENTRY[(int)entryCount]; 581Span<int> allData = buffer; 582Span<int> topLineLefts = allData[..topWidth]; 584Span<int> topLineRights = allData[..topWidth]; 586Span<int> leftLineTops = allData[..leftWidth]; 588Span<int> leftLineBottoms = allData[..leftWidth]; 590Span<int> bottomLineLefts = allData[..bottomWidth]; 592Span<int> bottomLineRights = allData[..bottomWidth]; 594Span<int> rightLineTops = allData[..rightWidth]; 596Span<int> rightLineBottoms = allData[..rightWidth]; 1456Span<(Color OldColor, Color NewColor)> map = 1614Span<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 (8)
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
System.Windows.Forms.Primitives.Tests (19)
Interop\Ole32\CADWORDTests.cs (1)
43Span<uint> elements = new(ca.pElems, values.Length);
Interop\Ole32\CALPOLESTRTests.cs (1)
43Span<IntPtr> elements = new(ca.pElems, values.Length);
Interop\Oleaut32\SAFEARRAYTests.cs (8)
226Span<int> indices1 = [0]; 227Span<int> indices2 = [1]; 273Span<int> indices1 = [-5]; 274Span<int> indices2 = [-4]; 327Span<int> indices1 = [0, 0]; 328Span<int> indices2 = [1, 2]; 381Span<int> indices1 = [-5, -4]; 382Span<int> indices2 = [-4, -3];
System\IO\Compression\RunLengthEncoderTests.cs (5)
12Span<byte> encoded = new byte[RunLengthEncoder.GetEncodedLength(data)]; 25Span<byte> data = new byte[count]; 26Span<byte> encoded = new byte[RunLengthEncoder.GetEncodedLength(data)]; 36Span<byte> encoded = new byte[RunLengthEncoder.GetEncodedLength(data)]; 40Span<byte> decoded = new byte[RunLengthEncoder.GetDecodedLength(encoded)];
System\SpanWriterTests.cs (4)
13Span<byte> span = new byte[5]; 37Span<byte> span = new byte[5]; 55Span<int> span = new int[5]; 73Span<Point> span = new Point[5];
System.Windows.Forms.Primitives.TestUtilities (2)
Extensions\AssertExtensions.cs (2)
525public static void SequenceEqual<T>(Span<T> expected, Span<T> actual) where T : IEquatable<T> => SequenceEqual((ReadOnlySpan<T>)expected, (ReadOnlySpan<T>)actual);
System.Windows.Forms.Tests (9)
SpanHelpersTests.cs (2)
21Span<char> destination = stackalloc char[destinationLength]; 40Span<char> copy = stackalloc char[source.Length];
System\Windows\Forms\ListBoxTests.cs (2)
2660Span<int> buffer = stackalloc int[5]; 3177Span<int> buffer = stackalloc int[5];
System\Windows\Forms\MonthCalendarTests.cs (3)
1030Span<SYSTEMTIME> range = stackalloc SYSTEMTIME[2]; 1173Span<SYSTEMTIME> range = stackalloc SYSTEMTIME[2]; 4206Span<uint> boldedDates = stackalloc uint[monthsCount];
System\Windows\Forms\RichTextBoxTests.cs (2)
9756Span<byte> output = stackalloc byte[16]; 11020Span<char> buffer = stackalloc char[PInvokeCore.MaxClassName];
System.Windows.Forms.UI.IntegrationTests (16)
Infra\ScreenRecordService.cs (3)
517Span<byte> buffer = [value]; 524Span<byte> encoded = stackalloc byte[sizeof(ushort)]; 531Span<byte> encoded = stackalloc byte[sizeof(uint)];
Input\KeyboardSimulator.cs (6)
22Span<INPUT> inputs = 33Span<INPUT> inputs = 44Span<INPUT> inputs = 56Span<INPUT> inputs = 73Span<INPUT> inputs = stackalloc INPUT[text.Length * 2]; 98Span<INPUT> inputs = stackalloc INPUT[modifierArray.Length * 2 + keyArray.Length * 2];
Input\MouseSimulator.cs (7)
83Span<INPUT> inputs = 94Span<INPUT> inputs = 105Span<INPUT> inputs = 117Span<INPUT> inputs = 140Span<INPUT> inputs = 151Span<INPUT> inputs = 162Span<INPUT> inputs =
Test.Utilities (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
Text.Analyzers (49)
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\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\Compilers\Core\Portable\Hashing\XxHashShared.cs (1)
331Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
128Span<char> chars = stackalloc char[2];
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
74Span<char> lowerCaseCharacters = value.Length < 512 87Span<char> queryCharacters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
89Span<char> targetLowerCaseCharacters = target.Length < 512
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
96var bytes = rentedArray is null
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
292=> compilation.GetTypeByMetadataName(typeof(Span<>).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
744Name: nameof(Span<>),
xunit.assert (53)
EqualityAsserts.cs (1)
51 /// If <see cref="MemoryExtensions.SequenceEqual{T}(Span{T}, ReadOnlySpan{T})"/> fails, a call
SpanAsserts.cs (12)
44 Span<T> expectedSubSpan, 45 Span<T> actualSpan) 61 Span<T> expectedSubSpan, 79 Span<T> actualSpan) 118 Span<T> expectedSubSpan, 119 Span<T> actualSpan) 135 Span<T> expectedSubSpan, 153 Span<T> actualSpan) 209 Span<T> expectedSpan, 210 Span<T> actualSpan) 221 Span<T> expectedSpan, 234 Span<T> actualSpan)
StringAsserts.cs (40)
179 Span<char> expectedSubstring, 180 Span<char> actualString, 192 Span<char> expectedSubstring, 206 Span<char> actualString, 236 Span<char> expectedSubstring, 237 Span<char> actualString) => 247 Span<char> expectedSubstring, 259 Span<char> actualString) => 426 Span<char> expectedSubstring, 427 Span<char> actualString, 439 Span<char> expectedSubstring, 453 Span<char> actualString, 481 Span<char> expectedSubstring, 482 Span<char> actualString) => 492 Span<char> expectedSubstring, 504 Span<char> actualString) => 741 Span<char> expectedEndString, 742 Span<char> actualString) => 752 Span<char> expectedEndString, 764 Span<char> actualString) => 786 Span<char> expectedEndString, 787 Span<char> actualString, 799 Span<char> expectedEndString, 813 Span<char> actualString, 1108 Span<char> expected, 1109 Span<char> actual) => 1119 Span<char> expected, 1131 Span<char> actual) => 1183 Span<char> expected, 1184 Span<char> actual, 1229 Span<char> expected, 1276 Span<char> actual, 1534 Span<char> expectedStartString, 1535 Span<char> actualString) => 1545 Span<char> expectedStartString, 1557 Span<char> actualString) => 1579 Span<char> expectedStartString, 1580 Span<char> actualString, 1592 Span<char> expectedStartString, 1606 Span<char> actualString,