You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While implementing the Ion C Rust bindings, I had to read through the memory ownership semantics of decimal writing in ion-binary.c.
The problem with this implementation is that although it allows the caller to "borrow" an ION_DECIMAL, each borrowed decimal gets accumulated with the stream/reader. For large streams of larger than decQuad decimals, this would be an effective memory leak. I believe this is also the case for the text side of the reader.
We should either consider making it managed by the caller (which could break existing clients) or make it use a single pre-allocated decimal to maintain the borrow semantics.
Either way the APIs on the reader do not document the behavior, and so whichever we do, we need to document it explicitly.
The text was updated successfully, but these errors were encountered:
While implementing the Ion C Rust bindings, I had to read through the memory ownership semantics of decimal writing in ion-binary.c.
The problem with this implementation is that although it allows the caller to "borrow" an
ION_DECIMAL
, each borrowed decimal gets accumulated with the stream/reader. For large streams of larger thandecQuad
decimals, this would be an effective memory leak. I believe this is also the case for the text side of the reader.We should either consider making it managed by the caller (which could break existing clients) or make it use a single pre-allocated decimal to maintain the borrow semantics.
Either way the APIs on the reader do not document the behavior, and so whichever we do, we need to document it explicitly.
The text was updated successfully, but these errors were encountered: