RFR: 8337237: Use FFM instead of Unsafe for Java 2D RenderBuffer class [v2]

Phil Race prr at openjdk.org
Fri Jul 26 22:59:27 UTC 2024


On Thu, 25 Jul 2024 23:57:35 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> src/java.desktop/share/classes/sun/java2d/pipe/RenderBuffer.java line 73:
>> 
>>> 71:     private final long baseAddress;
>>> 72:     private long curOffset;
>>> 73:     private final int capacity;
>> 
>> You could perhaps drop the `capacity` field, and use `segment.byteSize()` in it's place.
>
> P.S. same for `baseAddress` I think. Looks like it's only used in `getAddress` now. Could replace with `segment.address()`.

I guess .. they were finals so I expect this was considered optimal but it seems unlikely to matter.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20339#discussion_r1693438358


More information about the client-libs-dev mailing list