diff options
| -rw-r--r-- | src/lj_gc.c | 3 | ||||
| -rw-r--r-- | src/lj_trace.c | 2 |
2 files changed, 3 insertions, 2 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) { |
diff --git a/src/lj_trace.c b/src/lj_trace.c index 466d9cd2..2b8d931f 100644 --- a/src/lj_trace.c +++ b/src/lj_trace.c | |||
| @@ -781,7 +781,7 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr) | |||
| 781 | /* Just exit to interpreter. */ | 781 | /* Just exit to interpreter. */ |
| 782 | } else if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize) { | 782 | } else if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize) { |
| 783 | if (!(G(L)->hookmask & HOOK_GC)) | 783 | if (!(G(L)->hookmask & HOOK_GC)) |
| 784 | lj_gc_check(L); /* Exited because of GC: drive GC forward. */ | 784 | lj_gc_step(L); /* Exited because of GC: drive GC forward. */ |
| 785 | } else { | 785 | } else { |
| 786 | trace_hotside(J, pc); | 786 | trace_hotside(J, pc); |
| 787 | } | 787 | } |
