Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
8237370: Javadoc of memory access API still refers to old MemoryAddre…
…ss::offset method
Reviewed-by: chegar
- Loading branch information
|
@@ -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> |
|
|