uniffi-rs
ab7a4478 - Add workaround for JNA bug when passing small structs by value.

Commit
5 years ago
Add workaround for JNA bug when passing small structs by value. The current version of JNA appears to have a bug when passing small structs as arguments by value, on arm64 platforms, when the function call has too many arguments to pass the struct in registers. It turns out that our generated code does this a lot thanks to the way we pass around `RustBuffer` structs. This commit adds a temporary workaround for the issue, by padding our structs to be larger than 16 bytes, which causes them to be passed as pointers rather than by value. See https://github.com/mozilla/application-services/issues/3646 for investigation of the JNA issue, and https://github.com/mozilla/uniffi-rs/issues/334 to track the work of removing this workaround once a fix is released in upstream JNA.
Author
rfk rfk
Committer
rfk rfk
Parents
Loading