Perform Lua Garbage Collection
res = tools.gc( [what], [data]) )
Calls the Lua garbage collector.
Parameter | Type | Description |
---|---|---|
what |
integer | What to collect. Default = LUA_GCOLLECT |
data |
integer | Control information |
Returns | Type | Description |
---|---|---|
res |
integer | Result of lua_gc |
See lua_gc
in Lua 5.1 manual. Lua 5.1 Reference Manual
e.g.
tools.gc() -- full collect
what value |
Lua Define |
---|---|
0 | LUA_GCSTOP |
1 | LUA_GCRESTART |
2 | LUA_GCCOLLECT |
3 | LUA_GCCOUNT |
4 | LUA_GCCOUNTB |
5 | LUA_GCSTEP |
6 | LUA_GCSETPAUSE |
7 | LUA_GCSETSTEPMUL |
8 | LUA_GCSETMEMLIMIT |
9 | LUA_GCGETMEMLIMIT |