-
Notifications
You must be signed in to change notification settings - Fork 138
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 SampleBuffer::clear()
?
#126
Comments
And somewhat related: What's the point of storing |
Hi @torokati44, Having a clear method is a good idea. I haven't spent much time considering use cases for I've chosen not to resize the vector because it would likely involve extra zeroing operations, and/or extra allocations/deallocations. By managing the buffer myself I can avoid those. That being said, it should really be a boxed slice of |
Thanks for adding this to a milestone!
This is how it came up:
Okay, I see, that makes sense. I only considered the allocation part, which would likely(?) not take place, but the zeroing almost certainly would, yeah. |
Fixed by 10e8a2d. |
I found myself in a situation where clearing an existing
SampleBuffer
would be really useful.If I understand it right, that would be only a matter of setting
n_written
to0
.However, I found no way of doing this other than assigning a newly created, empty buffer to it.
Is this something that could be added perhaps?
The text was updated successfully, but these errors were encountered: