30 #if !defined(GCSTEPSIZE)
32 #define GCSTEPSIZE (cast_int(100 * sizeof(TString)))
39 #define GCSpropagate 0
42 #define GCSswpfinobj 3
43 #define GCSswptobefnz 4
49 #define issweepphase(g) \
50 (GCSswpallgc <= (g)->gcstate && (g)->gcstate <= GCSswpend)
61 #define keepinvariant(g) ((g)->gcstate <= GCSatomic)
67 #define resetbits(x,m) ((x) &= cast(lu_byte, ~(m)))
68 #define setbits(x,m) ((x) |= (m))
69 #define testbits(x,m) ((x) & (m))
70 #define bitmask(b) (1<<(b))
71 #define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2))
72 #define l_setbit(x,b) setbits(x, bitmask(b))
73 #define resetbit(x,b) resetbits(x, bitmask(b))
74 #define testbit(x,b) testbits(x, bitmask(b))
81 #define FINALIZEDBIT 3
84 #define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
87 #define iswhite(x) testbits((x)->marked, WHITEBITS)
88 #define isblack(x) testbit((x)->marked, BLACKBIT)
90 (!testbits((x)->marked, WHITEBITS | bitmask(BLACKBIT)))
92 #define tofinalize(x) testbit((x)->marked, FINALIZEDBIT)
94 #define otherwhite(g) ((g)->currentwhite ^ WHITEBITS)
95 #define isdeadm(ow,m) (!(((m) ^ WHITEBITS) & (ow)))
96 #define isdead(g,v) isdeadm(otherwhite(g), (v)->marked)
98 #define changewhite(x) ((x)->marked ^= WHITEBITS)
99 #define gray2black(x) l_setbit((x)->marked, BLACKBIT)
101 #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS)
110 #define luaC_condGC(L,pre,pos) \
111 { if (G(L)->GCdebt > 0) { pre; luaC_step(L); pos;}; \
112 condchangemem(L,pre,pos); }
115 #define luaC_checkGC(L) luaC_condGC(L,(void)0,(void)0)
118 #define luaC_barrier(L,p,v) ( \
119 (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \
120 luaC_barrier_(L,obj2gco(p),gcvalue(v)) : cast_void(0))
122 #define luaC_barrierback(L,p,v) ( \
123 (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \
124 luaC_barrierback_(L,p) : cast_void(0))
126 #define luaC_objbarrier(L,p,o) ( \
127 (isblack(p) && iswhite(o)) ? \
128 luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0))
130 #define luaC_upvalbarrier(L,uv) ( \
131 (iscollectable((uv)->v) && !upisopen(uv)) ? \
132 luaC_upvalbarrier_(L,uv) : cast_void(0))
void luaC_checkfinalizer(lua_State *L, GCObject *o, Table *mt)
void luaC_barrierback_(lua_State *L, Table *o)
void luaC_upvdeccount(lua_State *L, UpVal *uv)
void luaC_barrier_(lua_State *L, GCObject *o, GCObject *v)
void luaC_fix(lua_State *L, GCObject *o)
void luaC_runtilstate(lua_State *L, int statesmask)
void luaC_step(lua_State *L)
void luaC_upvalbarrier_(lua_State *L, UpVal *uv)
void luaC_freeallobjects(lua_State *L)
GCObject * luaC_newobj(lua_State *L, int tt, size_t sz)
void luaC_fullgc(lua_State *L, int isemergency)