changeset 57747:b4ccf83030cf

8237370: Javadoc of memory access API still refers to old MemoryAddress::offset method Reviewed-by: chegar
author mcimadamore
date Thu, 16 Jan 2020 17:25:04 +0000
parents 4a0a1b927608
children 5bc878966264
files src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java
diffstat 3 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java	Thu Jan 16 14:55:26 2020 +0000
+++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java	Thu Jan 16 17:25:04 2020 +0000
@@ -97,10 +97,10 @@
 
     /**
      * Perform bulk copy from source address to target address. More specifically, the bytes at addresses {@code src}
-     * through {@code src.offset(bytes - 1)} are copied into addresses {@code dst} through {@code dst.offset(bytes - 1)}.
+     * through {@code src.addOffset(bytes - 1)} are copied into addresses {@code dst} through {@code dst.addOffset(bytes - 1)}.
      * If the source and address ranges overlap, then the copying is performed as if the bytes at addresses {@code src}
-     * through {@code src.offset(bytes - 1)} were first copied into a temporary segment with size {@code bytes},
-     * and then the contents of the temporary segment were copied into the bytes at addresses {@code dst} through {@code dst.offset(bytes - 1)}.
+     * through {@code src.addOffset(bytes - 1)} were first copied into a temporary segment with size {@code bytes},
+     * and then the contents of the temporary segment were copied into the bytes at addresses {@code dst} through {@code dst.addOffset(bytes - 1)}.
      * @param src the source address.
      * @param dst the target address.
      * @param bytes the number of bytes to be copied.
--- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java	Thu Jan 16 14:55:26 2020 +0000
+++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java	Thu Jan 16 17:25:04 2020 +0000
@@ -110,7 +110,7 @@
  *
  * We can obtain the offset of the member layout named <code>value</code> from <code>seq</code>, as follows:
  * <blockquote><pre>{@code
-long valueOffset = seq.offset(PathElement.sequenceElement(), PathElement.groupElement("value"));
+long valueOffset = seq.addOffset(PathElement.sequenceElement(), PathElement.groupElement("value"));
  * }</pre></blockquote>
  *
  * Similarly, we can select the member layout named {@code value}, as follows:
--- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java	Thu Jan 16 14:55:26 2020 +0000
+++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java	Thu Jan 16 17:25:04 2020 +0000
@@ -33,7 +33,7 @@
 try (MemorySegment segment = MemorySegment.allocateNative(10 * 4)) {
    MemoryAddress base = segment.baseAddress();
    for (long i = 0 ; i < 10 ; i++) {
-     intHandle.set(base.offset(i * 4), (int)i);
+     intHandle.set(base.addOffset(i * 4), (int)i);
    }
  }
  * }</pre>