RFR: 7903597: Slim down RuntimeHelper

Jorn Vernee jvernee at openjdk.org
Mon Dec 4 14:32:21 UTC 2023


On Fri, 1 Dec 2023 16:58:12 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> Remove some of the helper methods in RuntimeHelper. They can be moved inline in the generated code.
> 
> Also: I've elected to move the `System.load(Library)` directives we generated inside RuntimeHelper into the first header class, in order to have it more localized to the actual code that a user sees. That also makes RuntimeHelper more 'dumb'. Only the package declaration is now injected into the template, which makes it easier for users to combined multiple extraction runs (they can just discard one of the generated RuntimeHelpers).

I've uploaded another version that removes RuntimeHelper completely, and instead generates the helper methods at the end of the first header class file we generate. Other classes (headers and FI classes) reference the helper methods in the first header: https://github.com/openjdk/jextract/pull/150/commits/3545fc7ee9ea7e7127a3c5e4835c1f56aac73716

I've also added back `downcallHandleVariadic` as suggested.

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

PR Comment: https://git.openjdk.org/jextract/pull/150#issuecomment-1838753047


More information about the jextract-dev mailing list