【发布时间】:2015-10-30 07:33:41
【问题描述】:
在将我的 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 5.1 手册的 Garbage Collection 部分,并为 5.1 gc 选择新的值,因为它已更改。
-
Aniway 感谢 cmets。我会检查 lua_gb 文档。
-
@Ramy - Lua 5.1 GC 的默认设置足够好。只有嵌入式系统可能需要 GC 调整。