You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(*) redefine callback functions to a style FFI will not overflow
Though in C function pointers are flexible, FFI seems to only accept
certain combination of usage:
```lua
-- as signature
void (*cb)(...);
-- when used
void consumer(cb c);
```
Some combination will result in FFI parser error, one will result in
FFI doing implict magic and result in overflow:
```lua
local ffi = require("ffi")
ffi.cdef[[
typedef int cb();
]]
for i=0, 60000 do
local pok, pp = pcall(ffi.cast, "cb*", function() end)
if not pok then
print(i, ", ", pp)
break
end
if pp then pp:free() end
end
```
0 commit comments