lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Roberto wrote:
> 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.

Thanks so much to you, and also to Mauro and Irayo.

Regards,
Makoto Hamanaka