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
The types z_bytes_writer_t, z_bytes_reader_t are copyable according to their names. But they wraps Rust types ZBytesWriter/ZBytesReader which are not copyable.
The behavior of parallel reading/writing to multiple readers/writers is not defined.
There should be one and only one reader or writer for z_owned_bytes_t at any moment.
So we have to:
make z_bytes_writer_t, z_bytes_reader_t owned to protect from copying
(not right now, but it would be nice to have) - fail on creation e.g. z_owned_bytes_writer_t if another one exists
The text was updated successfully, but these errors were encountered:
After discussion with @DenisBiryukov91 the following plan was proposed:
the writer becomes z_owned_bytes_writer_t. The construction of the writer (in append case) consumes z_owned_bytes_t with move operation. This guarantees that no other writer can be created for the same ZBytes. After finishing writing the function e.g. z_close_writer which consumes writer and constructs updated z_owned_bytes_t should be called
the reader remains as is, like e.g. z_slice_iterator_t. It's copyable, multiple readers for same z_owned_bytes_t are allowed
This proposal is similar to this attempt to fix the same issue in #675
Describe the release item
The types
z_bytes_writer_t
,z_bytes_reader_t
are copyable according to their names. But they wraps Rust typesZBytesWriter
/ZBytesReader
which are not copyable.The behavior of parallel reading/writing to multiple readers/writers is not defined.
There should be one and only one reader or writer for
z_owned_bytes_t
at any moment.So we have to:
z_bytes_writer_t
,z_bytes_reader_t
owned to protect from copyingz_owned_bytes_writer_t
if another one existsThe text was updated successfully, but these errors were encountered: