aboutsummaryrefslogtreecommitdiff
path: root/lgc.h
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.h')
-rw-r--r--lgc.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/lgc.h b/lgc.h
index b931ae1a..13563db3 100644
--- a/lgc.h
+++ b/lgc.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.h,v 2.65 2013/08/21 20:09:51 roberto Exp roberto $ 2** $Id: lgc.h,v 2.66 2013/08/23 13:34:54 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*/
@@ -55,7 +55,7 @@
55** all objects are white again. 55** all objects are white again.
56*/ 56*/
57 57
58#define keepinvariant(g) (g->gcstate <= GCSatomic) 58#define keepinvariant(g) ((g)->gcstate <= GCSatomic)
59 59
60 60
61/* 61/*
@@ -91,7 +91,7 @@
91 91
92#define tofinalize(x) testbit((x)->gch.marked, FINALIZEDBIT) 92#define tofinalize(x) testbit((x)->gch.marked, FINALIZEDBIT)
93 93
94#define otherwhite(g) (g->currentwhite ^ WHITEBITS) 94#define otherwhite(g) ((g)->currentwhite ^ WHITEBITS)
95#define isdeadm(ow,m) (!(((m) ^ WHITEBITS) & (ow))) 95#define isdeadm(ow,m) (!(((m) ^ WHITEBITS) & (ow)))
96#define isdead(g,v) isdeadm(otherwhite(g), (v)->gch.marked) 96#define isdead(g,v) isdeadm(otherwhite(g), (v)->gch.marked)
97 97
@@ -127,6 +127,10 @@
127 { if (nolocal(obj2gco(o)), isblack(obj2gco(p)) && iswhite(obj2gco(o))) \ 127 { if (nolocal(obj2gco(o)), isblack(obj2gco(p)) && iswhite(obj2gco(o))) \
128 luaC_barrierback_(L,p); } 128 luaC_barrierback_(L,p); }
129 129
130#define luaC_upvalbarrier(L,uv) \
131 { if (iscollectable((uv)->v) && !upisopen(uv)) \
132 luaC_upvalbarrier_(L,uv); }
133
130LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); 134LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o);
131LUAI_FUNC void luaC_freeallobjects (lua_State *L); 135LUAI_FUNC void luaC_freeallobjects (lua_State *L);
132LUAI_FUNC void luaC_step (lua_State *L); 136LUAI_FUNC void luaC_step (lua_State *L);
@@ -138,7 +142,9 @@ LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz,
138LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v); 142LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v);
139LUAI_FUNC void luaC_barrierback_ (lua_State *L, GCObject *o); 143LUAI_FUNC void luaC_barrierback_ (lua_State *L, GCObject *o);
140LUAI_FUNC void luaC_barrierproto_ (lua_State *L, Proto *p, Closure *c); 144LUAI_FUNC void luaC_barrierproto_ (lua_State *L, Proto *p, Closure *c);
145LUAI_FUNC void luaC_upvalbarrier_ (lua_State *L, UpVal *uv);
141LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); 146LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt);
142LUAI_FUNC void luaC_checkupvalcolor (global_State *g, UpVal *uv); 147LUAI_FUNC void luaC_upvdeccount (lua_State *L, UpVal *uv);
148
143 149
144#endif 150#endif