RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v8]
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed Mar 22 16:53:45 UTC 2023
On Wed, 22 Mar 2023 15:57:16 GMT, Per Minborg <pminborg at openjdk.org> 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
More information about the nio-dev
mailing list