Stream: wasi

Topic: ✔ Consider adding `cabi_realloc` to `wasi-libc`?


view this post on Zulip Joel Dice (Jul 01 2024 at 17:17):

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.

view this post on Zulip Joel Dice (Jul 02 2024 at 20:24):

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:

WASI libc implementation for WebAssembly. Contribute to WebAssembly/wasi-libc development by creating an account on GitHub.

view this post on Zulip Notification Bot (Jul 03 2024 at 14:05):

Joel Dice has marked this topic as resolved.


Last updated: Dec 23 2024 at 12:05 UTC