-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for the WASI ABI. #299
Conversation
301: Add arg and env support to wasi r=lachlansneff a=lachlansneff Co-authored-by: Lachlan Sneff <[email protected]> Co-authored-by: Mark McCaskey <[email protected]>
300: hook up wasi to wasmer r=lachlansneff a=MarkMcCaskey Co-authored-by: Mark McCaskey <[email protected]> Co-authored-by: Mark McCaskey <[email protected]>
@@ -63,7 +63,16 @@ impl Instance { | |||
// Initialize the vm::Ctx in-place after the backing | |||
// has been boxed. | |||
unsafe { | |||
*inner.vmctx = vm::Ctx::new(&mut inner.backing, &mut inner.import_backing, &module) | |||
*inner.vmctx = match imports.call_state_creator() { | |||
Some((data, dtor)) => vm::Ctx::new_with_data( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dtor
? maybe destructor
or finalizer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, either of those is fine. dtor
was just short and it's common in the c++ world.
303: Add all wasi types r=lachlansneff a=lachlansneff This adds all wasi types. Co-authored-by: Lachlan Sneff <[email protected]>
|
||
#[allow(clippy::mut_from_ref)] | ||
fn get_wasi_state(ctx: &Ctx) -> &mut WasiState { | ||
unsafe { &mut *(ctx.data as *mut WasiState) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One idea: we could differentiate between ModuleState, InstanceState, FunctionState (if we add that).
304: remove __wasi_ prefix r=lachlansneff a=MarkMcCaskey Co-authored-by: Mark McCaskey <[email protected]>
305: Feature/fix wasi setup r=lachlansneff a=MarkMcCaskey Co-authored-by: Mark McCaskey <[email protected]>
lib/wasi/src/state.rs
Outdated
Ok(Self { | ||
repo: RepoOpener::new() | ||
.create(true) | ||
.open("mem://foo", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's call it something else
bors r+ |
299: Support for the WASI ABI. r=xmclark a=lachlansneff part of #297 Co-authored-by: Lachlan Sneff <[email protected]> Co-authored-by: Mark McCaskey <[email protected]> Co-authored-by: bors[bot] <bors[bot]@users.noreply.github.com> Co-authored-by: Mark McCaskey <[email protected]>
Adapted API to Wasmer 3.0
part of #297