Closed Akazm closed 1 hour ago
Looks like we use Data
in two places:
Both times Data
is created adhoc and the reader passed on as a reference.
The Rust buffer is created sometime before those functions are called and is then deallocated shortly after.
It therefore should be safe to have Data
not copy out the data, but just reference it.
This avoids unnecessary copies between FFI and Swift.
Tests are apparently entirely unaffected (i.e. no changes to their results) by this change.
deallocator
is set to.none
since theFfiConverterRustBuffer
extension functionlift(_:)
ensures deallocation on it's own.