summaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-11-09 16:29:21 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-11-09 16:29:21 -0200
commit88eb901f81d647714d14b6f7e7c6455b46a27daa (patch)
tree3b37badf9c1d6d130a467ad586a816649984e6c7 /lgc.c
parent2583bac3d3dbbe8e5f532c93f33e2c9358b850c1 (diff)
downloadlua-88eb901f81d647714d14b6f7e7c6455b46a27daa.tar.gz
lua-88eb901f81d647714d14b6f7e7c6455b46a27daa.tar.bz2
lua-88eb901f81d647714d14b6f7e7c6455b46a27daa.zip
registry and global table may be changed through the API without a
write barrier, so GC should visit them in the atomic phase.
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lgc.c b/lgc.c
index b6bf9d04..91ed52dd 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 2.59 2009/11/05 17:43:54 roberto Exp roberto $ 2** $Id: lgc.c,v 2.60 2009/11/06 17:06:19 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*/
@@ -709,6 +709,9 @@ void luaC_freeall (lua_State *L) {
709static void atomic (lua_State *L) { 709static void atomic (lua_State *L) {
710 global_State *g = G(L); 710 global_State *g = G(L);
711 size_t udsize; /* total size of userdata to be finalized */ 711 size_t udsize; /* total size of userdata to be finalized */
712 /* global table and registry may be changed by API */
713 markvalue(g, &g->l_gt);
714 markvalue(g, &g->l_registry);
712 /* remark occasional upvalues of (maybe) dead threads */ 715 /* remark occasional upvalues of (maybe) dead threads */
713 g->gcstate = GCSatomic; 716 g->gcstate = GCSatomic;
714 remarkupvals(g); 717 remarkupvals(g);