Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs regarding undefined behavior when using multiple z_bytes_writers #682

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/zenoh_commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,8 @@ ZENOHC_API struct z_bytes_reader_t z_bytes_get_reader(const struct z_loaned_byte
ZENOHC_API
struct z_bytes_slice_iterator_t z_bytes_get_slice_iterator(const struct z_loaned_bytes_t *this_);
/**
* Gets writer for `this_`.
* @brief Gets writer for`this_`.
* @note Creating another writer while previous one is still in use is undefined behaviour.
*/
ZENOHC_API struct z_bytes_writer_t z_bytes_get_writer(struct z_loaned_bytes_t *this_);
/**
Expand Down
3 changes: 2 additions & 1 deletion src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,8 @@ pub use crate::opaque_types::z_bytes_writer_t;

decl_c_type! {loaned(z_bytes_writer_t, ZBytesWriter<'static>)}

/// Gets writer for `this_`.
/// @brief Gets writer for`this_`.
/// @note Creating another writer while previous one is still in use is undefined behaviour.
#[no_mangle]
extern "C" fn z_bytes_get_writer(this: &'static mut z_loaned_bytes_t) -> z_bytes_writer_t {
*this.as_rust_type_mut().writer().as_loaned_c_type_ref()
Expand Down