Skip to content

[monodroid] MonoVM initialization without pointer parsing - #5935

Merged
jonpryor merged 1 commit into
dotnet:mainfrom
grendello:net6-new-init
May 18, 2021
Merged

jonpryor merged 1 commit into
dotnet:mainfrom
grendello:net6-new-init

Conversation

@grendello

Copy link
Copy Markdown
Contributor

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)

@grendello
grendello requested a review from jonpryor as a code owner May 18, 2021 08:23
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)
@jonpryor
jonpryor merged commit cf84e1b into dotnet:main May 18, 2021
@grendello
grendello deleted the net6-new-init branch May 18, 2021 20:03
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants