Repository navigation
[monodroid] MonoVM initialization without pointer parsing - #5935
Merged
Merged
Conversation
Context: 0cd890b 0cd890b added code to initialize NET6 MonoVM using its new `monovm_initialize` API which accepts a number of key-value string properties, parsed by the runtime in order to configure various areas of the VM. One of these properties is `PINVOKE_OVERRIDE`, a new way to resolve p/invoke calls which, at the time of 0cd890b, required converting pointer to a callback function to a string, which would then be parsed by `monovm_initialize` back into a pointer. This commit removes the need for parsing by using new MonoVM initialization function, `monovm_initialize_preparsed`, which takes a typesafe struct of runtime initialization arguments, including a "real" pointer to the `PINVOKE_OVERRIDE` callback function. The new initialization routine still accepts the key-value properties but, at this point, we pass no additional properties using this mechanism (the class that handles them is kept around since it is possible we'll use it once `runtimeconfig.json` support lands)
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.
Context: 0cd890b
0cd890b added code to initialize NET6 MonoVM using its new
monovm_initializeAPI which accepts a number of key-value stringproperties, parsed by the runtime in order to configure various areas of
the VM. One of these properties is
PINVOKE_OVERRIDE, a new way toresolve p/invoke calls which, at the time of 0cd890b, required
converting pointer to a callback function to a string, which would then
be parsed by
monovm_initializeback into a pointer.This commit removes the need for parsing by using new MonoVM
initialization function,
monovm_initialize_preparsed, which takes atypesafe struct of runtime initialization arguments, including a "real"
pointer to the
PINVOKE_OVERRIDEcallback function.The new initialization routine still accepts the key-value properties
but, at this point, we pass no additional properties using this
mechanism (the class that handles them is kept around since it is
possible we'll use it once
runtimeconfig.jsonsupport lands)