Skip to content
kamih edited this page Jul 14, 2012 · 1 revision

Lua uses a garbage collector to free objects that are no longer referenced. By default, this collector is run internally whenever Lua decides to.

If you wish to disable it, you can call LuaState::disableGarbageCollector. If you wish to call it manually, you can call LuaState::collectGarbage. If you wish to re-enable it, you can call LuaState::enableGarbageCollector.

In VoidStorm, I have it disabled, and call it manually at the end of each frame, so that I can profile it.

Clone this wiki locally