[foreign-jextract] RFR: 8263018: Improve API for lifecycle of native resources [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Mar 24 14:38:48 UTC 2021


On Wed, 24 Mar 2021 14:31:36 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> I see what you mean.
>
> Actually, I think the code is correct, as the generated "main" method will either have no allocator argument (in case return is not a struct) or will have allocator parameter (in case return is struct). The issue with the code is that, when no  allocator argument is present, we should pass DEFAULT_ALLOCATOR to the underlying MH.

Scratch that - we don't need a new allocator parameter when struct is not returned as the underlying MH doesn't take an allocator.

I think the code is fine as is.

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

PR: https://git.openjdk.java.net/panama-foreign/pull/474


More information about the panama-dev mailing list