greyblake / whatlang-ffi

C bindings for whatlang Rust library
MIT License
9 stars 2 forks source link

&mut is not valid in ffi functions #1

Closed Dr-Emann closed 3 years ago

Dr-Emann commented 7 years ago

Rust &mut references have more guarantees than do c pointers: non-nullabilty and uniqueness. FFI functions should therefore avoid use of them as arguments, as c callers could pass null, or a non-unique pointer.

https://github.com/greyblake/whatlang-ffi/blob/54e9a1d4f43dbb359798b42c61cff6c2e6360eac/src/lib.rs#L17

iwillspeak commented 3 years ago

This is actually fixed by #8 and can be closed now. I must have messed up the mention in that PR so it hasn't been auto-closed.