[foreign-preview] RFR: 8281334: MemorySegment.ofBuffer does not keep byte buffer alive

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon Feb 7 13:14:54 UTC 2022


This patch tweaks AbstractMemorySegmentImpl::ofBuffer to create an heap scope which keeps the input ByteBuffer alive, in case the returned segment has to be associated with a global scope.

-------------

Commit messages:
 - Remove unused import in test
 - Initial push

Changes: https://git.openjdk.java.net/panama-foreign/pull/639/files
 Webrev: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=639&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8281334
  Stats: 25 lines in 2 files changed: 24 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/639.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/639/head:pull/639

PR: https://git.openjdk.java.net/panama-foreign/pull/639


More information about the panama-dev mailing list