On Thu, 16 Nov 2023 19:15:25 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
>> But... surely if I'm just accessing bytes the access cannot possibly be >> mis-aligned? > > Right. I think there is a difference between 'unaligned' and 'misaligned'. > Unaligned means there is no effort made to align the access (so it _may_ be > misaligned). Misaligned means _definitely not_ aligned. At least, that is my > interpretation. > > This is what I wrote in the latest version: > > > * For heap byte buffers, access is always unaligned. As a result, only > the plain > * {@linkplain VarHandle.AccessMode#GET get} > * and {@linkplain VarHandle.AccessMode#SET set} access modes are > supported by the > * returned var handle. For all other access modes, an {@link > IllegalStateException} > * will be thrown. Uhm, I think my assumption was wrong - the `byte`/`boolean` carrier is not supported by this method, so there's no case where heap access would be guaranteed to be aligned. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16681#discussion_r1396221179