<p>Hi Nicolas, Hi All,</p>
<p>this is an issue of funding the correct specification.  I fond this one:<br>
[http://people.freebsd.org/~obrien/amd64-elf-abi.pdf]<br>
and it states:</p>
<pre><code>The classification of aggregate (structures and arrays) and union types works as follows:
1. If the size of an object is larger than two eightbytes, or in C++, is a non- POD 10 structure or union type, or contains unaligned fields, it has class MEMORY.
</code></pre>
<p>This is far simpler than the alternatives.  So at least what we have may be correct on FreeBSD ;-)</p>
<p>Can someone find out what version of the standard is operative on linux and macOS?</p>
<p>The spec that splits struct fields across available registers is horribly complex but doable.  I did implement that spec for the VisualWorks FFI.  We're in a much better position than the VisualWorks FFI because Andreas designed and implemented signature type information correctly in his (our) FFI.  In his/our FFI, a function's type specification is associated with the function itself.  In VisualWorks, what is associated with a function is a very simplified reduction of types, and rich type information is only available attached to actual parameters, so pass in a C object with the wrong type information in VW and it will be marshaled incorrectly.</p>
<p>So while this is work to do, I'm sure we can do it quite straight-forwardly.  The key issue is to determine the right versions of ABI specification to use before we start implementation.  As I showed above I took the easy route; I found a version of the spec that had simple semantics and implemented it.  Mea culpa.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/443?email_source=notifications&email_token=AIJPEW3DM4OGMN2NFLSHPDTQT33P7A5CNFSM4JJ3EAU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEGQECA#issuecomment-554500616">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AIJPEWY5BGRISWQBA4FLCUDQT33P7ANCNFSM4JJ3EAUQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AIJPEW2QZNJUU2CEKN7USUDQT33P7A5CNFSM4JJ3EAU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEGQECA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/443?email_source=notifications\u0026email_token=AIJPEW3DM4OGMN2NFLSHPDTQT33P7A5CNFSM4JJ3EAU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEGQECA#issuecomment-554500616",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/443?email_source=notifications\u0026email_token=AIJPEW3DM4OGMN2NFLSHPDTQT33P7A5CNFSM4JJ3EAU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEGQECA#issuecomment-554500616",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>