This repository was archived by the owner on Aug 27, 2026. It is now read-only.
Repository navigation
[Java.Interop] Make Java.Interop.Export use optional - #401
Merged
grendello merged 1 commit intoDec 7, 2018
Merged
Conversation
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.
jonpryor
force-pushed
the
jonp-optional-MarshalMemberBuilder
branch
from
December 7, 2018 02:31
a8e2541 to
1de36bc
Compare
grendello
approved these changes
Dec 7, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The probing for
Java.Interop.Export.dllperformed withinJniRuntime.SetMarshalMemberBuilder()can be costly if theJava.Interop.Export.dllassembly 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.UseMarshalMemberBuilderproperty which controls whether
Java.Interop.Export.dllis loadedat all. If true -- the default -- then
JniRuntimewill attemptto load
Java.Interop.Export.dll, allowing theJniRuntime.MarshalMemberBuilderproperty to not throw aNotSupportedException.If
JniRuntime.CreationOptions.UseMarshalMemberBuilderis false --which will become the default in Xamarin.Android -- then
JniRuntime.SetMarshalMemberBuilder()will do nothing.