forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move return exception pool to StaticScope
We cannot use a static thread-local because it will root the entire runtime (at best) and potentially root classloaders and keep entire applications in memory after they should have been cleaned up. Moving this to StaticScope has the following advantages: * Localize the return jump cache to the point of initiation, the scope doing the non-local return. * Scopes not using return jumps will not use this cache and not create any objects. The lack of synchronization here is intentional; if two threads race and both create a ThreadLocal for the scope, one will win and the other will just be collected eventually. There's no particular need to ensure only one ThreadLocal gets created.
- Loading branch information
Showing
2 changed files
with
24 additions
and
9 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