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

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


> 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[]`).

Maurizio Cimadamore has refreshed the contents of this pull request, and previous commits have been removed. The
incremental views will show differences compared to the previous content of the PR. The pull request contains four new
commits since the last revision:

 - Remove extra white line
 - Tweak access of MemoryAccess constructor
 - Remove unused import
 - Fix javadoc issues

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

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/221/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/221/files/e37b15a0..c2bf804e

Webrevs:
 - full: https://webrevs.openjdk.java.net/panama-foreign/221/webrev.03
 - incr: https://webrevs.openjdk.java.net/panama-foreign/221/webrev.02-03

  Stats: 25 lines in 3 files changed: 0 ins; 1 del; 24 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/221.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/221/head:pull/221

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


More information about the panama-dev mailing list