On Wed, 22 Mar 2023 15:57:16 GMT, Per Minborg <[email protected]> wrote:
>> 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?
>
> I tried that but it turned out it can be zero in other contexts. Maybe we
> should add back the good 'ole "allowZero" flag?
yeah , a boolean seems good enough
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13079#discussion_r1145136161