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

ResourceScope handles should keep parent scope reachable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • None
    • repo-panama
    • tools

    Description

      When working with "untrusted" segments, the user might want to do this:

      ```
      try (var handle = segment.scope().acquire()) {
         // operate on segment safely
      } // ok now segment can be closed
      ```
      While this works to protect against deterministic deallocation, it fails to protect against implicit deallocation. So, if the segment becomes unreachable inside the TWR, its scope could still be closed (which might cause issue if e.g. the user has taken a long address out of the segment and operating on it).

      For these reasons, it would be preferrable if a scope handle would also help in keeping the scope reachable.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: