summaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lgc.c b/lgc.c
index b8ab674f..0612f4a5 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 2.72 2010/03/25 13:06:36 roberto Exp roberto $ 2** $Id: lgc.c,v 2.73 2010/03/25 19:37:23 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -375,7 +375,6 @@ static void traverseproto (global_State *g, Proto *f) {
375 375
376 376
377static void traverseclosure (global_State *g, Closure *cl) { 377static void traverseclosure (global_State *g, Closure *cl) {
378 markobject(g, cl->c.env);
379 if (cl->c.isC) { 378 if (cl->c.isC) {
380 int i; 379 int i;
381 for (i=0; i<cl->c.nupvalues; i++) /* mark its upvalues */ 380 for (i=0; i<cl->c.nupvalues; i++) /* mark its upvalues */
@@ -605,8 +604,6 @@ static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
605 604
606static void checkSizes (lua_State *L) { 605static void checkSizes (lua_State *L) {
607 global_State *g = G(L); 606 global_State *g = G(L);
608 if (g->gckind == KGC_EMERGENCY)
609 return; /* do not move buffers during emergency collection */
610 if (g->strt.nuse < cast(lu_int32, g->strt.size)) { 607 if (g->strt.nuse < cast(lu_int32, g->strt.size)) {
611 /* string-table size could be the smaller power of 2 larger than 'nuse' */ 608 /* string-table size could be the smaller power of 2 larger than 'nuse' */
612 int size = 1 << luaO_ceillog2(g->strt.nuse); 609 int size = 1 << luaO_ceillog2(g->strt.nuse);
@@ -787,7 +784,6 @@ static l_mem singlestep (lua_State *L) {
787 sweeplist(L, cast(GCObject **, &g->mainthread), 1); 784 sweeplist(L, cast(GCObject **, &g->mainthread), 1);
788 g->sweepgc = &g->udgc; /* prepare to sweep userdata */ 785 g->sweepgc = &g->udgc; /* prepare to sweep userdata */
789 g->gcstate = GCSsweepudata; 786 g->gcstate = GCSsweepudata;
790 checkSizes(L);
791 } 787 }
792 return GCSWEEPCOST; 788 return GCSWEEPCOST;
793 } 789 }
@@ -809,6 +805,7 @@ static l_mem singlestep (lua_State *L) {
809 return GCFINALIZECOST; 805 return GCFINALIZECOST;
810 } 806 }
811 else { 807 else {
808 checkSizes(L);
812 g->gcstate = GCSpause; /* end collection */ 809 g->gcstate = GCSpause; /* end collection */
813 return 0; 810 return 0;
814 } 811 }