-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix roots mechanism to avoid deadlocks and asserts (#402)
When roots are removed, avoid using allocations. This allows the removeRoots function to be used in finalizers, a common place to use them, since this is where you may want to unpin memory, or free externally allocated memory that you then want to unregister. When roots are added, we should be OK, because you shouldn't be adding roots in a finalizer. The issue with allocating in a finalizer is that the current arena is locked, and allocating may try to lock the arena again.
- Loading branch information
Showing
2 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters