On 19.03.2017 23:02, Chase wrote:
I may have missed what I'm looking for in the documentation, please let me
know if I have.  If not I'd like to hear from someone familiar with the code
base on how difficult of an undertaking this might be for me to attempt to
add to the project.

The boxing of structs on thunk signatures is performed on purpose.
By the time the thunks were designed, there was no straightforward
way to mirror a managed struct declaration in C/C++ because of
unexpected alignment issues.

The canonical sample was

struct PointF {
        float x;
        float y;
}

whose fields got aligned at 8 bytes boundaries by Mono, while GCC
has aligned them at 4 bytes (i386 ABI).

Years later the alignment issue was removed, but the thunk APIs
remained unchanged for obvious reasons (compatibility).
This can be fixed, but it requires some decent knowledge
of Mono's runtime.

Another issue is returning structs from methods. This is usually
not compatible across CPUs and ABIs. Internal calls are avoiding
such signatures, and are returning values as an "out" argument
instead.

As there is no fix for this (AFAIK), thunks can't return unboxed
structs. mono_runtime_invoke doesn't either.

Robert


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.dot.net
http://lists.dot.net/mailman/listinfo/mono-devel-list

Reply via email to