Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8288697

Clarify lifecycle of buffer segments and loader lookup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 20
    • 19
    • core-libs

      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.

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: