Describe the enhancement requested
Similar to #41349, .NET 5 introduced new overloads for decimalGetBits for which allow the use of a stackalloc'ed span, and avoiding the allocation of a fresh byte array for each value serialized. This should (slightly) reduce the allocations associated with serializing C# decimal values.
|
int[] decimalBits = decimal.GetBits(value); |
Component(s)
C#