On Wed, 22 Mar 2023 14:09:07 GMT, Per Minborg <pminb...@openjdk.org> wrote:
>> API changes for the FFM API (third preview) >> >> Specdiff: >> https://cr.openjdk.org/~pminborg/panama/21/v1/specdiff/overview-summary.html >> >> Javadoc: >> https://cr.openjdk.org/~pminborg/panama/21/v1/javadoc/java.base/module-summary.html > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Improve javadocs for Linker::captureStateLayout src/java.base/share/classes/java/lang/foreign/Linker.java line 628: > 626: * and possibly {@linkplain PaddingLayout padding layouts}. > 627: * As an example, on Windows, the returned layout might contain > three value layouts named: > 628: * <ul> Almost there - instead of listing the names, just put a code snippet with the struct layout! That will make it crystal clear. src/java.base/share/classes/java/lang/foreign/MemoryLayout.java line 697: > 695: */ > 696: static PaddingLayout paddingLayout(long bitSize) { > 697: if (bitSize <= 0) { While this does the right thing, I wonder if we can do better, as it seems we're checking size twice - perhaps we need to customize the `requireBitSizeValid` function? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13079#discussion_r1144915578 PR Review Comment: https://git.openjdk.org/jdk/pull/13079#discussion_r1144917200