Lua 5.1 相当于 lua_setgcthreshold

Lua 5.1 equivalent of lua_setgcthreshold

将我的 lua 版本从 5.0 更新到 5.1 之后 我得到一个 lua_setgcthreshold was not declared in this scope

使用 lua 5.0 一切正常。

在 lua 5.0 lua_setgcthreshold 中声明如下:

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

但在 5.1 中,我找不到与之对应的版本。 谁能帮帮我?

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