HolyLib Wiki

luagc

luagc

This library adds a few functions for debugging the lua gc.

Recently Added

This was recently added in version (0.8 - DEV).

Methods

table luagc.GetAllGCObjects( any targetObject )
Returns a table containing all GCobjects.
The GClist always goes from newest to oldest GCobjects due to how the GCobjects are chained.
This function itself create a table which is why doing
luagc.GetAllGCObjects(luagc.GetCurrentGCHeadObject())
Will always have 1 object - which is the returned table.
You can do table.remove(gcList, 1) to remove the first entry to get rid of it.
table luagc.GetContainingReferences( any object, boolean recursive = false, table ignoreGCObjects = nil )
Returns all GCobjects that the given object stores.
Returns the current GCobject that's at the head of the list.
The head object is always the newest one.
Returns a nicely formatted table showing which fields store which GC references for the given object.
Fields are not consistent and can be nil always check if a field exists!
number luagc.GetGCCount( any targetObject )
Returns the total count of GC objects.
table luagc.GetReferences( any object )
Returns a table containing all GCObjects that have a reference stored to the given object.
number luagc.GetSizeOfGCObject( any object, boolean recursive = false, table ignoreGCObjects = nil )
Returns the memory size of the given object.