Commit 706e4cc
[Java.Interop] Make
The probing for `Java.Interop.Export.dll` performed within
`JniRuntime.SetMarshalMemberBuilder()` can be costly if the
`Java.Interop.Export.dll` assembly isn't present or cannot be found,
which is *always* the case (currently) in Xamarin.Android, adding --
depending on device and profiler in use -- ~100ms to app startup (!).
Add a new `JniRuntime.CreationOptions.UseMarshalMemberBuilder`
property which controls whether `Java.Interop.Export.dll` is loaded
*at all*. If true -- the default -- then `JniRuntime` *will* attempt
to load `Java.Interop.Export.dll`, allowing the
`JniRuntime.MarshalMemberBuilder` property to not throw a
`NotSupportedException`.
If `JniRuntime.CreationOptions.UseMarshalMemberBuilder` is false --
which will become the default in Xamarin.Android -- then
`JniRuntime.SetMarshalMemberBuilder()` will do nothing.Java.Interop.Export use optional (#401)1 parent 8337615 commit 706e4cc
File tree
1 file changed
+5
-0
lines changed- src/Java.Interop/Java.Interop
1 file changed
+5
-0
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
0 commit comments