Fix GC steps threshold handling when called by JIT-compiled code.

Thanks to Cheng, Long.
This commit is contained in:
Mike Pall
2013-11-05 19:36:59 +01:00
parent 8944e27762
commit 7b4d5306c7
2 changed files with 5 additions and 3 deletions

View File

@@ -689,12 +689,14 @@ int LJ_FASTCALL lj_gc_step(lua_State *L)
} while ((int32_t)lim > 0);
if (g->gc.debt < GCSTEPSIZE) {
g->gc.threshold = g->gc.total + GCSTEPSIZE;
g->vmstate = ostate;
return 1;
} else {
g->gc.debt -= GCSTEPSIZE;
g->gc.threshold = g->gc.total;
g->vmstate = ostate;
return 0;
}
g->vmstate = ostate;
return 0;
}
/* Ditto, but fix the stack top first. */