RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Apr 15 13:12:44 UTC 2024


On Mon, 15 Apr 2024 13:05:01 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 615:
>> 
>>> 613:      * the requested byte alignment during native segment allocation)}
>>> 614:      * <p>
>>> 615:      * The returned alignment is always an even power of two and is derived from:
>> 
>> Not sure about the "even". Surely 2^3 is a valid max alignment?
>
> The meaning of "even" here is that it is a number 2^n, n >= 0, n ∈ Z. But maybe "a power of two" is enough.

power of two implies even, so I'd say it's better to omit

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18779#discussion_r1565769068


More information about the core-libs-dev mailing list