[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Unpicking require
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 31 Dec 2021 06:59:05 -0300
> It's restrictive in my opinion, the limitation is unnecessary.
>
> Maybe there is a better solution :
>
> diff --git a/lgc.c b/lgc.c
> [...]
> - o->next = g->finobj; /* link it in 'finobj' list */
> - g->finobj = o;
> + if (g->gcstp & GCSTPCLS) { /* closing state? */
> + o->next = g->tobefnz;
> + g->tobefnz = o;
> + } else {
> + o->next = g->finobj; /* link it in 'finobj' list */
> + g->finobj = o;
> + }
Have you tried this change with the standard test suite?
The test suite uses a nice hack, which I particularly enjoy, for
tracking GC cycles:
local mt = {}
function mt.__gc (o)
stderr:write'.' -- mark progress
setmetatable(o, mt) -- remark object for finalization
end
setmetatable({}, mt)
With this change, this code creates an infinite loop. So, we lose this
kind of hack for gaining a flexibility that I am not sure can be useful
in practice. (At least nobody ever asked for it.) Even if we find it to
be more useful, it would create a gratuitously incompatibility for what
is mainly a bug-fix release.
-- Roberto