aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-05-10 13:46:49 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-05-10 13:46:49 -0300
commitc006f085d98923e505c7fe8909944d3c182f8301 (patch)
tree4ebfc327b86d74ce18e316f24c28e18564c9160b /lgc.c
parenta48e330f37c06ec733234f96421a17e89ec61145 (diff)
downloadlua-c006f085d98923e505c7fe8909944d3c182f8301.tar.gz
lua-c006f085d98923e505c7fe8909944d3c182f8301.tar.bz2
lua-c006f085d98923e505c7fe8909944d3c182f8301.zip
new macro 'resetoldbit'
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lgc.c b/lgc.c
index 49d00f3c..97f8bd4c 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 2.91 2010/05/07 18:19:36 roberto Exp roberto $ 2** $Id: lgc.c,v 2.92 2010/05/07 18:43:24 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 resetbit(o->gch.marked, OLDBIT); 167 resetoldbit(o);
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 }
@@ -729,7 +729,7 @@ void luaC_separateudata (lua_State *L, int all) {
729 p = &gch(curr)->next; /* don't bother with it */ 729 p = &gch(curr)->next; /* don't bother with it */
730 else { 730 else {
731 l_setbit(gch(curr)->marked, FINALIZEDBIT); /* won't be finalized again */ 731 l_setbit(gch(curr)->marked, FINALIZEDBIT); /* won't be finalized again */
732 resetbit(gch(curr)->marked, OLDBIT); /* may be old when 'all' */ 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;
@@ -745,8 +745,8 @@ void luaC_separateudata (lua_State *L, int all) {
745*/ 745*/
746void luaC_checkfinalizer (lua_State *L, Udata *u) { 746void luaC_checkfinalizer (lua_State *L, Udata *u) {
747 global_State *g = G(L); 747 global_State *g = G(L);
748 if (testbit(u->uv.marked, SEPARATED) || /* userdata is already separated... */ 748 if (testbit(u->uv.marked, SEPARATED) || /* udata is already separated... */
749 isfinalized(&u->uv) || /* ... or is finalized... */ 749 isfinalized(&u->uv) || /* ... or is finalized... */
750 gfasttm(g, u->uv.metatable, TM_GC) == NULL) /* or has no finalizer? */ 750 gfasttm(g, u->uv.metatable, TM_GC) == NULL) /* or has no finalizer? */
751 return; /* nothing to be done */ 751 return; /* nothing to be done */
752 else { /* move 'u' to 'udgc' list */ 752 else { /* move 'u' to 'udgc' list */
@@ -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 resetbit(u->uv.marked, OLDBIT); 759 resetoldbit(obj2gco(u));
760 } 760 }
761} 761}
762 762