JDK-8287788 : Implement a better allocator for downcalls
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.foreign
  • Affected Version: repo-panama
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2022-06-03
  • Updated: 2025-02-05
  • Resolved: 2025-01-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 b08Fixed
Related Reports
Causes :  
Cloners :  
Relates :  
Description
Downcalls might need to perform some allocation. Currently this is done by using a fixed-size native arena.

But, the call to allocate this arena is relatively expensive compared to the overhead of a call, and it requires tricky arena size computations due to the need to align allocations, which also restricts the order in which allocations can occur.

We could instead implement a thread-local 'stack' allocator, which works like a dynamic sized arena, but with reset functionality to reset the allocated size back to a certain level. The underlying memory could stay around between calls, which could improve performance.
Comments
Changeset: 8cc13045 Branch: master Author: Matthias Ernst <mernst-github@mernst.org> Committer: Jorn Vernee <jvernee@openjdk.org> Date: 2025-01-27 19:40:26 +0000 URL: https://git.openjdk.org/jdk/commit/8cc13045428eebb8933df865f9a87f0f91909ba5
27-01-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23142 Date: 2025-01-15 21:39:05 +0000
19-01-2025