JSPI and function pointer cast handling

In the last post, I demonstrated how to use
JSPI in a simple program written for the wasm32-unknown-unknown platform. Of
course, wasm32-unknown-unknown does not support the libc standard library, so
it does not work for real-world code. Emscripten provides the
wasm32-unknown-emscripten target which does support these features.

The main additional problem that comes up when integrating with Emscripten is
the problem of JavaScript frames. Recall from the last post that to use
JavaScript Promise Integration, we wrap an async JavaScript function that we
want to use from C in new WebAssembly.Suspending() and we wrap the export in
WebAssembly.promising():

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论