out of the ground.
Date: Wed, 13 May 2015 18:05:06 +0200
From: mike-1505@xxxxxxxxxx
To: luajit@xxxxxxxxxxxxx
Subject: Re: funniness with pointers
William Adams wrote:
myobj.A = ffi.new("epoll_event")
You've probably gotten the declaration of epoll_event wrong. For
multi-arch compatibility, it's a packed structure on Linux/x64
(but not on other platforms!). Then it's 12 bytes long and not 16,
which matters most when you pass it to epoll().
ffi.cdef([[
struct epoll_event {
int32_t events;
epoll_data_t;
}]]..(ffi.arch == "x64" and [[__attribute__((__packed__));]] or [[;]]))
--Mike