Skip to content

Enable explicitly initializating copy-on-write images#3964

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:more-module-knobs
Apr 11, 2022
Merged

Enable explicitly initializating copy-on-write images#3964
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:more-module-knobs

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit adds a method, Module::initialize_copy_on_write_image,
which will explicitly create the copy-on-write image during the method
call instead of lazily deferring it until the first instantiation of a
module. Given the relative expense of creation of a memfd on Linux this
can otherwise run the risk of unnaturally perturbing the
time-of-instantiation of a module. Additionally whenever lazy
initialization is provided in an API it's typically good practice to
also have an optionally-called forced initialization.

This commit adds a method, `Module::initialize_copy_on_write_image`,
which will explicitly create the copy-on-write image during the method
call instead of lazily deferring it until the first instantiation of a
module. Given the relative expense of creation of a memfd on Linux this
can otherwise run the risk of unnaturally perturbing the
time-of-instantiation of a module. Additionally whenever lazy
initialization is provided in an API it's typically good practice to
also have an optionally-called forced initialization.
@github-actions github-actions Bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Mar 28, 2022
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @peterhuene

Details This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton alexcrichton merged commit 7e8f356 into bytecodealliance:main Apr 11, 2022
@alexcrichton alexcrichton deleted the more-module-knobs branch April 11, 2022 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants