diff options
author | Mike Pall <mike> | 2013-11-05 19:36:59 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2013-11-05 19:36:59 +0100 |
commit | 7b4d5306c7441a373516ee54bd942218f35348c2 (patch) | |
tree | b2963d0af64c5282189f74244fa2d550338c4380 /src/lj_gc.c | |
parent | 8944e27762712679e50962598ed1be8dc1fbe7be (diff) | |
download | luajit-7b4d5306c7441a373516ee54bd942218f35348c2.tar.gz luajit-7b4d5306c7441a373516ee54bd942218f35348c2.tar.bz2 luajit-7b4d5306c7441a373516ee54bd942218f35348c2.zip |
Fix GC steps threshold handling when called by JIT-compiled code.
Thanks to Cheng, Long.
Diffstat (limited to 'src/lj_gc.c')
-rw-r--r-- | src/lj_gc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c index 5c665786..7012dbec 100644 --- a/src/lj_gc.c +++ b/src/lj_gc.c | |||
@@ -689,12 +689,14 @@ int LJ_FASTCALL lj_gc_step(lua_State *L) | |||
689 | } while ((int32_t)lim > 0); | 689 | } while ((int32_t)lim > 0); |
690 | if (g->gc.debt < GCSTEPSIZE) { | 690 | if (g->gc.debt < GCSTEPSIZE) { |
691 | g->gc.threshold = g->gc.total + GCSTEPSIZE; | 691 | g->gc.threshold = g->gc.total + GCSTEPSIZE; |
692 | g->vmstate = ostate; | ||
693 | return 1; | ||
692 | } else { | 694 | } else { |
693 | g->gc.debt -= GCSTEPSIZE; | 695 | g->gc.debt -= GCSTEPSIZE; |
694 | g->gc.threshold = g->gc.total; | 696 | g->gc.threshold = g->gc.total; |
697 | g->vmstate = ostate; | ||
698 | return 0; | ||
695 | } | 699 | } |
696 | g->vmstate = ostate; | ||
697 | return 0; | ||
698 | } | 700 | } |
699 | 701 | ||
700 | /* Ditto, but fix the stack top first. */ | 702 | /* Ditto, but fix the stack top first. */ |