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

How to get memory in an import function in 3.0 for multiple instances? #3359

Closed
Berrysoft opened this issue Nov 23, 2022 · 3 comments
Closed
Assignees
Labels
priority-medium Medium priority issue ❓ question I've a question! 🏚 stale Inactive issues or PR

Comments

@Berrysoft
Copy link

According to #3113, the only case to get the memory field is after the instance being created. However, I want to manage multiple instances with one engine and one store. All instances need the same import functions. Does that mean I need to create the same functions multiple times? Are there any overhead?

@Berrysoft Berrysoft added the ❓ question I've a question! label Nov 23, 2022
@Berrysoft Berrysoft changed the title How to get memory in an import function in 3.0? How to get memory in an import function in 3.0 for multiple instances? Nov 23, 2022
@mikkel1156
Copy link

I've been scratching my head over this as well, mostly since I want access to memory to read strings from WasmPtr. But to get memory you need to get an instance first, which you get after the fact of creating it with imports.

@Michael-F-Bryan
Copy link
Contributor

As currently implemented, you can only have one wasmer::Store per instance. @ptitSeb is working on making the engine shareable between instances as part of #3378.

Copy link

stale bot commented Nov 29, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale Inactive issues or PR label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-medium Medium priority issue ❓ question I've a question! 🏚 stale Inactive issues or PR
Projects
None yet
Development

No branches or pull requests

4 participants