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

Explicitly specify that asSlice and reinterpret return a memory segment backed by the same region of memory.

XMLWordPrintable

        There has been some uncertainty among users about whether the behavior of MemorySegment::reinterpret performs allocation or not (such as here: https://stackoverflow.com/questions/78592574 but also elsewhere).

        It seems that, the javadoc of both the reinterpret and asSlice methods would benefit from static explicitly that: "the returned memory segment is backed by the same region of memory as this segment". Or something along those lines.

              pminborg Per-Ake Minborg
              jvernee Jorn Vernee
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: