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.
Macros | |
#define | lgc_c |
#define | LUA_CORE |
#define | GCSTEPSIZE 1024u |
#define | GCSWEEPMAX 40 |
#define | GCSWEEPCOST 10 |
#define | GCFINALIZECOST 100 |
#define | maskmarks cast_byte(~(bitmask(BLACKBIT)|WHITEBITS)) |
#define | makewhite(g, x) ((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g))) |
#define | white2gray(x) reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) |
#define | black2gray(x) resetbit((x)->gch.marked, BLACKBIT) |
#define | stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT) |
#define | isfinalized(u) testbit((u)->marked, FINALIZEDBIT) |
#define | markfinalized(u) l_setbit((u)->marked, FINALIZEDBIT) |
#define | KEYWEAK bitmask(KEYWEAKBIT) |
#define | VALUEWEAK bitmask(VALUEWEAKBIT) |
#define | markvalue(g, o) |
#define | markobject(g, t) |
#define | setthreshold(g) (g->GCthreshold = (g->estimate/100) * g->gcpause) |
#define | sweepwholelist(L, p) sweeplist(L,p,MAX_LUMEM) |
Definition at line 38 of file lua-5.1.5/src/lgc.c.
Referenced by luaC_barrierback(), and propagatemark().
#define GCFINALIZECOST 100 |
Definition at line 29 of file lua-5.1.5/src/lgc.c.
Referenced by singlestep().
#define GCSTEPSIZE 1024u |
Definition at line 26 of file lua-5.1.5/src/lgc.c.
Referenced by incstep(), lua_gc(), and luaC_step().
#define GCSWEEPCOST 10 |
Definition at line 28 of file lua-5.1.5/src/lgc.c.
Referenced by singlestep().
#define GCSWEEPMAX 40 |
Definition at line 27 of file lua-5.1.5/src/lgc.c.
Referenced by singlestep().
#define isfinalized | ( | u | ) | testbit((u)->marked, FINALIZEDBIT) |
Definition at line 43 of file lua-5.1.5/src/lgc.c.
Referenced by iscleared(), and luaC_separateudata().
#define KEYWEAK bitmask(KEYWEAKBIT) |
Definition at line 47 of file lua-5.1.5/src/lgc.c.
Referenced by traversetable().
#define lgc_c |
Definition at line 9 of file lua-5.1.5/src/lgc.c.
#define LUA_CORE |
Definition at line 10 of file lua-5.1.5/src/lgc.c.
#define makewhite | ( | g, | |
x ) ((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g))) |
Definition at line 34 of file lua-5.1.5/src/lgc.c.
Referenced by GCTM(), luaC_barrierf(), luaC_linkupval(), marktmu(), and sweeplist().
#define markfinalized | ( | u | ) | l_setbit((u)->marked, FINALIZEDBIT) |
Definition at line 44 of file lua-5.1.5/src/lgc.c.
Referenced by luaC_separateudata().
#define markobject | ( | g, | |
t ) |
Definition at line 55 of file lua-5.1.5/src/lgc.c.
Referenced by atomic(), markmt(), markroot(), reallymarkobject(), traverseclosure(), traverseproto(), and traversetable().
#define markvalue | ( | g, | |
o ) |
Definition at line 52 of file lua-5.1.5/src/lgc.c.
Referenced by markroot(), reallymarkobject(), remarkupvals(), traverseclosure(), traverseproto(), traversestack(), and traversetable().
Definition at line 32 of file lua-5.1.5/src/lgc.c.
#define setthreshold | ( | g | ) | (g->GCthreshold = (g->estimate/100) * g->gcpause) |
Definition at line 59 of file lua-5.1.5/src/lgc.c.
Referenced by luaC_fullgc(), and luaC_step().
#define stringmark | ( | s | ) | reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT) |
Definition at line 40 of file lua-5.1.5/src/lgc.c.
Referenced by iscleared(), and traverseproto().
Definition at line 404 of file lua-5.1.5/src/lgc.c.
Referenced by luaC_freeall(), singlestep(), and sweeplist().
#define VALUEWEAK bitmask(VALUEWEAKBIT) |
Definition at line 48 of file lua-5.1.5/src/lgc.c.
Referenced by traversetable().
#define white2gray | ( | x | ) | reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) |
Definition at line 37 of file lua-5.1.5/src/lgc.c.
Referenced by reallymarkobject().
|
static |
Definition at line 525 of file lua-5.1.5/src/lgc.c.
References cast_byte, cleartable(), global_State::currentwhite, global_State::estimate, G, GCSsweepstring, global_State::gcstate, global_State::gray, global_State::grayagain, iswhite, lua_assert, luaC_separateudata(), global_State::mainthread, markmt(), markobject, marktmu(), NULL, obj2gco, otherwhite, propagateall(), remarkupvals(), global_State::rootgc, global_State::sweepgc, global_State::sweepstrgc, global_State::totalbytes, and global_State::weak.
Referenced by singlestep().
|
static |
Definition at line 431 of file lua-5.1.5/src/lgc.c.
References global_State::buff, cast, G, LUA_MINBUFFER, luaS_resize(), luaZ_resizebuffer, luaZ_sizebuffer, MINSTRTABSIZE, stringtable::nuse, stringtable::size, and global_State::strt.
Referenced by singlestep().
Definition at line 241 of file lua-5.1.5/src/lgc.c.
References lua_State::base_ci, BASIC_STACK_SIZE, cast_int, lua_State::ci, condhardstacktests, EXTRA_STACK, luaD_reallocCI(), luaD_reallocstack(), LUAI_MAXCALLS, lua_State::size_ci, lua_State::stack, lua_State::stacksize, and stacksize.
Referenced by traversestack().
|
static |
Definition at line 351 of file lua-5.1.5/src/lgc.c.
References Table::array, Table::gclist, gco2h, gnode, gval, iscleared(), key2tval, KEYWEAKBIT, lua_assert, removeentry(), setnilvalue, Table::sizearray, sizenode, testbit, ttisnil, and VALUEWEAKBIT.
Referenced by atomic().
Definition at line 378 of file lua-5.1.5/src/lgc.c.
References G, GCObject::gch, gco2cl, gco2h, gco2p, gco2th, gco2ts, gco2u, gco2uv, lua_assert, LUA_TFUNCTION, LUA_TPROTO, LUA_TSTRING, LUA_TTABLE, LUA_TTHREAD, LUA_TUPVAL, LUA_TUSERDATA, luaE_freethread(), luaF_freeclosure(), luaF_freeproto(), luaF_freeupval(), luaH_free(), luaM_freemem, sizestring, and sizeudata.
Referenced by sweeplist().
|
static |
Definition at line 445 of file lua-5.1.5/src/lgc.c.
References lua_State::allowhook, fasttm, G, GCObject::gch, global_State::GCthreshold, luaD_call(), global_State::mainthread, makewhite, Udata::metatable, NULL, rawgco2u, setobj2s, setuvalue, TM_GC, global_State::tmudata, lua_State::top, global_State::totalbytes, and Udata::uv.
Referenced by luaC_callGCTM(), and singlestep().
|
static |
Definition at line 337 of file lua-5.1.5/src/lgc.c.
References gcvalue, iscollectable, isfinalized, iswhite, rawtsvalue, stringmark, ttisstring, ttisuserdata, and uvalue.
Referenced by cleartable().
Definition at line 674 of file lua-5.1.5/src/lgc.c.
References black2gray, G, Table::gclist, GCSfinalize, GCSpause, global_State::gcstate, global_State::grayagain, isblack, isdead, lua_assert, and obj2gco.
Definition at line 661 of file lua-5.1.5/src/lgc.c.
References G, GCObject::gch, GCSfinalize, GCSpause, GCSpropagate, global_State::gcstate, isblack, isdead, iswhite, lua_assert, LUA_TTABLE, makewhite, reallymarkobject(), and ttype.
void luaC_callGCTM | ( | lua_State * | L | ) |
Definition at line 477 of file lua-5.1.5/src/lgc.c.
Referenced by callallgcTM().
void luaC_freeall | ( | lua_State * | L | ) |
Definition at line 483 of file lua-5.1.5/src/lgc.c.
References bitmask, global_State::currentwhite, G, stringtable::hash, global_State::rootgc, SFIXEDBIT, stringtable::size, global_State::strt, sweepwholelist, and WHITEBITS.
Referenced by close_state().
void luaC_fullgc | ( | lua_State * | L | ) |
Definition at line 635 of file lua-5.1.5/src/lgc.c.
References G, GCSfinalize, GCSpause, GCSpropagate, GCSsweep, GCSsweepstring, global_State::gcstate, global_State::gray, global_State::grayagain, lua_assert, markroot(), NULL, global_State::rootgc, setthreshold, singlestep(), global_State::sweepgc, global_State::sweepstrgc, and global_State::weak.
Referenced by growstrtab(), lua_gc(), lua_gc(), luaM_realloc_(), and tryagain().
Definition at line 685 of file lua-5.1.5/src/lgc.c.
References G, GCObject::gch, luaC_white, and global_State::rootgc.
Referenced by luaE_newthread(), luaF_newCclosure(), luaF_newLclosure(), luaF_newproto(), luaF_newupval(), and luaH_new().
Definition at line 694 of file lua-5.1.5/src/lgc.c.
References G, GCObject::gch, GCSfinalize, GCSpause, GCSpropagate, global_State::gcstate, gray2black, isgray, lua_assert, luaC_barrier, makewhite, obj2gco, global_State::rootgc, and UpVal::v.
Referenced by luaF_close().
size_t luaC_separateudata | ( | lua_State * | L, |
int | all ) |
Definition at line 128 of file lua-5.1.5/src/lgc.c.
References fasttm, G, GCObject::gch, gco2u, isfinalized, iswhite, global_State::mainthread, markfinalized, NULL, sizeudata, TM_GC, and global_State::tmudata.
Referenced by atomic(), and lua_close().
void luaC_step | ( | lua_State * | L | ) |
Definition at line 610 of file lua-5.1.5/src/lgc.c.
References G, global_State::gcdept, GCSpause, global_State::gcstate, global_State::gcstepmul, GCSTEPSIZE, global_State::GCthreshold, MAX_LUMEM, setthreshold, singlestep(), and global_State::totalbytes.
|
static |
Definition at line 493 of file lua-5.1.5/src/lgc.c.
References markobject, global_State::mt, and NUM_TAGS.
Referenced by atomic(), and markroot().
|
static |
Definition at line 501 of file lua-5.1.5/src/lgc.c.
References G, GCSpropagate, global_State::gcstate, global_State::gray, global_State::grayagain, gt, global_State::mainthread, markmt(), markobject, markvalue, NULL, registry, and global_State::weak.
Referenced by luaC_fullgc(), and singlestep().
|
static |
Definition at line 115 of file lua-5.1.5/src/lgc.c.
References GCObject::gch, makewhite, reallymarkobject(), and global_State::tmudata.
Referenced by atomic().
|
static |
Definition at line 323 of file lua-5.1.5/src/lgc.c.
References global_State::gray, and propagatemark().
Referenced by atomic().
|
static |
Definition at line 277 of file lua-5.1.5/src/lgc.c.
References black2gray, Closure::c, GCObject::gch, Proto::gclist, Table::gclist, lua_State::gclist, gco2cl, gco2h, gco2p, gco2th, global_State::gray, gray2black, global_State::grayagain, isgray, Closure::l, lua_assert, LUA_TFUNCTION, LUA_TPROTO, LUA_TTABLE, LUA_TTHREAD, lua_State::size_ci, Table::sizearray, sizeCclosure, Proto::sizecode, Proto::sizek, sizeLclosure, Proto::sizelineinfo, Proto::sizelocvars, sizenode, Proto::sizep, Proto::sizeupvalues, lua_State::stacksize, traverseclosure(), traverseproto(), traversestack(), and traversetable().
Referenced by propagateall(), and singlestep().
|
static |
Definition at line 69 of file lua-5.1.5/src/lgc.c.
References GCObject::gch, gco2cl, gco2h, gco2p, gco2th, gco2u, gco2uv, global_State::gray, gray2black, isdead, iswhite, lua_assert, LUA_TFUNCTION, LUA_TPROTO, LUA_TSTRING, LUA_TTABLE, LUA_TTHREAD, LUA_TUPVAL, LUA_TUSERDATA, markobject, markvalue, Table::metatable, UpVal::u, UpVal::v, UpVal::value, and white2gray.
Referenced by luaC_barrierf(), and marktmu().
|
static |
Definition at line 515 of file lua-5.1.5/src/lgc.c.
References isgray, UpVal::l, lua_assert, markvalue, UpVal::next, obj2gco, UpVal::prev, UpVal::u, global_State::uvhead, and UpVal::v.
Referenced by atomic().
|
static |
Definition at line 62 of file lua-5.1.5/src/lgc.c.
References gkey, gval, iscollectable, lua_assert, LUA_TDEADKEY, setttype, and ttisnil.
Referenced by cleartable(), and traversetable().
Definition at line 556 of file lua-5.1.5/src/lgc.c.
References atomic(), checkSizes(), global_State::estimate, G, global_State::gcdept, GCFINALIZECOST, GCSfinalize, GCSpause, GCSpropagate, GCSsweep, GCSsweepstring, global_State::gcstate, GCSWEEPCOST, GCSWEEPMAX, GCTM(), global_State::gray, stringtable::hash, lua_assert, markroot(), NULL, propagatemark(), stringtable::size, global_State::strt, global_State::sweepgc, sweeplist(), global_State::sweepstrgc, sweepwholelist, global_State::tmudata, and global_State::totalbytes.
Referenced by luaC_fullgc(), and luaC_step().
Definition at line 407 of file lua-5.1.5/src/lgc.c.
References bitmask, FIXEDBIT, freeobj(), G, GCObject::gch, gco2th, isdead, lua_assert, LUA_TTHREAD, makewhite, NULL, otherwhite, global_State::rootgc, SFIXEDBIT, sweepwholelist, testbit, and WHITEBITS.
Referenced by singlestep().
|
static |
Definition at line 224 of file lua-5.1.5/src/lgc.c.
References Closure::c, Closure::l, lua_assert, markobject, markvalue, Proto::nups, LClosure::p, LClosure::upvals, and CClosure::upvalue.
Referenced by propagatemark().
|
static |
Definition at line 203 of file lua-5.1.5/src/lgc.c.
References Proto::k, Proto::locvars, markobject, markvalue, Proto::p, Proto::sizek, Proto::sizelocvars, Proto::sizep, Proto::sizeupvalues, Proto::source, stringmark, Proto::upvalues, and LocVar::varname.
Referenced by propagatemark().
|
static |
Definition at line 256 of file lua-5.1.5/src/lgc.c.
References lua_State::base_ci, checkstacksizes(), lua_State::ci, gt, lua_assert, markvalue, setnilvalue, lua_State::stack, lua_State::stack_last, CallInfo::top, and lua_State::top.
Referenced by propagatemark().
|
static |
Definition at line 158 of file lua-5.1.5/src/lgc.c.
References Table::array, cast_byte, Table::gclist, gfasttm, gkey, gnode, gval, KEYWEAK, KEYWEAKBIT, lua_assert, LUA_TDEADKEY, markobject, markvalue, Table::metatable, NULL, obj2gco, removeentry(), Table::sizearray, sizenode, svalue, TM_MODE, ttisnil, ttisstring, ttype, VALUEWEAK, VALUEWEAKBIT, and global_State::weak.
Referenced by propagatemark().