[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: bug of GC "step"
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 4 Jul 2008 11:23:39 -0300
> > Doesn't this second change solve both problems? As long as an end-of-cycle
> > breaks the loop, infinite loops are avoided. luaC_step already stops
> > at end-of-cycle, so I guess all we need is something like this (untested):
> >
> > - while (g->GCthreshold <= g->totalbytes)
> > - luaC_step(L);
> > - if (g->gcstate == GCSpause) /* end of cycle? */
> > - res = 1; /* signal it */
> >
> > + while (g->GCthreshold <= g->totalbytes) {
> > + luaC_step(L);
> > + if (g->gcstate == GCSpause) /* end of cycle? */
> > + return 1; /* signal it */
> > + }
>
> Yes!
> I think this will fix both problems.
> I'll test it with my Lua projects, not so many I have though.
Actually your original fix is better than this one. (This one returns
without "calling" the macro lua_unlock.)
-- Roberto