Cosmin Apreutesei wrote: > Eg. say I write the above as simply: > > ffi.C.some_api(ffi.cast('mystruct*', ffi.new('mystruct', initial_data)) > > Does Lua guarantee to keep mystruct alive until some_api() returns or No. > is just the argument (i.e. the mystruct pointer) guaranteed to stay? Yes. --Mike