On Mon, 19 May 2025 18:30:45 GMT, ExE Boss <d...@openjdk.org> wrote: >> Kim Barrett has updated the pull request incrementally with one additional >> commit since the last revision: >> >> move jdk.internal.nio.Cleaner to sun.nio > > src/java.base/share/classes/java/nio/Bits.java line 145: > >> 143: // Increment with overflow to 0, so the value >> can >> 144: // never equal the initial/reset cleanedEpoch >> value. >> 145: RESERVE_GC_EPOCH = Integer.max(0, >> RESERVE_GC_EPOCH + 1); > > Could also do the following which avoids the branch in `Integer.max`: > Suggestion: > > RESERVE_GC_EPOCH = (RESERVE_GC_EPOCH + 1) & > Integer.MAX_VALUE;
I think the use of `Integer.max` is clearer, any performance difference is insignificant, and the compiler can make that change as an optimization if appropriate. So I'm not inclined to accept this suggestion. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25289#discussion_r2096422654