Resource management for macro/plugin classloaders, classpath JARs#7366
Merged
lrytz merged 9 commits intoscala:2.13.xfrom Nov 8, 2018
Merged
Resource management for macro/plugin classloaders, classpath JARs#7366lrytz merged 9 commits intoscala:2.13.xfrom
lrytz merged 9 commits intoscala:2.13.xfrom
Conversation
For better cacheability
An extension point analagous to `findMacroClassLoader`
This lets customized Global's deliver this file, and offloads the scanning logic.
Close Global-scoped JARs and ClassLoaders. Entries of FileBasedCache that have a lifetime that exceeds any single Global instance are reference counted. When the count hits zero, it is closed if no references appear after a delay.
viktorklang
reviewed
Oct 23, 2018
Co-Authored-By: retronym <jzaugg@gmail.com>
retronym
commented
Oct 23, 2018
Member
|
I'm reviewing this tomorrow, sorry for the delay! |
Member
|
@retronym is this still WIP? |
Member
Author
|
@lrytz Could you please take a look at this one? |
0268bc4 to
a9105fb
Compare
lrytz
approved these changes
Nov 8, 2018
retronym
added a commit
to retronym/scala
that referenced
this pull request
Jan 15, 2019
…th JARs Backports: - scala#7366 - scala#7644
retronym
added a commit
to retronym/scala
that referenced
this pull request
Jan 15, 2019
…th JARs Backports: - scala#7366 - scala#7644
retronym
added a commit
to retronym/scala
that referenced
this pull request
Jan 22, 2019
…th JARs Backports: - scala#7366 - scala#7644
retronym
added a commit
to retronym/scala
that referenced
this pull request
Feb 4, 2019
…th JARs Backports: - scala#7366 - scala#7644
retronym
added a commit
to retronym/scala
that referenced
this pull request
Feb 4, 2019
…th JARs Backports: - scala#7366 - scala#7644
retronym
added a commit
to retronym/scala
that referenced
this pull request
Feb 4, 2019
…th JARs Backports: - scala#7366 - scala#7644
retronym
added a commit
to retronym/scala
that referenced
this pull request
Feb 20, 2019
…th JARs Backports: - scala#7366 - scala#7644
retronym
added a commit
to retronym/zinc
that referenced
this pull request
Feb 26, 2019
This will close file handles to JARs within recent versions of Scalac. References scala/scala#7366
retronym
added a commit
to retronym/zinc
that referenced
this pull request
Feb 26, 2019
This will close file handles to JARs within recent versions of Scalac. References scala/scala#7366
eed3si9n
pushed a commit
to eed3si9n/scala
that referenced
this pull request
May 14, 2019
This will close file handles to JARs within recent versions of Scalac. References scala#7366
lrytz
pushed a commit
to lrytz/scala
that referenced
this pull request
Nov 5, 2019
This will close file handles to JARs within recent versions of Scalac. References scala#7366 Rewritten from sbt/zinc@1f91729
This was referenced Jul 14, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Global now has a close() method, which closes any classloaders
and open JARs created for compiler plugins, macros, and the
classpath.
When these aren't owned by Global (because caching is turned on),
this reference counts are decremented on Global.close.
When the reference count for a resource reaches zero, it is queued
for close after a short (and configurable) delay.
Also introduces a setting to provide a restricted classpath for
the macro classloader, which can improve the hit ratio when
-Ycache-macro-classloader.