HI, https://github.com/bytecodealliance/wit-bindgen/blob/b8c1222d00e406eead22d0bffe388ff04d11b7ea/crates/c/src/lib.rs#L406 is using a static area for the RET_AREA for exports. This is fine for testing, but for re-entrant code, would this be better allocated and free'ed in the post-return method?
It's suitable for all situations because reentrancy is not allowed before the return area's contents are read, given the guarantees of the component model
even with threads?
with threads it'd theoretically be a thread-local area but at this time threads don't fit well with components just yet
Thanks I saw https://github.com/bytecodealliance/wit-bindgen/pull/326 which handled imports so just wondered.
Scott Waye has marked this topic as resolved.
ah that was for avoiding data segments in the adapter which was a bit of a niche use case
Last updated: Dec 23 2024 at 12:05 UTC