RFR: 8334137: Marlin: replace sun.misc.Unsafe memory access methods with FFM [v7]

Kevin Rushforth kcr at openjdk.org
Wed Jun 11 15:20:40 UTC 2025


On Wed, 11 Jun 2025 14:24:50 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Kevin Rushforth has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Initialize alpha maps in constructor to ensure they are created on the right thread (QuantumRenderer)
>
> modules/javafx.graphics/src/main/java/com/sun/marlin/MaskMarlinAlphaConsumer.java line 111:
> 
>> 109:         byte[] _ALPHA_MAP = buildAlphaMap(MarlinConst.MAX_AA_ALPHA);
>> 110:         ALPHA_MAP = _ALPHA_MAP; // Keep alive the OffHeapArray
>> 111:         ALPHA_MAP_OFF_HEAP = new OffHeapArray(ALPHA_MAP, ALPHA_MAP.length); // 1K
> 
> L110: is `ALPHA_MAP` needed to keep the `parent` reference in `OffHeapArray`?  if so, why not use a single `Object` instead of an array?

It's actually unused (in practice), but I didn't want to change the logic any more than I had to. It doesn't matter enough to care about, so I didn't want to think about whether the reference could be eliminated.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1814#discussion_r2140469377


More information about the openjfx-dev mailing list