Skip to content
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

feat(import) Support instance context API #26

Merged
merged 3 commits into from
Jun 4, 2019

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented Jun 4, 2019

Partially address #23.
Ping @YaronWittenstein

This PR brings an InstanceContext API:

  1. From an imported function, call IntoInstanceContext(context) to cast the unsafe.Pointer into an InstanceContext,
  2. Now, call the Memory method to get the instance context,
  3. Use the Memory.Data method to read or write memor data.

Hywan added 3 commits June 4, 2019 11:46
New `InstanceContext` API so that imported function can access the
instance memory for example.
@Hywan Hywan added 🎉 enhancement New feature or request 📦 component-runtime About the Wasm runtime 📚 documentation Do you like to read? 🧪 tests I love tests labels Jun 4, 2019
@Hywan Hywan self-assigned this Jun 4, 2019
@Hywan
Copy link
Contributor Author

Hywan commented Jun 4, 2019

bors r+

bors bot added a commit that referenced this pull request Jun 4, 2019
26: feat(import) Support instance context API r=Hywan a=Hywan

Partially address #23.
Ping @YaronWittenstein

This PR brings an `InstanceContext` API:

1. From an imported function, call `IntoInstanceContext(context)` to cast the `unsafe.Pointer` into an `InstanceContext`,
2. Now, call the `Memory` method to get the instance context,
3. Use the `Memory.Data` method to read or write memor data.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
@YaronWittenstein
Copy link

@Hywan you're the man!!

@bors
Copy link
Contributor

bors bot commented Jun 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 component-runtime About the Wasm runtime 📚 documentation Do you like to read? 🎉 enhancement New feature or request 🧪 tests I love tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants