On Mon, 5 May 2025 16:53:58 GMT, Per Minborg <pminb...@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. This pull request has now been integrated. Changeset: 45cf32bd Author: Per Minborg <pminb...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/45cf32bd2c9e44e2fcbb4b8d0714b87e078cdb7c Stats: 650 lines in 4 files changed: 649 ins; 0 del; 1 mod 8347408: Create an internal method handle adapter for system calls with errno Reviewed-by: mcimadamore ------------- PR: https://git.openjdk.org/jdk/pull/25043