mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8317819: Scope should reflect lifetime of underying resource (mainline)
Reviewed-by: jvernee
This commit is contained in:
parent
6f1d8962df
commit
b07da3ae15
12 changed files with 254 additions and 64 deletions
|
@ -165,7 +165,7 @@ public interface SymbolLookup {
|
|||
* <p>
|
||||
* Libraries associated with a class loader are unloaded when the class loader becomes
|
||||
* <a href="../../../java/lang/ref/package.html#reachability">unreachable</a>. The symbol lookup
|
||||
* returned by this method is associated with a fresh {@linkplain MemorySegment.Scope scope} which keeps the caller's
|
||||
* returned by this method is associated with an automatic {@linkplain MemorySegment.Scope scope} which keeps the caller's
|
||||
* class loader reachable. Therefore, libraries associated with the caller's class loader are kept loaded
|
||||
* (and their symbols available) as long as a loader lookup for that class loader, or any of the segments
|
||||
* obtained by it, is reachable.
|
||||
|
@ -189,7 +189,7 @@ public interface SymbolLookup {
|
|||
if ((loader == null || loader instanceof BuiltinClassLoader)) {
|
||||
loaderArena = Arena.global();
|
||||
} else {
|
||||
MemorySessionImpl session = MemorySessionImpl.heapSession(loader);
|
||||
MemorySessionImpl session = MemorySessionImpl.createHeap(loader);
|
||||
loaderArena = session.asArena();
|
||||
}
|
||||
return name -> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue