aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-08-28 15:30:26 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-08-28 15:30:26 -0300
commit9a871dd3db1baf8c7ac3bb94f03eb1f1bc3532e9 (patch)
tree90a993daf7e7b5eb8e92e713b084cf086b684c53 /lgc.c
parent90972ff136f310f00b04d9e9837ee0640983b743 (diff)
downloadlua-9a871dd3db1baf8c7ac3bb94f03eb1f1bc3532e9.tar.gz
lua-9a871dd3db1baf8c7ac3bb94f03eb1f1bc3532e9.tar.bz2
lua-9a871dd3db1baf8c7ac3bb94f03eb1f1bc3532e9.zip
tables and userdata all go to local list, too
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lgc.c b/lgc.c
index f905d9d5..8661fe8d 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 2.153 2013/08/27 18:53:35 roberto Exp roberto $ 2** $Id: lgc.c,v 2.154 2013/08/27 20:04:00 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*/
@@ -867,11 +867,13 @@ void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) {
867 g->sweepgc = sweeptolive(L, g->sweepgc, NULL); 867 g->sweepgc = sweeptolive(L, g->sweepgc, NULL);
868 } 868 }
869 /* search for pointer pointing to 'o' */ 869 /* search for pointer pointing to 'o' */
870 for (p = &g->allgc; *p != o; p = &gch(*p)->next) { /* empty */ } 870 p = (testbit(ho->marked, LOCALMARK)) ? &g->allgc : &g->localgc;
871 for (; *p != o; p = &gch(*p)->next) { /* empty */ }
871 *p = ho->next; /* remove 'o' from 'allgc' list */ 872 *p = ho->next; /* remove 'o' from 'allgc' list */
872 ho->next = g->finobj; /* link it in list 'finobj' */ 873 ho->next = g->finobj; /* link it in list 'finobj' */
873 g->finobj = o; 874 g->finobj = o;
874 l_setbit(ho->marked, FINALIZEDBIT); /* mark it as such */ 875 l_setbit(ho->marked, FINALIZEDBIT); /* mark it as such */
876 l_setbit(ho->marked, LOCALMARK); /* not in 'localgc' anymore */
875 if (!keepinvariant(g)) /* not keeping invariant? */ 877 if (!keepinvariant(g)) /* not keeping invariant? */
876 makewhite(g, o); /* "sweep" object */ 878 makewhite(g, o); /* "sweep" object */
877 } 879 }