[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: About coroutines and light threads
- From: "Sebby " <beast@...>
- Date: Wed, 25 Oct 2000 01:20:24 -0000
--- In lua-l@egroups.com, Luiz Henrique de Figueiredo <lhf@t...>
wrote:
> >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
Ok, not too bad. Then i guess i'd be simple enough to modify GC to
process all threads to mark all the used elements before actualy
collecting.
Sebastien St-Laurent
Software Engineer, Z-Axis ltd.
sebby@z-axis.com