[foreign-memaccess] [Rev 01] RFR: 8240874: Add finer-grained access control for memory segments

Jorn Vernee jvernee at openjdk.java.net
Thu Mar 12 16:31:27 UTC 2020


On Thu, 12 Mar 2020 15:54:40 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> This patch adds a finer-grained access control for memory segments; instead of the ad-hoc `MemorySegment::asReadOnly`,
>> we now support a more complete `MemorySegment::withAccessModes`, where access modes is an int mask.
>> Supported access modes are `READ`, `WRITE`, `CLOSE` and `ACQUIRE`, which gives much more freedom to clients when it
>> comes to create restricted views (I've added a new section on that in the MemorySegment toplevel javadoc).
>> I also did some minor changes, mostly to get rid of confinement restrictions where such restrictions were not needed
>> (e.g. `MemorySegment::asSlice`).
>
> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   * add hasAccessModes() predicate
>   * fix data provider

LGTM!

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

Marked as reviewed by jvernee (Committer).

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


More information about the panama-dev mailing list