Re: LuaJIT FFI: pointer<->lightuserdata ?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: LuaJIT FFI: pointer<->lightuserdata ?
- From: Mike Pall <mikelu-1102@...>
- Date: 2011年2月17日 00:10:50 +0100
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