[foreign-memaccess] Integrated: JDK-8252757: Add support for shared segments (followup)

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Sep 10 14:54:31 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.

This pull request has now been integrated.

Changeset: 266fe530
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.java.net/panama-foreign/commit/266fe530
Stats:     26 lines in 3 files changed: 7 ins; 19 del; 0 mod

8252757: Add support for shared segments (followup)

Reviewed-by: jvernee

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

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


More information about the panama-dev mailing list