Replies: 1 comment
-
|
This change allowed us to reuse a significant amount of code while also offering |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, after upgrading to MessagePack 3.1.4, some of my serialization code now fails. One issue seems to be caused by the change in
MessagePackWriter.Write(ulong value).In version 2, the size of the required span depends on the value being serialized. In version 3, it is 9 by default:
AssumesTrue(MessagePackPrimitives.TryWrite(writer.GetSpan(9), value, out var bytesWritten));When serializing to a fixed sized buffer ( for example, when manually serializing a gRPC payload where the size is precalculated), the buffer might be smaller than the required span. And the buffer cannot be (and shouldn't be for performance reason) resized.
When serializing a ulong value of 0, the write will fail when trying to allocate 9 bytes, even though it only requires 1 byte to serialize the value.
Beta Was this translation helpful? Give feedback.
All reactions