Stream: wasmtime

Topic: export return area


view this post on Zulip Ashanti Mutinta (Nov 18 2024 at 14:56):

I read in the Csharp bindings that export bindings can be statically allocated for the return area while there is no option for imports because they use the stack. I was wondering if someone can elaborate on this! What makes exports a good candidate for this versus imports?

view this post on Zulip Alex Crichton (Nov 18 2024 at 16:27):

This is generally a per-language decision and per-bindings-generator decision. It largely boils down to runtime requirements and such. Rust doesn't use statically allocated areas for imports to work in cases like the WASIp1-to-WASIp2 adapter which has very strict requirements on what memory can be used where. I don't think there's an issue otherwise in using statically allocated areas for imports

view this post on Zulip Ashanti Mutinta (Nov 19 2024 at 19:39):

Alex Crichton said:

This is generally a per-language decision and per-bindings-generator decision. It largely boils down to runtime requirements and such. Rust doesn't use statically allocated areas for imports to work in cases like the WASIp1-to-WASIp2 adapter which has very strict requirements on what memory can be used where. I don't think there's an issue otherwise in using statically allocated areas for imports

Awesome thank you!


Last updated: Nov 22 2024 at 16:03 UTC