lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>Okay, then the question is how does the Lua GC work? Ok, i'v heard it 
>isn't by refcount, but how does it keep track of used/unused objects. 

It's a simple mark-and-sweep: all objects are kept in linked lists;
starting from all places that can store a Lua object, mark those objects
that are reacheable; then traverse the linked lists, collecting all objects
that are still unmarked. Something like this..
--lhf