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 methods for copying slices of data into and out of the ring buffer #59

Open
mgeier opened this issue Jul 8, 2021 · 2 comments · May be fixed by #66
Open

Add methods for copying slices of data into and out of the ring buffer #59

mgeier opened this issue Jul 8, 2021 · 2 comments · May be fixed by #66

Comments

@mgeier
Copy link
Owner

mgeier commented Jul 8, 2021

This has been discussed in #57.

I think the API for writing would be straightforward and the implementation could use the existing write_chunk_uninit() method.

I'm less sure about the API for reading. I guess users could provide an already initialized slice onto which the data will be copied.
However, it might be more efficient in some cases if the user could provide some kind of uninitialized slice.

I think it would be useful to provide those methods for T: Copy types, because under the hood memcopy() or memmove() will be used for maximum efficiency.
I'm not sure if it would also make sense for less constrained types.

@mgeier mgeier mentioned this issue Jul 8, 2021
@mgeier
Copy link
Owner Author

mgeier commented Sep 5, 2021

I'm still unsure how to call these methods ... any suggestions?

Since these convenience functions would not break backwards compatibility, I think I'll make a new release soon without them and add them at a later point.

In the meantime, I've (arguably) improved the examples in the docs: #64.

@mgeier mgeier linked a pull request Sep 24, 2021 that will close this issue
@mgeier
Copy link
Owner Author

mgeier commented Sep 24, 2021

I've created a possible implementation in #66.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant