Review and fix potential `url` instance memory leaks
It's unclear how these url instances are dropped, if at all:
https://github.com/bytecodealliance/StarlingMonkey/blob/main/builtins/web/url.cpp#L364 https://github.com/bytecodealliance/StarlingMonkey/blob/main/builtins/web/url.cpp#L748 https://github.com/bytecodealliance/StarlingMonkey/blob/main/host-apis/wasi-0.2.0/host_api.cpp#L665
Building on #212, I'm working on a Rust based host API implementation as a way to support the upcoming WASIp3 async without having to use C APIs (that aren't even supported by wit-bindgen yet.)
As part of that, I'm integrating CXX support. Perhaps we should change the existing crates to be based on CXX instead of the hodgepodge of hand-written APIs that I put together ages ago?
Do you mean this: https://github.com/dtolnay/cxx ? If so, yes we could then return unique_ptr from Rust, that would solve the issue here. BTW, I remember one of the annoyances of working with cxx was that it used exceptions to model returning the Result from C++ to Rust with no option to disable exceptions. I'm not sure if this is going to be issue for us.