summaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lgc.c b/lgc.c
index 97f8bd4c..2ad6ca77 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 2.92 2010/05/07 18:43:24 roberto Exp roberto $ 2** $Id: lgc.c,v 2.93 2010/05/10 16:46:49 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*/
@@ -164,7 +164,7 @@ void luaC_checkupvalcolor (global_State *g, UpVal *uv) {
164 lua_assert(!isblack(o)); /* open upvalues are never black */ 164 lua_assert(!isblack(o)); /* open upvalues are never black */
165 if (isgray(o)) { 165 if (isgray(o)) {
166 if (keepinvariant(g)) { 166 if (keepinvariant(g)) {
167 resetoldbit(o); 167 resetoldbit(o); /* see MOVE OLD rule */
168 gray2black(o); /* it is being visited now */ 168 gray2black(o); /* it is being visited now */
169 markvalue(g, uv->v); 169 markvalue(g, uv->v);
170 } 170 }
@@ -670,6 +670,7 @@ static Udata *udata2finalize (global_State *g) {
670 u->uv.next = g->allgc; /* return it to 'allgc' list */ 670 u->uv.next = g->allgc; /* return it to 'allgc' list */
671 g->allgc = o; 671 g->allgc = o;
672 resetbit(u->uv.marked, SEPARATED); /* mark that it is not in 'tobefnz' */ 672 resetbit(u->uv.marked, SEPARATED); /* mark that it is not in 'tobefnz' */
673 resetoldbit(o); /* see MOVE OLD rule */
673 if (!keepinvariant(g)) /* not keeping invariant? */ 674 if (!keepinvariant(g)) /* not keeping invariant? */
674 makewhite(g, o); /* "sweep" object */ 675 makewhite(g, o); /* "sweep" object */
675 return u; 676 return u;
@@ -729,7 +730,6 @@ void luaC_separateudata (lua_State *L, int all) {
729 p = &gch(curr)->next; /* don't bother with it */ 730 p = &gch(curr)->next; /* don't bother with it */
730 else { 731 else {
731 l_setbit(gch(curr)->marked, FINALIZEDBIT); /* won't be finalized again */ 732 l_setbit(gch(curr)->marked, FINALIZEDBIT); /* won't be finalized again */
732 resetoldbit(curr); /* may be old when 'all' is true */
733 *p = gch(curr)->next; /* remove 'curr' from 'udgc' list */ 733 *p = gch(curr)->next; /* remove 'curr' from 'udgc' list */
734 gch(curr)->next = *lastnext; /* link at the end of 'tobefnz' list */ 734 gch(curr)->next = *lastnext; /* link at the end of 'tobefnz' list */
735 *lastnext = curr; 735 *lastnext = curr;
@@ -756,7 +756,7 @@ void luaC_checkfinalizer (lua_State *L, Udata *u) {
756 u->uv.next = g->udgc; /* link it in list 'udgc' */ 756 u->uv.next = g->udgc; /* link it in list 'udgc' */
757 g->udgc = obj2gco(u); 757 g->udgc = obj2gco(u);
758 l_setbit(u->uv.marked, SEPARATED); /* mark it as such */ 758 l_setbit(u->uv.marked, SEPARATED); /* mark it as such */
759 resetoldbit(obj2gco(u)); 759 resetoldbit(obj2gco(u)); /* see MOVE OLD rule */
760 } 760 }
761} 761}
762 762
@@ -854,7 +854,6 @@ static void atomic (lua_State *L) {
854 854
855static l_mem singlestep (lua_State *L) { 855static l_mem singlestep (lua_State *L) {
856 global_State *g = G(L); 856 global_State *g = G(L);
857 /*lua_checkmemory(L);*/
858 switch (g->gcstate) { 857 switch (g->gcstate) {
859 case GCSpause: { 858 case GCSpause: {
860 if (!isgenerational(g)) 859 if (!isgenerational(g))