[foreign] rethinking Panama annotations

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Nov 26 18:50:17 UTC 2018


On 26/11/2018 18:42, Jorn Vernee wrote:
> This seems fine to me, after all Callbacks are a carrier for function 
> pointers, so @NativeCallback declaring the layout of a function 
> pointer seems to make sense from a user perspective as well. 

Btw, this also closes a small hole in the LayoutType.ofFunction factiry, 
currently declared as follows:

<Z> LayoutType<Callback<Z>> ofFunction(Address layout, Class<Z> funcIntf)

Since the @NativeCallback annotation did not contain info about the 
address layout, this info had to be supplied by the client. In the new 
proposed format, all the info is contained in the annotation, meaning 
that we can drop the first argument safely, and make the API tighter 
(and more similar to structs).

Maurizio




More information about the panama-dev mailing list