diff options
Diffstat (limited to 'src/lj_gc.c')
-rw-r--r-- | src/lj_gc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c index 592d770b..c41cef21 100644 --- a/src/lj_gc.c +++ b/src/lj_gc.c | |||
@@ -673,7 +673,8 @@ int LJ_FASTCALL lj_gc_step(lua_State *L) | |||
673 | lim = (GCSTEPSIZE/100) * g->gc.stepmul; | 673 | lim = (GCSTEPSIZE/100) * g->gc.stepmul; |
674 | if (lim == 0) | 674 | if (lim == 0) |
675 | lim = LJ_MAX_MEM; | 675 | lim = LJ_MAX_MEM; |
676 | g->gc.debt += g->gc.total - g->gc.threshold; | 676 | if (g->gc.total > g->gc.threshold) |
677 | g->gc.debt += g->gc.total - g->gc.threshold; | ||
677 | do { | 678 | do { |
678 | lim -= (MSize)gc_onestep(L); | 679 | lim -= (MSize)gc_onestep(L); |
679 | if (g->gc.state == GCSpause) { | 680 | if (g->gc.state == GCSpause) { |