ResourceScope handles should keep parent scope reachable

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • None
    • Affects Version/s: repo-panama
    • Component/s: tools

      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.

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

              Created:
              Updated:
              Resolved: