Apple's profiling tool Instruments is reporting memory leaks on each async call from Swift to Rust.
I've tried investigating this but couldn't find the cause. Could anyone help take a look?
Minimal example:
// rust side
#[uniffi::export]
async fn rust_side_function() -> u32 { 42 }
// swift side
Task {
_ = await rustSideFunction()
}
Observed Behavior
Each call to rustSideFunction() leaks 64 + 64 + 128 bytes (256 bytes total) on my machine (M4 Mac).
I've created this repository to demonstrate the example.