-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Refactor the internals of vm::Memory
to simplify the RuntimeLinearMemory
trait
#9577
Open
alexcrichton
wants to merge
10
commits into
bytecodealliance:main
Choose a base branch
from
alexcrichton:simplify-memory
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+455
−537
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of storing just a trait object store instead an `enum` between "local" memory and shared memory. This helps remove redundant trait impls on shared memories, removes the need for `dyn Any`, and removes the possibility of wrapping a shared memory as a shared memory. This is additionally intended to make it a bit easier to see what's nested where and reduce some layers of indirection.
This is intended to be a non-shared implementation of a linear memory with various bits and pieces tracking state. The end goal is to simplify the `RuntimeLinearMemory` trait to its bare bones necessary to faithfully implement wasm linear memory.
Further simplify `RuntimeLinearMemory` by moving these responsibilities up a layer into the `LocalMemory` structure.
No need to plumb it through all the traits any more. Now it's possible to only have it handled in `LocalMemory` and other pieces don't have to worry about it.
Further simplify custom traits and mmap/static memory by moving more responsibility into `LocalMemory`.
github-actions
bot
added
fuzzing
Issues related to our fuzzing infrastructure
wasmtime:api
Related to the API of the `wasmtime` crate itself
wasmtime:c-api
Issues pertaining to the C API.
labels
Nov 7, 2024
Subscribe to Label Actioncc @fitzgen
This issue or pull request has been labeled: "fuzzing", "wasmtime:api", "wasmtime:c-api"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
fuzzing
Issues related to our fuzzing infrastructure
wasmtime:api
Related to the API of the `wasmtime` crate itself
wasmtime:c-api
Issues pertaining to the C API.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a series of commits which have the end-goal of removing the
RuntimeLinearMemory
trait and replacing it withwasmtime::LinearMemory
. In doing this though I wanted to simplify the trait to move more responsibilities up a layer so it's clearer what the safety contracts are and what exactly is required on behalf of embedders. This moves many of the responsibilities to a newLocalMemory
type rather than having most of the functionality implemented through trait methods. This provides, for example, a vector of having CoW support in Wasmtime without supporting it throughLinearMemory
(or not officially at least).Each commit here is probably best viewed one-at-a-time since this adds up to a number of changes but I've tried to keep things separated and have tests passing for each individual commit.
Fixes #9568