Draft
Conversation
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 |
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
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>.