RustAudio / dasp

The fundamentals for Digital Audio Signal Processing. Formerly `sample`.
Other
883 stars 64 forks source link

Add `extend` and `read` to ringbuffer. #140

Open richard-uk1 opened 3 years ago

richard-uk1 commented 3 years ago

I've been using the ringbuffer with its iterators and I can't get the computer to optimize copying, so I made some methods that do it manually. They need examples but I want to check you're interested first.

mitchmindtree commented 3 years ago

Certainly interested, thanks for the PR! Let me know when the examples are in and you'd like me to take a closer look :+1:

richard-uk1 commented 3 years ago

After experimentation using copy_from_slice doesn't seem slower than ptr::copy_nonoverlapping and doesn't need unsafe, so I'm using that.

richard-uk1 commented 3 years ago

Ready for review.

richard-uk1 commented 3 years ago

friendly bump