lua-users home
lua-l archive

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


> What I really want to know is how these things will be, or should be in
> the future.
> 
> Then, do you think that both two points need to be changed in some way?
> 
> The second one, collegarbage("step",n) sometimes does't return "cycle
> end flag" when it should, is not yet discussed enough here. I think I've
> shown some way to reproduce what I'm saying, mainly on my second mail on
> this topic.

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 */
+     }


-- Roberto