lua-users home
lua-l archive

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


On Mon, Nov 9, 2009 at 12:43 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> - for example, being able to call an API function that returns 0 or 1
>> to indicate whether the GC is currently running or not.
>
> Why? What can will you do with that information?
>

If I have a C module function where I want to be certain the Lua
garbage collector is not running temporarily for a particular piece of
code, I would use it then - just in case that function is ever called
from a context where the garbage collector has *already* been stopped,
and the calling function does not expect it to be restarted. In that
situation I would get the current state at the beginning, then
conditionally decide whether to start the GC again at the end.

-Duncan