-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Introduce wasmtime::Store::try_new, which handles OOM
#12415
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
Introduce wasmtime::Store::try_new, which handles OOM
#12415
Conversation
alexcrichton
left a comment
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.
Nice 👍
Subscribe to Label Actioncc @fitzgen DetailsThis issue or pull request has been labeled: "fuzzing", "wasmtime:api"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
e119b58 to
8d5daa1
Compare
|
@fitzgen oh to resolve that, you'll need to set |
Subscribe to Label ActionDetailsThis issue or pull request has been labeled: "winch"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
`Store::new` is an infallible constructor, so there is not a direct way to make it return an error on OOM. Additionally, it is one of the most-used functions in the Wasmtime embedder API, so changing its signature to return a `Result` is a non-starter -- it would cause way too much pain. So instead we define `Store::try_new` which returns a `Result` and make `Store::new` call and unwrap that new constructor. Part of bytecodealliance#12069
8d5daa1 to
948deef
Compare
* Introduce `wasmtime::Store::try_new`, which handles OOM `Store::new` is an infallible constructor, so there is not a direct way to make it return an error on OOM. Additionally, it is one of the most-used functions in the Wasmtime embedder API, so changing its signature to return a `Result` is a non-starter -- it would cause way too much pain. So instead we define `Store::try_new` which returns a `Result` and make `Store::new` call and unwrap that new constructor. Part of #12069 * update disas tests and fix winch * Disable concurrency support in `Store::try_new` OOM test * Add attributes that were lost in rebase
* Introduce `wasmtime::Store::try_new`, which handles OOM `Store::new` is an infallible constructor, so there is not a direct way to make it return an error on OOM. Additionally, it is one of the most-used functions in the Wasmtime embedder API, so changing its signature to return a `Result` is a non-starter -- it would cause way too much pain. So instead we define `Store::try_new` which returns a `Result` and make `Store::new` call and unwrap that new constructor. Part of #12069 * update disas tests and fix winch * Disable concurrency support in `Store::try_new` OOM test * Add attributes that were lost in rebase
Store::newis an infallible constructor, so there is not a direct way to makeit return an error on OOM. Additionally, it is one of the most-used functions in
the Wasmtime embedder API, so changing its signature to return a
Resultis anon-starter -- it would cause way too much pain. So instead we define
Store::try_newwhich returns aResultand makeStore::newcall and unwrapthat new constructor.
Part of #12069
Depends on
ModuleRuntimeInfos across all stores in an engine #12409initialize_vmctx#12412ModuleRuntimeInfo#12413memory_tysparam fromvm::Instance::new#12414