]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Follow-up fix for GC step threshold fix.
authorMike Pall <mike>
Fri, 22 Nov 2013 04:13:13 +0000 (05:13 +0100)
committerMike Pall <mike>
Fri, 22 Nov 2013 04:13:13 +0000 (05:13 +0100)
src/lj_gc.c
src/lj_trace.c

index 2a4d299b75a0b8ef41f110e6910382dd73236b76..fba932bab6f0948a481604bfec7ca325e47c3522 100644 (file)
@@ -678,7 +678,8 @@ int LJ_FASTCALL lj_gc_step(lua_State *L)
   lim = (GCSTEPSIZE/100) * g->gc.stepmul;
   if (lim == 0)
     lim = LJ_MAX_MEM;
-  g->gc.debt += g->gc.total - g->gc.threshold;
+  if (g->gc.total > g->gc.threshold)
+    g->gc.debt += g->gc.total - g->gc.threshold;
   do {
     lim -= (MSize)gc_onestep(L);
     if (g->gc.state == GCSpause) {
index add9da6d412c3065e0760cfbad9d87efe6335586..c70fc247ecc5527b6bf3436b2451ef55126e2f3e 100644 (file)
@@ -778,7 +778,7 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)
   setcframe_pc(cf, pc);
   if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize) {
     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 {
     trace_hotside(J, pc);
   }