96 references to StackallocByteThreshold
System.Text.Json (96)
src\libraries\System.Text.Json\Common\JsonConstants.cs (1)
13public const int StackallocCharThreshold = StackallocByteThreshold / 2;
System\Text\Json\Document\JsonDocument.cs (2)
312Span<byte> otherUtf8Text = length <= JsonConstants.StackallocByteThreshold ? 313stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (3)
30if (maxBytes < JsonConstants.StackallocByteThreshold) 32Span<byte> utf8Name = stackalloc byte[JsonConstants.StackallocByteThreshold]; 142Span<byte> utf8UnescapedStack = stackalloc byte[JsonConstants.StackallocByteThreshold];
System\Text\Json\JsonEncodedText.cs (2)
83Span<byte> utf8Bytes = expectedByteCount <= JsonConstants.StackallocByteThreshold ? 84stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\JsonHelpers.Escaping.cs (4)
40Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 41stackalloc byte[JsonConstants.StackallocByteThreshold] : 68Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 69stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (18)
18Span<byte> utf8Unescaped = utf8Source.Length <= JsonConstants.StackallocByteThreshold ? 19stackalloc byte[JsonConstants.StackallocByteThreshold] : 48Span<byte> utf8Unescaped = length <= JsonConstants.StackallocByteThreshold ? 49stackalloc byte[JsonConstants.StackallocByteThreshold] : 75Span<byte> utf8Unescaped = length <= JsonConstants.StackallocByteThreshold ? 76stackalloc byte[JsonConstants.StackallocByteThreshold] : 100Span<byte> utf8Unescaped = utf8Source.Length <= JsonConstants.StackallocByteThreshold ? 101stackalloc byte[JsonConstants.StackallocByteThreshold] : 131Span<byte> utf8Unescaped = length <= JsonConstants.StackallocByteThreshold ? 132stackalloc byte[JsonConstants.StackallocByteThreshold] : 135Span<byte> utf8Escaped = length <= JsonConstants.StackallocByteThreshold ? 136stackalloc byte[JsonConstants.StackallocByteThreshold] : 173Span<byte> utf8Unescaped1 = utf8Source1.Length <= JsonConstants.StackallocByteThreshold ? 174stackalloc byte[JsonConstants.StackallocByteThreshold] : 177Span<byte> utf8Unescaped2 = utf8Source2.Length <= JsonConstants.StackallocByteThreshold ? 178stackalloc byte[JsonConstants.StackallocByteThreshold] : 222Span<byte> byteSpan = utf8Unescaped.Length <= JsonConstants.StackallocByteThreshold ? 223stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Reader\Utf8JsonReader.cs (2)
542if (length > JsonConstants.StackallocByteThreshold) 549otherUtf8Text = stackalloc byte[JsonConstants.StackallocByteThreshold];
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (6)
156Span<byte> unescapedBuffer = valueLength <= JsonConstants.StackallocByteThreshold ? 157stackalloc byte[JsonConstants.StackallocByteThreshold] : 171Span<byte> intermediate = valueLength <= JsonConstants.StackallocByteThreshold ? 172stackalloc byte[JsonConstants.StackallocByteThreshold] : 208Span<byte> intermediate = sequenceLength <= JsonConstants.StackallocByteThreshold ? 209stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (2)
44Span<byte> byteBuffer = bufferLength <= JsonConstants.StackallocByteThreshold 45? stackalloc byte[JsonConstants.StackallocByteThreshold]
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (2)
41Span<byte> buffer = bufferLength <= JsonConstants.StackallocByteThreshold 42? stackalloc byte[JsonConstants.StackallocByteThreshold]
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (2)
41Span<byte> buffer = bufferLength <= JsonConstants.StackallocByteThreshold 42? stackalloc byte[JsonConstants.StackallocByteThreshold]
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (4)
389json.Length <= (JsonConstants.StackallocByteThreshold / JsonConstants.MaxExpansionFactorWhileTranscoding) ? stackalloc byte[JsonConstants.StackallocByteThreshold] : 420json.Length <= (JsonConstants.StackallocByteThreshold / JsonConstants.MaxExpansionFactorWhileTranscoding) ? stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\JsonWriterHelper.cs (4)
316Span<byte> quotedValue = quotedLength > JsonConstants.StackallocByteThreshold 318: stackalloc byte[JsonConstants.StackallocByteThreshold].Slice(0, quotedLength); 345if (length > JsonConstants.StackallocByteThreshold) 352escapedValue = stackalloc byte[JsonConstants.StackallocByteThreshold];
System\Text\Json\Writer\Utf8JsonWriter.cs (2)
821Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 822stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (2)
166Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 167stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (2)
173Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 174stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (2)
172Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 173stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (2)
172Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 173stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (2)
176Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 177stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (2)
176Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 177stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (2)
146Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 147stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (2)
172Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 173stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (2)
291Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 292stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (2)
245Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 246stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (14)
280if (length > JsonConstants.StackallocByteThreshold) 287escapedPropertyName = stackalloc byte[JsonConstants.StackallocByteThreshold]; 903Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 904stackalloc byte[JsonConstants.StackallocByteThreshold] : 972Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 973stackalloc byte[JsonConstants.StackallocByteThreshold] : 1135if (length > JsonConstants.StackallocByteThreshold) 1142escapedValue = stackalloc byte[JsonConstants.StackallocByteThreshold]; 1155if (length > JsonConstants.StackallocByteThreshold) 1162escapedPropertyName = stackalloc byte[JsonConstants.StackallocByteThreshold]; 1195if (length > JsonConstants.StackallocByteThreshold) 1202escapedValue = stackalloc byte[JsonConstants.StackallocByteThreshold]; 1275if (length > JsonConstants.StackallocByteThreshold) 1282escapedPropertyName = stackalloc byte[JsonConstants.StackallocByteThreshold];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (2)
254Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 255stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (2)
205json.Length <= (JsonConstants.StackallocByteThreshold / JsonConstants.MaxExpansionFactorWhileTranscoding) ? stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (2)
339Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 340stackalloc byte[JsonConstants.StackallocByteThreshold] :
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (2)
308Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 309stackalloc byte[JsonConstants.StackallocByteThreshold] :