opus-rs icon indicating copy to clipboard operation
opus-rs copied to clipboard

Use Rust rather than C allocator

Open SpaceManiac opened this issue 7 years ago • 0 comments

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.

SpaceManiac avatar May 16 '17 05:05 SpaceManiac