Skip to content
Permalink
Browse files

8237370: Javadoc of memory access API still refers to old MemoryAddre…

…ss::offset method

Reviewed-by: chegar
  • Loading branch information
mcimadamore committed Jan 16, 2020
1 parent af5ff9a commit 96f5699e926afab5236b9a8df130e22442727742
@@ -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.
@@ -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:
@@ -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>

0 comments on commit 96f5699

Please sign in to comment.