opus-rs
opus-rs copied to clipboard
Use Rust rather than C allocator
Opus offers x_get_size
and x_init
functions that can be used to use an allocator other than C's malloc. Because this binding is intended for use by Rust hosts, using Rust's allocator is preferred over letting C malloc, when feasible.
Biggest caveat: C malloc has byzantine alignment guarantees, stricter on some platforms than Vec<usize>
allows. Probably opus won't require greater than usize
alignment, but it's better to be on the safe side.