RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v16]

Jorn Vernee jvernee at openjdk.org
Wed Mar 15 17:27:32 UTC 2023


On Tue, 14 Mar 2023 22:52:44 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

> Btw. the new cases in which we use int and short accesses when byteWidth is not a power of 2 are never unaligned AFAICS. I guess _UNALIGNED is unnecessary in the JAVA_INT_UNALIGNED and JAVA_SHORT_UNALIGNED. They are always aligned wrt. to their size.

They are not necessarily aligned, for instance of the struct we are given is not aligned itself (at least in the reading case). Though we currently reject that case in AbstractLinker, it is something we might want to allow, and we have been looking at that as of late, for instance to pass packed structs to native code.

FWIW, using the unaligned variant effectively just turns off the alignment checks we do. So we have less safety, in theory. There should be no performance difference though just from using the _UNALIGNED layout.

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

PR: https://git.openjdk.org/jdk/pull/12708


More information about the core-libs-dev mailing list