我的代码中涉及到皮秒(数字大于10^12)。
将数据传递给Lua的C代码(atime和eventid均为size_t类型)。
lua_getglobal ( luactx, "timer_callback" );
lua_pushunsigned ( luactx, atime );
lua_pushunsigned ( luactx, eventid );
lua_pcall ( luactx, 2, 0, 0 );
Lua函数
function timer_callback(time, eventid)
if eventid == TX_CLOCK then
out_log(tostring(time)) --result is random garbage
set_callback(time + 1000000000000, TX_CLOCK)
return
end
end
我尝试过使用lua_pushnumber,但在lua中结果为负数。
lua_Integer
,默认为64位。 - indiv