Replies: 2 comments
-
@Kofemolka You already have the patch, so it would be great if you create a PR with two commits: one adding a test reproducing your problem, and another one with the attached patch. You could let us do the changes, but that would probably mean this will linger for a longer time, as we have little time to dedicate to a not so common use case. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Moving this ticket to the Ideas discussion forum where enhancements and feature requests are discussed. |
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
-
Hello!
We are using CDR and FastBuffer inside our language bindings: Python, Golang, Java. For that we have a C-wrapper, consisting of struct to hold CDR and FastBuffer, and set of methods to serialize/deserialize different types.
Since we can't allocate this on stack, every time we need to serialize or deserialize some data model a new instance of this wrapping struct is allocated in the heap and deleted afterwards.
For performance reasons, we would like to create this struct and subsequently CDR and FastBuffer only once per our data model, and "reset" it with pointer to raw buffer during each serialize/deserialize sequence.
FastBuffer has perfectly legal way of re-init, since implements move ctor and assignment operator.
CDR has method
reset()
which also does what we need, except re-evaluation ofm_lastPosition
, which should point to the end of a FastBuffer.Here is a sample usage:
After calling
serializer.reset()
it'sm_lastPosition
will point to the end of a previous buffer, not current.Attaching one-liner patch that solves this.
Beta Was this translation helpful? Give feedback.
All reactions