[foreign-memaccess+abi] RFR: 8292034: Improve javadoc after memory segment/memory address unification [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Sep 22 10:11:33 UTC 2022


On Thu, 22 Sep 2022 08:00:36 GMT, Per Minborg <duke at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Replace "alignment constraints" with "alignment constraint", in accordance to what done in `MemorySegment` javadoc
>
> 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.
 ```

-------------

PR: https://git.openjdk.org/panama-foreign/pull/730


More information about the panama-dev mailing list