Right now it's very easy to accidentally generate code that fails to free Rust-allocated memory, resulting in memory leaks. This is becoming especially prevalent as we flesh out support for marshaling lists of values. As such, it would be very helpful to have integration tests that could automatically detect memory leaks so that we could have more confidence that the generated code is sound.
The big issue here is that I'm not sure how to detect memory leaks coming from unmanaged code on the C# side. For pure-Rust projects we can use tools like valgrind to see the application leaks memory, but in this case we need to specifically verify that the way that the generated C# bindings interact with the Rust code doesn't leak. If we can figure out a way to detect this programmatically, we can setup integrations tests for catching leaks.
Right now it's very easy to accidentally generate code that fails to free Rust-allocated memory, resulting in memory leaks. This is becoming especially prevalent as we flesh out support for marshaling lists of values. As such, it would be very helpful to have integration tests that could automatically detect memory leaks so that we could have more confidence that the generated code is sound.
The big issue here is that I'm not sure how to detect memory leaks coming from unmanaged code on the C# side. For pure-Rust projects we can use tools like valgrind to see the application leaks memory, but in this case we need to specifically verify that the way that the generated C# bindings interact with the Rust code doesn't leak. If we can figure out a way to detect this programmatically, we can setup integrations tests for catching leaks.