-
Notifications
You must be signed in to change notification settings - Fork 922
Support ?Send function environments
#5660
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
Draft
Twey
wants to merge
23
commits into
wasmerio:main
Choose a base branch
from
Twey:non-send
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.
Draft
Conversation
This file contains hidden or 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
Member
|
Thanks for creating the PR, we believe is a step in the right direction. We need a bit more time to review and test in other places (like browser) |
Contributor
Author
|
Appreciate it! Currently only the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR is currently a draft, as the work needs to be ported to the other (non-
sys) backends and also needs documentation in some places (not to mention some cleanups :)), but contains all public API changes and works forsysso I'm submitting it early for directional feedback.Description
Apropos of #4634, parameterize the
Storeon a type of type-erasedObjects. This enables building stores where the internalObjectisBox<dyn Any>(instead ofBox<dyn Any + Send>) to permit the storage of non-Sendobjects in the store.Type defaults have been used to maintain API compatibility for the most part. However, this is still technically a breaking change, since it changes some public but less-used APIs in incompatible ways (e.g. adding
type ObjecttoAsStoreRef).This PR focuses on function environments, as that's what we need to be non-
Send, but could also be generalized to other parts of the API such as extern refs or trap handlers.A trait
Upcast<T>is introduced towasmer-typesfor types that can type-eraseT, and implemented forBox<dyn Any>andBox<dyn Any + Send>.