On Mon, 26 Feb 2024 15:10:55 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> re-widen test > > src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 328: > >> 326: * physical address 1010.</li> >> 327: * <li>The starting physical address of a {@code long[]} array will be >> 8-byte aligned >> 328: * (e.g. 1000), so that successive long elements occur at 8-byte >> aligned addresses > > I believe there might be other changes required. I see the following > sentences in the javadoc: > > > * In other words, heap segments feature a (platform-dependent) > <em>maximum</em> > * alignment which is derived from the size of the elements of the Java array > backing the > * segment, as shown in the following table: > ``` > > > * In such circumstances, clients have two options. They can use a heap > segment backed > * by a different array type (e.g. {@code long[]}), capable of supporting > greater maximum > * alignment. More specifically, the maximum alignment associated with {@code > long[]} is > * set to {@code ValueLayout.JAVA_LONG.byteAlignment()} which is a > platform-dependent > * value (set to {@code ValueLayout.ADDRESS.byteSize()}). That is, {@code > long[]}) is > * guaranteed to provide at least 8-byte alignment in 64-bit platforms, but > only 4-byte > * alignment in 32-bit platforms: > ``` > > ``` > * In practice, the Java runtime lays out arrays in memory so that each > n-byte element > * occurs at an n-byte aligned physical address (except for {@code long[]} and > * {@code double[]}, where alignment is platform-dependent, as explained > below). > ``` > Hi @mcimadamore, thanks for making a comment in an OpenJDK project! > > All comments and discussions in the OpenJDK Community must be made available > under the OpenJDK [Terms of Use](https://openjdk.java.net/legal/tou/). If you > already are an OpenJDK [Author](https://openjdk.java.net/bylaws#author), > [Committer](https://openjdk.java.net/bylaws#committer) or > [Reviewer](https://openjdk.java.net/bylaws#reviewer), please click > [here](https://bugs.openjdk.java.net/secure/CreateIssue.jspa?pid=11300&issuetype=1) > to open a new issue so that we can record that fact. Please Use "Add GitHub > user mcimadamore" for the summary. > > If you are not an OpenJDK Author, Committer or Reviewer, simply check the box > below to accept the OpenJDK Terms of Use for your comments. > > * [ ] I agree to the [OpenJDK Terms of > Use](https://openjdk.java.net/legal/tou/) for all comments I make in a > project in the [OpenJDK GitHub organization](https://github.com/openjdk). > > Your comment will be automatically restored once you have accepted the > OpenJDK [Terms of Use](https://openjdk.java.net/legal/tou/). It is strange to see this comment because @mcimadamore had already been a member in OpenJDK. The SKARA bot may meet a bug. CC'ing @erikj79 and @zhaosongzs . ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18007#discussion_r1506099034