lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Speaking of the "small struct" rules, I'm running into an "NYI" issue with an API call that returns a 16-byte (two-pointer) struct.

Is there a workaround to let me receive a "struct { void *a; void *b; }" by value on my 64-bit Mac?

Thanks,
David


On Tue, Jan 25, 2011 at 12:40 AM, Enrico Colombini <erix@erix.it> wrote:
On 25/01/2011 0.47, Mike Pall wrote:
1. On x86, you can pass the components of the struct to simulate
pass-by-value, i.e.:

 ffi.C.objc_msgSend(r, s,   0, 0, 32, 32,   a, b)

This doesn't work on x64 because of the crazy rules for passing
structs by value in the x64 ABI.

Notes like this, and many others you posted here, will be invaluable in the documentation/FAQ.

(that's another way to say: we know you're overworked, but please try to collect them for inclusion in the docs, if you can)

--
 Enrico