LuaNET, the lua 5.1 api documentation!

Lua-Api

Core

[LUA 5.1] collectgarbage

function collectgarbage ( opt, arg )
This function is a generic interface to the garbage collector.
It performs different functions according to its first argument, opt:

  • "stop":
    stops the garbage collector.
  • "restart":
    restarts the garbage collector.
  • "collect":
    performs a full garbage-collection cycle.
  • "count":
    returns the total memory in use by Lua (in Kbytes).
  • "step":
    performs a garbage-collection step.
    The step "size" is controlled by arg
    (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 arg.
    Returns true if the step finished a collection cycle.
  • "setpause":
    sets arg/100 as the new value for the pause of
    the collector.
  • "setstepmul":
    sets arg/100 as the new value for the step multiplier of
    the collector.

Comments

© 2007 DracoBlue :: Valid XHTML, CSS, RSS Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC | SourceNet © 2007, DracoBlue :: Page created in 0.374 seconds with 21 queries.