aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-19 12:09:37 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-19 12:09:37 -0300
commite43612aaf62bbb92fd7555b132d9ee1c0394dc58 (patch)
tree552eabfbbdce5a60754200d36f23e84ddf0e2adc /lgc.c
parent2898e2fd12db741c58813671e56e628039d9bdc7 (diff)
downloadlua-e43612aaf62bbb92fd7555b132d9ee1c0394dc58.tar.gz
lua-e43612aaf62bbb92fd7555b132d9ee1c0394dc58.tar.bz2
lua-e43612aaf62bbb92fd7555b132d9ee1c0394dc58.zip
put the restriction that 'luaC_barrierback' works only on tables
in its prototype
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/lgc.c b/lgc.c
index 958322a0..896aeef0 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 2.188 2014/07/18 14:46:47 roberto Exp roberto $ 2** $Id: lgc.c,v 2.189 2014/07/19 14:44: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*/
@@ -153,16 +153,14 @@ void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) {
153 153
154/* 154/*
155** barrier that moves collector backward, that is, mark the black object 155** barrier that moves collector backward, that is, mark the black object
156** pointing to a white object as gray again. (Current implementation 156** pointing to a white object as gray again.
157** only works for tables; access to 'gclist' is not uniform across
158** different types.)
159*/ 157*/
160void luaC_barrierback_ (lua_State *L, GCObject *o) { 158void luaC_barrierback_ (lua_State *L, Table *t) {
161 global_State *g = G(L); 159 global_State *g = G(L);
162 lua_assert(isblack(o) && !isdead(g, o) && o->tt == LUA_TTABLE); 160 lua_assert(isblack(t) && !isdead(g, t));
163 black2gray(o); /* make object gray (again) */ 161 black2gray(t); /* make table gray (again) */
164 gco2t(o)->gclist = g->grayagain; 162 t->gclist = g->grayagain;
165 g->grayagain = o; 163 g->grayagain = obj2gco(t);
166} 164}
167 165
168 166