Integrated: 7903628: Replace ofAddress method in FI classes with a static invoke method
Jorn Vernee
jvernee at openjdk.org
Tue Jan 16 17:30:53 UTC 2024
On Tue, 16 Jan 2024 15:55:16 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> This patch replaces the factory method in the generated function pointer interfaces with a static invoke method. This avoids clients having to wrap a function pointer in an instance of the interface in order to invoke it, and instead allows invoking function pointers more directly. This aligns with the general jextract strategy of being 'all static' which avoids object allocation overheads.
>
> The new approach also simplifies the handling of function pointers that accept an allocator (because they return a struct by-value), as now we no longer how to infer the allocator, but the client can pass it explicitly when invoking the function pointer.
This pull request has now been integrated.
Changeset: 28b2a78d
Author: Jorn Vernee <jvernee at openjdk.org>
URL: https://git.openjdk.org/jextract/commit/28b2a78d6fadc0d6050fdf870854ed03b71f663f
Stats: 27 lines in 4 files changed: 2 ins; 4 del; 21 mod
7903628: Replace ofAddress method in FI classes with a static invoke method
Reviewed-by: mcimadamore
-------------
PR: https://git.openjdk.org/jextract/pull/180
More information about the jextract-dev
mailing list