rust-diplomat / diplomat

Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code
https://rust-diplomat.github.io/book/
Other
532 stars 51 forks source link

Fixing hardcoded 64-bit length for a slice in Kotlin #730

Closed emarteca closed 1 week ago

emarteca commented 1 week ago

The Kotlin backend representation of a Slice is currently not compatible with 32-bit architectures. The Kotlin slice hardcodes the length as a 64-bit integer (a Long), but the corresponding native code expects the length to be a usize.

This PR adds a size_t representation for Kotlin, and uses it for the slice length.