[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] passing struct by value does not respect x86_64 SysV ABI (#443)

balazskosi notifications at github.com
Fri Nov 8 10:44:16 UTC 2019


I've heard that Lua's FFI is wonderful. Maybe we should take a look how did they tackle this problem. 

After some quick digging around, here is the code setting up the arguments:
https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/lj_ccall.c#L917

Here are the x64 specific defines used by the setting up code:
https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/lj_ccall.c#L132

They definitely have all the type information. They get it from parsing the C declarations.

Here is an example of the declaration part:
https://github.com/luapower/chipmunk/blob/master/chipmunk_h.lua
And the usage:
https://github.com/luapower/chipmunk/blob/master/chipmunk_demo.lua

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/443#issuecomment-551559042
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20191108/3d2052f3/attachment.html>


More information about the Vm-dev mailing list