【问题标题】:Lua 5.1 equivalent of lua_setgcthresholdLua 5.1 相当于 lua_setgcthreshold
【发布时间】: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 调整。

标签: lua garbage-collection


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2010-12-23
    • 2014-03-06
    • 2016-06-23
    • 2021-12-31
    • 2021-07-29
    • 2020-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多