Tao.Lua SDK Documentation

Lua.lua_gc Method 

Controls the garbage collector.

[Visual Basic]
Public Shared Function lua_gc( _
   ByVal L As IntPtr, _
   ByVal what As Integer, _
   ByVal data As Integer _
) As Integer
[C#]
public static int lua_gc(
   IntPtr L,
   int what,
   int data
);

Parameters

L
what
data

Return Value

Remarks

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. The step "size" is controlled by data (larger values mean more steps) in a non-specified way. If you want to control the step size you must experimentally tune the value of data. The function returns 1 if the step finished a garbage-collection cycle. LUA_GCSETPAUSE: sets data/100 as the new value for the pause of the collector (see §2.10). The function returns the previous value of the pause. LUA_GCSETSTEPMUL: sets arg/100 as the new value for the step multiplier of the collector (see §2.10). The function returns the previous value of the step multiplier.

See Also

Lua Class | Tao.Lua Namespace