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

Jorn Vernee jvernee at openjdk.org
Mon Apr 15 17:02:46 UTC 2024


On Mon, 15 Apr 2024 14:21:23 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> This PR proposes to add a new method `MemorySegment::maxByteAlignment` that returns the maximum byte alignment of a segment (both heap and native segments).
>> 
>> Clients can then use this method to determine if a segment is properly aligned for any given layout (e.g. following a `MemorySegment::reinterpret` operation).
>
> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision:
> 
>  - Update after comments
>  - Merge branch 'master' into ms-reinterpret2
>  - Update src/java.base/share/classes/jdk/internal/foreign/HeapMemorySegmentImpl.java
>    
>    Co-authored-by: Jorn Vernee <JornVernee at users.noreply.github.com>
>  - Update src/java.base/share/classes/jdk/internal/foreign/NativeMemorySegmentImpl.java
>    
>    Co-authored-by: Jorn Vernee <JornVernee at users.noreply.github.com>
>  - Update src/java.base/share/classes/java/lang/foreign/MemorySegment.java
>    
>    Co-authored-by: Maurizio Cimadamore <54672762+mcimadamore at users.noreply.github.com>
>  - Fix imports and copyright
>  - Update maxByteAlignment docs
>  - Improve doc and tests
>  - Add a MS::maxByteAlignment method

Marked as reviewed by jvernee (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/18779#pullrequestreview-2001722291


More information about the core-libs-dev mailing list