lua_gc
[-0, +0, m]
int lua_gc (lua_State *L, int what, int data);
Controls the garbage collector.
This function performs several tasks, according to the value of the parameter what
:
-
LUA_GCSTOP
: stops the garbage collector. -
LUA_GCRESTART
: restarts the garbage collector. -
LUA_GCCOLLECT
: performs a full garbage-collection cycle. -
LUA_GCCOUNT
: returns the current amount of memory (in Kbytes) in use by Lua. -
LUA_GCCOUNTB
: returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024. -
LUA_GCSTEP
: performs an incremental step of garbage collection. -
LUA_GCSETPAUSE
: setsdata
as the new value for the pause of the collector (see §2.5) and returns the previous value of the pause. -
LUA_GCSETSTEPMUL
: setsdata
as the new value for the step multiplier of the collector (see §2.5) and returns the previous value of the step multiplier. -
LUA_GCISRUNNING
: returns a boolean that tells whether the collector is running (i.e., not stopped).
For more details about these options, see collectgarbage
.
Please login to continue.