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

Clarify lifecycle of buffer segments and loader lookup

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: