31 #define GCSpropagate 0 32 #define GCSenteratomic 1 35 #define GCSswpfinobj 4 36 #define GCSswptobefnz 5 42 #define issweepphase(g) \ 43 (GCSswpallgc <= (g)->gcstate && (g)->gcstate <= GCSswpend) 54 #define keepinvariant(g) ((g)->gcstate <= GCSatomic) 60 #define resetbits(x,m) ((x) &= cast_byte(~(m))) 61 #define setbits(x,m) ((x) |= (m)) 62 #define testbits(x,m) ((x) & (m)) 63 #define bitmask(b) (1<<(b)) 64 #define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2)) 65 #define l_setbit(x,b) setbits(x, bitmask(b)) 66 #define resetbit(x,b) resetbits(x, bitmask(b)) 67 #define testbit(x,b) testbits(x, bitmask(b)) 78 #define FINALIZEDBIT 6 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) & (ow)) 96 #define isdead(g,v) isdeadm(otherwhite(g), (v)->marked) 98 #define changewhite(x) ((x)->marked ^= WHITEBITS) 100 check_exp(!iswhite(x), l_setbit((x)->marked, BLACKBIT)) 102 #define luaC_white(g) cast_byte((g)->currentwhite & WHITEBITS) 116 #define getage(o) ((o)->marked & AGEBITS) 117 #define setage(o,a) ((o)->marked = cast_byte(((o)->marked & (~AGEBITS)) | a)) 118 #define isold(o) (getage(o) > G_SURVIVAL) 120 #define changeage(o,f,t) \ 121 check_exp(getage(o) == (f), (o)->marked ^= ((f)^(t))) 125 #define LUAI_GENMAJORMUL 100 126 #define LUAI_GENMINORMUL 20 129 #define LUAI_GCPAUSE 200 135 #define getgcparam(p) ((p) * 4) 136 #define setgcparam(p,v) ((p) = (v) / 4) 138 #define LUAI_GCMUL 100 141 #define LUAI_GCSTEPSIZE 13 149 #define isdecGCmodegen(g) (g->gckind == KGC_GEN || g->lastatomic != 0) 157 #define luaC_condGC(L,pre,pos) \ 158 { if (G(L)->GCdebt > 0) { pre; luaC_step(L); pos;}; \ 159 condchangemem(L,pre,pos); } 162 #define luaC_checkGC(L) luaC_condGC(L,(void)0,(void)0) 165 #define luaC_barrier(L,p,v) ( \ 166 (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \ 167 luaC_barrier_(L,obj2gco(p),gcvalue(v)) : cast_void(0)) 169 #define luaC_barrierback(L,p,v) ( \ 170 (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \ 171 luaC_barrierback_(L,p) : cast_void(0)) 173 #define luaC_objbarrier(L,p,o) ( \ 174 (isblack(p) && iswhite(o)) ? \ 175 luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0))
LUAI_FUNC void luaC_runtilstate(lua_State *L, int statesmask)
LUAI_FUNC void luaC_fix(lua_State *L, GCObject *o)
LUAI_FUNC GCObject * luaC_newobj(lua_State *L, int tt, size_t sz)
LUAI_FUNC void luaC_step(lua_State *L)
LUAI_FUNC void luaC_changemode(lua_State *L, int newmode)
LUAI_FUNC void luaC_checkfinalizer(lua_State *L, GCObject *o, Table *mt)
LUAI_FUNC void luaC_freeallobjects(lua_State *L)
LUAI_FUNC void luaC_fullgc(lua_State *L, int isemergency)
LUAI_FUNC void luaC_barrierback_(lua_State *L, GCObject *o)
LUAI_FUNC void luaC_barrier_(lua_State *L, GCObject *o, GCObject *v)