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

add support for transferring data ownership to Bytes via custom deleter #335

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

DenisBiryukov91
Copy link
Contributor

add support for transferring data ownership to Bytes via custom deleter

@DenisBiryukov91 DenisBiryukov91 added the enhancement New feature or request label Dec 18, 2024
@YuanYuYuan
Copy link
Contributor

Nit: shall we align with the doc in zenoh-c? https://github.com/eclipse-zenoh/zenoh-c/blob/8974132e1bd49954ebf0a7b6242c8c3f8d21f503/include/zenoh_commons.h#L1480-L1482
In particular, the deleter has a guide for static variables.

@DenisBiryukov91
Copy link
Contributor Author

Nit: shall we align with the doc in zenoh-c? https://github.com/eclipse-zenoh/zenoh-c/blob/8974132e1bd49954ebf0a7b6242c8c3f8d21f503/include/zenoh_commons.h#L1480-L1482 In particular, the deleter has a guide for static variables.

I added to the docs, that deleter should be a thread safe. There is no need for extra mention for NULL, since Deleter can not be null here and should always a valid callable. It can have an empty implementation if user desires (it is way simpler to provide it in c++ than in c)

@milyin milyin merged commit f7f084e into eclipse-zenoh:main Dec 18, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants