aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
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