lua-users home
lua-l archive

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


On Tue, Dec 28, 2010 at 6:55 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> Currently, if you stop the garbage collector (collectgarbage'stop')
>> and later force a full collection (collectgarbage()), the collector
>> restarts running. How many of you rely on this behavior? Wouldn't
>> it be more useful to keep the collector stopped until an explicit
>> call to collectgarbage'restart'?
>
> Just to make myself clear: I meant to keep the collector stopped *after*
> doing the requested full collection.
>
> In other words, currently the call collectgarbage() is equivalent to the
> sequence collectgarbage(); collectgarbage'restart'. The proposal is to
> remove this implicit restart. After the full collection, the collector
> keeps its running status (stopped or running) as it was before the
> full collection.
>
> -- Roberto
>
>

I think removing the implicit restart is a good idea. I also think it
would be a good idea to be able to easily know whether the GC is
currently running, so that a function could temporarily stop the GC
before restarting it later, or if it's stopped leave it stopped.

-Duncan