Clarify lifecycle of buffer segments and loader lookup

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 20
    • Affects Version/s: 19
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: