[Mono-dev] Method for common marshaling between calls in/out of mono?
Jonathan Mitchell
lists at mugginsoft.com
Mon Mar 20 09:42:03 UTC 2017
> On 19 Mar 2017, at 22:34, Chase <kiro.roo at gmail.com> wrote:
>
> I apologize as I used the term marshaling incorrectly here. I used it as a
> term to describe the differences in how certain objects specifically structs
> are passed between the two methods. As for internal calls, you receive a
> pointer to memory of the struct, and thunks you pass a boxed mono object.
>
These API’s (not forgetting mono_runtime_invoke) do, as you say, use different calling conventions for their reference type arguments.
I don’t think that there is much to be done about this at the Mono run time level.
The thunking API is certainly simpler given that you just have to provide MonoObject *.
You could likely provide some helper functions that could query an exclusively MonoObject * argument list and unbox reference types on the fly.
> I've written a wrapper generator which aids in the process of binding the
> languages.
Which language are you calling into the embedded API from?
In my own case my wrappers are produced a code generator which understands how to generate argument lists both for property thunking and for method invocation using mono_runtime_invoke.
Jonathan
More information about the Mono-devel-list
mailing list