[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Reentrant GC
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 27 Nov 2018 12:01:05 -0200
> > I still fail to see your point. The GC in Lua already is
> > "reentrant/recursive": you can freely call a garbage collection inside
> > a __gc metamethod. (Although, as others pointed out, this is smelly.)
> It disables debug hooks.
The disabling of debug hooks has nothing to do with being reentrant (at
least for I understand as reentrant). This is mainly to avoid confusion
when debugging, but maybe it would be better to allow hooks during
finalizers. The implementation can work both ways, without other
modifications than the setting of "allowhook'.
(Similarly, a finalizer stops the GC only to avoid confusion, such
as another finalizer being called during the finalizer. There is
nothing in the code that demands those restrictions.)