diff options
Diffstat (limited to 'lgc.c')
| -rw-r--r-- | lgc.c | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lgc.c,v 2.228 2017/05/04 13:32:01 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 2.229 2017/05/26 19:14:29 roberto Exp roberto $ |
| 3 | ** Garbage Collector | 3 | ** Garbage Collector |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -1486,7 +1486,9 @@ void luaC_runtilstate (lua_State *L, int statesmask) { | |||
| 1486 | static void incstep (lua_State *L, global_State *g) { | 1486 | static void incstep (lua_State *L, global_State *g) { |
| 1487 | int stepmul = (g->gcstepmul | 1); /* avoid division by 0 */ | 1487 | int stepmul = (g->gcstepmul | 1); /* avoid division by 0 */ |
| 1488 | l_mem debt = (g->GCdebt / WORK2MEM) * stepmul; | 1488 | l_mem debt = (g->GCdebt / WORK2MEM) * stepmul; |
| 1489 | l_mem stepsize = cast(l_mem, 1) << g->gcstepsize; | 1489 | l_mem stepsize = (g->gcstepsize <= log2maxs(l_mem)) |
| 1490 | ? cast(l_mem, 1) << g->gcstepsize | ||
| 1491 | : MAX_LMEM; | ||
| 1490 | stepsize = -((stepsize / WORK2MEM) * stepmul); | 1492 | stepsize = -((stepsize / WORK2MEM) * stepmul); |
| 1491 | do { /* repeat until pause or enough "credit" (negative debt) */ | 1493 | do { /* repeat until pause or enough "credit" (negative debt) */ |
| 1492 | lu_mem work = singlestep(L); /* perform one single step */ | 1494 | lu_mem work = singlestep(L); /* perform one single step */ |
