RFR: 8344882: (bf) Temporary direct buffers should not count against the upper limit on direct buffer memory

Chen Liang liach at openjdk.org
Sat Nov 23 14:35:14 UTC 2024


On Sat, 23 Nov 2024 01:09:30 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template line 77:
>> 
>>> 75:     static final boolean UNALIGNED = Bits.unaligned();
>>> 76: 
>>> 77:     private @Stable boolean temporary; // defaults to false
>> 
>> Any reason this is `@Stable` instead of `final`?
>
> I think it avoids setting it to `false` when it is not `true`.

A stable means a false value cannot be constant-folded, but since java.nio is not trusted by ciField.cpp, using final is actually worse than a stable :(

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22339#discussion_r1855203993


More information about the core-libs-dev mailing list