Hi all. I've been chatting with folks on the .NET Discord regarding WASIp2 support, and one of the questions that came up was "Where does/should cabi_realloc
belong?". Currently, for Rust and C/C++, it gets generated by wit-bindgen
and linked in as a weak symbol. We do the same for C#/.NET currently, but it's a bit more awkward there because for technical reasons it needs to be implemented in C, but that means the user needs to have a C compiler installed.
Should we consider adding it to wasi-libc
, at least as part of the wasm32-wasip2
target? The other option would be to add it to the .NET standard library, but that work would need to be duplicated across all languages, potentially.
Nevermind -- it already is part of wasi-libc
: https://github.com/WebAssembly/wasi-libc/blob/320bbbcced68ce8e564b0dc4c8f80a5a5ad21a9c/libc-bottom-half/sources/wasip2.c#L372-L378. And I'm the one who put it there :sweat_smile:
Joel Dice has marked this topic as resolved.
Last updated: Nov 22 2024 at 16:03 UTC