On Thu, 26 Oct 2023 09:17:25 GMT, Per Minborg <pminb...@openjdk.org> wrote:
>> This PR proposes removing the restriction that only heap `MemorySegment` >> wrapping a `byte` array can be accessed by Vectors. Now any array type can >> be used provided the element alignment constraints are respected. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Allow unaligned array access Marked as reviewed by mcimadamore (Reviewer). On a second look, I agree with the comments. Logically, the vector API is accessing elements using `JAVA_XYZ_UNALIGNED` layouts, which should _always_ succeed. E.g. no alignment exception should ever be possible when doing unaligned access, regardless of whether the segment is on/off heap. ------------- PR Review: https://git.openjdk.org/jdk/pull/16360#pullrequestreview-1700040222 PR Comment: https://git.openjdk.org/jdk/pull/16360#issuecomment-1781433386