rework luv work vm storage into userdata #757
Merged
+69
−65
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.
Moves work vm storage into a garbage collected userdata. Allowing for each lua state to manage its own storage. This completely removes the need for a global array of work vms.
Better than #755 because it does not introduce an extra interface that integrators have to deal with.
Essentially an expansion of #756 by using the userdata object to store the entire vm array.
In particular, this should mimic pre loop
__gc
behavior of multiple lua states having access to a pool of work vms and that pool being cleaned up automatically everywhere; the existing loop__gc
does not handle this case well, particularly when one state is closed first (the other state may then attempt to use closed lua states).Fixes #754