#include <string.h>
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#include "lmem.h"
#include "lobject.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"
Go to the source code of this file.
Definition at line 62 of file lgc.cpp.
Referenced by luaC_barrierback_(), luaC_barrierproto_(), propagatemark(), and traversetable().
#define checkconsistency | ( | obj | ) | lua_longassert(!iscollectable(obj) || righttt(obj)) |
#define checkdeadkey | ( | n | ) | lua_assert(!ttisdeadkey(gkey(n)) || ttisnil(gval(n))) |
Definition at line 67 of file lgc.cpp.
Referenced by traverseephemeron(), traversestrongtable(), and traverseweakvalue().
#define GCFINALIZENUM 4 |
Definition at line 36 of file lgc.cpp.
Referenced by luaC_forcestep().
#define GCSWEEPCOST ((sizeof(TString) + 4) / 4) |
Definition at line 30 of file lgc.cpp.
Referenced by singlestep().
#define GCSWEEPMAX (cast_int((GCSTEPSIZE / GCSWEEPCOST) / 4)) |
Definition at line 33 of file lgc.cpp.
Referenced by singlestep().
Definition at line 93 of file lgc.cpp.
Referenced by clearkeys(), clearvalues(), traverseephemeron(), traversestrongtable(), and traverseweakvalue().
#define isfinalized | ( | x | ) | testbit(gch(x)->marked, FINALIZEDBIT) |
Definition at line 65 of file lgc.cpp.
Referenced by luaC_checkfinalizer(), separatetobefnz(), and udata2finalize().
Definition at line 99 of file lgc.cpp.
Referenced by reallymarkobject(), traverseephemeron(), traversetable(), and traverseweakvalue().
#define makewhite | ( | g, | |
x | |||
) | (gch(x)->marked = cast_byte((gch(x)->marked & maskcolors) | luaC_white(g))) |
Definition at line 58 of file lgc.cpp.
Referenced by luaC_barrier_(), luaC_checkfinalizer(), luaC_checkupvalcolor(), markbeingfnz(), and udata2finalize().
Definition at line 77 of file lgc.cpp.
Referenced by atomic(), iscleared(), markmt(), reallymarkobject(), restartcollection(), traverseLclosure(), traverseproto(), and traversetable().
#define markvalue | ( | g, | |
o | |||
) |
Definition at line 74 of file lgc.cpp.
Referenced by atomic(), luaC_checkupvalcolor(), reallymarkobject(), remarkupvals(), restartcollection(), traverseCclosure(), traverseproto(), traversestack(), traversestrongtable(), and traverseweakvalue().
Definition at line 57 of file lgc.cpp.
Referenced by sweeplist().
#define PAUSEADJ 100 |
Definition at line 50 of file lgc.cpp.
Referenced by setpause().
#define sweepphases (bitmask(GCSsweepstring) | bitmask(GCSsweepudata) | bitmask(GCSsweep)) |
Definition at line 923 of file lgc.cpp.
Referenced by luaC_changemode().
Definition at line 689 of file lgc.cpp.
Referenced by luaC_freeallobjects(), singlestep(), and sweepthread().
Definition at line 61 of file lgc.cpp.
Referenced by reallymarkobject().
Definition at line 998 of file lgc.cpp.
References global_State::allweak, cast, cast_byte, clearkeys(), clearvalues(), convergeephemerons(), global_State::currentwhite, global_State::ephemeron, G, global_State::GCmemtrav, iswhite, global_State::l_registry, lua_assert, global_State::mainthread, markbeingfnz(), markmt(), markobject, markvalue, obj2gco, otherwhite, propagateall(), remarkupvals(), retraversegrays(), separatetobefnz(), and global_State::weak.
Referenced by singlestep().
Definition at line 973 of file lgc.cpp.
References G, GCTM(), resetoldbit, and global_State::tobefnz.
Referenced by luaC_freeallobjects(), and luaC_fullgc().
Definition at line 777 of file lgc.cpp.
References global_State::buff, cast, G, global_State::gckind, KGC_EMERGENCY, luaS_resize(), luaZ_freebuffer, stringtable::nuse, stringtable::size, and global_State::strt.
Referenced by singlestep().
|
static |
Definition at line 624 of file lgc.cpp.
References gco2t, gkey, gnode, gnodelast, gval, iscleared(), removeentry(), setnilvalue, and ttisnil.
Referenced by atomic().
|
static |
Definition at line 642 of file lgc.cpp.
References Table::array, gco2t, gnode, gnodelast, gval, i, iscleared(), removeentry(), setnilvalue, Table::sizearray, and ttisnil.
Referenced by atomic().
|
static |
Definition at line 593 of file lgc.cpp.
References global_State::ephemeron, gco2t, next, propagateall(), and traverseephemeron().
Referenced by atomic().
Definition at line 802 of file lgc.cpp.
References luaD_call(), lua_State::top, and UNUSED.
Referenced by GCTM().
Definition at line 935 of file lgc.cpp.
References global_State::allgc, global_State::finobj, G, GCSsweepstring, global_State::gcstate, lua_assert, global_State::sweepfin, global_State::sweepgc, global_State::sweepstrgc, and sweeptolive().
Referenced by luaC_changemode(), luaC_fullgc(), and singlestep().
Definition at line 662 of file lgc.cpp.
References G, gch, gco2ccl, gco2lcl, gco2p, gco2t, gco2th, gco2ts, gco2u, gco2uv, lua_assert, LUA_TCCL, LUA_TLCL, LUA_TLNGSTR, LUA_TPROTO, LUA_TSHRSTR, LUA_TTABLE, LUA_TTHREAD, LUA_TUPVAL, LUA_TUSERDATA, luaE_freethread(), luaF_freeproto(), luaF_freeupval(), luaH_free(), luaM_freemem, sizeCclosure, sizeLclosure, sizestring, and sizeudata.
Referenced by sweeplist().
Definition at line 808 of file lgc.cpp.
References lua_State::allowhook, dothecall(), G, global_State::gcrunning, LUA_ERRGCMM, LUA_ERRRUN, LUA_OK, luaD_pcall(), luaD_throw(), luaO_pushfstring(), luaT_gettmbyobj(), game_logic::msg(), savestack, setgcovalue, setobj2s, svalue, TM_GC, lua_State::top, ttisfunction, ttisstring, and udata2finalize().
Referenced by callallpendingfinalizers(), and luaC_forcestep().
Definition at line 1116 of file lgc.cpp.
References bitmask, G, global_State::GCestimate, global_State::gcmajorinc, GCSpause, GCSpropagate, global_State::gcstate, gettotalbytes, lua_assert, luaC_fullgc(), luaC_runtilstate(), and setpause().
Referenced by luaC_forcestep().
Definition at line 1138 of file lgc.cpp.
References G, global_State::GCdebt, global_State::GCestimate, GCSpause, global_State::gcstate, global_State::gcstepmul, GCSTEPSIZE, luaE_setdebt(), MAX_LMEM, setpause(), singlestep(), and STEPMULADJ.
Referenced by luaC_forcestep().
|
static |
Definition at line 120 of file lgc.cpp.
References gcvalue, iscollectable, iswhite, markobject, rawtsvalue, and ttisstring.
Referenced by clearkeys(), clearvalues(), traverseephemeron(), and traverseweakvalue().
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().
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().
|
static |
Definition at line 310 of file lgc.cpp.
References gch, makewhite, next, reallymarkobject(), and global_State::tobefnz.
Referenced by atomic(), and restartcollection().
|
static |
Definition at line 300 of file lgc.cpp.
References i, LUA_NUMTAGS, markobject, and global_State::mt.
Referenced by atomic(), and restartcollection().
|
static |
Definition at line 565 of file lgc.cpp.
References global_State::gray, and propagatemark().
Referenced by atomic(), convergeephemerons(), propagatelist(), and retraversegrays().
|
static |
Definition at line 570 of file lgc.cpp.
References global_State::gray, lua_assert, and propagateall().
Referenced by retraversegrays().
|
static |
Definition at line 520 of file lgc.cpp.
References black2gray, gch, lua_State::gclist, Proto::gclist, Table::gclist, global_State::GCmemtrav, gco2ccl, gco2lcl, gco2p, gco2t, gco2th, global_State::gray, gray2black, global_State::grayagain, isgray, lua_assert, LUA_TCCL, LUA_TLCL, LUA_TPROTO, LUA_TTABLE, LUA_TTHREAD, traverseCclosure(), traverseLclosure(), traverseproto(), traversestack(), and traversetable().
Referenced by propagateall(), and singlestep().
|
static |
Definition at line 242 of file lgc.cpp.
References gch, global_State::GCmemtrav, gco2ccl, gco2lcl, gco2p, gco2t, gco2th, gco2ts, gco2u, gco2uv, global_State::gray, gray2black, linktable, lua_assert, LUA_TCCL, LUA_TLCL, LUA_TLNGSTR, LUA_TPROTO, LUA_TSHRSTR, LUA_TTABLE, LUA_TTHREAD, LUA_TUPVAL, LUA_TUSERDATA, markobject, markvalue, sizestring, sizeudata, UpVal::u, UpVal::v, UpVal::value, and white2gray.
Referenced by luaC_barrier_(), markbeingfnz(), and traverseephemeron().
|
static |
Definition at line 106 of file lgc.cpp.
References gkey, gval, lua_assert, setdeadvalue, ttisnil, and valiswhite.
Referenced by clearkeys(), clearvalues(), traverseephemeron(), traversestrongtable(), and traverseweakvalue().
|
static |
Definition at line 336 of file lgc.cpp.
References global_State::allweak, global_State::ephemeron, global_State::gray, global_State::grayagain, global_State::l_registry, global_State::mainthread, markbeingfnz(), markmt(), markobject, markvalue, and global_State::weak.
Referenced by singlestep().
|
static |
Definition at line 581 of file lgc.cpp.
References global_State::ephemeron, global_State::grayagain, propagateall(), propagatelist(), and global_State::weak.
Referenced by atomic().
Definition at line 844 of file lgc.cpp.
References curr, FINALIZEDBIT, global_State::finobj, G, gch, isfinalized, iswhite, l_setbit, lua_assert, SEPARATED, testbit, and global_State::tobefnz.
Referenced by atomic(), and luaC_freeallobjects().
|
static |
Definition at line 912 of file lgc.cpp.
References cast, global_State::gcpause, gettotalbytes, luaE_setdebt(), MAX_LMEM, and PAUSEADJ.
Referenced by generationalcollection(), incstep(), and luaC_fullgc().
Definition at line 1039 of file lgc.cpp.
References atomic(), checkSizes(), entersweep(), G, global_State::GCestimate, global_State::GCmemtrav, GCSatomic, GCSpause, GCSpropagate, GCSsweep, GCSsweepstring, GCSsweepudata, global_State::gcstate, GCSWEEPCOST, GCSWEEPMAX, global_State::gray, stringtable::hash, i, isgenerational, lua_assert, global_State::mainthread, obj2gco, propagatemark(), restartcollection(), stringtable::size, global_State::strt, sw, global_State::sweepfin, global_State::sweepgc, sweeplist(), global_State::sweepstrgc, and sweepwholelist.
Referenced by incstep(), and luaC_runtilstate().
Definition at line 718 of file lgc.cpp.
References bitmask, cast_byte, curr, freeobj(), G, gch, gco2th, isdeadm, isgenerational, LUA_TTHREAD, luaC_white, maskcolors, OLDBIT, otherwhite, sweepthread(), and testbits.
Referenced by singlestep(), and sweeptolive().
Definition at line 697 of file lgc.cpp.
References G, KGC_EMERGENCY, luaD_shrinkstack(), luaE_freeCI(), lua_State::openupval, lua_State::stack, and sweepwholelist.
Referenced by sweeplist().
Definition at line 757 of file lgc.cpp.
References i, and sweeplist().
Referenced by entersweep(), and luaC_checkfinalizer().
|
static |
Definition at line 478 of file lgc.cpp.
References i, markvalue, sizeCclosure, and CClosure::upvalue.
Referenced by propagatemark().
|
static |
Definition at line 377 of file lgc.cpp.
References global_State::allweak, Table::array, checkdeadkey, global_State::ephemeron, gcvalue, gkey, gnode, gnodelast, global_State::grayagain, gval, i, iscleared(), linktable, reallymarkobject(), removeentry(), Table::sizearray, ttisnil, and valiswhite.
Referenced by convergeephemerons(), and traversetable().
|
static |
Definition at line 485 of file lgc.cpp.
References i, markobject, LClosure::p, sizeLclosure, and LClosure::upvals.
Referenced by propagatemark().
|
static |
Definition at line 456 of file lgc.cpp.
References Proto::cache, i, int(), iswhite, Proto::k, Proto::locvars, markobject, markvalue, Upvaldesc::name, obj2gco, Proto::p, Proto::sizecode, Proto::sizek, Proto::sizelineinfo, Proto::sizelocvars, Proto::sizep, Proto::sizeupvalues, Proto::source, Proto::upvalues, and LocVar::varname.
Referenced by propagatemark().
|
static |
Definition at line 494 of file lgc.cpp.
References lua_State::base_ci, lua_State::ci, GCSatomic, global_State::gcstate, markvalue, CallInfo::next, setnilvalue, lua_State::stack, lua_State::stacksize, and lua_State::top.
Referenced by propagatemark().
|
static |
Definition at line 415 of file lgc.cpp.
References Table::array, checkdeadkey, gkey, gnode, gnodelast, gval, i, lua_assert, markvalue, removeentry(), Table::sizearray, and ttisnil.
Referenced by traversetable().
|
static |
Definition at line 433 of file lgc.cpp.
References global_State::allweak, black2gray, cast, gfasttm, linktable, markobject, Table::metatable, obj2gco, Table::sizearray, sizenode, svalue, TM_MODE, traverseephemeron(), traversestrongtable(), traverseweakvalue(), and ttisstring.
Referenced by propagatemark().
|
static |
Definition at line 354 of file lgc.cpp.
References checkdeadkey, gkey, gnode, gnodelast, global_State::grayagain, gval, iscleared(), linktable, lua_assert, markvalue, removeentry(), Table::sizearray, ttisnil, and global_State::weak.
Referenced by traversetable().
|
static |
Definition at line 788 of file lgc.cpp.
References global_State::allgc, gch, isfinalized, isold, keepinvariantout, lua_assert, makewhite, resetbit, SEPARATED, and global_State::tobefnz.
Referenced by GCTM().