lua-users home
lua-l archive

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


Javier Guerra Giraldez wrote:
> under FFI, casting to a number solves the keyability part, but then
> the point is: can it be cast back to the same pointer? or should i
> keep the boxed pointer?

Both work, but I would just re-cast it back when needed.

Pointer boxing overhead can usually be eliminated. It's always
eliminated if you do it in a single expression together with the
C function call: somecfunc(ffi.cast("void *", addr), ...)

--Mike