Github User Fetcher 1.0.0
C Application with Server and GUI
|
#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 63 of file lua-5.2.4/src/lgc.c.
Referenced by luaC_barrierback_(), luaC_barrierproto_(), propagatemark(), and traversetable().
#define checkconsistency | ( | obj | ) | lua_longassert(!iscollectable(obj) || righttt(obj)) |
Definition at line 71 of file lua-5.2.4/src/lgc.c.
#define checkdeadkey | ( | n | ) | lua_assert(!ttisdeadkey(gkey(n)) || ttisnil(gval(n))) |
Definition at line 68 of file lua-5.2.4/src/lgc.c.
Referenced by traverseephemeron(), traversestrongtable(), and traverseweakvalue().
#define GCFINALIZENUM 4 |
Definition at line 37 of file lua-5.2.4/src/lgc.c.
Referenced by luaC_forcestep().
#define GCSWEEPCOST ((sizeof(TString) + 4) / 4) |
Definition at line 31 of file lua-5.2.4/src/lgc.c.
Referenced by singlestep().
#define GCSWEEPMAX (cast_int((GCSTEPSIZE / GCSWEEPCOST) / 4)) |
Definition at line 34 of file lua-5.2.4/src/lgc.c.
Referenced by singlestep().
Definition at line 94 of file lua-5.2.4/src/lgc.c.
Referenced by clearkeys(), clearvalues(), traverseephemeron(), traversestrongtable(), and traverseweakvalue().
#define isfinalized | ( | x | ) | testbit(gch(x)->marked, FINALIZEDBIT) |
Definition at line 66 of file lua-5.2.4/src/lgc.c.
Referenced by luaC_checkfinalizer(), separatetobefnz(), and udata2finalize().
#define lgc_c |
Definition at line 9 of file lua-5.2.4/src/lgc.c.
#define linktable | ( | h, | |
p ) ((h)->gclist = *(p), *(p) = obj2gco(h)) |
Definition at line 100 of file lua-5.2.4/src/lgc.c.
Referenced by reallymarkobject(), traverseephemeron(), traversetable(), and traverseweakvalue().
#define LUA_CORE |
Definition at line 10 of file lua-5.2.4/src/lgc.c.
#define makewhite | ( | g, | |
x ) (gch(x)->marked = cast_byte((gch(x)->marked & maskcolors) | luaC_white(g))) |
Definition at line 59 of file lua-5.2.4/src/lgc.c.
Referenced by luaC_barrier_(), luaC_checkfinalizer(), luaC_checkupvalcolor(), markbeingfnz(), and udata2finalize().
#define markobject | ( | g, | |
t ) |
Definition at line 78 of file lua-5.2.4/src/lgc.c.
Referenced by atomic(), iscleared(), markmt(), reallymarkobject(), restartcollection(), traverseLclosure(), traverseproto(), and traversetable().
#define markvalue | ( | g, | |
o ) |
Definition at line 75 of file lua-5.2.4/src/lgc.c.
Referenced by atomic(), luaC_checkupvalcolor(), reallymarkobject(), remarkupvals(), restartcollection(), traverseCclosure(), traverseproto(), traversestack(), traversestrongtable(), and traverseweakvalue().
Definition at line 58 of file lua-5.2.4/src/lgc.c.
Referenced by sweeplist().
#define PAUSEADJ 100 |
Definition at line 51 of file lua-5.2.4/src/lgc.c.
Referenced by setpause().
#define STEPMULADJ 200 |
Definition at line 44 of file lua-5.2.4/src/lgc.c.
Referenced by incstep().
#define sweepphases (bitmask(GCSsweepstring) | bitmask(GCSsweepudata) | bitmask(GCSsweep)) |
Definition at line 924 of file lua-5.2.4/src/lgc.c.
Referenced by luaC_changemode().
Definition at line 690 of file lua-5.2.4/src/lgc.c.
Referenced by luaC_freeallobjects(), singlestep(), and sweepthread().
Definition at line 62 of file lua-5.2.4/src/lgc.c.
Referenced by reallymarkobject().
Definition at line 999 of file lua-5.2.4/src/lgc.c.
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, NULL, obj2gco, otherwhite, propagateall(), remarkupvals(), retraversegrays(), separatetobefnz(), and global_State::weak.
Referenced by singlestep().
|
static |
Definition at line 974 of file lua-5.2.4/src/lgc.c.
References G, GCTM(), resetoldbit, and global_State::tobefnz.
Referenced by luaC_freeallobjects(), and luaC_fullgc().
|
static |
Definition at line 778 of file lua-5.2.4/src/lgc.c.
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 625 of file lua-5.2.4/src/lgc.c.
References gco2t, gkey, gnode, gnodelast, gval, iscleared(), removeentry(), setnilvalue, and ttisnil.
Referenced by atomic().
|
static |
Definition at line 643 of file lua-5.2.4/src/lgc.c.
References Table::array, gco2t, gnode, gnodelast, gval, iscleared(), removeentry(), setnilvalue, Table::sizearray, and ttisnil.
Referenced by atomic().
|
static |
Definition at line 594 of file lua-5.2.4/src/lgc.c.
References global_State::ephemeron, gco2t, next, NULL, propagateall(), and traverseephemeron().
Referenced by atomic().
|
static |
Definition at line 803 of file lua-5.2.4/src/lgc.c.
References luaD_call(), lua_State::top, and UNUSED.
Referenced by GCTM().
|
static |
Definition at line 936 of file lua-5.2.4/src/lgc.c.
References global_State::allgc, global_State::finobj, G, GCSsweepstring, global_State::gcstate, lua_assert, NULL, global_State::sweepfin, global_State::sweepgc, global_State::sweepstrgc, and sweeptolive().
Referenced by luaC_changemode(), luaC_fullgc(), and singlestep().
Definition at line 663 of file lua-5.2.4/src/lgc.c.
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().
|
static |
Definition at line 809 of file lua-5.2.4/src/lgc.c.
References lua_State::allowhook, dothecall(), G, global_State::gcrunning, LUA_ERRGCMM, LUA_ERRRUN, LUA_OK, luaD_pcall(), luaD_throw(), luaO_pushfstring(), luaT_gettmbyobj(), NULL, savestack, setgcovalue, setobj2s, svalue, TM_GC, lua_State::top, ttisfunction, ttisstring, and udata2finalize().
Referenced by callallpendingfinalizers(), and luaC_forcestep().
|
static |
Definition at line 1117 of file lua-5.2.4/src/lgc.c.
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().
|
static |
Definition at line 1139 of file lua-5.2.4/src/lgc.c.
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 121 of file lua-5.2.4/src/lgc.c.
References gcvalue, iscollectable, iswhite, markobject, rawtsvalue, and ttisstring.
Referenced by clearkeys(), clearvalues(), traverseephemeron(), and traverseweakvalue().
Definition at line 135 of file lua-5.2.4/src/lgc.c.
References G, gch, GCSpause, global_State::gcstate, isblack, isdead, issweepphase, iswhite, keepinvariantout, lua_assert, LUA_TTABLE, makewhite, and reallymarkobject().
Definition at line 155 of file lua-5.2.4/src/lgc.c.
References black2gray, G, gch, gco2t, global_State::grayagain, isblack, isdead, lua_assert, and LUA_TTABLE.
Definition at line 172 of file lua-5.2.4/src/lgc.c.
References black2gray, Proto::cache, G, Proto::gclist, global_State::grayagain, isblack, lua_assert, luaC_objbarrier, NULL, and obj2gco.
void luaC_changemode | ( | lua_State * | L, |
int | mode ) |
Definition at line 952 of file lua-5.2.4/src/lgc.c.
References bitmask, entersweep(), G, global_State::GCestimate, global_State::gckind, GCSpropagate, gettotalbytes, KGC_GEN, KGC_NORMAL, luaC_runtilstate(), and sweepphases.
Definition at line 873 of file lua-5.2.4/src/lgc.c.
References global_State::allgc, global_State::finobj, G, gch, gfasttm, isfinalized, issweepphase, keepinvariantout, l_setbit, lua_assert, makewhite, NULL, 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 190 of file lua-5.2.4/src/lgc.c.
References gray2black, isblack, isgray, issweepphase, keepinvariant, lua_assert, makewhite, markvalue, obj2gco, resetoldbit, and UpVal::v.
Referenced by luaF_close().
void luaC_forcestep | ( | lua_State * | L | ) |
Definition at line 1163 of file lua-5.2.4/src/lgc.c.
References G, GCFINALIZENUM, GCSpause, global_State::gcstate, GCTM(), generationalcollection(), incstep(), isgenerational, and global_State::tobefnz.
Referenced by lua_gc(), and luaC_step().
void luaC_freeallobjects | ( | lua_State * | L | ) |
Definition at line 983 of file lua-5.2.4/src/lgc.c.
References global_State::allgc, callallpendingfinalizers(), global_State::currentwhite, global_State::finobj, G, global_State::gckind, stringtable::hash, KGC_NORMAL, lua_assert, NULL, stringtable::nuse, separatetobefnz(), stringtable::size, global_State::strt, sweepwholelist, and WHITEBITS.
Referenced by close_state(), close_state(), and close_state().
void luaC_fullgc | ( | lua_State * | L, |
int | isemergency ) |
Definition at line 1189 of file lua-5.2.4/src/lgc.c.
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().
Definition at line 212 of file lua-5.2.4/src/lgc.c.
References global_State::allgc, cast, G, gch, luaC_white, luaM_newobject, novariant, NULL, and obj2gco.
Referenced by createstrobj(), createstrobj(), createstrobj(), lua_newthread(), luaF_findupval(), luaF_initupvals(), luaF_newCclosure(), luaF_newCclosure(), luaF_newLclosure(), luaF_newLclosure(), luaF_newproto(), luaF_newupval(), luaH_new(), luaS_newudata(), luaS_newudata(), luaS_newudata(), and newupval().
void luaC_runtilstate | ( | lua_State * | L, |
int | statesmask ) |
Definition at line 1110 of file lua-5.2.4/src/lgc.c.
References G, global_State::gcstate, singlestep(), and testbit.
Referenced by generationalcollection(), luaC_changemode(), luaC_fullgc(), and luaS_resize().
void luaC_step | ( | lua_State * | L | ) |
Definition at line 1177 of file lua-5.2.4/src/lgc.c.
References G, global_State::gcrunning, GCSTEPSIZE, luaC_forcestep(), and luaE_setdebt().
|
static |
Definition at line 311 of file lua-5.2.4/src/lgc.c.
References gch, makewhite, NULL, reallymarkobject(), and global_State::tobefnz.
Referenced by atomic(), and restartcollection().
|
static |
Definition at line 301 of file lua-5.2.4/src/lgc.c.
References LUA_NUMTAGS, markobject, and global_State::mt.
Referenced by atomic(), and restartcollection().
|
static |
Definition at line 566 of file lua-5.2.4/src/lgc.c.
References global_State::gray, and propagatemark().
Referenced by atomic(), convergeephemerons(), propagatelist(), and retraversegrays().
|
static |
Definition at line 571 of file lua-5.2.4/src/lgc.c.
References global_State::gray, lua_assert, NULL, and propagateall().
Referenced by retraversegrays().
|
static |
Definition at line 521 of file lua-5.2.4/src/lgc.c.
References black2gray, gch, Proto::gclist, Table::gclist, lua_State::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 243 of file lua-5.2.4/src/lgc.c.
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, Table::metatable, sizestring, sizeudata, UpVal::u, UpVal::v, UpVal::value, and white2gray.
Referenced by luaC_barrier_(), markbeingfnz(), and traverseephemeron().
|
static |
Definition at line 324 of file lua-5.2.4/src/lgc.c.
References isgray, UpVal::l, markvalue, UpVal::next, obj2gco, UpVal::u, global_State::uvhead, and UpVal::v.
Referenced by atomic().
|
static |
Definition at line 107 of file lua-5.2.4/src/lgc.c.
References gkey, gval, lua_assert, setdeadvalue, ttisnil, and valiswhite.
Referenced by clearkeys(), clearvalues(), traverseephemeron(), traversestrongtable(), and traverseweakvalue().
|
static |
Definition at line 337 of file lua-5.2.4/src/lgc.c.
References global_State::allweak, global_State::ephemeron, global_State::gray, global_State::grayagain, global_State::l_registry, global_State::mainthread, markbeingfnz(), markmt(), markobject, markvalue, NULL, and global_State::weak.
Referenced by singlestep().
|
static |
Definition at line 582 of file lua-5.2.4/src/lgc.c.
References global_State::ephemeron, global_State::grayagain, NULL, propagateall(), propagatelist(), and global_State::weak.
Referenced by atomic().
|
static |
Definition at line 845 of file lua-5.2.4/src/lgc.c.
References FINALIZEDBIT, global_State::finobj, G, gch, isfinalized, iswhite, l_setbit, lua_assert, NULL, SEPARATED, testbit, and global_State::tobefnz.
Referenced by atomic(), and luaC_freeallobjects().
|
static |
Definition at line 913 of file lua-5.2.4/src/lgc.c.
References cast, global_State::gcpause, gettotalbytes, luaE_setdebt(), MAX_LMEM, and PAUSEADJ.
Referenced by generationalcollection(), incstep(), and luaC_fullgc().
Definition at line 1040 of file lua-5.2.4/src/lgc.c.
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, isgenerational, lua_assert, global_State::mainthread, obj2gco, propagatemark(), restartcollection(), stringtable::size, global_State::strt, global_State::sweepfin, global_State::sweepgc, sweeplist(), global_State::sweepstrgc, and sweepwholelist.
Referenced by incstep(), and luaC_runtilstate().
Definition at line 719 of file lua-5.2.4/src/lgc.c.
References bitmask, cast_byte, freeobj(), G, gch, gco2th, isdeadm, isgenerational, LUA_TTHREAD, luaC_white, maskcolors, NULL, OLDBIT, otherwhite, sweepthread(), and testbits.
Referenced by singlestep(), and sweeptolive().
Definition at line 698 of file lua-5.2.4/src/lgc.c.
References G, KGC_EMERGENCY, luaD_shrinkstack(), luaE_freeCI(), NULL, lua_State::openupval, lua_State::stack, and sweepwholelist.
Referenced by sweeplist().
Definition at line 758 of file lua-5.2.4/src/lgc.c.
References sweeplist().
Referenced by entersweep(), and luaC_checkfinalizer().
|
static |
Definition at line 479 of file lua-5.2.4/src/lgc.c.
References markvalue, sizeCclosure, and CClosure::upvalue.
Referenced by propagatemark().
|
static |
Definition at line 378 of file lua-5.2.4/src/lgc.c.
References global_State::allweak, Table::array, checkdeadkey, global_State::ephemeron, GCSatomic, global_State::gcstate, gcvalue, gkey, gnode, gnodelast, global_State::grayagain, gval, iscleared(), linktable, reallymarkobject(), removeentry(), Table::sizearray, ttisnil, and valiswhite.
Referenced by convergeephemerons(), and traversetable().
|
static |
Definition at line 486 of file lua-5.2.4/src/lgc.c.
References markobject, LClosure::p, sizeLclosure, and LClosure::upvals.
Referenced by propagatemark().
|
static |
Definition at line 457 of file lua-5.2.4/src/lgc.c.
References Proto::cache, iswhite, Proto::k, Proto::locvars, markobject, markvalue, NULL, 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 495 of file lua-5.2.4/src/lgc.c.
References lua_State::base_ci, lua_State::ci, GCSatomic, global_State::gcstate, markvalue, CallInfo::next, NULL, setnilvalue, lua_State::stack, lua_State::stacksize, and lua_State::top.
Referenced by propagatemark().
|
static |
Definition at line 416 of file lua-5.2.4/src/lgc.c.
References Table::array, checkdeadkey, gkey, gnode, gnodelast, gval, lua_assert, markvalue, removeentry(), Table::sizearray, and ttisnil.
Referenced by traversetable().
|
static |
Definition at line 434 of file lua-5.2.4/src/lgc.c.
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 355 of file lua-5.2.4/src/lgc.c.
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 789 of file lua-5.2.4/src/lgc.c.
References global_State::allgc, gch, isfinalized, isold, keepinvariantout, lua_assert, makewhite, resetbit, SEPARATED, and global_State::tobefnz.
Referenced by GCTM().