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

Partially fix unbounded memory leak from the FuncDataRegistry #2699

Merged
merged 2 commits into from
Nov 30, 2021

Conversation

Amanieu
Copy link
Contributor

@Amanieu Amanieu commented Nov 30, 2021

This PR makes the VMCallerCheckedAnyfuncs for the functions (defined and import) of an instance owned by that instance itself instead of owned by the store-global FuncDataRegistry. This allows them to be properly freed when the instance is unloaded.

Functions used as funcrefs still require an allocation in the FuncDataRegistry, but this should fix the leak for anyone not using function reference types directly.

This also improves instantiation times since we no longer need to grab the global FuncDataRegister lock during instantiation.

@Amanieu Amanieu requested a review from syrusakbary as a code owner November 30, 2021 03:18
@Amanieu Amanieu mentioned this pull request Nov 30, 2021
4 tasks
@Amanieu
Copy link
Contributor Author

Amanieu commented Nov 30, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 30, 2021

@bors bors bot merged commit 9797775 into master Nov 30, 2021
@bors bors bot deleted the instance_funcrefs branch November 30, 2021 17:19
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

Successfully merging this pull request may close these issues.

2 participants