[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Feature request: use counter for LUA_GCSTOP/LUA_GCRESTART
- From: Florian Weimer <fw@...>
- Date: Mon, 09 Nov 2009 18:59:18 +0100
* Luiz Henrique de Figueiredo:
>> - 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 you want to call fork() from Lua code, you have to disable the GC
so that finalization doesn't occur both in the child and the parent.
If this happens in a library routine, you need to make sure that the
code composes with callers needing to disable GC as well. And this
means that you need some sort of counter.