11219 references to Length
aspire (34)
Aspire.Cli.Tests (1)
Aspire.Dashboard (12)
Aspire.Hosting (3)
Aspire.Hosting.Docker (14)
cdac-build-tool (7)
ConfigurationSchemaGenerator (2)
dotnet (17)
dotnet-aot (5)
dotnet-dev-certs (22)
EventSourceGenerator (2)
GenerateDocumentationAndConfigFiles (48)
ILAssembler (23)
GrammarVisitor.cs (18)
2507SerializationTypeCode.Boolean => valueBytes.Length >= 1 && valueBytes[0] != 0,
2508SerializationTypeCode.Char => valueBytes.Length >= 2 ? BitConverter.ToChar(valueBytes) : '\0',
2509SerializationTypeCode.SByte => valueBytes.Length >= 1 ? (sbyte)valueBytes[0] : (sbyte)0,
2510SerializationTypeCode.Byte => valueBytes.Length >= 1 ? valueBytes[0] : (byte)0,
2511SerializationTypeCode.Int16 => valueBytes.Length >= 2 ? BitConverter.ToInt16(valueBytes) : (short)0,
2512SerializationTypeCode.UInt16 => valueBytes.Length >= 2 ? BitConverter.ToUInt16(valueBytes) : (ushort)0,
2513SerializationTypeCode.Int32 => valueBytes.Length >= 4 ? BitConverter.ToInt32(valueBytes) : 0,
2514SerializationTypeCode.UInt32 => valueBytes.Length >= 4 ? BitConverter.ToUInt32(valueBytes) : 0u,
2515SerializationTypeCode.Int64 => valueBytes.Length >= 8 ? BitConverter.ToInt64(valueBytes) : 0L,
2516SerializationTypeCode.UInt64 => valueBytes.Length >= 8 ? BitConverter.ToUInt64(valueBytes) : 0uL,
2517SerializationTypeCode.Single => valueBytes.Length >= 4 ? BitConverter.ToSingle(valueBytes) : 0f,
2518SerializationTypeCode.Double => valueBytes.Length >= 8 ? BitConverter.ToDouble(valueBytes) : 0d,
2540if (bytes.Length == 0)
2561if (bytes.Length < 2) return null;
2568if (bytes.Length < 4) return null;
2572if (bytes.Length < bytesRead + length)
3105for (int i = 0; i < bytesAsChars.Length; i++)
3315for (int i = 0; i < value.Length; i++, result *= 8)
ilc (1)
ILCompiler.Compiler (79)
ILCompiler.ReadyToRun (81)
ILCompiler.RyuJit (9)
ILCompiler.TypeSystem (36)
illink (25)
ILLink.RoslynAnalyzer (36)
libmscordaccore_universal (8)
Entrypoints.cs (8)
69return writeThreadContext(threadId, (uint)context.Length, contextPtr, delegateContext);
72byte* alignedBuffer = (byte*)NativeMemory.AlignedAlloc((nuint)context.Length, RequiredAlignment);
75context.CopyTo(new Span<byte>(alignedBuffer, context.Length));
76return writeThreadContext(threadId, (uint)context.Length, alignedBuffer, delegateContext);
430return dataTarget.SetThreadContext(threadId, (uint)context.Length, contextPtr);
433byte* alignedBuffer = (byte*)NativeMemory.AlignedAlloc((nuint)context.Length, RequiredAlignment);
436context.CopyTo(new Span<byte>(alignedBuffer, context.Length));
437return dataTarget.SetThreadContext(threadId, (uint)context.Length, alignedBuffer);
Microsoft.AspNetCore.Antiforgery (6)
Microsoft.AspNetCore.Authentication.Cookies (1)
Microsoft.AspNetCore.Authentication.Negotiate (5)
Microsoft.AspNetCore.Authorization (2)
Microsoft.AspNetCore.Components (23)
Microsoft.AspNetCore.Components.Endpoints (5)
Microsoft.AspNetCore.Components.Forms (2)
Microsoft.AspNetCore.Components.QuickGrid (1)
Microsoft.AspNetCore.Components.Server (30)
Microsoft.AspNetCore.Components.Web (6)
Microsoft.AspNetCore.Components.WebAssembly (2)
Microsoft.AspNetCore.Components.WebView (2)
Microsoft.AspNetCore.CookiePolicy (1)
Microsoft.AspNetCore.Cors (2)
Microsoft.AspNetCore.Cryptography.Internal (2)
Microsoft.AspNetCore.DataProtection (34)
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (4)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (22)
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (13)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Abstractions (7)
Microsoft.AspNetCore.Http.Connections (4)
Microsoft.AspNetCore.Http.Connections.Client (1)
Microsoft.AspNetCore.Http.Connections.Common (1)
Microsoft.AspNetCore.Http.Extensions (11)
Microsoft.AspNetCore.Http.Results (1)
Microsoft.AspNetCore.HttpLogging (6)
Microsoft.AspNetCore.HttpOverrides (1)
Microsoft.AspNetCore.Identity (5)
Microsoft.AspNetCore.Mvc.Core (2)
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Microsoft.AspNetCore.OpenApi (6)
Microsoft.AspNetCore.OutputCaching (8)
Microsoft.AspNetCore.Razor.Utilities.Shared (29)
Microsoft.AspNetCore.ResponseCaching (1)
Microsoft.AspNetCore.Routing (23)
Microsoft.AspNetCore.Server.HttpSys (20)
_generated\78\Windows.Win32.PInvoke.HTTPAPI.dll.g.cs (4)
641 uint __result = PInvoke.HttpSendResponseEntityBody(RequestQueueHandleLocal, RequestId, Flags, (ushort )EntityChunks.Length, EntityChunksLocal, BytesSentLocal, default, default, Overlapped, LogData.HasValue ? &LogDataLocal : null);
671 uint __result = PInvoke.HttpSendResponseEntityBody(RequestQueueHandleLocal, RequestId, Flags, (ushort )EntityChunks.Length, EntityChunksLocal, default(uint* ), default, default, Overlapped, LogData.HasValue ? &LogDataLocal : null);
744 uint __result = PInvoke.HttpSetRequestQueueProperty(RequestQueueHandleLocal, Property, (void* )PropertyInformationLocal, (uint )PropertyInformation.Length, default, default);
790 uint __result = PInvoke.HttpSetUrlGroupProperty(UrlGroupId, Property, (void* )PropertyInformationLocal, (uint )PropertyInformation.Length);
Microsoft.AspNetCore.Server.IIS (16)
Microsoft.AspNetCore.Server.Kestrel.Core (172)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Microsoft.AspNetCore.SignalR.Common (5)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (4)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (5)
Microsoft.AspNetCore.SignalR.Specification.Tests (4)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (4)
Microsoft.AspNetCore.Watch.BrowserRefresh (6)
Microsoft.AspNetCore.WebSockets (6)
Microsoft.AspNetCore.WebUtilities (29)
Microsoft.Build (224)
Microsoft.Build.Framework (31)
Microsoft.Build.Tasks.CodeAnalysis (6)
Microsoft.Build.Tasks.Core (111)
Microsoft.Build.Tasks.Git (2)
Microsoft.Build.Utilities.Core (72)
Microsoft.CodeAnalysis (106)
Microsoft.CodeAnalysis.Analyzers (49)
Microsoft.CodeAnalysis.AnalyzerUtilities (49)
Microsoft.CodeAnalysis.CodeStyle (52)
Microsoft.CodeAnalysis.CSharp (24)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.Features (4)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Microsoft.CodeAnalysis.Extensions.Package (4)
Microsoft.CodeAnalysis.Features (13)
Microsoft.CodeAnalysis.NetAnalyzers (1)
Microsoft.CodeAnalysis.Razor.Compiler (77)
Microsoft.CodeAnalysis.ResxSourceGenerator (49)
Microsoft.CodeAnalysis.Workspaces (75)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (4)
Microsoft.CSharp (1)
Microsoft.Data.Analysis (168)
Microsoft.Data.Analysis.Tests (4)
Microsoft.Diagnostics.DataContractReader (1)
Microsoft.Diagnostics.DataContractReader.Contracts (12)
Microsoft.Diagnostics.DataContractReader.Legacy (75)
_generated\36\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface.cs (18)
305for (int __i0 = 0; __i0 < __values_native__managedSpan.Length; ++__i0, ++__values_native__lastIndexMarshalled)
324__values_native__numElements = __values_native__marshaller.GetManagedValuesSource().Length;
367for (int __i0 = 0; __i0 < __values_native__nativeSpan.Length; ++__i0)
544for (int __i0 = 0; __i0 < __values_native__managedSpan.Length; ++__i0, ++__values_native__lastIndexMarshalled)
564__values_native__numElements = __values_native__marshaller.GetManagedValuesSource().Length;
608for (int __i0 = 0; __i0 < __values_native__nativeSpan.Length; ++__i0)
901for (int __i0 = 0; __i0 < __modules_native__managedSpan.Length; ++__i0, ++__modules_native__lastIndexMarshalled)
921__modules_native__numElements = __modules_native__marshaller.GetManagedValuesSource().Length;
965for (int __i0 = 0; __i0 < __modules_native__nativeSpan.Length; ++__i0)
2297for (int __i0 = 0; __i0 < __heaps_native__managedSpan.Length; ++__i0, ++__heaps_native__lastIndexMarshalled)
2316__heaps_native__numElements = __heaps_native__marshaller.GetManagedValuesSource().Length;
2359for (int __i0 = 0; __i0 < __heaps_native__nativeSpan.Length; ++__i0)
3322global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpJitCodeHeapInfo, global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpJitCodeHeapInfo>.GetManagedValuesDestination(codeHeaps).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpJitCodeHeapInfo, global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpJitCodeHeapInfo>.GetUnmanagedValuesSource(__codeHeaps_native, __codeHeaps_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpJitCodeHeapInfo, global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpJitCodeHeapInfo>.GetUnmanagedValuesSource(__codeHeaps_native, __codeHeaps_native__numElements).Length));
3612global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData, global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData>.GetManagedValuesDestination(interfaces).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData, global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData>.GetUnmanagedValuesSource(__interfaces_native, __interfaces_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData, global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData>.GetUnmanagedValuesSource(__interfaces_native, __interfaces_native__numElements).Length));
3707global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData, global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData>.GetManagedValuesDestination(interfaces).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData, global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData>.GetUnmanagedValuesSource(__interfaces_native, __interfaces_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData, global::Microsoft.Diagnostics.DataContractReader.Legacy.DacpCOMInterfacePointerData>.GetUnmanagedValuesSource(__interfaces_native, __interfaces_native__numElements).Length));
3963for (int __i0 = 0; __i0 < __values_native__managedSpan.Length; ++__i0, ++__values_native__lastIndexMarshalled)
3983__values_native__numElements = __values_native__marshaller.GetManagedValuesSource().Length;
4027for (int __i0 = 0; __i0 < __values_native__nativeSpan.Length; ++__i0)
_generated\56\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface18.cs (3)
126global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSCodeRange, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSCodeRange>.GetManagedValuesDestination(ranges).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSCodeRange, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSCodeRange>.GetUnmanagedValuesSource(__ranges_native, __ranges_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSCodeRange, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSCodeRange>.GetUnmanagedValuesSource(__ranges_native, __ranges_native__numElements).Length));
179global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<uint, uint>.GetManagedValuesDestination(offsets).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<uint, uint>.GetUnmanagedValuesSource(__offsets_native, __offsets_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<uint, uint>.GetUnmanagedValuesSource(__offsets_native, __offsets_native__numElements).Length));
232global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSGCSlotLifetime, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSGCSlotLifetime>.GetManagedValuesDestination(lifetimes).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSGCSlotLifetime, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSGCSlotLifetime>.GetUnmanagedValuesSource(__lifetimes_native, __lifetimes_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSGCSlotLifetime, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSGCSlotLifetime>.GetUnmanagedValuesSource(__lifetimes_native, __lifetimes_native__numElements).Length));
_generated\59\Microsoft.Diagnostics.DataContractReader.Legacy.IXCLRDataProcess.cs (2)
1913global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<uint, uint>.GetManagedValuesDestination(flags).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<uint, uint>.GetUnmanagedValuesSource(__flags_native, __flags_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<uint, uint>.GetUnmanagedValuesSource(__flags_native, __flags_native__numElements).Length));
2049global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<uint, uint>.GetManagedValuesDestination(flags).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<uint, uint>.GetUnmanagedValuesSource(__flags_native, __flags_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<uint, uint>.GetUnmanagedValuesSource(__flags_native, __flags_native__numElements).Length));
Microsoft.Diagnostics.NETCore.Client (1)
Microsoft.DiaSymReader (135)
_generated\10\Microsoft.DiaSymReader.ISymUnmanagedAsyncMethod.cs (3)
323global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(breakpointMethod).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__breakpointMethod_native, __breakpointMethod_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__breakpointMethod_native, __breakpointMethod_native__numElements).Length));
324global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(breakpointOffset).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__breakpointOffset_native, __breakpointOffset_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__breakpointOffset_native, __breakpointOffset_native__numElements).Length));
325global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(yieldOffsets).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__yieldOffsets_native, __yieldOffsets_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__yieldOffsets_native, __yieldOffsets_native__numElements).Length));
_generated\15\Microsoft.DiaSymReader.ISymUnmanagedConstant.cs (2)
81global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetManagedValuesDestination(name).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetUnmanagedValuesSource(__name_native, __name_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetUnmanagedValuesSource(__name_native, __name_native__numElements).Length));
193global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetManagedValuesDestination(signature).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__signature_native, __signature_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__signature_native, __signature_native__numElements).Length));
_generated\17\Microsoft.DiaSymReader.ISymUnmanagedDocument.cs (3)
95global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetManagedValuesDestination(url).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetUnmanagedValuesSource(__url_native, __url_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetUnmanagedValuesSource(__url_native, __url_native__numElements).Length));
324global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetManagedValuesDestination(checksum).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__checksum_native, __checksum_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__checksum_native, __checksum_native__numElements).Length));
510global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetManagedValuesDestination(source).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__source_native, __source_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__source_native, __source_native__numElements).Length));
_generated\19\Microsoft.DiaSymReader.ISymUnmanagedMethod.cs (17)
373global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(ranges).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__ranges_native, __ranges_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__ranges_native, __ranges_native__numElements).Length));
407for (int __i0 = 0; __i0 < __parameters_native__managedSpan.Length; ++__i0, ++__parameters_native__lastIndexMarshalled)
429__parameters_native__numElements = __parameters_native__marshaller.GetManagedValuesSource().Length;
483for (int __i0 = 0; __i0 < __parameters_native__nativeSpan.Length; ++__i0)
600for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0, ++__documents_native__lastIndexMarshalled)
624__documents_native__numElements = __documents_native__marshaller.GetManagedValuesSource().Length;
690for (int __i0 = 0; __i0 < __documents_native__nativeSpan.Length; ++__i0)
701global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(columns).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__columns_native, __columns_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__columns_native, __columns_native__numElements).Length));
702global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(lines).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__lines_native, __lines_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__lines_native, __lines_native__numElements).Length));
748for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0, ++__documents_native__lastIndexMarshalled)
775__documents_native__numElements = __documents_native__marshaller.GetManagedValuesSource().Length;
856for (int __i0 = 0; __i0 < __documents_native__nativeSpan.Length; ++__i0)
869global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(endColumns).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__endColumns_native, __endColumns_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__endColumns_native, __endColumns_native__numElements).Length));
870global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(endLines).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__endLines_native, __endLines_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__endLines_native, __endLines_native__numElements).Length));
871global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(startColumns).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__startColumns_native, __startColumns_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__startColumns_native, __startColumns_native__numElements).Length));
872global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(startLines).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__startLines_native, __startLines_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__startLines_native, __startLines_native__numElements).Length));
887global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetManagedValuesDestination(offsets).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__offsets_native, __offsets_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<int, int>.GetUnmanagedValuesSource(__offsets_native, __offsets_native__numElements).Length));
_generated\22\Microsoft.DiaSymReader.ISymUnmanagedReader.cs (17)
153for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0, ++__documents_native__lastIndexMarshalled)
175__documents_native__numElements = __documents_native__marshaller.GetManagedValuesSource().Length;
229for (int __i0 = 0; __i0 < __documents_native__nativeSpan.Length; ++__i0)
448for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0, ++__variables_native__lastIndexMarshalled)
470__variables_native__numElements = __variables_native__marshaller.GetManagedValuesSource().Length;
524for (int __i0 = 0; __i0 < __variables_native__nativeSpan.Length; ++__i0)
581for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0, ++__variables_native__lastIndexMarshalled)
603__variables_native__numElements = __variables_native__marshaller.GetManagedValuesSource().Length;
657for (int __i0 = 0; __i0 < __variables_native__nativeSpan.Length; ++__i0)
803global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetManagedValuesDestination(customDebugInformation).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__customDebugInformation_native, __customDebugInformation_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__customDebugInformation_native, __customDebugInformation_native__numElements).Length));
837for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0, ++__namespaces_native__lastIndexMarshalled)
859__namespaces_native__numElements = __namespaces_native__marshaller.GetManagedValuesSource().Length;
913for (int __i0 = 0; __i0 < __namespaces_native__nativeSpan.Length; ++__i0)
1162global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetManagedValuesDestination(name).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetUnmanagedValuesSource(__name_native, __name_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetUnmanagedValuesSource(__name_native, __name_native__numElements).Length));
1197for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0, ++__methods_native__lastIndexMarshalled)
1220__methods_native__numElements = __methods_native__marshaller.GetManagedValuesSource().Length;
1276for (int __i0 = 0; __i0 < __methods_native__nativeSpan.Length; ++__i0)
_generated\23\Microsoft.DiaSymReader.ISymUnmanagedReader2.cs (14)
160global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetManagedValuesDestination(customDebugInformation).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__customDebugInformation_native, __customDebugInformation_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__customDebugInformation_native, __customDebugInformation_native__numElements).Length));
195for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0, ++__methods_native__lastIndexMarshalled)
218__methods_native__numElements = __methods_native__marshaller.GetManagedValuesSource().Length;
274for (int __i0 = 0; __i0 < __methods_native__nativeSpan.Length; ++__i0)
370for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0, ++__documents_native__lastIndexMarshalled)
392__documents_native__numElements = __documents_native__marshaller.GetManagedValuesSource().Length;
543for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0, ++__variables_native__lastIndexMarshalled)
565__variables_native__numElements = __variables_native__marshaller.GetManagedValuesSource().Length;
623for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0, ++__variables_native__lastIndexMarshalled)
645__variables_native__numElements = __variables_native__marshaller.GetManagedValuesSource().Length;
768for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0, ++__namespaces_native__lastIndexMarshalled)
790__namespaces_native__numElements = __namespaces_native__marshaller.GetManagedValuesSource().Length;
971for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0, ++__methods_native__lastIndexMarshalled)
994__methods_native__numElements = __methods_native__marshaller.GetManagedValuesSource().Length;
_generated\24\Microsoft.DiaSymReader.ISymUnmanagedReader3.cs (14)
102global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetManagedValuesDestination(customDebugInformation).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__customDebugInformation_native, __customDebugInformation_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__customDebugInformation_native, __customDebugInformation_native__numElements).Length));
158global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetManagedValuesDestination(customDebugInformation).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__customDebugInformation_native, __customDebugInformation_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__customDebugInformation_native, __customDebugInformation_native__numElements).Length));
230for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0, ++__documents_native__lastIndexMarshalled)
252__documents_native__numElements = __documents_native__marshaller.GetManagedValuesSource().Length;
403for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0, ++__variables_native__lastIndexMarshalled)
425__variables_native__numElements = __variables_native__marshaller.GetManagedValuesSource().Length;
483for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0, ++__variables_native__lastIndexMarshalled)
505__variables_native__numElements = __variables_native__marshaller.GetManagedValuesSource().Length;
628for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0, ++__namespaces_native__lastIndexMarshalled)
650__namespaces_native__numElements = __namespaces_native__marshaller.GetManagedValuesSource().Length;
831for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0, ++__methods_native__lastIndexMarshalled)
854__methods_native__numElements = __methods_native__marshaller.GetManagedValuesSource().Length;
1043for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0, ++__methods_native__lastIndexMarshalled)
1066__methods_native__numElements = __methods_native__marshaller.GetManagedValuesSource().Length;
_generated\31\Microsoft.DiaSymReader.ISymUnmanagedVariable.cs (2)
93global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetManagedValuesDestination(name).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetUnmanagedValuesSource(__name_native, __name_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<char, char>.GetUnmanagedValuesSource(__name_native, __name_native__numElements).Length));
190global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetManagedValuesDestination(signature).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__signature_native, __signature_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.GetUnmanagedValuesSource(__signature_native, __signature_native__numElements).Length));
Microsoft.DotNet.HotReload.Watch (21)
Microsoft.DotNet.NativeWrapper (1)
Microsoft.DotNet.ProjectTools (2)
Microsoft.DotNet.StrongName (3)
Microsoft.DotNet.TemplateLocator (2)
Microsoft.Extensions.AI (7)
Microsoft.Extensions.AI.Abstractions (3)
Microsoft.Extensions.AI.Evaluation.NLP (6)
Microsoft.Extensions.AI.Evaluation.Quality (1)
Microsoft.Extensions.AI.Integration.Tests (3)
Microsoft.Extensions.Caching.Hybrid (3)
Microsoft.Extensions.Compliance.Abstractions (4)
Microsoft.Extensions.Compliance.Abstractions.Tests (2)
Microsoft.Extensions.Compliance.Redaction.Tests (2)
Microsoft.Extensions.Configuration.Binder.SourceGeneration (12)
Microsoft.Extensions.Configuration.EnvironmentVariables (3)
Microsoft.Extensions.DataIngestion (7)
Microsoft.Extensions.DependencyModel (6)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (26)
Microsoft.Extensions.Http.Diagnostics (12)
Microsoft.Extensions.Identity.Core (2)
Microsoft.Extensions.Logging.Abstractions (3)
Microsoft.Extensions.Logging.Console (7)
Microsoft.Extensions.Logging.Generators (11)
Microsoft.Extensions.Options.SourceGeneration (2)
Microsoft.Extensions.Primitives (2)
Microsoft.Extensions.ServiceDiscovery.Dns (3)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (5)
Microsoft.Extensions.Telemetry (19)
Microsoft.Extensions.Telemetry.Abstractions.Tests (12)
Microsoft.Extensions.Telemetry.Tests (7)
Microsoft.Interop.ComInterfaceGenerator (4)
Microsoft.Interop.LibraryImportGenerator (2)
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
Microsoft.Interop.SourceGeneration (2)
Microsoft.JSInterop (2)
Microsoft.Maui (1)
Microsoft.Maui.Essentials (2)
Microsoft.Maui.Graphics (14)
Microsoft.ML.Core (183)
Microsoft.ML.Core.Tests (39)
UnitTests\TestVBuffer.cs (34)
38Assert.Equal(4, buffer.GetValues().Length);
101float infNorm = a.GetValues().Length == 0 ? 0 : a.Items().Max(iv => Math.Abs(iv.Value));
471List<int> indices = new List<int>(a.GetIndices().Length);
472TDst[] values = new TDst[a.GetValues().Length];
546if (a.GetValues().Length == 0 || c == 0)
554var editor = VBufferEditor.Create(ref aa, b.Length, aa.GetValues().Length, requireIndicesOnDense: true);
908while (index < a.GetValues().Length)
928Assert.True(expectedIndices.Count <= a.GetValues().Length);
1014var editor = VBufferEditor.Create(ref dst, src.Length, src.GetValues().Length);
1030Assert.Equal(expected.GetValues().Length, actual.GetValues().Length);
1034for (int i = 0; i < expected.GetIndices().Length; ++i)
1037for (int i = 0; i < expected.GetValues().Length; ++i)
1118GenerateVBuffer(rgen, len, a.GetValues().Length, out b);
1120for (int i = 0; i < a.GetIndices().Length; ++i)
1127GenerateVBuffer(rgen, a.GetValues().Length, rgen.Next(a.GetValues().Length), out b);
1128bEditor = VBufferEditor.Create(ref b, len, b.GetValues().Length);
1141int boundary = rgen.Next(a.GetValues().Length + 1);
1142GenerateVBuffer(rgen, len, a.GetValues().Length - boundary, out b);
1143if (a.GetValues().Length != 0 && b.GetValues().Length != 0 && a.GetValues().Length != b.GetValues().Length)
1189int j = actual.GetValues().Length == 0 ? length : actual.GetIndices()[jj];
1195j = ++jj == actual.GetValues().Length ? length : actual.GetIndices()[jj];
1205int i = expected.GetValues().Length == 0 ? length : expected.GetIndices()[ii];
1211i = ++ii == expected.GetValues().Length ? length : expected.GetIndices()[ii];
1222int i = expected.GetValues().Length == 0 ? length : expected.GetIndices()[ii];
1223int j = actual.GetValues().Length == 0 ? length : actual.GetIndices()[jj];
1231i = ++ii == expected.GetValues().Length ? length : expected.GetIndices()[ii];
1232j = ++jj == actual.GetValues().Length ? length : actual.GetIndices()[jj];
1237i = ++ii == expected.GetValues().Length ? length : expected.GetIndices()[ii];
1243j = ++jj == actual.GetValues().Length ? length : actual.GetIndices()[jj];
Microsoft.ML.CpuMath (85)
Microsoft.ML.Data (229)
Deprecated\Vector\VBufferMathUtils.cs (39)
22if (aValues.Length == 0)
51if (aValues.Length == 0)
63if (aValues.Length == 0)
74if (aValues.Length == 0)
86if (c == 1 || dst.GetValues().Length == 0)
104int count = srcValues.Length;
144if (srcValues.Length == 0)
153CpuMathUtils.Add(srcValues, src.GetIndices(), editor.Values, srcValues.Length);
172if (srcValues.Length == 0 || c == 0)
181CpuMathUtils.AddScale(c, srcValues, src.GetIndices(), editor.Values, srcValues.Length);
198if (srcValues.Length == 0 || c == 0)
226if (c == 0 || b.GetValues().Length == 0)
228else if (a.GetValues().Length == 0)
246if (srcValues.Length == 0 || c == 0)
256CpuMathUtils.AddScale(c, srcValues, values, srcValues.Length);
258CpuMathUtils.AddScale(c, srcValues, src.GetIndices(), values, srcValues.Length);
268int dMin = dstIndices.Length == 0 ? 0 : dstIndices.FindIndexSorted(0, dstIndices.Length, offset);
269int dLim = dstIndices.Length == 0 ? 0 : dstIndices.FindIndexSorted(dMin, dstIndices.Length, offset + src.Length);
277gapCount = srcValues.Length;
279for (int iS = 0, iD = dMin; iS < srcIndices.Length && iD < dLim;)
298dstValues.Length + gapCount,
306if (dstValues.Length != dLim)
308Contracts.Assert(dLim < dstValues.Length);
309indices.Slice(dLim, dstValues.Length - dLim)
311values.Slice(dLim, dstValues.Length - dLim)
340int iS = srcIndices.Length - 1;
387else if (src.GetValues().Length == 0 || c == 0)
413if (srcValues.Length == 0)
418Contracts.Assert(-1 <= ind && ind < srcValues.Length);
437while (ind < srcIndices.Length && srcIndices[ind] == ind)
439Contracts.Assert(ind <= srcIndices.Length);
440Contracts.Assert(ind == srcIndices.Length || ind < srcIndices[ind]);
449if (srcValues.Length == 0)
454Contracts.Assert(-1 <= ind && ind < srcValues.Length);
473while (ind < srcIndices.Length && srcIndices[ind] == ind)
475Contracts.Assert(ind <= srcIndices.Length);
476Contracts.Assert(ind == srcIndices.Length || ind < srcIndices[ind]);
Deprecated\Vector\VectorUtils.cs (36)
34if (bValues.Length == 0)
38return CpuMathUtils.DotProductSparse(a, bValues, b.GetIndices(), bValues.Length);
47if (aValues.Length == 0 || bValues.Length == 0)
54return CpuMathUtils.DotProductSparse(aValues, bValues, b.GetIndices(), bValues.Length);
58return CpuMathUtils.DotProductSparse(bValues, aValues, a.GetIndices(), aValues.Length);
59return DotProductSparse(aValues, a.GetIndices(), 0, aValues.Length, bValues, b.GetIndices(), 0, bValues.Length);
83for (int i = 0; i < aValues.Length; i++)
175Contracts.Assert(valuesA.Length == indicesA.Length);
176Contracts.Assert(valuesB.Length == indicesB.Length);
182while (ia < indicesA.Length && ib < indicesB.Length)
205while (ia < indicesA.Length)
212while (ib < indicesB.Length)
225if (valuesB.Length == 0)
228var dotP = CpuMathUtils.DotProductSparse(valuesA, valuesB, indicesB, valuesB.Length);
235Contracts.Assert(0 <= length && length <= valuesA.Length);
236Contracts.Assert(0 <= length && length <= valuesB.Length);
258if (aValues.Length == 0 || bValues.Length == 0)
264return CpuMathUtils.DotProductSparse(aValues.Slice(offset), bValues, b.GetIndices(), bValues.Length);
270int aMin = Utils.FindIndexSorted(aIndices, 0, aIndices.Length, offset);
271int aLim = Utils.FindIndexSorted(aIndices, 0, aIndices.Length, offset + b.Length);
279for (int iA = aMin, iB = 0; iA < aLim && iB < bIndices.Length;)
309if (bValues.Length == 0)
314return CpuMathUtils.DotProductSparse(a.AsSpan(offset), bValues, b.GetIndices(), bValues.Length);
323Contracts.Assert(0 <= ia && ia < iaLim && iaLim <= aIndices.Length);
324Contracts.Assert(0 <= ib && ib < ibLim && ibLim <= bIndices.Length);
447if (srcValues.Length == 0 || c == 0)
451CpuMathUtils.AddScale(c, srcValues, dst, srcValues.Length);
455for (int i = 0; i < srcValues.Length; i++)
475if (srcValues.Length == 0 || c == 0)
486for (int i = 0; i < srcValues.Length; i++)
Microsoft.ML.DataView (5)
Microsoft.ML.Ensemble (3)
Microsoft.ML.EntryPoints (1)
Microsoft.ML.FastTree (24)
Microsoft.ML.ImageAnalytics (2)
Microsoft.ML.KMeansClustering (3)
Microsoft.ML.LightGbm (5)
Microsoft.ML.Mkl.Components (10)
Microsoft.ML.OneDal (2)
Microsoft.ML.OnnxTransformer (2)
Microsoft.ML.PCA (1)
Microsoft.ML.Predictor.Tests (1)
Microsoft.ML.Samples (3)
Microsoft.ML.StandardTrainers (37)
Standard\SdcaBinary.cs (3)
880CpuMathUtils.SdcaL1UpdateDense(primalUpdate, featureValues.Length, featureValues, l1Threshold, l1IntermediateWeightsEditor.Values, weightsEditor.Values);
881else if (featureValues.Length > 0)
882CpuMathUtils.SdcaL1UpdateSparse(primalUpdate, featureValues.Length, featureValues, features.GetIndices(), l1Threshold, l1IntermediateWeightsEditor.Values, weightsEditor.Values);
Standard\SdcaMulticlass.cs (6)
298CpuMathUtils.SdcaL1UpdateDense(-primalUpdate, featureValues.Length, featureValues, l1Threshold, l1IntermediateWeightsEditor.Values, weightsEditor.Values);
299else if (featureValues.Length > 0)
300CpuMathUtils.SdcaL1UpdateSparse(-primalUpdate, featureValues.Length, featureValues, features.GetIndices(), l1Threshold, l1IntermediateWeightsEditor.Values, weightsEditor.Values);
329CpuMathUtils.SdcaL1UpdateDense(labelPrimalUpdate, featureValues.Length, featureValues, l1Threshold, l1IntermediateWeightsEditor.Values, weightsEditor.Values);
330else if (featureValues.Length > 0)
331CpuMathUtils.SdcaL1UpdateSparse(labelPrimalUpdate, featureValues.Length, featureValues, features.GetIndices(), l1Threshold, l1IntermediateWeightsEditor.Values, weightsEditor.Values);
Microsoft.ML.TensorFlow.Tests (16)
TensorflowTests.cs (16)
305Assert.Equal(sample.OneDim.Length, oneDimValues.Length);
309Assert.Equal(sample.TwoDim.Length, twoDimValues.Length);
313Assert.Equal(sample.ThreeDim.Length, threeDimValues.Length);
317Assert.Equal(sample.FourDim.Length, fourDimValues.Length);
321Assert.Equal(sample.FourDimKnown.Length, fourDimKnownValues.Length);
446Assert.Equal(2, f64Values.Length);
449Assert.Equal(2, f32Values.Length);
452Assert.Equal(2, i64Values.Length);
455Assert.Equal(2, i32Values.Length);
458Assert.Equal(2, i16Values.Length);
461Assert.Equal(2, i8Values.Length);
464Assert.Equal(2, u64Values.Length);
467Assert.Equal(2, u32Values.Length);
470Assert.Equal(2, u16Values.Length);
473Assert.Equal(2, u8Values.Length);
476Assert.Equal(2, bValues.Length);
Microsoft.ML.TestFramework (3)
Microsoft.ML.TestFrameworkCommon (2)
Microsoft.ML.Tests (16)
Microsoft.ML.TimeSeries (2)
Microsoft.ML.Tokenizers (318)
Model\BPETokenizer.cs (41)
860span = span.Slice(0, span.Length - EndOfWordSuffix.Length);
957sSpan = sSpan.Slice(0, sSpan.Length - EndOfWordSuffix!.Length);
964if (sSpan.Length > buffer.Length)
971charsWritten += sSpan.Length;
972buffer = buffer.Slice(sSpan.Length);
1017if (specialTokenSpan.Length > buffer.Length)
1023buffer = buffer.Slice(specialTokenSpan.Length);
1024charsWritten += specialTokenSpan.Length;
1036span = span.Slice(0, span.Length - EndOfWordSuffix.Length);
1046if (current.Length < span.Length)
1051for (int i = 0; i < span.Length; i++)
1056current = utf8bytes.Slice(incompleteUtf8BytesInBufferIndex, incompleteUtf8BytesInBuffer + span.Length);
1192Word word = Word.WithCapacity(w.Length);
1199while (i < w.Length)
1203if (Char.IsHighSurrogate(w[i]) && i < w.Length - 1 && Char.IsLowSurrogate(w[i + 1]))
1217if (ContinuingSubwordPrefix.Length + s.Length <= buffer.Length)
1221s = buffer.Slice(0, ContinuingSubwordPrefix.Length + s.Length);
1235if (i + length >= w.Length && EndOfWordSuffix is not null)
1237if (s.Length + EndOfWordSuffix.Length <= buffer.Length)
1240EndOfWordSuffix.AsSpan().CopyTo(buffer.Slice(s.Length));
1241s = buffer.Slice(0, s.Length + EndOfWordSuffix.Length);
1311tokens.Add(new EncodedToken(value.specialTokenId, value.specialToken, new Range(offset, offset + text.Length)));
1323int destinationMaxSize = Encoding.UTF8.GetMaxByteCount(text.Length);
1354if (textSpan.Length <= MaxWordLengthToCache)
1421charsConsumed = text.Length;
1436int destinationMaxSize = Encoding.UTF8.GetMaxByteCount(text.Length);
1459int res = WordToIds(ref hit, accumulatedIds, out charsConsumed, textSpan.Length, maxTokens);
1462charsConsumed = charsConsumed >= textSpan.Length ? text.Length : mapping[charsConsumed];
1470if (textSpan.Length <= MaxWordLengthToCache)
1480int result = WordToIds(ref word, accumulatedIds, out charsConsumed, textSpan.Length, maxTokens);
1483charsConsumed = charsConsumed >= textSpan.Length ? text.Length : mapping[charsConsumed];
1516int destinationMaxSize = Encoding.UTF8.GetMaxByteCount(text.Length);
1539int res = WordToIdsFromEnd(ref hit, accumulatedIds, out textIndex, textSpan.Length, maxTokens);
1543textIndex = textIndex >= textSpan.Length ? text.Length : mapping[textIndex];
1551if (textSpan.Length <= MaxWordLengthToCache)
1561int result = WordToIdsFromEnd(ref word, accumulatedIds, out textIndex, textSpan.Length, maxTokens);
1565textIndex = textIndex >= textSpan.Length ? text.Length : mapping[textIndex];
Model\CodeGenTokenizer.cs (40)
345if (span.Length + 1 > BufferLength)
347mutatedInputText = ArrayPool<char>.Shared.Rent(span.Length + 1);
352span = mutatedInputSpan.Slice(0, span.Length + 1);
385PriorityQueue<SymbolPair> agenda = new(textSpanToEncode.Length);
401int index = addPrefixSpace ? Math.Max(0, textSpanToEncode.Length - 1) : textSpanToEncode.Length;
405return new EncodeResults<EncodedToken> { Tokens = tokens, NormalizedText = normalizedText, CharsConsumed = textSpanToEncode.Length };
435tokens.Add(new EncodedToken(value.specialTokenId, value.specialToken, new Range(index, index + ((addPrefixSpace && offset == 0) ? textSpan.Length - 1 : textSpan.Length))));
452int destinationMaxSize = Encoding.UTF8.GetMaxByteCount(textSpan.Length);
466if (textSpan.Length <= MaxTokenLengthToCache)
602if (span.Length + 1 > BufferLength)
604mutatedInputText = ArrayPool<char>.Shared.Rent(span.Length + 1);
609span = mutatedInputSpan.Slice(0, span.Length + 1);
625PriorityQueue<SymbolPair> agenda = new(textSpanToEncode.Length);
821if (span.Length + 1 > BufferLength)
823mutatedInputText = ArrayPool<char>.Shared.Rent(span.Length + 1);
828span = mutatedInputSpan.Slice(0, span.Length + 1);
837PriorityQueue<SymbolPair> agenda = new(textSpanToEncode.Length);
958if (span.Length + 1 > BufferLength)
960mutatedInputText = ArrayPool<char>.Shared.Rent(span.Length + 1);
965span = mutatedInputSpan.Slice(0, span.Length + 1);
974PriorityQueue<SymbolPair> agenda = new(textSpanToEncode.Length);
1119charsConsumed = textSpan.Length;
1125return EncodeToIdsResult(hit, accumulatedIds, maxTokens, textSpan.Length, out charsConsumed);
1135int destinationMaxSize = Encoding.UTF8.GetMaxByteCount(textSpan.Length);
1149int length = text is not null ? text.Length : textSpan.Length;
1155return EncodeToIdsResult(result, accumulatedIds, maxTokens, textSpan.Length, out charsConsumed);
1172textIndex = textSpan.Length;
1189return EncodeToIdsFromEndResult(hit, accumulatedIds, maxTokens, textSpan.Length, out textIndex);
1199int destinationMaxSize = Encoding.UTF8.GetMaxByteCount(textSpan.Length);
1213int length = text is not null ? text.Length : textSpan.Length;
1219return EncodeToIdsFromEndResult(result, accumulatedIds, maxTokens, textSpan.Length, out textIndex);
1452if (specialTokenSpan.Length > buffer.Length)
1458buffer = buffer.Slice(specialTokenSpan.Length);
1459charsWritten += specialTokenSpan.Length;
1472if (current.Length < span.Length)
1477for (int i = 0; i < span.Length; i++)
1482current = utf8bytes.Slice(incompleteUtf8BytesInBufferIndex, incompleteUtf8BytesInBuffer + span.Length);
1682int endIndex = index + length < mapping.Length ? mapping[index + length] : originalText.Length;
Model\EnglishRobertaTokenizer.cs (15)
363char[] token = ArrayPool<char>.Shared.Rent(text.Length);
364int[] indexMapping = ArrayPool<int>.Shared.Rent(text.Length);
369for (int i = 0; i < text.Length; i++)
672return EncodeToIdsResult(hit, accumulatedIds, maxTokens, text.Length, out charsConsumed);
675char[] token = ArrayPool<char>.Shared.Rent(text.Length);
676int[] indexMapping = ArrayPool<int>.Shared.Rent(text.Length);
681for (int i = 0; i < text.Length; i++)
695charsConsumed = text.Length;
704return EncodeToIdsResult(result, accumulatedIds, maxTokens, text.Length, out charsConsumed);
711textIndex = text.Length;
717return EncodeToIdsFromEndResult(hit, accumulatedIds, maxTokens, text.Length, out textIndex);
720char[] token = ArrayPool<char>.Shared.Rent(text.Length);
721int[] indexMapping = ArrayPool<int>.Shared.Rent(text.Length);
726for (int i = 0; i < text.Length; i++)
749return EncodeToIdsFromEndResult(result, accumulatedIds, maxTokens, text.Length, out textIndex);
Model\TiktokenTokenizer.cs (20)
323int utf8Length = Encoding.UTF8.GetMaxByteCount(text.Length);
329indexMappingSpan[encodedLength] = text.Length;
341if (text.Length <= MaxWordLengthToCache)
430return EncodeToIdsResult(value, accumulatedIds, maxTokenCount, text.Length, out charsConsumed);
435charsConsumed = text.Length;
440int utf8Length = Encoding.UTF8.GetMaxByteCount(text.Length);
446indexMappingSpan[encodedLength] = text.Length;
455if (text.Length <= MaxWordLengthToCache)
461return EncodeToIdsResult(encodedTokens, accumulatedIds, maxTokenCount, text.Length, out charsConsumed);
596return EncodeToIdsResult(value, accumulatedIds: null, maxTokens, text.Length, out charsConsumed);
601charsConsumed = text.Length;
605int utf8Length = Encoding.UTF8.GetMaxByteCount(text.Length);
611indexMappingSpan[encodedLength] = text.Length;
620if (text.Length <= MaxWordLengthToCache)
626return EncodeToIdsResult(encodedTokens, accumulatedIds: null, maxTokens, text.Length, out charsConsumed);
722return EncodeToIdsFromEndResult(value, accumulatedIds: null, maxTokens, text.Length, out textIndex);
731int utf8Length = Encoding.UTF8.GetMaxByteCount(text.Length);
737indexMappingSpan[encodedLength] = text.Length;
746if (text.Length <= MaxWordLengthToCache)
752return EncodeToIdsFromEndResult(encodedTokens, accumulatedIds: null, maxTokens, text.Length, out textIndex);
Microsoft.ML.Tokenizers.Tests (24)
Microsoft.ML.TorchSharp (16)
Microsoft.ML.Transforms (100)
Microsoft.NET.Build.Containers (9)
Microsoft.NET.Build.Tasks (2)
Microsoft.NET.HostModel (9)
Microsoft.Net.Http.Headers (11)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (13)
Microsoft.NET.Sdk.WorkloadManifestReader (2)
Microsoft.NET.StringTools (18)
Microsoft.Private.Windows.Core (80)
Microsoft.SourceLink.AzureDevOpsServer.Git (2)
Microsoft.SourceLink.AzureRepos.Git (2)
Microsoft.SourceLink.Bitbucket.Git (2)
Microsoft.SourceLink.Common (2)
Microsoft.SourceLink.Gitea (2)
Microsoft.SourceLink.Gitee (2)
Microsoft.SourceLink.GitHub (2)
Microsoft.SourceLink.GitLab (2)
Microsoft.SourceLink.GitWeb (2)
Microsoft.Win32.Registry (4)
NuGet.Commands (1)
NuGet.ProjectModel (2)
PresentationBuildTasks (11)
PresentationCore (6)
PresentationFramework (45)
PresentationUI (3)
RepoTasks (22)
Roslyn.Diagnostics.Analyzers (49)
Roslyn.Diagnostics.CSharp.Analyzers (1)
Shared (14)
System.Collections (3)
System.Collections.Immutable (46)
System.Collections.Specialized (1)
System.CommandLine (2)
System.ComponentModel.Annotations (1)
System.ComponentModel.TypeConverter (8)
System.Console (12)
System.Data.Common (29)
System.Data.Odbc (17)
System.Data.OleDb (17)
System.Diagnostics.DiagnosticSource (47)
System.Diagnostics.EventLog (2)
System.Diagnostics.FileVersionInfo (1)
System.Diagnostics.PerformanceCounter (15)
System.Diagnostics.Process (23)
System.DirectoryServices.Protocols (1)
System.Drawing.Common (79)
System\Drawing\Drawing2D\GraphicsPath.cs (22)
43if (pts.Length != types.Length)
52PInvokeGdiPlus.GdipCreatePath2((GdiPlus.PointF*)p, t, types.Length, (GdiPlus.FillMode)fillMode, &path).ThrowIfFailed();
79if (pts.Length != types.Length)
88PInvokeGdiPlus.GdipCreatePath2I((GdiPlus.Point*)p, t, types.Length, (GdiPlus.FillMode)fillMode, &path).ThrowIfFailed();
334if (points.Length == 0)
341PInvokeGdiPlus.GdipAddPathLine2(_nativePath, (GdiPlus.PointF*)p, points.Length).ThrowIfFailed();
361if (points.Length == 0)
368PInvokeGdiPlus.GdipAddPathLine2I(_nativePath, (GdiPlus.Point*)p, points.Length).ThrowIfFailed();
413PInvokeGdiPlus.GdipAddPathBeziers(_nativePath, (GdiPlus.PointF*)p, points.Length).ThrowIfFailed();
435if (points.Length == 0)
440PInvokeGdiPlus.GdipAddPathBeziersI(_nativePath, (GdiPlus.Point*)p, points.Length).ThrowIfFailed();
499points.Length,
547points.Length,
575PInvokeGdiPlus.GdipAddPathClosedCurve2(_nativePath, (GdiPlus.PointF*)p, points.Length, tension).ThrowIfFailed();
605PInvokeGdiPlus.GdipAddPathClosedCurve2I(_nativePath, (GdiPlus.Point*)p, points.Length, tension).ThrowIfFailed();
634PInvokeGdiPlus.GdipAddPathRectangles(_nativePath, (RectF*)r, rects.Length).ThrowIfFailed();
654PInvokeGdiPlus.GdipAddPathRectanglesI(_nativePath, (Rect*)r, rects.Length).ThrowIfFailed();
743PInvokeGdiPlus.GdipAddPathPolygon(_nativePath, (GdiPlus.PointF*)p, points.Length).ThrowIfFailed();
764PInvokeGdiPlus.GdipAddPathPolygonI(_nativePath, (GdiPlus.Point*)p, points.Length).ThrowIfFailed();
915destPoints.Length,
System\Drawing\Graphics.cs (31)
770CheckErrorStatus(PInvokeGdiPlus.GdipDrawRectangles(NativeGraphics, pen.NativePen, (RectF*)r, rects.Length));
795CheckErrorStatus(PInvokeGdiPlus.GdipDrawRectanglesI(NativeGraphics, pen.NativePen, (Rect*)r, rects.Length));
869CheckErrorStatus(PInvokeGdiPlus.GdipDrawPolygon(NativeGraphics, pen.NativePen, (GdiPlus.PointF*)p, points.Length));
894CheckErrorStatus(PInvokeGdiPlus.GdipDrawPolygonI(NativeGraphics, pen.NativePen, (GdiPlus.Point*)p, points.Length));
929CheckErrorStatus(PInvokeGdiPlus.GdipDrawCurve(NativeGraphics, pen.NativePen, (GdiPlus.PointF*)p, points.Length));
954(GdiPlus.PointF*)p, points.Length,
990(GdiPlus.PointF*)p, points.Length,
1014CheckErrorStatus(PInvokeGdiPlus.GdipDrawCurveI(NativeGraphics, pen.NativePen, (GdiPlus.Point*)p, points.Length));
1039(GdiPlus.Point*)p, points.Length,
1072(GdiPlus.Point*)p, points.Length,
1100(GdiPlus.PointF*)p, points.Length));
1131(GdiPlus.PointF*)p, points.Length,
1156(GdiPlus.Point*)p, points.Length));
1182(GdiPlus.Point*)p, points.Length,
1266CheckErrorStatus(PInvokeGdiPlus.GdipFillRectangles(NativeGraphics, brush.NativeBrush, (RectF*)r, rects.Length));
1288CheckErrorStatus(PInvokeGdiPlus.GdipFillRectanglesI(NativeGraphics, brush.NativeBrush, (Rect*)r, rects.Length));
1321(GdiPlus.PointF*)p, points.Length,
1360(GdiPlus.Point*)p, points.Length,
1463(GdiPlus.PointF*)p, points.Length));
1504(GdiPlus.PointF*)p, points.Length,
1531(GdiPlus.Point*)p, points.Length));
1567(GdiPlus.Point*)p, points.Length,
1749c, s.Length,
1811text.Length,
1979text.Length,
2377CheckErrorStatus(PInvokeGdiPlus.GdipDrawLines(NativeGraphics, pen.NativePen, (GdiPlus.PointF*)p, points.Length));
2424CheckErrorStatus(PInvokeGdiPlus.GdipDrawLinesI(NativeGraphics, pen.NativePen, (GdiPlus.Point*)p, points.Length));
2606pts.Length));
2632pts.Length));
2807(GdiPlus.PointF*)p, points.Length));
2839points.Length));
System\Drawing\Icon.cs (2)
551_handle = PInvoke.CreateIconFromResourceEx(b, (uint)bestImage.Length, fIcon: true, 0x00030000, 0, 0, 0);
558_handle = PInvoke.CreateIconFromResourceEx(b, (uint)bestImage.Length, fIcon: true, 0x00030000, 0, 0, 0);
System.Drawing.Primitives (3)
System.Formats.Asn1 (134)
System.Formats.Cbor (24)
System.Formats.Nrbf (3)
System.Formats.Tar (42)
System.IO.Compression (57)
System.IO.Compression.Brotli (11)
System.IO.Compression.ZipFile (3)
System.IO.FileSystem.AccessControl (21)
System.IO.FileSystem.DriveInfo (6)
System.IO.FileSystem.Watcher (21)
System.IO.Hashing (81)
System.IO.Packaging (9)
System.IO.Pipelines (2)
System.IO.Pipes (1)
System.IO.Ports (1)
System.Linq (38)
System.Memory (58)
System.Memory.Data (1)
System.Net.Http (168)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
42if (buffer.Length != 0)
System.Net.Http.WinHttpHandler (2)
System.Net.HttpListener (13)
System.Net.Mail (36)
System.Net.NameResolution (7)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
66err = Interop.Sys.GetAddressFamily(rawAddress, buffer.Length, (int*)&family);
94err = Interop.Sys.GetPort(rawAddress, buffer.Length, &port);
118err = Interop.Sys.GetIPv4Address(rawAddress, buffer.Length, &ipAddress);
132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope);
System.Net.NetworkInformation (23)
System.Net.Ping (8)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
66err = Interop.Sys.GetAddressFamily(rawAddress, buffer.Length, (int*)&family);
94err = Interop.Sys.GetPort(rawAddress, buffer.Length, &port);
118err = Interop.Sys.GetIPv4Address(rawAddress, buffer.Length, &ipAddress);
132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope);
System.Net.Primitives (44)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
66err = Interop.Sys.GetAddressFamily(rawAddress, buffer.Length, (int*)&family);
94err = Interop.Sys.GetPort(rawAddress, buffer.Length, &port);
118err = Interop.Sys.GetIPv4Address(rawAddress, buffer.Length, &ipAddress);
132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope);
System.Net.Quic (57)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
66err = Interop.Sys.GetAddressFamily(rawAddress, buffer.Length, (int*)&family);
94err = Interop.Sys.GetPort(rawAddress, buffer.Length, &port);
118err = Interop.Sys.GetIPv4Address(rawAddress, buffer.Length, &ipAddress);
132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope);
System.Net.Requests (1)
System.Net.Security (155)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs (9)
126inputBytes.Length,
170inputBytes.Length,
246inputBytes.Length,
274inputBytes.Length,
343return Wrap(out minorStatus, contextHandle, ref isEncrypt, inputBytesPtr, inputBytes.Length, ref outBuffer);
356return Unwrap(out minorStatus, contextHandle, out isEncrypt, inputBytesPtr, inputBytes.Length, ref outBuffer);
368return GetMic(out minorStatus, contextHandle, inputBytesPtr, inputBytes.Length, ref outBuffer);
381return VerifyMic(out minorStatus, contextHandle, inputBytesPtr, inputBytes.Length, tokenBytesPtr, tokenBytes.Length);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (24)
364Debug.Assert(HeaderLength == NtlmHeader.Length);
381if (length == 0 || offset < 0 || offset > payload.Length - length)
403SetField(ref field, data.Length, offset);
405offset += data.Length;
423if (password.Length > 128)
454Debug.Assert(serverChallenge.Length == ChallengeLength);
456Debug.Assert(ntlm2hash.Length == DigestLength);
458Span<byte> blob = payload.Slice(payloadOffset, sizeof(NtChallengeResponse) + serverInfo.Length);
466serverInfo.CopyTo(MemoryMarshal.CreateSpan(ref temp.ServerInfo[0], serverInfo.Length));
521byte[] targetInfoBuffer = new byte[targetInfo.Length + 20 /* channel binding */ + 4 + spnSize /* SPN */ + 8 /* flags */ + 4 /* EOL */];
527if (targetInfo.Length > 0)
530while (info.Length >= 4)
543if (length > info.Length - 4)
632if (blob.Length < sizeof(ChallengeMessage))
642!NtlmHeader.SequenceEqual(blob.Slice(0, NtlmHeader.Length)))
811if (signature.Length != SignatureLength ||
845Span<byte> output = outputWriter.GetSpan(input.Length + SignatureLength);
846_clientSeal.Transform(input, output.Slice(SignatureLength, input.Length));
851outputWriter.Advance(input.Length + SignatureLength);
865if (input.Length < SignatureLength)
870Span<byte> output = outputWriter.GetSpan(input.Length - SignatureLength);
871_serverSeal.Transform(input.Slice(SignatureLength), output.Slice(0, input.Length - SignatureLength));
872if (!VerifyMIC(output.Slice(0, input.Length - SignatureLength), input.Slice(0, SignatureLength)))
878outputWriter.Advance(input.Length - SignatureLength);
System.Net.ServerSentEvents (12)
System.Net.Sockets (16)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
66err = Interop.Sys.GetAddressFamily(rawAddress, buffer.Length, (int*)&family);
94err = Interop.Sys.GetPort(rawAddress, buffer.Length, &port);
118err = Interop.Sys.GetIPv4Address(rawAddress, buffer.Length, &ipAddress);
132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope);
System.Net.WebClient (14)
System.Net.WebHeaderCollection (1)
System.Net.WebSockets (14)
System.Numerics.Tensors (385)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryInputBinaryOutput.cs (47)
51if (x.Length > destination1.Length)
56if (x.Length > destination2.Length)
63ValidateOutputSpansNonOverlapping(x.Length, destination1, destination2);
72oneVectorFromEnd = x.Length - Vector512<T>.Count;
87if (i != x.Length)
89i = x.Length - Vector512<T>.Count;
102oneVectorFromEnd = x.Length - Vector256<T>.Count;
117if (i != x.Length)
119i = x.Length - Vector256<T>.Count;
132oneVectorFromEnd = x.Length - Vector128<T>.Count;
147if (i != x.Length)
149i = x.Length - Vector128<T>.Count;
160while (i < x.Length)
178if (x.Length != y.Length)
183if (x.Length > destination1.Length)
188if (x.Length > destination2.Length)
197ValidateOutputSpansNonOverlapping(x.Length, destination1, destination2);
207oneVectorFromEnd = x.Length - Vector512<T>.Count;
222if (i != x.Length)
224Vector512<T> mask = Vector512.Equals(CreateRemainderMaskVector512<T>(x.Length - i), Vector512<T>.Zero);
226i = x.Length - Vector512<T>.Count;
255oneVectorFromEnd = x.Length - Vector256<T>.Count;
270if (i != x.Length)
272Vector256<T> mask = Vector256.Equals(CreateRemainderMaskVector256<T>(x.Length - i), Vector256<T>.Zero);
274i = x.Length - Vector256<T>.Count;
303oneVectorFromEnd = x.Length - Vector128<T>.Count;
318if (i != x.Length)
320Vector128<T> mask = Vector128.Equals(CreateRemainderMaskVector128<T>(x.Length - i), Vector128<T>.Zero);
322i = x.Length - Vector128<T>.Count;
349while (i < x.Length)
367if (x.Length > destination1.Length)
372if (x.Length > destination2.Length)
379ValidateOutputSpansNonOverlapping(x.Length, destination1, destination2);
388oneVectorFromEnd = x.Length - Vector512<T>.Count;
405if (i != x.Length)
407Vector512<T> mask = Vector512.Equals(CreateRemainderMaskVector512<T>(x.Length - i), Vector512<T>.Zero);
409i = x.Length - Vector512<T>.Count;
438oneVectorFromEnd = x.Length - Vector256<T>.Count;
455if (i != x.Length)
457Vector256<T> mask = Vector256.Equals(CreateRemainderMaskVector256<T>(x.Length - i), Vector256<T>.Zero);
459i = x.Length - Vector256<T>.Count;
488oneVectorFromEnd = x.Length - Vector128<T>.Count;
505if (i != x.Length)
507Vector128<T> mask = Vector128.Equals(CreateRemainderMaskVector128<T>(x.Length - i), Vector128<T>.Zero);
509i = x.Length - Vector128<T>.Count;
536while (i < x.Length)
System\Numerics\Tensors\netcore\TensorPrimitives.CosineSimilarity.cs (42)
52if (x.Length != y.Length)
61if (Vector512.IsHardwareAccelerated && Vector512<T>.IsSupported && x.Length >= Vector512<T>.Count)
71int oneVectorFromEnd = x.Length - Vector512<T>.Count;
85if (i != x.Length)
87Vector512<T> remainderMask = CreateRemainderMaskVector512<T>(x.Length - i);
90Vector512.LoadUnsafe(ref xRef, (uint)(x.Length - Vector512<T>.Count)) & remainderMask,
91Vector512.LoadUnsafe(ref yRef, (uint)(x.Length - Vector512<T>.Count)) & remainderMask,
98if (Vector256.IsHardwareAccelerated && Vector256<T>.IsSupported && x.Length >= Vector256<T>.Count)
108int oneVectorFromEnd = x.Length - Vector256<T>.Count;
122if (i != x.Length)
124Vector256<T> remainderMask = CreateRemainderMaskVector256<T>(x.Length - i);
127Vector256.LoadUnsafe(ref xRef, (uint)(x.Length - Vector256<T>.Count)) & remainderMask,
128Vector256.LoadUnsafe(ref yRef, (uint)(x.Length - Vector256<T>.Count)) & remainderMask,
135if (Vector128.IsHardwareAccelerated && Vector128<T>.IsSupported && x.Length >= Vector128<T>.Count)
145int oneVectorFromEnd = x.Length - Vector128<T>.Count;
159if (i != x.Length)
161Vector128<T> remainderMask = CreateRemainderMaskVector128<T>(x.Length - i);
164Vector128.LoadUnsafe(ref xRef, (uint)(x.Length - Vector128<T>.Count)) & remainderMask,
165Vector128.LoadUnsafe(ref yRef, (uint)(x.Length - Vector128<T>.Count)) & remainderMask,
175for (int i = 0; i < x.Length; i++)
191if (x.Length != y.Length)
201if (Vector512.IsHardwareAccelerated && x.Length >= Vector512<short>.Count)
212int oneVectorFromEnd = x.Length - Vector512<short>.Count;
227if (i != x.Length)
229Vector512<short> remainderMask = CreateRemainderMaskVector512<short>(x.Length - i);
232Vector512.LoadUnsafe(ref xRef, (uint)(x.Length - Vector512<short>.Count)) & remainderMask);
234Vector512.LoadUnsafe(ref yRef, (uint)(x.Length - Vector512<short>.Count)) & remainderMask);
243if (Vector256.IsHardwareAccelerated && x.Length >= Vector256<short>.Count)
254int oneVectorFromEnd = x.Length - Vector256<short>.Count;
269if (i != x.Length)
271Vector256<short> remainderMask = CreateRemainderMaskVector256<short>(x.Length - i);
274Vector256.LoadUnsafe(ref xRef, (uint)(x.Length - Vector256<short>.Count)) & remainderMask);
276Vector256.LoadUnsafe(ref yRef, (uint)(x.Length - Vector256<short>.Count)) & remainderMask);
285if (Vector128.IsHardwareAccelerated && x.Length >= Vector128<short>.Count)
296int oneVectorFromEnd = x.Length - Vector128<short>.Count;
311if (i != x.Length)
313Vector128<short> remainderMask = CreateRemainderMaskVector128<short>(x.Length - i);
316Vector128.LoadUnsafe(ref xRef, (uint)(x.Length - Vector128<short>.Count)) & remainderMask);
318Vector128.LoadUnsafe(ref yRef, (uint)(x.Length - Vector128<short>.Count)) & remainderMask);
330for (int i = 0; i < x.Length; i++)
System\Numerics\Tensors\netcore\TensorPrimitives.HammingDistance.cs (29)
22if (x.Length != y.Length)
28for (int i = 0; i < x.Length; i++)
55MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(x)), x.Length),
56MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As<T, ushort>(ref MemoryMarshal.GetReference(y)), y.Length));
65if (x.Length != y.Length)
75if (Vector128.IsHardwareAccelerated && Vector128<T>.IsSupported && x.Length >= Vector128<T>.Count)
77if (Vector256.IsHardwareAccelerated && Vector256<T>.IsSupported && x.Length >= Vector256<T>.Count)
79if (Vector512.IsHardwareAccelerated && Vector512<T>.IsSupported && x.Length >= Vector512<T>.Count)
84int oneVectorFromEnd = x.Length - Vector512<T>.Count;
98if (i != x.Length)
100Vector512<T> xVec = Vector512.LoadUnsafe(ref xRef, (uint)(x.Length - Vector512<T>.Count));
101Vector512<T> yVec = Vector512.LoadUnsafe(ref yRef, (uint)(x.Length - Vector512<T>.Count));
103Vector512<T> remainderMask = CreateRemainderMaskVector512<T>(x.Length - i);
116int oneVectorFromEnd = x.Length - Vector256<T>.Count;
130if (i != x.Length)
132Vector256<T> xVec = Vector256.LoadUnsafe(ref xRef, (uint)(x.Length - Vector256<T>.Count));
133Vector256<T> yVec = Vector256.LoadUnsafe(ref yRef, (uint)(x.Length - Vector256<T>.Count));
135Vector256<T> remainderMask = CreateRemainderMaskVector256<T>(x.Length - i);
149int oneVectorFromEnd = x.Length - Vector128<T>.Count;
163if (i != x.Length)
165Vector128<T> xVec = Vector128.LoadUnsafe(ref xRef, (uint)(x.Length - Vector128<T>.Count));
166Vector128<T> yVec = Vector128.LoadUnsafe(ref yRef, (uint)(x.Length - Vector128<T>.Count));
168Vector128<T> remainderMask = CreateRemainderMaskVector128<T>(x.Length - i);
178for (int i = 0; i < x.Length; i++)
189for (int i = 0; i < x.Length; i++)
198Debug.Assert(count >= 0 && count <= x.Length, $"Expected count to be in the range [0, {x.Length}], got {count}.");
System.Private.CoreLib (2229)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.Default.cs (1)
18if (source.Length < 26)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.G.cs (1)
17if (source.Length < 19)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.R.cs (1)
17if (source.Length < 29)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Convert.cs (38)
2349if (bytes.Length == 0)
2361int outputLength = ToBase64_CalculateAndValidateOutputLength(bytes.Length, insertLineBreaks: true);
2423if (bytes.Length == 0)
2431int charLengthRequired = ToBase64_CalculateAndValidateOutputLength(bytes.Length, insertLineBreaks);
2455Debug.Assert(destination.Length >= ToBase64_CalculateAndValidateOutputLength(source.Length, insertLineBreaks: true));
2461int chunkSize = Math.Min(source.Length, Base64LineBreakPosition / 4 * 3); // 76 base64 chars == 57 bytes
2585if (chars.Length == 0)
2590if (!int.IsEvenInteger(chars.Length))
2595byte[] result = GC.AllocateUninitializedArray<byte>(chars.Length / 2);
2611if (utf8Source.Length == 0)
2616if (!int.IsEvenInteger(utf8Source.Length))
2621byte[] result = GC.AllocateUninitializedArray<byte>(utf8Source.Length / 2);
2659(int quotient, int remainder) = Math.DivRem(source.Length, 2);
2681source = source.Slice(0, source.Length - 1);
2699charsConsumed = source.Length;
2715(int quotient, int remainder) = Math.DivRem(utf8Source.Length, 2);
2737utf8Source = utf8Source.Slice(0, utf8Source.Length - 1);
2755bytesConsumed = utf8Source.Length;
2799if (bytes.Length == 0)
2803ArgumentOutOfRangeException.ThrowIfGreaterThan(bytes.Length, int.MaxValue / 2, nameof(bytes));
2815if (source.Length == 0)
2820else if ((source.Length > (int.MaxValue / 2)) || (destination.Length < (source.Length * 2)))
2827charsWritten = source.Length * 2;
2838if (source.Length == 0)
2843else if ((source.Length > (int.MaxValue / 2)) || (utf8Destination.Length < (source.Length * 2)))
2850bytesWritten = source.Length * 2;
2894if (bytes.Length == 0)
2898ArgumentOutOfRangeException.ThrowIfGreaterThan(bytes.Length, int.MaxValue / 2, nameof(bytes));
2910if (source.Length == 0)
2915else if ((source.Length > (int.MaxValue / 2)) || (destination.Length < (source.Length * 2)))
2922charsWritten = source.Length * 2;
2933if (source.Length == 0)
2938else if ((source.Length > (int.MaxValue / 2)) || (utf8Destination.Length < (source.Length * 2)))
2945bytesWritten = source.Length * 2;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (89)
63return Interop.Globalization.CompareString(_sortHandle, pString1, string1.Length, pString2, string2.Length, options);
71Debug.Assert(target.Length != 0);
92return Interop.Globalization.IndexOf(_sortHandle, pTarget, target.Length, pSource, source.Length, options, matchLengthPtr);
94return Interop.Globalization.LastIndexOf(_sortHandle, pTarget, target.Length, pSource, source.Length, options, matchLengthPtr);
122if (target.Length > source.Length)
138endIndex = source.Length - target.Length + 1;
145startIndex = source.Length - target.Length;
155for (; targetIndex < target.Length; targetIndex++, sourceIndex++)
180if (sourceIndex < source.Length - 1 && *(a + sourceIndex + 1) >= 0x80)
186if (sourceIndex < source.Length && *(a + sourceIndex) >= 0x80)
189*matchLengthPtr = target.Length;
213return Interop.Globalization.IndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr);
215return Interop.Globalization.LastIndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr);
237if (target.Length > source.Length)
253endIndex = source.Length - target.Length + 1;
260startIndex = source.Length - target.Length;
270for (; targetIndex < target.Length; targetIndex++, sourceIndex++)
284if (sourceIndex < source.Length - 1 && *(a + sourceIndex + 1) >= 0x80)
290if (sourceIndex < source.Length && *(a + sourceIndex) >= 0x80)
293*matchLengthPtr = target.Length;
307return Interop.Globalization.IndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr);
309return Interop.Globalization.LastIndexOf(_sortHandle, b, target.Length, a, source.Length, options, matchLengthPtr);
338return Interop.Globalization.StartsWith(_sortHandle, pPrefix, prefix.Length, pSource, source.Length, options, matchLengthPtr);
350int length = Math.Min(source.Length, prefix.Length);
385if (a < ap + source.Length - 1 && *(a + 1) >= 0x80)
387if (b < bp + prefix.Length - 1 && *(b + 1) >= 0x80)
394if (source.Length < prefix.Length)
403if (source.Length > prefix.Length)
412*matchLengthPtr = prefix.Length; // non-linguistic match doesn't change UTF-16 length
421return Interop.Globalization.StartsWith(_sortHandle, bp, prefix.Length, ap, source.Length, options, matchLengthPtr);
432int length = Math.Min(source.Length, prefix.Length);
456if (a < ap + source.Length - 1 && *(a + 1) >= 0x80)
458if (b < bp + prefix.Length - 1 && *(b + 1) >= 0x80)
465if (source.Length < prefix.Length)
474if (source.Length > prefix.Length)
484*matchLengthPtr = prefix.Length; // non-linguistic match doesn't change UTF-16 length
493return Interop.Globalization.StartsWith(_sortHandle, bp, prefix.Length, ap, source.Length, options, matchLengthPtr);
522return Interop.Globalization.EndsWith(_sortHandle, pSuffix, suffix.Length, pSource, source.Length, options, matchLengthPtr);
534int length = Math.Min(source.Length, suffix.Length);
539char* a = ap + source.Length - 1;
540char* b = bp + suffix.Length - 1;
578if (source.Length < suffix.Length)
587if (source.Length > suffix.Length)
597*matchLengthPtr = suffix.Length; // non-linguistic match doesn't change UTF-16 length
606return Interop.Globalization.EndsWith(_sortHandle, bp, suffix.Length, ap, source.Length, options, matchLengthPtr);
617int length = Math.Min(source.Length, suffix.Length);
622char* a = ap + source.Length - 1;
623char* b = bp + suffix.Length - 1;
650if (source.Length < suffix.Length)
659if (source.Length > suffix.Length)
669*matchLengthPtr = suffix.Length; // non-linguistic match doesn't change UTF-16 length
678return Interop.Globalization.EndsWith(_sortHandle, bp, suffix.Length, ap, source.Length, options, matchLengthPtr);
769actualSortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pDest, destination.Length, options);
815return Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, null, 0, options);
863int sortKeyLength = checked((source.Length > 1024 * 1024 / 4) ? 0 : 4 * source.Length);
882sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKey.Length, options);
905sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKey.Length, options);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (25)
107if (unicode.Length == 0)
114throw new ArgumentException(SR.Format(SR.Argument_InvalidCharSequence, unicode.Length - 1), nameof(unicode));
183if (ascii.Length > 0 && ascii[^1] == (char)0)
214Debug.Assert(input.Length > 0);
217originalString.Length == input.Length &&
218input.Length == output.Length &&
219Ordinal.EqualsIgnoreCase(ref MemoryMarshal.GetReference(input), ref MemoryMarshal.GetReference(output), input.Length))
262Debug.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii] Expected 0 length strings to fail before now.");
265throw new ArgumentException(SR.Format(SR.Argument_InvalidCharSequence, unicode.Length - 1), nameof(unicode));
283if (unicode.Length <= destination.Length)
286charsWritten = unicode.Length;
296Debug.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii] Expected 0 length strings to fail before now.");
299throw new ArgumentException(SR.Format(SR.Argument_InvalidCharSequence, unicode.Length - 1), nameof(unicode));
325if (unicode.Length == 0)
331for (int i = 0; i < unicode.Length; i++)
371if (iLastDot == -1 && unicode.Length > c_labelLimit)
375if (unicode.Length > c_defaultNameLimit - (IsDot(unicode[^1]) ? 0 : 1))
414if (unicode.Length == 0)
417StringBuilder output = new StringBuilder(unicode.Length);
423while (iNextDot < unicode.Length)
430iNextDot = iNextDot < 0 ? unicode.Length : iNextDot + iAfterLastDot;
436if (iNextDot != unicode.Length)
606if (iNextDot != unicode.Length)
638if (char.IsHighSurrogate(s[index]) && index + 1 < s.Length && char.IsLowSurrogate(s[index + 1]))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (4)
60int actualLength = Interop.Globalization.ToAscii(flags, unicode, unicode.Length, destination, destination.Length);
104int realLen = Interop.Globalization.ToUnicode(flags, ascii, ascii.Length, output, output.Length);
131int actualLength = Interop.Globalization.ToUnicode(flags, ascii, ascii.Length, destination, destination.Length);
170for (int i = 0; i < s.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (6)
46int length = Interop.Normaliz.IdnToAscii(flags, unicode, unicode.Length, output, output.Length);
63int length = Interop.Normaliz.IdnToAscii(flags, unicode, unicode.Length, Span<char>.Empty, 0);
76int actualLength = Interop.Normaliz.IdnToAscii(flags, unicode, unicode.Length, destination, destination.Length);
120int length = Interop.Normaliz.IdnToUnicode(flags, ascii, ascii.Length, output, output.Length);
137int length = Interop.Normaliz.IdnToUnicode(flags, ascii, ascii.Length, Span<char>.Empty, 0);
150int actualLength = Interop.Normaliz.IdnToUnicode(flags, ascii, ascii.Length, destination, destination.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (5)
35ret = Interop.Globalization.IsNormalized(normalizationForm, pInput, source.Length);
149realLen = Interop.Globalization.NormalizeString(normalizationForm, pInput, source.Length, pDest, destination.Length);
188realLen = Interop.Globalization.NormalizeString(normalizationForm, pInput, source.Length, null, 0);
221for (; (uint)i < (uint)s.Length; i++)
243if ((uint)(i + 1) >= (uint)s.Length || !char.IsLowSurrogate(s[i + 1]))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (3)
24result = Interop.Normaliz.IsNormalizedString(normalizationForm, pInput, source.Length);
136realLength = Interop.Normaliz.NormalizeString(normalizationForm, pInput, source.Length, pDest, destination.Length);
179realLength = Interop.Normaliz.NormalizeString(normalizationForm, pInput, source.Length, null, 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (309)
337span.Length);
344span.Length);
351span.Length);
358span.Length);
362return SpanHelpers.Contains(ref MemoryMarshal.GetReference(span), value, span.Length);
820span.Length);
827span.Length);
834span.Length);
841span.Length);
845return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value, span.Length);
869span.Length);
876span.Length);
883span.Length);
890span.Length);
897for (int i = 0; i < span.Length; i++)
915for (int i = 0; i < span.Length; i++)
948span.Length);
956span.Length);
960return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
986span.Length);
994span.Length);
1001for (int i = 0; i < span.Length; i++)
1020for (int i = 0; i < span.Length; i++)
1056span.Length);
1065span.Length);
1069return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
1097span.Length);
1106span.Length);
1113for (int i = 0; i < span.Length; i++)
1132for (int i = 0; i < span.Length; i++)
1160span.Length);
1170span.Length);
1174return SpanHelpers.IndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, value3, span.Length);
1187switch (values.Length)
1210if (sizeof(T) == sizeof(byte) && values.Length == 5)
1221span.Length);
1223else if (sizeof(T) == sizeof(short) && values.Length == 5)
1234span.Length);
1242span.Length,
1244values.Length);
1247for (int i = 0; i < span.Length; i++)
1270switch (values.Length)
1285for (int i = 0; i < span.Length; i++)
1398span.Length);
1405span.Length);
1412span.Length);
1419span.Length);
1423return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value, span.Length);
1447span.Length);
1454span.Length);
1461span.Length);
1468span.Length);
1475for (int i = span.Length - 1; i >= 0; i--)
1493for (int i = span.Length - 1; i >= 0; i--)
1526span.Length);
1534span.Length);
1538return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
1564span.Length);
1572span.Length);
1579for (int i = span.Length - 1; i >= 0; i--)
1598for (int i = span.Length - 1; i >= 0; i--)
1634span.Length);
1643span.Length);
1647return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
1675span.Length);
1684span.Length);
1691for (int i = span.Length - 1; i >= 0; i--)
1711for (int i = span.Length - 1; i >= 0; i--)
1739span.Length);
1749span.Length);
1753return SpanHelpers.LastIndexOfAnyExcept(ref MemoryMarshal.GetReference(span), value0, value1, value2, value3, span.Length);
1766switch (values.Length)
1773return span.Length - 1;
1790if (sizeof(T) == sizeof(byte) && values.Length == 5)
1801span.Length);
1803else if (sizeof(T) == sizeof(short) && values.Length == 5)
1814span.Length);
1822span.Length,
1824values.Length);
1827for (int i = span.Length - 1; i >= 0; i--)
1850switch (values.Length)
1853return span.Length - 1;
1865for (int i = span.Length - 1; i >= 0; i--)
1933span.Length);
1942span.Length);
1951span.Length);
1960span.Length);
1964return SpanHelpers.IndexOfAnyInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
2004span.Length);
2013span.Length);
2022span.Length);
2031span.Length);
2035return SpanHelpers.IndexOfAnyExceptInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
2075span.Length);
2084span.Length);
2093span.Length);
2102span.Length);
2106return SpanHelpers.LastIndexOfAnyInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
2135return span.Length - 1;
2146span.Length);
2155span.Length);
2164span.Length);
2173span.Length);
2177return SpanHelpers.LastIndexOfAnyExceptInRange(ref MemoryMarshal.GetReference(span), lowInclusive, highInclusive, span.Length);
2218span.Length);
2224span.Length);
2230span.Length);
2236span.Length);
2239return SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
2259span.Length);
2265span.Length);
2271span.Length);
2277span.Length);
2283for (int i = 0; i < span.Length; i++)
2300for (int i = 0; i < span.Length; i++)
2326span.Length,
2328value.Length);
2333span.Length,
2335value.Length);
2338return SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
2355span.Length,
2357value.Length);
2362span.Length,
2364value.Length);
2370if (value.Length == 0)
2414span.Length);
2421span.Length);
2428span.Length);
2435span.Length);
2439return SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
2460span.Length);
2467span.Length);
2474span.Length);
2481span.Length);
2488for (int i = span.Length - 1; i >= 0; i--)
2506for (int i = span.Length - 1; i >= 0; i--)
2533span.Length,
2535value.Length);
2541span.Length,
2543value.Length);
2547return SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
2565span.Length,
2567value.Length);
2573span.Length,
2575value.Length);
2582if (value.Length == 0)
2584return span.Length;
2589int pos = span.Length;
2678span.Length);
2686span.Length);
2690return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
2713span.Length);
2721span.Length);
2728for (int i = 0; i < span.Length; i++)
2746for (int i = 0; i < span.Length; i++)
2779span.Length);
2788span.Length);
2792return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
2817span.Length);
2826span.Length);
2833for (int i = 0; i < span.Length; i++)
2852for (int i = 0; i < span.Length; i++)
2881switch (values.Length)
2887return SpanHelpers.IndexOfValueType(ref spanRef, valueRef, span.Length);
2894span.Length);
2902span.Length);
2911span.Length);
2921span.Length);
2929return values.Length switch
29321 => SpanHelpers.IndexOfValueType(ref spanRef, valueRef, span.Length),
2937span.Length),
2943span.Length),
2950span.Length),
2958span.Length),
2959_ => ProbabilisticMap.IndexOfAny(ref Unsafe.As<short, char>(ref spanRef), span.Length, ref Unsafe.As<short, char>(ref valueRef), values.Length),
2964return SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(values), values.Length);
2975switch (values.Length)
2992for (int i = 0; i < span.Length; i++)
3098span.Length);
3106span.Length);
3110return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
3133span.Length);
3141span.Length);
3148for (int i = span.Length - 1; i >= 0; i--)
3167for (int i = span.Length - 1; i >= 0; i--)
3200span.Length);
3209span.Length);
3213return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
3238span.Length);
3247span.Length);
3254for (int i = span.Length - 1; i >= 0; i--)
3274for (int i = span.Length - 1; i >= 0; i--)
3303switch (values.Length)
3309return SpanHelpers.LastIndexOfValueType(ref spanRef, valueRef, span.Length);
3316span.Length);
3324span.Length);
3333span.Length);
3343span.Length);
3351return values.Length switch
33541 => SpanHelpers.LastIndexOfValueType(ref spanRef, valueRef, span.Length),
3359span.Length),
3365span.Length),
3372span.Length),
3380span.Length),
3381_ => ProbabilisticMap.LastIndexOfAny(ref Unsafe.As<short, char>(ref spanRef), span.Length, ref Unsafe.As<short, char>(ref valueRef), values.Length),
3386return SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(values), values.Length);
3397switch (values.Length)
3414for (int i = span.Length - 1; i >= 0; i--)
3449int length = span.Length;
3450int otherLength = other.Length;
3485if (span.Length != other.Length)
3500((uint)span.Length) * (nuint)sizeof(T)); // If this multiplication overflows, the Span we got overflows the entire address range. There's no happy outcome for this API in such a case so we choose not to take the overhead of checking.
3504for (int i = 0; i < span.Length; i++)
3518for (int i = 0; i < span.Length; i++)
3541span.Length,
3543other.Length);
3548span.Length,
3550other.Length);
3552return SpanHelpers.SequenceCompareTo(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(other), other.Length);
3560int minLength = Math.Min(span.Length, other.Length);
3572return span.Length.CompareTo(other.Length);
3591int valueLength = value.Length;
3594return valueLength <= span.Length &&
3601return valueLength <= span.Length && SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(value), valueLength);
3614value.Length <= span.Length &&
3615SequenceEqual(span.Slice(0, value.Length), value, comparer);
3633int spanLength = span.Length;
3634int valueLength = value.Length;
3661value.Length <= span.Length &&
3662SequenceEqual(span.Slice(span.Length - value.Length), value, comparer);
3673span.Length != 0 && (span[0]?.Equals(value) ?? (object?)value is null);
3685span.Length != 0 &&
3697span.Length != 0 && (span[^1]?.Equals(value) ?? (object?)value is null);
3709span.Length != 0 &&
4133return (nuint)byteOffset < (nuint)((nint)span.Length * sizeof(T)) ||
4134(nuint)byteOffset > (nuint)(-((nint)other.Length * sizeof(T)));
4152if ((nuint)byteOffset < (nuint)((nint)span.Length * sizeof(T)) ||
4153(nuint)byteOffset > (nuint)(-((nint)other.Length * sizeof(T))))
4249/// no larger element, the bitwise complement of <see cref="ReadOnlySpan{T}.Length"/>.
4271/// no larger element, the bitwise complement of <see cref="ReadOnlySpan{T}.Length"/>.
4297/// no larger element, the bitwise complement of <see cref="ReadOnlySpan{T}.Length"/>.
4632uint length = (uint)source.Length;
4648((nuint)byteOffset < (nuint)((nint)source.Length * sizeof(T)) ||
4716uint length = (uint)source.Length;
4732((nuint)byteOffset < (nuint)((nint)source.Length * sizeof(T)) ||
4788destination = destination.Slice(0, source.Length);
4790for (int i = 0; i < source.Length; i++)
4801destination = destination.Slice(0, source.Length);
4804for (int i = 0; i < source.Length; i++)
4828if (source.Length > destination.Length)
4840ReplaceAny(destination.Slice(0, source.Length), values, newValue);
4878if (source.Length > destination.Length)
4890ReplaceAnyExcept(destination.Slice(0, source.Length), values, newValue);
4939nuint length = Math.Min((nuint)(uint)span.Length, (nuint)(uint)other.Length);
4966for (int i = 0; i < span.Length; i++)
4974return span.Length;
4998for (int i = 0; i < span.Length; i++)
5006return span.Length;
5013if (other.Length > span.Length)
5015other = other.Slice(0, span.Length);
5018span = span.Slice(0, other.Length);
5148int startInclusive = 0, endExclusive = source.Length;
5201if (separators.IsEmpty && destination.Length > source.Length)
5242if (separators.IsEmpty && destination.Length > source.Length)
5275if (source.Length == 0)
5291endExclusive = source.Length;
5325separatorLength = separatorOrSeparators.Length;
5378endExclusive = source.Length;
5435span.Length);
5442span.Length);
5449span.Length);
5456span.Length);
5463span.Length);
5484span.Length);
5491span.Length);
5498span.Length);
5505span.Length);
5513for (int i = 0; i < span.Length; i++)
5532for (int i = 0; i < span.Length; i++)
5561switch (value.Length)
5575span = span.Slice(pos + value.Length);
5591switch (value.Length)
5605span = span.Slice(pos + value.Length);
5810format.ValidateNumberOfArgs(args.Length);
5811return args.Length switch
5927if (typeof(T) == typeof(char) && separators.Length == 0)
5947_splitMode = separator.Length == 0 ?
5985separatorLength = _separatorBuffer.Length;
6008_startNext = _endCurrent = _source.Length;
6296_pos += value.Length;
6316int paddingRequired = alignment - value.Length;
6325Debug.Assert(alignment > value.Length);
6331_pos += value.Length;
6340_pos += value.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (34)
19for (int i = 0; i < span.Length; i++)
82if (span.Length != value.Length)
84if (value.Length == 0) // span.Length == value.Length == 0
92if (span.Length != value.Length)
94if (value.Length == 0) // span.Length == value.Length == 0
96return Ordinal.EqualsIgnoreCase(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(value), span.Length);
121if (span.Length == 0 || other.Length == 0)
122return span.Length - other.Length;
127return Ordinal.CompareStringIgnoreCase(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(other), other.Length);
143return SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
192span.Length,
194value.Length);
247if (destination.Length < source.Length)
254return source.Length;
271if (destination.Length < source.Length)
278return source.Length;
299if (destination.Length < source.Length)
306return source.Length;
323if (destination.Length < source.Length)
330return source.Length;
387=> value.Length <= span.Length
389ref Unsafe.Add(ref MemoryMarshal.GetReference(span), span.Length - value.Length),
391value.Length);
425=> value.Length <= span.Length
426&& Ordinal.EqualsIgnoreCase(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(value), value.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfilerEventSource.cs (1)
89int length = buffer.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1SearchValues.cs (5)
20Debug.Assert(values.Length == 1);
36SpanHelpers.NonPackedIndexOfValueType<TImpl, SpanHelpers.DontNegate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length);
40SpanHelpers.NonPackedIndexOfValueType<TImpl, SpanHelpers.Negate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length);
44SpanHelpers.LastIndexOfValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length);
48SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2CharPackedIgnoreCaseSearchValues.cs (4)
44PackedSpanHelpers.IndexOfAnyIgnoreCase(ref MemoryMarshal.GetReference(span), _e0, _e1, span.Length);
49PackedSpanHelpers.IndexOfAnyExceptIgnoreCase(ref MemoryMarshal.GetReference(span), _e0, _e1, span.Length);
57ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
65ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2SearchValues.cs (5)
20Debug.Assert(values.Length == 2);
36SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.DontNegate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length);
40SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.Negate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length);
44SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length);
48SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any3SearchValues.cs (5)
20Debug.Assert(values.Length == 3);
36SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.DontNegate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length);
40SpanHelpers.NonPackedIndexOfAnyValueType<TImpl, SpanHelpers.Negate<TImpl>>(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length);
44SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length);
48SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any4SearchValues.cs (5)
20Debug.Assert(values.Length == 4);
39SpanHelpers.IndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length);
43SpanHelpers.IndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length);
47SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length);
51SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any5SearchValues.cs (5)
20Debug.Assert(values.Length == 5);
40SpanHelpers.IndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length);
44SpanHelpers.IndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length);
48SpanHelpers.LastIndexOfAnyValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length);
52SpanHelpers.LastIndexOfAnyExceptValueType(ref Unsafe.As<T, TImpl>(ref MemoryMarshal.GetReference(span)), _e0, _e1, _e2, _e3, _e4, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\AnyByteSearchValues.cs (6)
32ref MemoryMarshal.GetReference(span), span.Length, ref _state);
40ref MemoryMarshal.GetReference(span), span.Length, ref _state);
48ref MemoryMarshal.GetReference(span), span.Length, ref _state);
56ref MemoryMarshal.GetReference(span), span.Length, ref _state);
64ref MemoryMarshal.GetReference(span), span.Length, ref _state);
72ref MemoryMarshal.GetReference(span), span.Length, ref _state);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiByteSearchValues.cs (6)
48ref MemoryMarshal.GetReference(span), span.Length, ref _state);
56ref MemoryMarshal.GetReference(span), span.Length, ref _state);
64ref MemoryMarshal.GetReference(span), span.Length, ref _state);
72ref MemoryMarshal.GetReference(span), span.Length, ref _state);
80ref MemoryMarshal.GetReference(span), span.Length, ref _state);
88ref MemoryMarshal.GetReference(span), span.Length, ref _state);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiCharSearchValues.cs (6)
50ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
58ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
66ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
74ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
82ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
90ref Unsafe.As<char, short>(ref MemoryMarshal.GetReference(span)), span.Length, ref _state);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\EmptySearchValues.cs (1)
25span.Length - 1;
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticCharSearchValues.cs (4)
26ProbabilisticMap.IndexOfAny<SearchValues.TrueConst>(ref MemoryMarshal.GetReference(span), span.Length, ref _map);
29ProbabilisticMapState.IndexOfAnySimpleLoop<SearchValues.TrueConst, IndexOfAnyAsciiSearcher.Negate>(ref MemoryMarshal.GetReference(span), span.Length, ref _map);
32ProbabilisticMap.LastIndexOfAny<SearchValues.TrueConst>(ref MemoryMarshal.GetReference(span), span.Length, ref _map);
35ProbabilisticMapState.LastIndexOfAnySimpleLoop<SearchValues.TrueConst, IndexOfAnyAsciiSearcher.Negate>(ref MemoryMarshal.GetReference(span), span.Length, ref _map);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticWithAsciiCharSearchValues.cs (18)
44if (IndexOfAnyAsciiSearcher.IsVectorizationSupported && span.Length >= Vector128<short>.Count && char.IsAscii(span[0]))
61span.Length,
71span.Length,
76if ((uint)offset >= (uint)span.Length || char.IsAscii(span[offset]))
87span.Length,
105if (IndexOfAnyAsciiSearcher.IsVectorizationSupported && span.Length >= Vector128<short>.Count && char.IsAscii(span[0]))
110span.Length,
114if ((uint)offset >= (uint)span.Length || char.IsAscii(span[offset]))
125span.Length,
141if (IndexOfAnyAsciiSearcher.IsVectorizationSupported && span.Length >= Vector128<short>.Count && char.IsAscii(span[^1]))
160span.Length,
170span.Length,
175if ((uint)offset >= (uint)span.Length || char.IsAscii(span[offset]))
186span.Length,
194if (IndexOfAnyAsciiSearcher.IsVectorizationSupported && span.Length >= Vector128<short>.Count && char.IsAscii(span[^1]))
199span.Length,
203if ((uint)offset >= (uint)span.Length || char.IsAscii(span[offset]))
214span.Length,
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (8)
349=> SpanHelpers.SequenceCompareTo(ref MemoryMarshal.GetReference(strA), strA.Length, ref MemoryMarshal.GetReference(strB), strB.Length);
717return Marvin.ComputeHash32(ref Unsafe.As<char, byte>(ref MemoryMarshal.GetReference(value)), (uint)value.Length * 2 /* in bytes, not chars */, (uint)seed, (uint)(seed >> 32));
750return Marvin.ComputeHash32OrdinalIgnoreCase(ref MemoryMarshal.GetReference(value), value.Length /* in chars, not bytes */, (uint)seed, (uint)(seed >> 32));
803int length = span.Length;
913int length = span.Length;
990return GetNonRandomizedHashCodeOrdinalIgnoreCaseSlow(hash1, hash2, span.Slice(span.Length - length));
995int length = str.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (96)
101if (args.Length <= 1)
117var strings = new string[args.Length];
121for (int i = 0; i < args.Length; i++)
310int length = checked(str0.Length + str1.Length);
320str1.CopyTo(resultSpan.Slice(str0.Length));
327int length = checked(str0.Length + str1.Length + str2.Length);
337resultSpan = resultSpan.Slice(str0.Length);
340resultSpan = resultSpan.Slice(str1.Length);
349int length = checked(str0.Length + str1.Length + str2.Length + str3.Length);
359resultSpan = resultSpan.Slice(str0.Length);
362resultSpan = resultSpan.Slice(str1.Length);
365resultSpan = resultSpan.Slice(str2.Length);
374int length = checked(str0.Length + str1.Length + str2.Length + str3.Length + str4.Length);
384resultSpan = resultSpan.Slice(str0.Length);
387resultSpan = resultSpan.Slice(str1.Length);
390resultSpan = resultSpan.Slice(str2.Length);
393resultSpan = resultSpan.Slice(str3.Length);
413if (values.Length <= 1)
429for (int i = 0; i < values.Length; i++)
452for (int i = 0; i < values.Length; i++)
559sb.EnsureCapacity(format.Length + args.Length * 8);
655format.ValidateNumberOfArgs(args.Length);
656return args.Length switch
907if (values.Length == 1)
916for (int i = 1; i < values.Length; i++)
1056if (values.Length <= 1)
1063long totalSeparatorsLength = (long)(values.Length - 1) * separator.Length;
1092for (int i = 0; i < values.Length; i++)
1114if (i < values.Length - 1)
1122if (separator.Length == 1)
1128separator.CopyTo(new Span<char>(ref dest, separator.Length));
1131copiedLength += separator.Length;
1245result.EnsureCapacity(searchSpace.Length);
1432Debug.Assert(indices.Length > 0);
1434long dstLength = this.Length + ((long)(newValue.Length - oldValueLength)) * indices.Length;
1444for (int r = 0; r < indices.Length; r++)
1607if ((uint)idx >= (uint)text.Length)
1621if ((uint)nextCharIdx < (uint)text.Length && text[nextCharIdx] == '\n')
1665if ((uint)idx >= (uint)remaining.Length) break; // no more newline chars
1666stride = remaining[idx] == '\r' && (uint)(idx + 1) < (uint)remaining.Length && remaining[idx + 1] == '\n' ? 2 : 1;
1804if (sepList.Length == 0)
1882if (sepList.Length == 0)
1928if (sepList.Length == 0)
1935? SplitWithPostProcessing(sepList, default, separator.Length, count, options)
1936: SplitWithoutPostProcessing(sepList, default, separator.Length, count);
1952int numActualReplaces = (sepList.Length < count) ? sepList.Length : count;
1985int numReplaces = sepList.Length;
2063if (separators.Length == 0)
2065for (int i = 0; i < source.Length; i++)
2075else if (separators.Length <= 3)
2079sep1 = separators.Length > 1 ? separators[1] : sep0;
2080sep2 = separators.Length > 2 ? separators[2] : sep1;
2081if (Vector128.IsHardwareAccelerated && source.Length >= Vector128<ushort>.Count * 2)
2087for (int i = 0; i < source.Length; i++)
2104for (int i = 0; i < source.Length; i++)
2122Debug.Assert(sourceSpan.Length >= Vector128<ushort>.Count*2);
2127if (Vector512.IsHardwareAccelerated && (uint)remaining.Length >= (uint)Vector512<ushort>.Count*2)
2142while ((uint)remaining.Length >= (uint)Vector512<ushort>.Count*2)
2184while ((uint)remaining.Length >= (uint)Vector512<ushort>.Count)
2207if (remaining.Length > 0)
2209Vector512<ushort> vector = Vector512.Create(sourceSpanUInt16.Slice(sourceSpanUInt16.Length - Vector512<ushort>.Count));
2211int finalIndex = sourceSpanUInt16.Length - Vector512<ushort>.Count;
2212ulong mask = cmp.ExtractMostSignificantBits() & 0x5555555555555555 & ~((1UL << (Vector512<byte>.Count - remaining.Length * sizeof(char))) - 1);
2222else if (Vector256.IsHardwareAccelerated && (uint)remaining.Length >= (uint)Vector256<ushort>.Count*2)
2237while ((uint)remaining.Length >= (uint)Vector256<ushort>.Count*2)
2279while ((uint)remaining.Length >= (uint)Vector256<ushort>.Count)
2302if (remaining.Length > 0)
2304Vector256<ushort> vector = Vector256.Create(sourceSpanUInt16.Slice(sourceSpanUInt16.Length - Vector256<ushort>.Count));
2306int finalIndex = sourceSpanUInt16.Length - Vector256<ushort>.Count;
2307uint mask = cmp.ExtractMostSignificantBits() & 0x55555555 & ~((1u << (Vector256<byte>.Count - remaining.Length * sizeof(char))) - 1);
2332while ((uint)remaining.Length >= (uint)Vector128<ushort>.Count*2)
2374while ((uint)remaining.Length >= (uint)Vector128<ushort>.Count)
2397if (remaining.Length > 0)
2399Vector128<ushort> vector = Vector128.Create(sourceSpanUInt16.Slice(sourceSpanUInt16.Length - Vector128<ushort>.Count));
2401int finalIndex = sourceSpanUInt16.Length - Vector128<ushort>.Count;
2402uint mask = cmp.ExtractMostSignificantBits() & 0x5555 & ~((1u << (Vector128<byte>.Count - remaining.Length * sizeof(char))) - 1);
2438i += separator.Length;
2439source = source.Slice(index + separator.Length);
2454for (int i = 0; i < source.Length; i++)
2456for (int j = 0; j < separators.Length; j++)
2464if (source[i] == separator[0] && currentSepLength <= source.Length - i)
2761return TrimHelper(pTrimChars, trimChars.Length, TrimType.Both);
2828return TrimHelper(pTrimChars, trimChars.Length, TrimType.Head);
2895return TrimHelper(pTrimChars, trimChars.Length, TrimType.Tail);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Equality.cs (18)
25=> left.Length == right.Length
26&& Equals<byte, byte, PlainLoader<byte>>(ref MemoryMarshal.GetReference(left), ref MemoryMarshal.GetReference(right), (uint)right.Length);
30=> left.Length == right.Length
31&& Equals<byte, ushort, WideningLoader>(ref MemoryMarshal.GetReference(left), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length);
39=> left.Length == right.Length
40&& Equals<ushort, ushort, PlainLoader<ushort>>(ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(left)), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length);
176=> left.Length == right.Length
177&& EqualsIgnoreCase<byte, byte, PlainLoader<byte>>(ref MemoryMarshal.GetReference(left), ref MemoryMarshal.GetReference(right), (uint)right.Length);
181=> left.Length == right.Length
182&& EqualsIgnoreCase<byte, ushort, WideningLoader>(ref MemoryMarshal.GetReference(left), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length);
190=> left.Length == right.Length
191&& EqualsIgnoreCase<ushort, ushort, PlainLoader<ushort>>(ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(left)), ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(right)), (uint)right.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (8)
147return GetByteCountCommon(charsPtr, chars.Length);
322return GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length);
332int written = GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length, throwForDestinationOverflow: false);
394int numElementsToConvert = Math.Min(chars.Length, bytes.Length);
489return GetCharCountCommon(bytesPtr, bytes.Length);
613return GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length);
623int written = GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length, throwForDestinationOverflow: false);
682int numElementsToConvert = Math.Min(bytes.Length, chars.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (3)
115return GetCharCount(bytesPtr, bytes.Length, flush);
202return GetChars(bytesPtr, bytes.Length, charsPtr, chars.Length, flush);
308Convert(bytesPtr, bytes.Length, charsPtr, chars.Length, flush, out bytesUsed, out charsUsed, out completed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (3)
113return GetByteCount(charsPtr, chars.Length, flush);
199return GetBytes(charsPtr, chars.Length, bytesPtr, bytes.Length, flush);
307Convert(charsPtr, chars.Length, bytesPtr, bytes.Length, flush, out charsUsed, out bytesUsed, out completed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (5)
585return GetByteCount(charsPtr, chars.Length);
732return GetBytes(charsPtr, chars.Length, bytesPtr, bytes.Length);
787return GetCharCount(bytesPtr, bytes.Length);
881return GetChars(bytesPtr, bytes.Length, charsPtr, chars.Length);
917return string.CreateStringFromEncoding(bytesPtr, bytes.Length, this);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (15)
274charsLength: chars.Length,
367charsLength: chars.Length,
551charsLength: chars.Length,
572encoder._charsUsed = originalCharCount - chars.Length; // total number of characters consumed up until now
609Debug.Assert(charsConsumedThisIteration == chars.Length, "If returning NeedMoreData, should out the entire buffer length as chars consumed.");
654charsLength: chars.Length,
698Debug.Assert(originalCharsLength >= chars.Length, "About to report a negative number of chars used?");
699encoder._charsUsed = originalCharsLength - chars.Length; // number of chars consumed
874bytesLength: bytes.Length,
963bytesLength: bytes.Length,
1154bytesLength: bytes.Length,
1211Debug.Assert(bytesConsumedThisIteration == bytes.Length, "If returning NeedMoreData, should out the entire buffer length as bytes consumed.");
1254bytesLength: bytes.Length,
1295Debug.Assert(originalBytesLength >= bytes.Length, "About to report a negative number of bytes used?");
1296decoder._bytesUsed = originalBytesLength - bytes.Length; // number of bytes consumed
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (7)
86return GetByteCountCommon(charsPtr, chars.Length);
234return GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length);
244int written = GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length, throwForDestinationOverflow: false);
381return bytes.Length;
529return GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length);
536if (bytes.Length <= chars.Length)
541charsWritten = GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (33)
977long insertingChars = (long)value.Length * count;
988ReplaceInPlaceAtChunk(ref chunk!, ref indexInChunk, ref MemoryMarshal.GetReference(value), value.Length);
1135Append(ref MemoryMarshal.GetReference(value), value.Length);
1318for (int i = 1; i < values.Length; i++)
1458if (value.Length != 0)
1460Insert(index, ref MemoryMarshal.GetReference(value), value.Length);
1749if ((uint)index >= (uint)args.Length)
1796if (itemFormatSpan.Length != 0)
1932format.ValidateNumberOfArgs(args.Length);
1933return args.Length switch
2075if (span.Length != Length)
2090if (!chunk.EqualsOrdinal(span.Slice(span.Length - offset, chunk_length)))
2141if (oldValue.Length == 0)
2160while (oldValue.Length <= remainingChunk.Length)
2171remainingChunk = remainingChunk.Slice(foundPos + oldValue.Length);
2172indexInChunk += oldValue.Length;
2173count -= foundPos + oldValue.Length;
2188int move = remainingChunk.Length - (oldValue.Length - 1);
2195Debug.Assert(oldValue.Length > Math.Min(count, chunk.m_ChunkLength - indexInChunk),
2196$"oldValue.Length = {oldValue.Length}, chunk.m_ChunkLength - indexInChunk = {chunk.m_ChunkLength - indexInChunk}, count == {count}");
2204indexInChunk += oldValue.Length;
2205count -= oldValue.Length;
2226ReplaceAllInChunk(replacements.AsSpan(), chunk, oldValue.Length, newValue);
2227index += (newValue.Length - oldValue.Length) * replacements.Length;
2446long longDelta = (value.Length - removeCount) * (long)replacements.Length;
2467ReplaceInPlaceAtChunk(ref targetChunk!, ref targetIndexInChunk, ref MemoryMarshal.GetReference<char>(value), value.Length);
2470if ((uint)i >= replacements.Length)
2507for (int i = 0; i < value.Length; i++)
3212int paddingRequired = alignment - value.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (6)
196return GetByteCountCommon(charsPtr, chars.Length);
368return GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length);
378int written = GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length, throwForDestinationOverflow: false);
489return GetCharCountCommon(bytesPtr, bytes.Length);
563return GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length);
573int written = GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length, throwForDestinationOverflow: false);
System.Private.CoreLib.Generators (8)
System.Private.DataContractSerialization (53)
System\Xml\XmlBinaryWriter.cs (19)
607if (chars.Length > 0)
611UnsafeWriteText(pch, chars.Length);
862WriteArray(XmlBinaryNodeType.BoolTextWithEndElement, items.Length, MemoryMarshal.AsBytes(items));
869WriteArray(XmlBinaryNodeType.Int16TextWithEndElement, items.Length, MemoryMarshal.AsBytes(items));
873WriteArrayInfo(XmlBinaryNodeType.Int16TextWithEndElement, items.Length);
885WriteArray(XmlBinaryNodeType.Int32TextWithEndElement, items.Length, MemoryMarshal.AsBytes(items));
889WriteArrayInfo(XmlBinaryNodeType.Int32TextWithEndElement, items.Length);
901WriteArray(XmlBinaryNodeType.Int64TextWithEndElement, items.Length, MemoryMarshal.AsBytes(items));
905WriteArrayInfo(XmlBinaryNodeType.Int64TextWithEndElement, items.Length);
917WriteArray(XmlBinaryNodeType.FloatTextWithEndElement, items.Length, MemoryMarshal.AsBytes(items));
921WriteArrayInfo(XmlBinaryNodeType.FloatTextWithEndElement, items.Length);
935WriteArray(XmlBinaryNodeType.DoubleTextWithEndElement, items.Length, MemoryMarshal.AsBytes(items));
939WriteArrayInfo(XmlBinaryNodeType.DoubleTextWithEndElement, items.Length);
953WriteArray(XmlBinaryNodeType.DecimalTextWithEndElement, items.Length, MemoryMarshal.AsBytes(items));
958WriteArrayInfo(XmlBinaryNodeType.DecimalTextWithEndElement, items.Length);
976WriteArrayInfo(XmlBinaryNodeType.DateTimeTextWithEndElement, items.Length);
987WriteArray(XmlBinaryNodeType.GuidTextWithEndElement, items.Length, MemoryMarshal.AsBytes(items));
992WriteArrayInfo(XmlBinaryNodeType.GuidTextWithEndElement, items.Length);
1004WriteArrayInfo(XmlBinaryNodeType.TimeSpanTextWithEndElement, items.Length);
System.Private.Reflection.Execution (1)
System.Private.StackTraceMetadata (7)
System.Private.TypeLoader (11)
System.Private.Uri (109)
System.Private.Windows.Core (56)
System.Private.Windows.GdiPlus (4)
System.Private.Xml (109)
System.Reflection.Emit (3)
System.Reflection.Metadata (41)
System.Reflection.MetadataLoadContext (1)
System.Resources.Extensions (7)
System.Runtime.InteropServices.JavaScript (1)
System.Runtime.Numerics (513)
System\Number.BigInteger.cs (62)
105if (value.Length == 0)
112if (value.Length < 255)
114buffer = stackalloc byte[value.Length + 1 + 1];
118buffer = arrayFromPool = ArrayPool<byte>.Shared.Rent(value.Length + 1 + 1);
173for (index = 0; index < value.Length; index++)
188while ((validLength < value.Length) && TParser.IsValidDigit(TChar.CastToUInt32(value[validLength])))
200while ((trailingStart < value.Length) && IsWhite(TChar.CastToUInt32(value[trailingStart])))
210if ((trailingStart != value.Length) && ((style & AllowTrailingInvalidCharacters) == 0))
226int leadingBitsCount = value.Length % TParser.DigitsPerBlock;
287int wholeBlockCount = value.Length / TParser.DigitsPerBlock;
305index += value.Length;
398ReadOnlySpan<byte> fracDigitsSpan = number.Digits.Slice(intDigits.Length);
418int base1E9Length = (intDigits.Length + PowersOf1e9.MaxPartialDigits - 1) / PowersOf1e9.MaxPartialDigits;
422ReadOnlySpan<byte> leadingDigits = intDigits[..(intDigits.Length % PowersOf1e9.MaxPartialDigits)];
423if (leadingDigits.Length != 0)
429intDigits = intDigits.Slice(leadingDigits.Length);
430Debug.Assert(intDigits.Length % PowersOf1e9.MaxPartialDigits == 0);
439Debug.Assert(intDigits.Length == 0);
467int valueDigits = (base1E9.Length - 1) * PowersOf1e9.MaxPartialDigits + FormattingHelpers.CountDigits(base1E9[^1]);
475int leadingLength = checked((int)(digitRatio * PowersOf1e9.MaxPartialDigits * base1E9.Length) + 3);
497if (base1E9.Length < BigIntegerParseNaiveThresholdInRecursive)
504while (base1E9.Length <= multiplier1E9Length)
512Debug.Assert(multiplier1E9Length < base1E9.Length && base1E9.Length <= multiplier1E9Length * 2);
521Span<nuint> bitsUpper = bits.Slice(multiplierTrailingZeroCount, buffer2.Length + multiplier.Length);
535if (base1E9.Length == 0)
568if (base1E9.Length == 0)
575for (int i = base1E9.Length - 2; i >= 0; i--)
819Debug.Assert(formatString == null || formatString.Length == formatSpan.Length);
886int valueDigits = (base1E9Value.Length - 1) * PowersOf1e9.MaxPartialDigits + FormattingHelpers.CountDigits(base1E9Value[^1]);
894int strLength = strDigits + sNegative.Length;
1017for (int i = 0; i < base1E9Value.Length - 1; i++)
1037if (bits.Length <= ToStringNaiveThreshold)
1043PowersOf1e9.FloorBufferSize(bits.Length, out int powersOf1e9BufferLength, out int maxIndex);
1050Debug.Assert(bits.Length == 0 || bits[^1] != 0);
1053if (bits.Length <= ToStringNaiveThreshold)
1062while (bits.Length < powOfTen.Length + omittedLength || BigIntegerCalculator.Compare(bits.Slice(omittedLength), powOfTen) < 0)
1069int upperLength = bits.Length - powOfTen.Length - omittedLength + 1;
1072int lowerLength = bits.Length;
1109for (int iuSrc = bits.Length; --iuSrc >= 0;)
1177if (buffer.Length > LeadingPowers1E9.Length &&
1369Debug.Assert(Indexes[6] == LeadingPowers1E9.Length);
1370if (pow1E9.Length <= LeadingPowers1E9.Length)
1376LeadingPowers1E9.CopyTo(pow1E9.Slice(0, LeadingPowers1E9.Length));
1381for (int i = 6; i + 1 < Indexes.Length; i++)
1383Debug.Assert(2 * src.Length - (Indexes[i + 1] - Indexes[i]) is 0 or 1);
1384if (pow1E9.Length - toExclusive < (src.Length << 1))
1389Span<nuint> dst = pow1E9.Slice(toExclusive, src.Length << 1);
1416if ((uint)index < (uint)Indexes.Length)
1422maxIndex = Indexes.Length - 2;
1450int hi = Indexes.Length - 1;
1471if (trailingZeroCount < UInt32PowersOfTen.Length)
1473BigIntegerCalculator.Multiply(left, UInt32PowersOfTen[trailingZeroCount], bits.Slice(0, left.Length + 1));
1487int curLength = first.Length;
1502Debug.Assert(fi + 1 < Indexes.Length);
1509Span<nuint> dst = powersOfTen2.Slice(0, curLength += power.Length);
1527Span<nuint> bits2 = bits.Slice(omittedLength, curLength += left.Length);
1599Debug.Assert(destination.Length * TParser.DigitsPerBlock == input.Length);
1603int blockStart = input.Length - (i + 1) * TParser.DigitsPerBlock;
System\Numerics\BigIntegerCalculator.DivRem.cs (106)
35Debug.Assert(left.Length >= 1);
36Debug.Assert(quotient.Length == left.Length);
43for (int i = left.Length - 1; i >= 0; i--)
52Debug.Assert(left.Length >= 1);
56for (int i = left.Length - 1; i >= 0; i--)
66Debug.Assert(left.Length >= 1);
67Debug.Assert(right.Length >= 1);
68Debug.Assert(left.Length >= right.Length);
69Debug.Assert(quotient.Length == left.Length - right.Length + 1);
70Debug.Assert(remainder.Length == left.Length);
74if (right.Length < DivideBurnikelZieglerThreshold || left.Length - right.Length < DivideBurnikelZieglerThreshold)
87Debug.Assert(left.Length >= 1);
88Debug.Assert(right.Length >= 1);
89Debug.Assert(left.Length >= right.Length);
90Debug.Assert(quotient.Length == left.Length - right.Length + 1);
93if (right.Length < DivideBurnikelZieglerThreshold || left.Length - right.Length < DivideBurnikelZieglerThreshold)
99Span<nuint> leftCopy = BigInteger.RentedBuffer.Create(left.Length, out BigInteger.RentedBuffer leftCopyBuffer);
114Debug.Assert(left.Length >= 1);
115Debug.Assert(right.Length >= 1);
116Debug.Assert(left.Length >= right.Length);
117Debug.Assert(remainder.Length == left.Length);
120if (right.Length < DivideBurnikelZieglerThreshold || left.Length - right.Length < DivideBurnikelZieglerThreshold)
129int quotientLength = left.Length - right.Length + 1;
149Debug.Assert(right.Length >= 1);
150Debug.Assert(left.Length >= right.Length);
151Debug.Assert(quotient.Length == left.Length - right.Length + 1
155if (right.Length < DivideBurnikelZieglerThreshold || left.Length - right.Length < DivideBurnikelZieglerThreshold)
166int quotientLength = quotient.Length > 0 ? 0 : left.Length - right.Length + 1;
180Debug.Assert(right.Length >= 1);
181Debug.Assert(left.Length >= right.Length);
184|| quotient.Length == left.Length - right.Length + 1
185|| (CompareActual(left.Slice(left.Length - right.Length), right) < 0 && quotient.Length == left.Length - right.Length));
193nuint divLo = right.Length > 1 ? right[^2] : 0;
202nuint divNx = right.Length > 2 ? right[^3] : 0;
210for (int i = left.Length; i >= right.Length; i--)
212int n = i - right.Length;
270Debug.Assert(left.Length >= right.Length);
276for (int i = 0; i < right.Length; i++)
287Debug.Assert(left.Length >= right.Length);
315Debug.Assert(left.Length >= 1);
316Debug.Assert(right.Length >= 1);
317Debug.Assert(left.Length >= right.Length);
318Debug.Assert(quotient.Length == left.Length - right.Length + 1);
319Debug.Assert(remainder.Length == left.Length || remainder.Length == 0);
327int m = (int)BitOperations.RoundUpToPowerOf2((uint)right.Length / (uint)DivideBurnikelZieglerThreshold + 1);
329int j = (right.Length + m - 1) / m; // Ceil(right.Length/m)
333int sigmaDigit = n - right.Length;
338int aLength = left.Length + sigmaDigit;
354Debug.Assert(src.Length + sigmaDigit <= bits.Length);
359dst.Slice(src.Length).Clear();
459Debug.Assert(left.Length == 2 * right.Length);
460Debug.Assert(CompareActual(left.Slice(right.Length), right) < 0);
461Debug.Assert(quotient.Length == right.Length);
462Debug.Assert(remainder.Length >= right.Length + 1);
464Debug.Assert(right.Length < DivideBurnikelZieglerThreshold);
468if (left.Length < right.Length)
472remainder.Slice(left.Length).Clear();
474else if (right.Length == 1)
478if (quotient.Length < left.Length)
480Debug.Assert(quotient.Length + 1 == left.Length);
489quotient.Slice(left.Length).Clear();
501Span<nuint> r1 = BigInteger.RentedBuffer.Create(left.Length, out BigInteger.RentedBuffer r1Buffer);
504int quotientLength = Math.Min(left.Length - right.Length + 1, quotient.Length);
527Debug.Assert(left.Length == 2 * right.Length);
528Debug.Assert(CompareActual(left.Slice(right.Length), right) < 0);
529Debug.Assert(quotient.Length == right.Length);
530Debug.Assert(remainder.Length >= right.Length + 1);
533if ((right.Length & 1) != 0 || right.Length < DivideBurnikelZieglerThreshold)
539int halfN = right.Length >> 1;
541Span<nuint> r1 = BigInteger.RentedBuffer.Create(right.Length + 1, out BigInteger.RentedBuffer r1Buffer);
543BurnikelZieglerD3n2n(left.Slice(right.Length), left.Slice(halfN, halfN), right, quotient.Slice(halfN), r1);
544BurnikelZieglerD3n2n(r1.Slice(0, right.Length), left.Slice(0, halfN), right, quotient.Slice(0, halfN), remainder);
552Debug.Assert(right.Length % 2 == 0);
553Debug.Assert(left12.Length == right.Length);
554Debug.Assert(2 * left3.Length == right.Length);
555Debug.Assert(2 * quotient.Length == right.Length);
556Debug.Assert(remainder.Length >= right.Length + 1);
560int n = right.Length >> 1;
566Span<nuint> d = BigInteger.RentedBuffer.Create(right.Length, out BigInteger.RentedBuffer dBuffer);
609Debug.Assert(bits.Length == left.Length + right.Length);
613bits = bits.Slice(0, left.Length + right.Length);
System\Numerics\BigIntegerCalculator.FastReducer.cs (19)
26Debug.Assert(r.Length == modulus.Length * 2 + 1);
27Debug.Assert(mu.Length == r.Length - modulus.Length + 1);
28Debug.Assert(q1.Length == modulus.Length * 2 + 2);
29Debug.Assert(q2.Length == modulus.Length * 2 + 2);
47Debug.Assert(value.Length <= _modulus.Length * 2);
50if (value.Length < _modulus.Length)
57int l1 = DivMul(value, _mu, _q1, _modulus.Length - 1);
61int l2 = DivMul(_q1.Slice(0, l1), _modulus, _q2, _modulus.Length + 1);
64int length = SubMod(value, _q2.Slice(0, l2), _modulus, _modulus.Length + 1);
75Debug.Assert(bits.Length + k >= left.Length + right.Length);
82if (left.Length > k)
85bits = bits.Slice(0, left.Length + right.Length);
107if (right.Length > k)
118Debug.Assert(left.Length >= right.Length);
123if (right.Length != 0)
125_ = left[right.Length - 1];
128for (; i < right.Length; i++)
System\Numerics\BigIntegerCalculator.PowMod.cs (30)
23Debug.Assert(bits.Length == PowBound(power, value.Length));
29valueCopy.Slice(value.Length).Clear();
31Span<nuint> result = PowCore(valueCopy, value.Length, temp, power, bits);
71int resultLength = leftLength + right.Length;
172for (int i = 0; i < power.Length - 1; i++)
261Debug.Assert(bits.Length == modulus.Length + modulus.Length);
266int size = Math.Max(value.Length, bits.Length);
272valueCopy.Slice(value.Length).Clear();
274if (value.Length > modulus.Length)
276Remainder(value, modulus, valueCopy.Slice(0, value.Length));
301Debug.Assert(bits.Length == modulus.Length + modulus.Length);
306int size = Math.Max(value.Length, bits.Length);
312valueCopy.Slice(value.Length).Clear();
314if (value.Length > modulus.Length)
316Remainder(value, modulus, valueCopy.Slice(0, value.Length));
351if (modulus.Length < ReducerThreshold)
375if (modulus.Length < ReducerThreshold)
391int size = modulus.Length * 2 + 1;
394size = r.Length - modulus.Length + 1;
397size = modulus.Length * 2 + 2;
483Debug.Assert(bits.Length >= modulus.Length * 2);
490int k = modulus.Length;
499if (shifted.Length >= modulus.Length)
678int k = modulus.Length;
750for (int i = 0; i < power.Length - 1; i++)
812for (int i = 0; i < power.Length - 1; i++)
System\Numerics\BigIntegerCalculator.SquMul.cs (107)
29Debug.Assert(bits.Length == value.Length + value.Length);
41if (value.Length < SquareKaratsubaThreshold)
45else if (value.Length < SquareToom3Threshold)
56Debug.Assert(value.Length >= 3);
57Debug.Assert(bits.Length >= value.Length + value.Length);
65int n = (value.Length + 2) / 3;
94Debug.Assert(bits.Length == value.Length + value.Length);
105int n = value.Length >> 1;
122int foldLength = valueHigh.Length + 1;
146Debug.Assert(bits.Length == value.Length + value.Length);
162for (int i = 0; i < value.Length; i++)
184for (int i = 0; i < value.Length; i++)
206Debug.Assert(bits.Length == left.Length + 1);
209bits[left.Length] = carry;
215if (left.Length < right.Length)
222Debug.Assert(left.Length >= right.Length);
223Debug.Assert(right.Length >= 0);
224Debug.Assert(right.IsEmpty || bits.Length >= left.Length + right.Length);
239if (right.Length < MultiplyKaratsubaThreshold)
243else if ((left.Length + 1) >> 1 is int n && right.Length <= n)
247else if (right.Length < MultiplyToom3Threshold)
258Debug.Assert(left.Length >= 3);
259Debug.Assert(left.Length >= right.Length);
260Debug.Assert(bits.Length >= left.Length + right.Length);
268int n = (left.Length + 2) / 3;
270Debug.Assert(right.Length > n);
271if (((uint)right.Length << 1) <= (uint)n)
306Debug.Assert(3 * n - left.Length is 0 or 1 or 2);
307Debug.Assert(right.Length > n);
308Debug.Assert(right.Length <= 2 * n);
309Debug.Assert(bits.Length >= left.Length + right.Length);
319Span<nuint> z0 = bits.Slice(0, left0.Length + right0.Length);
341if (left0.Length < left2.Length)
421Debug.Assert(left.Length >= right.Length);
422Debug.Assert(bits.Length >= left.Length + right.Length);
426Debug.Assert(2 * n - left.Length is 0 or 1);
427Debug.Assert(right.Length > n);
441Debug.Assert(leftLow.Length >= leftHigh.Length);
442Debug.Assert(rightLow.Length >= rightHigh.Length);
475Debug.Assert(ActualLength(core) <= left.Length + 1);
485Debug.Assert(left.Length >= right.Length);
486Debug.Assert(2 * n - left.Length is 0 or 1);
487Debug.Assert(right.Length <= n);
488Debug.Assert(bits.Length >= left.Length + right.Length);
494Debug.Assert(leftLow.Length >= leftHigh.Length);
497Span<nuint> bitsLow = bits.Slice(0, n + right.Length);
503int carryLength = right.Length;
506Span<nuint> carryOrig = bitsHigh.Slice(0, right.Length);
511Multiply(leftHigh, right, bitsHigh.Slice(0, leftHigh.Length + right.Length));
520Debug.Assert(right.Length < MultiplyKaratsubaThreshold);
529for (int i = 0; i < right.Length; i++)
532bits[i + left.Length] = carry;
559Debug.Assert(value.Length > n);
567if (value.Length <= n + n)
637Debug.Assert(cInf.Length >= right.cInf.Length);
657Span<nuint> r0 = bits.Slice(0, p0.Length + q0.Length);
660? bits.Slice(4 * n, pInf.Length + qInf.Length)
663Span<nuint> r1 = buffer.Slice(0, p1.Length + q1.Length);
664Span<nuint> rm1 = buffer.Slice(rLength, pm1.Length + qm1.Length);
665Span<nuint> rm2 = buffer.Slice(rLength * 2, pm2.Length + qm2.Length);
701Span<nuint> r0 = bits.Slice(0, p0.Length << 1);
702Span<nuint> rInf = bits.Slice(4 * n, pInf.Length << 1);
704Span<nuint> r1 = buffer.Slice(0, p1.Length << 1);
705Span<nuint> rm1 = buffer.Slice(rLength, pm1.Length << 1);
706Span<nuint> rm2 = buffer.Slice(rLength * 2, pm2.Length << 1);
865Debug.Assert(left.Length >= right.Length);
866Debug.Assert(core.Length >= left.Length);
877if (right.Length != 0)
879_ = left[right.Length - 1];
880_ = core[left.Length - 1];
887for (; i < right.Length; i++)
894for (; i < left.Length; i++)
912for (; i < right.Length; i++)
919for (; i < left.Length; i++)
938Debug.Assert(left.Length >= right.Length);
956Debug.Assert(left.Length >= right.Length);
988left = left.Slice(0, right.Length);
1002Debug.Assert(left.Length >= right.Length);
1032left = left.Slice(0, right.Length);
System.Security.Cryptography (669)
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptDecapsulateEncapsulate.cs (1)
47(uint)cipherText.Length,
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptEncryptDecrypt.cs (2)
23NTSTATUS ntStatus = BCryptEncrypt(hKey, pbInput, input.Length, IntPtr.Zero, iv, iv == null ? 0 : iv.Length, pbOutput, output.Length, out cbResult, 0);
44NTSTATUS ntStatus = BCryptDecrypt(hKey, pbInput, input.Length, IntPtr.Zero, iv, iv == null ? 0 : iv.Length, pbOutput, output.Length, out cbResult, 0);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptImportKeyPair.cs (1)
41keyBlob.Length,
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.NCryptDecapsulateEncapsulate.cs (1)
48(uint)cipherText.Length,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.SignVerify.cs (4)
106ErrorCode errorCode = Interop.NCrypt.NCryptVerifySignature(keyHandle, pPaddingInfo, hash, hash.Length, signature, signature.Length, paddingMode);
110errorCode = Interop.NCrypt.NCryptVerifySignature(keyHandle, pPaddingInfo, hash, hash.Length, signature, signature.Length, paddingMode);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (5)
125if (!encrypt && data.Length != modulusSizeInBytes)
132data.Length > modulusSizeInBytes - Pkcs1PaddingOverhead)
140if (encrypt && data.Length == 0)
290Interop.NCrypt.NCryptEncrypt(key, input, input.Length, paddingInfo, output, output.Length, out bytesNeeded, paddingMode) :
291Interop.NCrypt.NCryptDecrypt(key, input, input.Length, paddingInfo, output, output.Length, out bytesNeeded, paddingMode);
System\Security\Cryptography\BasicSymmetricCipherLiteNCrypt.cs (9)
57Debug.Assert(input.Length > 0);
58Debug.Assert((input.Length % PaddingSizeInBytes) == 0);
83if (numBytesWritten != input.Length)
103Interop.NCrypt.NCryptEncrypt(keyHandle, input, input.Length, null, output, output.Length, out bytesWritten, AsymmetricPaddingMode.None) :
104Interop.NCrypt.NCryptDecrypt(keyHandle, input, input.Length, null, output, output.Length, out bytesWritten, AsymmetricPaddingMode.None);
130iv.Length,
144Debug.Assert((input.Length % PaddingSizeInBytes) == 0);
148if (input.Length != 0)
151Debug.Assert(numBytesWritten == input.Length); // Our implementation of Transform() guarantees this. See comment above.
System\Security\Cryptography\ECDsa.cs (7)
909hashSpan = HashData(data.ToArray(), 0, data.Length, hashAlgorithm);
1009byte[] array = ArrayPool<byte>.Shared.Rent(data.Length);
1015byte[] hash = HashData(array, 0, data.Length, hashAlgorithm);
1032Array.Clear(array, 0, data.Length);
1218byte[] array = ArrayPool<byte>.Shared.Rent(data.Length);
1223byte[] ret = HashData(array, 0, data.Length, hashAlgorithm);
1229Array.Clear(array, 0, data.Length);
System\Security\Cryptography\HashProviderDispenser.Windows.cs (4)
279NTSTATUS ntStatus = Interop.BCrypt.BCryptHash((uint)algHandle, pKey, key.Length, pSrc, source.Length, pDest, digestSizeInBytes);
303key.Length,
314ntStatus = Interop.BCrypt.BCryptHashData(hHash, source, source.Length, 0);
System\Security\Cryptography\LiteHash.Windows.cs (7)
61key.Length,
76customizationString.Length,
128CheckStatus(Interop.BCrypt.BCryptHashData(_hashHandle, data, data.Length, dwFlags: 0));
237NTSTATUS ntStatus = Interop.BCrypt.BCryptHashData(_hashHandle, data, data.Length, dwFlags: 0);
350NTSTATUS ntStatus = Interop.BCrypt.BCryptHashData(_hashHandle, data, data.Length, dwFlags: 0);
404key.Length,
423NTSTATUS ntStatus = Interop.BCrypt.BCryptHashData(_hashHandle, data, data.Length, dwFlags: 0);
System\Security\Cryptography\X509Certificates\Asn1\TbsCertificateAsn.xml.cs (5)
213decoded.SerialNumber = rebindSpan.Overlaps(tmpSpan, out offset) ? rebind.Slice(offset, tmpSpan.Length) : tmpSpan.ToArray();
221decoded.Issuer = rebindSpan.Overlaps(tmpSpan, out offset) ? rebind.Slice(offset, tmpSpan.Length) : tmpSpan.ToArray();
229decoded.Subject = rebindSpan.Overlaps(tmpSpan, out offset) ? rebind.Slice(offset, tmpSpan.Length) : tmpSpan.ToArray();
237decoded.IssuerUniqueId = rebindSpan.Overlaps(tmpSpan, out offset) ? rebind.Slice(offset, tmpSpan.Length) : tmpSpan.ToArray();
252decoded.SubjectUniqueId = rebindSpan.Overlaps(tmpSpan, out offset) ? rebind.Slice(offset, tmpSpan.Length) : tmpSpan.ToArray();
System.Security.Cryptography.Cose (17)
System.Security.Cryptography.Pkcs (138)
System.Security.Cryptography.ProtectedData (3)
System.Security.Cryptography.Xml (10)
System.Security.Principal.Windows (5)
System.ServiceModel.NetFramingBase (2)
System.ServiceProcess.ServiceController (3)
System.Text.Encoding.CodePages (11)
System.Text.Encodings.Web (42)
System.Text.Json (895)
System\Text\Json\Document\JsonDocument.cs (24)
311int length = checked(otherText.Length * JsonConstants.MaxExpansionFactorWhileTranscoding);
353if (otherUtf8Text.Length > segment.Length || (!shouldUnescape && otherUtf8Text.Length != segment.Length))
360if (otherUtf8Text.Length < segment.Length / JsonConstants.MaxExpansionFactorWhileEscaping)
428consumed == segment.Length)
450consumed == segment.Length)
472consumed == segment.Length)
494consumed == segment.Length)
516consumed == segment.Length)
538consumed == segment.Length)
560consumed == segment.Length)
582consumed == segment.Length)
604segment.Length == bytesConsumed)
626segment.Length == bytesConsumed)
648segment.Length == bytesConsumed)
927database.Append(tokenType, tokenStart, reader.ValueSpan.Length);
974database.Append(tokenType, tokenStart, reader.ValueSpan.Length);
990database.Append(tokenType, tokenStart + 1, reader.ValueSpan.Length);
1015database.Append(tokenType, tokenStart + 1, reader.ValueSpan.Length);
1024database.Append(tokenType, tokenStart, reader.ValueSpan.Length);
1031Debug.Assert(reader.BytesConsumed == utf8JsonSpan.Length);
System\Text\Json\ThrowHelper.cs (22)
142if (propertyName.Length > JsonConstants.MaxUnescapedTokenSize)
144ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length));
148Debug.Assert(value.Length > JsonConstants.MaxUnescapedTokenSize);
149ThrowArgumentException(SR.Format(SR.ValueTooLarge, value.Length));
156if (propertyName.Length > JsonConstants.MaxUnescapedTokenSize)
158ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length));
162Debug.Assert(value.Length > JsonConstants.MaxCharacterTokenSize);
163ThrowArgumentException(SR.Format(SR.ValueTooLarge, value.Length));
170if (propertyName.Length > JsonConstants.MaxCharacterTokenSize)
172ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length));
176Debug.Assert(value.Length > JsonConstants.MaxUnescapedTokenSize);
177ThrowArgumentException(SR.Format(SR.ValueTooLarge, value.Length));
184if (propertyName.Length > JsonConstants.MaxCharacterTokenSize)
186ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length));
190Debug.Assert(value.Length > JsonConstants.MaxCharacterTokenSize);
191ThrowArgumentException(SR.Format(SR.ValueTooLarge, value.Length));
205Debug.Assert(propertyName.Length > JsonConstants.MaxCharacterTokenSize);
206ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length));
258Debug.Assert(propertyName.Length > JsonConstants.MaxCharacterTokenSize);
259ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length));
534int printFirst10 = Math.Min(value.Length, 10);
549if (printFirst10 < value.Length)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (121)
27escapedPropertyNameSection.Slice(1, escapedPropertyNameSection.Length - 3);
33Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxUnescapedTokenSize - 3);
45Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize);
95Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2);
112Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length);
119int length = JsonWriterHelper.GetMaxEscapedLength(propertyName.Length, firstEscapeIndexProp);
158Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize);
159Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 4) / JsonConstants.MaxExpansionFactorWhileTranscoding);
163int maxRequired = (escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding) + 4;
189Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize);
190Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 5 - indent - _newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding);
194int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding) + 5 + _newLineLength;
244Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2);
271Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length);
278int length = JsonWriterHelper.GetMaxEscapedLength(utf8PropertyName.Length, firstEscapeIndexProp);
319Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize);
320Debug.Assert(escapedPropertyName.Length < int.MaxValue - 4);
322int minRequired = escapedPropertyName.Length + 3; // 2 quotes for property name, and 1 colon
339BytesPending += escapedPropertyName.Length;
349Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxEscapedTokenSize - 3);
350Debug.Assert(escapedPropertyNameSection.Length < int.MaxValue - 4);
352int maxRequired = escapedPropertyNameSection.Length + 1; // Optionally, 1 list separator
367BytesPending += escapedPropertyNameSection.Length;
377Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize);
378Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - 5 - _newLineLength);
380int minRequired = indent + escapedPropertyName.Length + 4; // 2 quotes for property name, 1 colon, and 1 space
408BytesPending += escapedPropertyName.Length;
428Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize && utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize);
595Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize);
601Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2);
682Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize);
688Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2);
769Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize);
775Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2);
841Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize);
847Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2);
896Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length);
897Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < utf8Value.Length);
901int length = JsonWriterHelper.GetMaxEscapedLength(utf8Value.Length, firstEscapeIndex);
919Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length);
920Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < value.Length);
924int length = JsonWriterHelper.GetMaxEscapedLength(value.Length, firstEscapeIndex);
942Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length);
943Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < propertyName.Length);
947int length = JsonWriterHelper.GetMaxEscapedLength(propertyName.Length, firstEscapeIndex);
965Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length);
966Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < utf8PropertyName.Length);
970int length = JsonWriterHelper.GetMaxEscapedLength(utf8PropertyName.Length, firstEscapeIndex);
991Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2);
992Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2);
1010Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2);
1011Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2);
1029Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2);
1030Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2);
1048Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2);
1049Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2);
1064Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length);
1065Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length);
1073int length = JsonWriterHelper.GetMaxEscapedLength(value.Length, firstEscapeIndexVal);
1093int length = JsonWriterHelper.GetMaxEscapedLength(propertyName.Length, firstEscapeIndexProp);
1124Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length);
1125Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length);
1133int length = JsonWriterHelper.GetMaxEscapedLength(utf8Value.Length, firstEscapeIndexVal);
1153int length = JsonWriterHelper.GetMaxEscapedLength(utf8PropertyName.Length, firstEscapeIndexProp);
1184Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length);
1185Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length);
1193int length = JsonWriterHelper.GetMaxEscapedLength(utf8Value.Length, firstEscapeIndexVal);
1213int length = JsonWriterHelper.GetMaxEscapedLength(propertyName.Length, firstEscapeIndexProp);
1244Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length);
1245Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length);
1253int length = JsonWriterHelper.GetMaxEscapedLength(value.Length, firstEscapeIndexVal);
1273int length = JsonWriterHelper.GetMaxEscapedLength(utf8PropertyName.Length, firstEscapeIndexProp);
1357Debug.Assert(escapedValue.Length <= JsonConstants.MaxUnescapedTokenSize);
1358Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 6) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length);
1362int maxRequired = ((escapedPropertyName.Length + escapedValue.Length) * JsonConstants.MaxExpansionFactorWhileTranscoding) + 6;
1392Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize);
1393Debug.Assert(escapedPropertyName.Length < int.MaxValue - escapedValue.Length - 6);
1395int minRequired = escapedPropertyName.Length + escapedValue.Length + 5; // 2 quotes for property name, 2 quotes for value, and 1 colon
1412BytesPending += escapedPropertyName.Length;
1420BytesPending += escapedValue.Length;
1428Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize);
1429Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 6);
1433int maxRequired = (escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding) + escapedValue.Length + 6;
1456BytesPending += escapedValue.Length;
1464Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize);
1465Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 6);
1469int maxRequired = (escapedValue.Length * JsonConstants.MaxExpansionFactorWhileTranscoding) + escapedPropertyName.Length + 6;
1485BytesPending += escapedPropertyName.Length;
1503Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize);
1504Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 7 - indent - _newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length);
1508int maxRequired = indent + ((escapedPropertyName.Length + escapedValue.Length) * JsonConstants.MaxExpansionFactorWhileTranscoding) + 7 + _newLineLength;
1553Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize);
1554Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - escapedValue.Length - 7 - _newLineLength);
1556int minRequired = indent + escapedPropertyName.Length + escapedValue.Length + 6; // 2 quotes for property name, 2 quotes for value, 1 colon, and 1 space
1584BytesPending += escapedPropertyName.Length;
1593BytesPending += escapedValue.Length;
1604Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize);
1605Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - _newLineLength);
1609int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding) + escapedValue.Length + 7 + _newLineLength;
1644BytesPending += escapedValue.Length;
1655Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize);
1656Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - _newLineLength);
1660int maxRequired = indent + (escapedValue.Length * JsonConstants.MaxExpansionFactorWhileTranscoding) + escapedPropertyName.Length + 7 + _newLineLength;
1687BytesPending += escapedPropertyName.Length;
System.Text.Json.SourceGeneration (15)
System.Text.RegularExpressions (150)
System\Text\RegularExpressions\RegexRunner.cs (12)
143if (s == null || text != s.AsSpan(beginning, text.Length))
160InternalScan(runregex!, beginning, beginning + text.Length);
286runtextend = text.Length;
294new Match(runregex, runregex.capsize, runtext, text.Length) :
295new MatchSparse(runregex, runregex.caps, runregex.capsize, runtext, text.Length);
299m.Reset(runtext, text.Length);
420return ((uint)indexM1 < (uint)inputSpan.Length && RegexCharClass.IsBoundaryWordChar(inputSpan[indexM1])) !=
421((uint)index < (uint)inputSpan.Length && RegexCharClass.IsBoundaryWordChar(inputSpan[index]));
430return (uint)indexMinus1 >= (uint)inputSpan.Length || !RegexCharClass.IsBoundaryWordChar(inputSpan[indexMinus1]);
437(uint)index >= (uint)inputSpan.Length || !RegexCharClass.IsBoundaryWordChar(inputSpan[index]);
452return ((uint)indexM1 < (uint)inputSpan.Length && RegexCharClass.IsECMAWordChar(inputSpan[indexM1])) !=
453((uint)index < (uint)inputSpan.Length && RegexCharClass.IsECMAWordChar(inputSpan[index]));
System.Text.RegularExpressions.Generator (70)
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
898if (c >= frequency.Length)
System.Threading.AccessControl (1)
System.Web.HttpUtility (18)
System.Windows.Forms (22)
System.Windows.Forms.Design (10)
System.Windows.Forms.Primitives (145)
System.Xaml (7)
UIAutomationClientSideProviders (5)
VBCSCompiler (1)