[foreign-memaccess+abi] RFR: 8292034: Improve javadoc after memory segment/memory address unification [v2]
Maurizio Cimadamore
mcimadamore at openjdk.org
Mon Sep 26 13:51:38 UTC 2022
On Thu, 22 Sep 2022 10:07:47 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 224:
>>
>>> 222: * For example:
>>> 223: * <ul>
>>> 224: * <li>A native segment at address 1000 can be accessed at offsets 0, 8, 16, 24, etc under an 8-byte alignment constraint,
>>
>> Here, we have to be more specific about the alignment of the segment address and the alignment of the layout otherwise there might be confusion.
>
> I think this includes all the information? E.g. address 1000 is a number, which is can be divided by 2/4/8. In a paragraph above we explain that:
>
>
> For example, the address 1000 is aligned according to an 8-byte alignment constraint (because 1000 is an integer multiple of 8), and to a 4-byte alignment constraint, and to a 2-byte alignment constraint; in contrast, the address 1004 is aligned according to a 4-byte alignment constraint, and to a 2-byte alignment constraint, but not to an 8-byte alignment constraint.
> ```
I've decided to leave this as is for the time being.
-------------
PR: https://git.openjdk.org/panama-foreign/pull/730
More information about the panama-dev
mailing list