Go to the source code of this file.
Macros | |
#define | GCSTEPSIZE (cast_int(100 * sizeof(TString))) |
#define | GCSpropagate 0 |
#define | GCSatomic 1 |
#define | GCSsweepstring 2 |
#define | GCSsweepudata 3 |
#define | GCSsweep 4 |
#define | GCSpause 5 |
#define | issweepphase(g) (GCSsweepstring <= (g)->gcstate && (g)->gcstate <= GCSsweep) |
#define | isgenerational(g) ((g)->gckind == KGC_GEN) |
#define | keepinvariant(g) (isgenerational(g) || g->gcstate <= GCSatomic) |
#define | keepinvariantout(g) |
#define | resetbits(x, m) ((x) &= cast(lu_byte, ~(m))) |
#define | setbits(x, m) ((x) |= (m)) |
#define | testbits(x, m) ((x) & (m)) |
#define | bitmask(b) (1<<(b)) |
#define | bit2mask(b1, b2) (bitmask(b1) | bitmask(b2)) |
#define | l_setbit(x, b) setbits(x, bitmask(b)) |
#define | resetbit(x, b) resetbits(x, bitmask(b)) |
#define | testbit(x, b) testbits(x, bitmask(b)) |
#define | WHITE0BIT 0 /* object is white (type 0) */ |
#define | WHITE1BIT 1 /* object is white (type 1) */ |
#define | BLACKBIT 2 /* object is black */ |
#define | FINALIZEDBIT 3 /* object has been separated for finalization */ |
#define | SEPARATED 4 /* object is in 'finobj' list or in 'tobefnz' */ |
#define | FIXEDBIT 5 /* object is fixed (should not be collected) */ |
#define | OLDBIT 6 /* object is old (only in generational mode) */ |
#define | WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) |
#define | iswhite(x) testbits((x)->gch.marked, WHITEBITS) |
#define | isblack(x) testbit((x)->gch.marked, BLACKBIT) |
#define | isgray(x) |
#define | isold(x) testbit((x)->gch.marked, OLDBIT) |
#define | resetoldbit(o) resetbit((o)->gch.marked, OLDBIT) |
#define | otherwhite(g) (g->currentwhite ^ WHITEBITS) |
#define | isdeadm(ow, m) (!(((m) ^ WHITEBITS) & (ow))) |
#define | isdead(g, v) isdeadm(otherwhite(g), (v)->gch.marked) |
#define | changewhite(x) ((x)->gch.marked ^= WHITEBITS) |
#define | gray2black(x) l_setbit((x)->gch.marked, BLACKBIT) |
#define | valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x))) |
#define | luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) |
#define | luaC_condGC(L, c) {if (G(L)->GCdebt > 0) {c;}; condchangemem(L);} |
#define | luaC_checkGC(L) luaC_condGC(L, luaC_step(L);) |
#define | luaC_barrier(L, p, v) |
#define | luaC_barrierback(L, p, v) |
#define | luaC_objbarrier(L, p, o) |
#define | luaC_objbarrierback(L, p, o) { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) luaC_barrierback_(L,p); } |
#define | luaC_barrierproto(L, p, c) { if (isblack(obj2gco(p))) luaC_barrierproto_(L,p,c); } |
Functions | |
LUAI_FUNC void | luaC_freeallobjects (lua_State *L) |
LUAI_FUNC void | luaC_step (lua_State *L) |
LUAI_FUNC void | luaC_forcestep (lua_State *L) |
LUAI_FUNC void | luaC_runtilstate (lua_State *L, int statesmask) |
LUAI_FUNC void | luaC_fullgc (lua_State *L, int isemergency) |
LUAI_FUNC GCObject * | luaC_newobj (lua_State *L, int tt, size_t sz, GCObject **list, int offset) |
LUAI_FUNC void | luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) |
LUAI_FUNC void | luaC_barrierback_ (lua_State *L, GCObject *o) |
LUAI_FUNC void | luaC_barrierproto_ (lua_State *L, Proto *p, Closure *c) |
LUAI_FUNC void | luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) |
LUAI_FUNC void | luaC_checkupvalcolor (global_State *g, UpVal *uv) |
LUAI_FUNC void | luaC_changemode (lua_State *L, int mode) |
Definition at line 79 of file lgc.h.
Referenced by lua_newstate().
Definition at line 78 of file lgc.h.
Referenced by generationalcollection(), luaC_changemode(), luaC_fullgc(), luaS_resize(), and sweeplist().
Definition at line 113 of file lgc.h.
Referenced by internshrstr(), and luaF_findupval().
#define FINALIZEDBIT 3 /* object has been separated for finalization */ |
Definition at line 89 of file lgc.h.
Referenced by separatetobefnz().
#define FIXEDBIT 5 /* object is fixed (should not be collected) */ |
Definition at line 91 of file lgc.h.
Referenced by lua_newstate().
#define GCSatomic 1 |
Definition at line 39 of file lgc.h.
Referenced by singlestep(), and traversestack().
#define GCSpause 5 |
Definition at line 43 of file lgc.h.
Referenced by generationalcollection(), incstep(), lua_gc(), lua_newstate(), luaC_barrier_(), luaC_forcestep(), luaC_fullgc(), and singlestep().
#define GCSpropagate 0 |
Definition at line 38 of file lgc.h.
Referenced by generationalcollection(), luaC_changemode(), luaC_fullgc(), and singlestep().
#define GCSsweep 4 |
Definition at line 42 of file lgc.h.
Referenced by singlestep().
#define GCSsweepstring 2 |
Definition at line 40 of file lgc.h.
Referenced by entersweep(), luaS_resize(), and singlestep().
#define GCSsweepudata 3 |
Definition at line 41 of file lgc.h.
Referenced by singlestep().
Definition at line 31 of file lgc.h.
Referenced by incstep(), lua_gc(), and luaC_step().
Definition at line 114 of file lgc.h.
Referenced by luaC_checkupvalcolor(), propagatemark(), and reallymarkobject().
Definition at line 99 of file lgc.h.
Referenced by luaC_barrier_(), luaC_barrierback_(), luaC_barrierproto_(), luaC_checkupvalcolor(), and luaF_close().
Definition at line 111 of file lgc.h.
Referenced by internshrstr(), luaC_barrier_(), luaC_barrierback_(), luaF_close(), and luaF_findupval().
Definition at line 110 of file lgc.h.
Referenced by sweeplist().
Definition at line 49 of file lgc.h.
Referenced by luaC_forcestep(), singlestep(), and sweeplist().
#define isgray | ( | x | ) |
Definition at line 100 of file lgc.h.
Referenced by luaC_checkupvalcolor(), propagatemark(), and remarkupvals().
Definition at line 103 of file lgc.h.
Referenced by luaF_findupval(), and udata2finalize().
#define issweepphase | ( | g | ) | (GCSsweepstring <= (g)->gcstate && (g)->gcstate <= GCSsweep) |
Definition at line 46 of file lgc.h.
Referenced by luaC_barrier_(), luaC_checkfinalizer(), and luaC_checkupvalcolor().
Definition at line 98 of file lgc.h.
Referenced by atomic(), iscleared(), luaC_barrier_(), separatetobefnz(), and traverseproto().
#define keepinvariant | ( | g | ) | (isgenerational(g) || g->gcstate <= GCSatomic) |
Definition at line 60 of file lgc.h.
Referenced by luaC_checkupvalcolor(), and luaC_fullgc().
#define keepinvariantout | ( | g | ) |
Definition at line 67 of file lgc.h.
Referenced by luaC_barrier_(), luaC_checkfinalizer(), and udata2finalize().
Definition at line 80 of file lgc.h.
Referenced by luaC_checkfinalizer(), and separatetobefnz().
Definition at line 126 of file lgc.h.
Referenced by addk(), lua_load(), lua_setupvalue(), luaV_execute(), and moveto().
Definition at line 129 of file lgc.h.
Referenced by lua_rawset(), lua_rawseti(), lua_rawsetp(), luaH_newkey(), luaV_execute(), and luaV_settable().
Definition at line 139 of file lgc.h.
Referenced by pushclosure().
#define luaC_checkGC | ( | L | ) | luaC_condGC(L, luaC_step(L);) |
Definition at line 123 of file lgc.h.
Referenced by close_func(), lua_concat(), lua_createtable(), lua_newthread(), lua_newuserdata(), lua_pushcclosure(), lua_pushfstring(), lua_pushlstring(), lua_pushstring(), lua_pushvfstring(), lua_tolstring(), luaD_precall(), and luaX_newstring().
#define luaC_condGC | ( | L, | |
c | |||
) | {if (G(L)->GCdebt > 0) {c;}; condchangemem(L);} |
#define luaC_objbarrier | ( | L, | |
p, | |||
o | |||
) |
Definition at line 132 of file lgc.h.
Referenced by addprototype(), f_parser(), lua_setmetatable(), lua_setuservalue(), lua_upvaluejoin(), luaC_barrierproto_(), newupvalue(), and registerlocalvar().
#define luaC_objbarrierback | ( | L, | |
p, | |||
o | |||
) | { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) luaC_barrierback_(L,p); } |
Definition at line 136 of file lgc.h.
Referenced by lua_setmetatable().
Definition at line 118 of file lgc.h.
Referenced by lua_newstate(), luaC_newobj(), and sweeplist().
Definition at line 92 of file lgc.h.
Referenced by sweeplist().
Definition at line 109 of file lgc.h.
Referenced by atomic(), and sweeplist().
Definition at line 81 of file lgc.h.
Referenced by udata2finalize().
Definition at line 107 of file lgc.h.
Referenced by callallpendingfinalizers(), luaC_checkfinalizer(), luaC_checkupvalcolor(), and luaS_resize().
Definition at line 90 of file lgc.h.
Referenced by luaC_checkfinalizer(), separatetobefnz(), and udata2finalize().
Definition at line 82 of file lgc.h.
Referenced by luaC_checkfinalizer(), luaC_runtilstate(), and separatetobefnz().
Definition at line 77 of file lgc.h.
Referenced by sweeplist().
Definition at line 116 of file lgc.h.
Referenced by removeentry(), and traverseephemeron().
#define WHITE0BIT 0 /* object is white (type 0) */ |
Definition at line 86 of file lgc.h.
Referenced by lua_newstate().
Definition at line 95 of file lgc.h.
Referenced by luaC_freeallobjects().
Definition at line 134 of file lgc.cpp.
References G, gch, GCSpause, global_State::gcstate, isblack, isdead, issweepphase, iswhite, keepinvariantout, lua_assert, LUA_TTABLE, makewhite, and reallymarkobject().
Definition at line 154 of file lgc.cpp.
References black2gray, G, gch, gco2t, global_State::grayagain, isblack, isdead, lua_assert, and LUA_TTABLE.
Definition at line 171 of file lgc.cpp.
References black2gray, Proto::cache, G, Proto::gclist, global_State::grayagain, isblack, lua_assert, luaC_objbarrier, and obj2gco.
Definition at line 951 of file lgc.cpp.
References bitmask, entersweep(), G, global_State::GCestimate, global_State::gckind, GCSpropagate, gettotalbytes, KGC_GEN, KGC_NORMAL, luaC_runtilstate(), and sweepphases.
Referenced by lua_gc().
Definition at line 872 of file lgc.cpp.
References global_State::allgc, global_State::finobj, G, gch, gfasttm, isfinalized, issweepphase, keepinvariantout, l_setbit, lua_assert, makewhite, resetoldbit, SEPARATED, global_State::sweepgc, sweeptolive(), testbit, and TM_GC.
Referenced by lua_setmetatable().
LUAI_FUNC void luaC_checkupvalcolor | ( | global_State * | g, |
UpVal * | uv | ||
) |
Definition at line 189 of file lgc.cpp.
References gray2black, isblack, isgray, issweepphase, keepinvariant, lua_assert, makewhite, markvalue, obj2gco, resetoldbit, and UpVal::v.
Referenced by luaF_close().
Definition at line 1162 of file lgc.cpp.
References G, GCFINALIZENUM, GCSpause, global_State::gcstate, GCTM(), generationalcollection(), i, incstep(), isgenerational, and global_State::tobefnz.
Referenced by lua_gc(), and luaC_step().
Definition at line 982 of file lgc.cpp.
References global_State::allgc, callallpendingfinalizers(), global_State::currentwhite, global_State::finobj, G, global_State::gckind, stringtable::hash, i, KGC_NORMAL, lua_assert, stringtable::nuse, separatetobefnz(), stringtable::size, global_State::strt, sweepwholelist, and WHITEBITS.
Referenced by close_state().
Definition at line 1188 of file lgc.cpp.
References bitmask, callallpendingfinalizers(), entersweep(), G, global_State::gckind, GCSpause, GCSpropagate, gettotalbytes, keepinvariant, KGC_EMERGENCY, KGC_GEN, KGC_NORMAL, lua_assert, luaC_runtilstate(), and setpause().
Referenced by generationalcollection(), lua_gc(), and luaM_realloc_().
Definition at line 211 of file lgc.cpp.
References global_State::allgc, cast, G, gch, luaC_white, luaM_newobject, novariant, and obj2gco.
Referenced by createstrobj(), lua_newthread(), luaF_findupval(), luaF_newCclosure(), luaF_newLclosure(), luaF_newproto(), luaF_newupval(), luaH_new(), and luaS_newudata().
Definition at line 1109 of file lgc.cpp.
References G, global_State::gcstate, singlestep(), and testbit.
Referenced by generationalcollection(), luaC_changemode(), luaC_fullgc(), and luaS_resize().
Definition at line 1176 of file lgc.cpp.
References G, global_State::gcrunning, GCSTEPSIZE, luaC_forcestep(), and luaE_setdebt().