aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2013-11-22 05:13:13 +0100
committerMike Pall <mike>2013-11-22 05:13:13 +0100
commit9d909883474e0079227aed20a50122b5969ed429 (patch)
treef5ab375cc6eb7a7c10b9cf0f83cfc2ef27a6afa1
parent751eacec7b1927c4554de94a7771503736e97e46 (diff)
downloadluajit-9d909883474e0079227aed20a50122b5969ed429.tar.gz
luajit-9d909883474e0079227aed20a50122b5969ed429.tar.bz2
luajit-9d909883474e0079227aed20a50122b5969ed429.zip
Follow-up fix for GC step threshold fix.
-rw-r--r--src/lj_gc.c3
-rw-r--r--src/lj_trace.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c
index 2a4d299b..fba932ba 100644
--- a/src/lj_gc.c
+++ b/src/lj_gc.c
@@ -678,7 +678,8 @@ int LJ_FASTCALL lj_gc_step(lua_State *L)
678 lim = (GCSTEPSIZE/100) * g->gc.stepmul; 678 lim = (GCSTEPSIZE/100) * g->gc.stepmul;
679 if (lim == 0) 679 if (lim == 0)
680 lim = LJ_MAX_MEM; 680 lim = LJ_MAX_MEM;
681 g->gc.debt += g->gc.total - g->gc.threshold; 681 if (g->gc.total > g->gc.threshold)
682 g->gc.debt += g->gc.total - g->gc.threshold;
682 do { 683 do {
683 lim -= (MSize)gc_onestep(L); 684 lim -= (MSize)gc_onestep(L);
684 if (g->gc.state == GCSpause) { 685 if (g->gc.state == GCSpause) {
diff --git a/src/lj_trace.c b/src/lj_trace.c
index add9da6d..c70fc247 100644
--- a/src/lj_trace.c
+++ b/src/lj_trace.c
@@ -778,7 +778,7 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)
778 setcframe_pc(cf, pc); 778 setcframe_pc(cf, pc);
779 if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize) { 779 if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize) {
780 if (!(G(L)->hookmask & HOOK_GC)) 780 if (!(G(L)->hookmask & HOOK_GC))
781 lj_gc_check(L); /* Exited because of GC: drive GC forward. */ 781 lj_gc_step(L); /* Exited because of GC: drive GC forward. */
782 } else { 782 } else {
783 trace_hotside(J, pc); 783 trace_hotside(J, pc);
784 } 784 }