You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commit db84cc3 noted that the sample failed to run because
NativeAOT didn't know how to produce the required "stubs" to allow
a `System.Delegate` field to be marshaled.
Commit a32e244 was an attempt to "fix" this by introducing a
`JniBlittableNativeMethodRegistration` and using C#9 function pointers
to register `ManagedPeer` marshal methods instead of delegates.
While this works, this is an extensive change, and leaves various
"corner cases" in how things fit together, such as the
`JniNativeMethodRegistrationArguments` struct used as part of
`jnimarshalmethod-gen`-based method registration.
@lambdageek found an easier solution: place
`[UnmanagedFunctionPointer]` onto the delegate declaration. This
appears to tell NativeAOT to generate the required stubs, with
significantly fewer changes. This also could fit nicely into a future
`generator` change to place `[UnmanagedFunctionPointer]` on all the
`_JniMarshal_*` declarations (56955d9).
0 commit comments