struct Luajit::LuaGC

Overview

Controls the Lua Garbage Collector

Defined in:

luajit/lua_gc.cr

Instance Method Summary

Instance Method Detail

def collect : Nil #

Performs a full garbage-collection cycle

Raises LuaError if operation fails


[View source]
def count : Int32 #

Returns the current amount of memory (in KBs) in use by Lua

Raises LuaError if operation fails


[View source]
def count_bytes : Int32 #

Returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024

Raises LuaError if operation fails


[View source]
def restart : Nil #

Restarts the garbage collector

Raises LuaError if operation fails


[View source]
def set_pause(data : Int32) : Int32 #

Sets data as the new value for the pause of the collector

Returns the previous value of the pause.

Raises LuaError if operation fails


[View source]
def set_step_multiplier(data : Int32) : Int32 #

Sets data as the new value for the step multiplier of the collector

Returns the previous value of the step multiplier.

Raises LuaError if operation fails


[View source]
def step(size : Int32) : Int32 #

Performs an incremental step of garbage collection

To control the step size, you must experimentally tune the value of size.

Returns 1 if the step finished a garbage-collection cycle.

Raises LuaError if operation fails


[View source]
def stop : Nil #

Stops the garbage collector

Raises LuaError if operation fails


[View source]