[Integrated] [foreign-memaccess] RFR: Move MemoryAddress::copy

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri May 15 15:30:27 UTC 2020


On Fri, 15 May 2020 13:45:26 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> As discussed, this patch moves `MemoryAddress::copy` as an *instance* method of `MemorySegment`, namely
> `MemorySegment::copyFrom`. I chose the `copyFrom` suggestion from John, since it allows us more freedom, in the future,
> to add overloads for different sources for the copy operation.
> I've rewrorked the documentation a bit to speak about segment offsets rather than addresses.
> 
> I believe all use cases touched by this change actually lead to simpler code, which is good.
> 
> I've also added a benchmark for some of the bulk operations such as fill and copyFrom - the numbers I've got look good:
> 
> Benchmark             Mode  Cnt       Score       Error  Units
> BulkOps.segment_copy  avgt   30  441675.750 ? 12794.881  ns/op
> BulkOps.segment_fill  avgt   30  122465.908 ?  1760.711  ns/op
> BulkOps.unsafe_copy   avgt   30  430153.694 ?  9055.253  ns/op
> BulkOps.unsafe_fill   avgt   30  120413.079 ?  3799.484  ns/op
> 
> Cheers

This pull request has now been integrated.

Changeset: 34873838
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.java.net/panama-foreign/commit/34873838
Stats:     170 lines in 8 files changed: 38 ins; 128 del; 4 mod

Move MemoryAddress::copy

Reviewed-by: chegar, jvernee

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

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


More information about the panama-dev mailing list