-
Bug
-
Resolution: Fixed
-
P3
-
19
Segments created from on-heap arrays have the global scope. This makes sense, since they are always accessible.
In other circumstances, however, we create some global-like scopes which additionally keep some heap objects alive (e.g. a byte buffer instance). This is the idiom used by MemorySegment::ofBuffer and SymbolLookup::loaderLookup.
We should always use global lookup for heap entities, and use segments to keep things reachable (as we do for arrays). This should make the javadoc clearer, and also remove "special" sessions from the user model.
In other circumstances, however, we create some global-like scopes which additionally keep some heap objects alive (e.g. a byte buffer instance). This is the idiom used by MemorySegment::ofBuffer and SymbolLookup::loaderLookup.
We should always use global lookup for heap entities, and use segments to keep things reachable (as we do for arrays). This should make the javadoc clearer, and also remove "special" sessions from the user model.
- links to
-
Review openjdk/jdk19/39