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

LibraryLookup javadoc should be clearer about how to create restricted segments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • None
    • repo-panama
    • tools

      The javadoc of LibraryLookup goes to some lengths to explain how method handles created by linkers keep the lookup alive (so that the library cannot be unloaded).

      There's however no discussion on how a client is supposed to create a memory segment out of a lookup symbol (e.g. for global variables). Given that keeping the lookup alive is important (otherwise dereferencing the global variable might fail in unexpected ways), the javadoc should recommend that restricted segments should always be created with the lookup symbol as an attachment.

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

              Created:
              Updated:
              Resolved: