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

Allow storing non-static data in a vm #497

Open
Marwes opened this Issue Mar 25, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@Marwes
Copy link
Member

Marwes commented Mar 25, 2018

Types with lifetimes may be possible. I actually had that working way, way back but ended up removing it since it was so limited (any lifetime needed to strictly outlive the interpreter itself making it more trouble than its worth).
Thanks to some changes done in the last year it could be worthwhile to try it again however as it is now possible to create short lived child interpreters which are already have the capability to restrict short lived values from escaping to longer lived interpreters. Piggybacking on this system it should be possible to create a interpreter for each script call (the interpreter could easily be recycled to avoid allocating a fresh one each time), pass it some reference values to the script and then destroy/recycle the interpreter before the references lifetimes ends. No promises though :)

From amethyst/amethyst#271 (comment)

cc @endeav0r

@Marwes Marwes changed the title Allow storing non-static in a vm Allow storing non-static data in a vm Mar 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment