RFR: 8347408: Create an internal method handle adapter for system calls with errno [v9]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu May 8 09:23:53 UTC 2025


On Thu, 8 May 2025 09:21:35 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> As we advance, converting older JDK code to use the relatively new FFM API requires system calls that can provide `errno` and the likes to explicitly allocate a MemorySegment to capture potential error states. This can lead to negative performance implications if not designed carefully and also introduces unnecessary code complexity.
>> 
>> Hence, this PR proposes adding a JDK internal method handle adapter that can be used to handle system calls with `errno`, `GetLastError`, and `WSAGetLastError`.
>> 
>> It relies on an efficient carrier-thread-local cache of memory regions to allide allocations.
>
> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address comments

src/java.desktop/share/classes/javax/swing/plaf/nimbus/skin.laf line 15520:

> 15518:                </regions>
> 15519:             </uiComponent>
> 15520:             <uiIconRegion name="ErrorIcon" subregion="true" key="errorIcon" segmentExtractorKey="OptionPane.errorIcon">

Spurious commit?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25043#discussion_r2079264611


More information about the core-libs-dev mailing list