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

Add explanation around MemorySegment:reinterpret regarding arenas

XMLWordPrintable

      If the arena is re-assigned by `MemorySegment::reinterpret`, the reinterpreted segment is not tied explicitly to the new arena. Instead, the old arena will free the segment upon being closed. This might cause use-after-free problems if a segment is re-assigned from an Arena other than Global (which is never closed).

      We should add verbiage to clarify how this works in the JavaDocs

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

              Created:
              Updated:
              Resolved: