Right now, the implementation of the custom feature uses a #[no_mangle] function named __getrandom_custom with signature: extern "C" fn(*mut u8, usize) -> u32.
When implementing this feature in #109, I initially used the extern "Rust" ABI, but after some discussion, we decided to use extern "C" due to issues around the stability of the "Rust" ABI.
However, @LegionMammal978 noted in #341 (comment) that panicking across an extern "C" function is unsafe, and it's very possible that a custom implementation could panic (certainly we do nothing to prevent that).
So should we switch to using the "Rust" ABI? If so, should we continue passing a raw pointer/length pair, or pass a slice?
Right now, the implementation of the
customfeature uses a#[no_mangle]function named__getrandom_customwith signature:extern "C" fn(*mut u8, usize) -> u32.When implementing this feature in #109, I initially used the
extern "Rust"ABI, but after some discussion, we decided to useextern "C"due to issues around the stability of the"Rust"ABI.However, @LegionMammal978 noted in #341 (comment) that panicking across an
extern "C"function is unsafe, and it's very possible that a custom implementation could panic (certainly we do nothing to prevent that).So should we switch to using the
"Rust"ABI? If so, should we continue passing a raw pointer/length pair, or pass a slice?