You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just saw the API __wasi_sock_recv() is using a pointer of __wasi_iovec_t as the second parameter. I wonder if we can use data structure for the data sharing between the WASM inside and outside. There are some concerns about the memory layout and endian might be different. I also found there are some static asserts about the the structure __wasi_iovec_t, and my guess it might be related with these concerns. My question is - do we have any common guideline about using structure pointer as WASI API parameter here?
In the short term, wasm pointers are always 32-bit and wasm integers are always little-endian, so __wasio_iovec_t will always have a very simple layout. It may differ from the host's layout of the same struct, but wasm pointers will always need to be translated before they can be used on the host, so it's not that different from what hosts would have to do anyway.
Longer term, I expect the API will be defined in terms of the webidl-bindings proposal, which will provide more flexibility.
Hi,
I just saw the API __wasi_sock_recv() is using a pointer of __wasi_iovec_t as the second parameter. I wonder if we can use data structure for the data sharing between the WASM inside and outside. There are some concerns about the memory layout and endian might be different. I also found there are some static asserts about the the structure __wasi_iovec_t, and my guess it might be related with these concerns. My question is - do we have any common guideline about using structure pointer as WASI API parameter here?
typedef struct __wasi_iovec_t {
void *buf;
size_t buf_len;
} __wasi_iovec_t;
The text was updated successfully, but these errors were encountered: