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