Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: use z_move in shm examples #589

Merged
merged 1 commit into from
Aug 12, 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
4 changes: 2 additions & 2 deletions examples/z_get_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int main(int argc, char** argv) {
printf("Unexpected failure during SHM buffer serialization...\n");
return -1;
}
opts.payload = &payload;
opts.payload = z_move(payload);
}
z_get(z_loan(s), z_loan(keyexpr), "", z_move(closure),
&opts); // here, the send is moved and will be dropped by zenoh when adequate
Expand Down Expand Up @@ -135,4 +135,4 @@ int main(int argc, char** argv) {
z_drop(z_move(provider));
z_drop(z_move(layout));
return 0;
}
}
4 changes: 2 additions & 2 deletions examples/z_pub_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ int main(int argc, char **argv) {
z_publisher_put_options_default(&options);

z_owned_bytes_t payload;
z_bytes_serialize_from_shm_mut(&payload, &alloc.buf);
z_bytes_serialize_from_shm_mut(&payload, z_move(alloc.buf));

z_publisher_put(z_loan(pub), z_move(payload), &options);
} else {
Expand All @@ -137,4 +137,4 @@ int main(int argc, char **argv) {
z_drop(z_move(layout));

return 0;
}
}
2 changes: 1 addition & 1 deletion examples/z_queryable_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void query_handler(const z_loaned_query_t *query, void *context) {
z_query_reply_options_default(&options);

z_owned_bytes_t reply_payload;
z_bytes_serialize_from_shm_mut(&reply_payload, &alloc.buf);
z_bytes_serialize_from_shm_mut(&reply_payload, z_move(alloc.buf));

z_view_keyexpr_t reply_keyexpr;
z_view_keyexpr_from_str(&reply_keyexpr, (const char *)context);
Expand Down