lua_setgcthreshold的Lua 5.1等效函数

在将我的lua版本从5.0更新到5.1后,我遇到了lua_setgcthreshold未在此范围内声明的问题。 所有5.0的工作都很好。

在lua 5.0中,lua_setgcthreshold声明如下:

LUA_API void  lua_setgcthreshold (lua_State *L, int newthreshold);

但是在5.1中,我找不到相应的替代品。 有人能帮助我吗?

点赞
用户3979429
用户3979429

根据你的情况,Lua 函数collectgarbage可能会对你有用。详情请见:http://luatut.com/collectgarbage.html

2015-10-29 23:33:41