Follow-up fix for GC step threshold fix.

This commit is contained in:
Mike Pall 2013-11-22 05:13:13 +01:00
parent 751eacec7b
commit 9d90988347
2 changed files with 3 additions and 2 deletions

View File

@ -678,6 +678,7 @@ int LJ_FASTCALL lj_gc_step(lua_State *L)
lim = (GCSTEPSIZE/100) * g->gc.stepmul; lim = (GCSTEPSIZE/100) * g->gc.stepmul;
if (lim == 0) if (lim == 0)
lim = LJ_MAX_MEM; lim = LJ_MAX_MEM;
if (g->gc.total > g->gc.threshold)
g->gc.debt += g->gc.total - g->gc.threshold; g->gc.debt += g->gc.total - g->gc.threshold;
do { do {
lim -= (MSize)gc_onestep(L); lim -= (MSize)gc_onestep(L);

View File

@ -778,7 +778,7 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)
setcframe_pc(cf, pc); setcframe_pc(cf, pc);
if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize) { if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize) {
if (!(G(L)->hookmask & HOOK_GC)) if (!(G(L)->hookmask & HOOK_GC))
lj_gc_check(L); /* Exited because of GC: drive GC forward. */ lj_gc_step(L); /* Exited because of GC: drive GC forward. */
} else { } else {
trace_hotside(J, pc); trace_hotside(J, pc);
} }