[foreign-memaccess] Integrated: 8248487: Add static helpers to access segments

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Jul 1 15:37:38 UTC 2020


On Mon, 29 Jun 2020 16:40:19 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This patch addresses some usability issues in the foreign memory API. First, it adds several static accessors for all
> carrier types in MemoryLayouts (I'm thorn whether to add this in MemoryLayouts or MemoryHandles, suggestions welcome).
> These accessors provide an access API that is similar to unsafe - all accessors expect a base address plus a byte
> offset. In most cases the accessors can be used and direct VH usage can be dropped, which might make approaching this
> API a bit easier.  Secondly, I've added a bunch of helpers to map a segment into _any_ array (as opposed to just
> `byte[]`). This makes the API more symmetric, given that, after all we _were_ able to create a segment from _any_ array
> (not just `byte[]`).

This pull request has now been integrated.

Changeset: 56d796fc
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.java.net/panama-foreign/commit/56d796fc
Stats:     999 lines in 9 files changed: 9 ins; 935 del; 55 mod

8248487: Add static helpers to access segments

Reviewed-by: sundar, jvernee, chegar, henryjen

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

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


More information about the panama-dev mailing list