RustAudio / dasp

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

Use const generics in the ring_buffer module #159

Closed default-username-852 closed 3 years ago

default-username-852 commented 3 years ago

Since const generics have been stable for a while now, I thought that it was time that this crate made use of them too. It is unnecessarily restrictive to only have a couple of sizes to choose from, and to use a size that isn't supported by arrays, you have to use a heap allocation which isn't always optimal. With const generics, its possible to store arbitrarily sized buffers on the stack instead.