Withdrawn: 7903947: Access to function pointers in structs could be streamlined
duke
duke at openjdk.org
Tue Nov 4 21:00:33 UTC 2025
On Wed, 23 Jul 2025 12:37:47 GMT, Nizar Benalla <nbenalla at openjdk.org> wrote:
> Please review this patch to add a new option where you can generate an direct invoker methods. This feature is intended to be used on structs that are just a collection of functions we had like to call.
>
> If this feature is used, we remove the getter to avoid name collisions as we assume this is similar to an interface.
>
> Changes to `GUIDE.md` have been intentionally left out from this initial patch to make reviews easier.
>
>
> struct Foo {
> struct Bar (*a)(void);
> struct Bar (*b)(int);
> };
>
>
> Before
>
>
> var foo = alloc_callback_h.foo();
>
> var barA = Foo.a.invoke(Foo.a(foo), arena);
> var barB = Foo.b.invoke(Foo.b(foo), arena, 100);
>
>
> After
>
>
> var foo = alloc_callback_h.foo();
>
> var barA = Foo.a(foo, arena);
> var barB = Foo.b(foo, arena, 100);
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.org/jextract/pull/287
More information about the jextract-dev
mailing list