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

Accessing non-static data from module loaders #634

Closed
Laegluin opened this issue Sep 22, 2018 · 2 comments
Closed

Accessing non-static data from module loaders #634

Laegluin opened this issue Sep 22, 2018 · 2 comments

Comments

@Laegluin
Copy link
Contributor

Since add_extern_module takes a function pointer, it's impossible to reference non-static data in a module. Is there a way to do this that doesn't require messing around with global variables? I was looking for a way to simply attach some data to the vm, but I don't think that's possible at the moment.

@Marwes
Copy link
Member

Marwes commented Sep 22, 2018

Tweaked the module loading so that it allows a Box<FnMut ...>. Since it's backwards compatible I will pull it into 0.9.1 after I have gone through a few more fixes.

@Laegluin
Copy link
Contributor Author

Yup, that helps a lot, thanks! :)

bors bot added a commit that referenced this issue Sep 22, 2018
636: feat(vm): Allow module loaders to contain state r=Marwes a=Marwes

Closes #634

Co-authored-by: Markus Westerlind <[email protected]>
@bors bors bot closed this as completed in #636 Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants