lua-users home
lua-l archive

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

On Tue, Feb 7, 2012 at 10:48 AM, Josh Haberman <> wrote:
>> *And* since dropping a reference
>> can conceivably lead to the object being destroyed then and there, if it
>> was the last reference, it means you have to be really careful when
>> references get dropped.
> The flip side is that destroying happens at a predictable time.  Garbage
> collection can also happen at unexpected times, but it is highly
> non-deterministic, so something that works 99% of the time can fail
> if GC happened to be initiated in a critical section.

I don't know if this is valid or not, but if you have a lot of
collection to do in one frame, with ref counting and manual collection
you're basically stuck with that but with an incremental collector you
can easily spread the collection across multiple frames. I always
thought as far as games were concerned limiting the GC to a specific
point and giving it a max time would be a good solution more than a
nasty hack. Provided you can't run over said limit too easily.