[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Feature request: use counter for LUA_GCSTOP/LUA_GCRESTART
- From: Duncan Cross <duncan.cross@...>
- Date: Mon, 9 Nov 2009 12:53:21 +0000
On Mon, Nov 9, 2009 at 12:43 PM, 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 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.