[foreign-memaccess] RFR: JDK-8252757: Add support for shared segments (followup)
Jorn Vernee
jvernee at openjdk.java.net
Thu Sep 10 14:51:39 UTC 2020
On Thu, 10 Sep 2020 14:42:50 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> I realized there's a small issue in the API code for shared segment support: the liveness test is always performed
> inside MemoryScope (e.g. on share(), confineTo() and close()). While this is ok, there is an usability issue, in that
> the `checkValidState` method inside MemoryScope throws raw scoped exceptions (as this routine is really meant only to
> be used during memory access). A better solution is to move the liveness check outside the scope implementation for
> these operations, and do the check in AbstractMemorySegment, which correctly wraps the exception. I've added a
> comprehensive test which checks that no raw exceptions are leaked from the segment API.
Marked as reviewed by jvernee (Committer).
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/318
More information about the panama-dev
mailing list