Go to the documentation of this file.
35 #define GCSWEEPMAX 100
46 #define GCFINALIZECOST 50
53 #define WORK2MEM sizeof(TValue)
64 #define maskcolors (bitmask(BLACKBIT) | WHITEBITS)
67 #define maskgcbits (maskcolors | AGEBITS)
71 #define makewhite(g,x) \
72 (x->marked = cast_byte((x->marked & ~maskcolors) | luaC_white(g)))
75 #define set2gray(x) resetbits(x->marked, maskcolors)
79 #define set2black(x) \
80 (x->marked = cast_byte((x->marked & ~WHITEBITS) | bitmask(BLACKBIT)))
83 #define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x)))
85 #define keyiswhite(n) (keyiscollectable(n) && iswhite(gckey(n)))
91 #define gcvalueN(o) (iscollectable(o) ? gcvalue(o) : NULL)
94 #define markvalue(g,o) { checkliveness(g->mainthread,o); \
95 if (valiswhite(o)) reallymarkobject(g,gcvalue(o)); }
97 #define markkey(g, n) { if keyiswhite(n) reallymarkobject(g,gckey(n)); }
99 #define markobject(g,t) { if (iswhite(t)) reallymarkobject(g, obj2gco(t)); }
105 #define markobjectN(g,t) { if (t) markobject(g,t); }
122 #define gnodelast(h) gnode(h, cast_sizet(sizenode(h)))
146 #define linkgclist(o,p) linkgclist_(obj2gco(o), &(o)->gclist, &(p))
159 #define linkobjgclist(o,p) linkgclist_(obj2gco(o), getgclist(o), &(p))
186 if (o == NULL)
return 0;
342 for (o = g->
tobefnz; o != NULL; o = o->next) {
365 while ((
thread = *p) != NULL) {
374 for (uv =
thread->openupval; uv != NULL; uv = uv->
u.
open.next) {
444 int hasclears = (h->
alimit > 0);
445 for (n =
gnode(h, 0); n < limit; n++) {
482 for (i = 0; i < asize; i++) {
490 for (i = 0; i < nsize; i++) {
521 for (i = 0; i < asize; i++)
523 for (n =
gnode(h, 0); n < limit; n++) {
537 const char *weakkey, *weakvalue;
543 (weakkey || weakvalue))) {
560 for (i = 0; i < u->
nuvalue; i++)
575 for (i = 0; i <
f->sizek; i++)
577 for (i = 0; i <
f->sizeupvalues; i++)
579 for (i = 0; i <
f->sizep; i++)
581 for (i = 0; i <
f->sizelocvars; i++)
583 return 1 +
f->sizek +
f->sizeupvalues +
f->sizep +
f->sizelocvars;
589 for (i = 0; i < cl->nupvalues; i++)
591 return 1 + cl->nupvalues;
601 for (i = 0; i < cl->nupvalues; i++) {
605 return 1 + cl->nupvalues;
630 for (; o < th->
top; o++)
691 while ((w =
next) != NULL) {
718 for (; l; l =
gco2t(l)->gclist) {
722 for (n =
gnode(h, 0); n < limit; n++) {
737 for (; l !=
f; l =
gco2t(l)->gclist) {
742 for (i = 0; i < asize; i++) {
747 for (n =
gnode(h, 0); n < limit; n++) {
822 for (i = 0; *p != NULL && i < countin; i++) {
824 int marked = curr->marked;
836 return (*p == NULL) ? NULL : p;
919 if (l_unlikely(status !=
LUA_OK)) {
933 for (i = 0; i < n && g->
tobefnz; i++)
978 curr->next = *lastnext;
980 lastnext = &curr->next;
1026 for (p = &g->
allgc; *p != o; p = &(*p)->next) { }
1055 while ((curr = *p) != NULL) {
1090 static const lu_byte nextage[] = {
1101 while ((curr = *p) != limit) {
1131 for (; p != NULL; p = p->next)
1147 while ((curr = *p) != NULL) {
1169 remain: p =
next;
continue;
1196 for (p = from; p != to; p = p->next) {
1242 g->
old1 = *psurvival;
1325 if (newmode != g->
gckind) {
1381 if (newatomic < lastatomic + (lastatomic >> 3)) {
1458 l_mem threshold, debt;
1462 threshold = (pause <
MAX_LMEM / estimate)
1466 if (debt > 0) debt = 0;
1491 while (p != limit) {
1533 g->
gray = grayagain;
1560 int nextstate,
GCObject **nextlist) {
1589 if (g->
gray == NULL) {
1670 debt = (debt / stepmul) *
WORK2MEM;
void luaE_warnerror(lua_State *L, const char *where)
GCObject * luaC_newobj(lua_State *L, int tt, size_t sz)
static int remarkupvals(global_State *g)
void luaC_barrierback_(lua_State *L, GCObject *o)
static void deletelist(lua_State *L, GCObject *p, GCObject *limit)
static void reallymarkobject(global_State *g, GCObject *o)
static lu_mem entergen(lua_State *L, global_State *g)
static void restartcollection(global_State *g)
static void cleargraylists(global_State *g)
void luaH_free(lua_State *L, Table *t)
#define isdecGCmodegen(g)
static void stepgenfull(lua_State *L, global_State *g)
static int traverseLclosure(global_State *g, LClosure *cl)
static int traverseudata(global_State *g, Udata *u)
#define linkobjgclist(o, p)
static void enterinc(global_State *g)
static void fullinc(lua_State *L, global_State *g)
static void markmt(global_State *g)
void luaF_freeproto(lua_State *L, Proto *f)
void luaC_checkfinalizer(lua_State *L, GCObject *o, Table *mt)
static void GCTM(lua_State *L)
static int traverseephemeron(global_State *g, Table *h, int inv)
static void checkpointer(GCObject **p, GCObject *o)
static int iscleared(global_State *g, const GCObject *o)
void luaF_unlinkupval(UpVal *uv)
static lu_mem traversetable(global_State *g, Table *h)
static GCObject ** sweeptolive(lua_State *L, GCObject **p)
static GCObject ** sweepgen(lua_State *L, global_State *g, GCObject **p, GCObject *limit, GCObject **pfirstold1)
static lu_mem singlestep(lua_State *L)
void luaC_step(lua_State *L)
void luaC_fix(lua_State *L, GCObject *o)
#define keyiscollectable(n)
static void setminordebt(global_State *g)
static void traversestrongtable(global_State *g, Table *h)
#define setgcovalue(L, obj, x)
#define changeage(o, f, t)
void luaC_runtilstate(lua_State *L, int statesmask)
void luaS_remove(lua_State *L, TString *ts)
static void clearbykeys(global_State *g, GCObject *l)
#define markobjectN(g, t)
void luaD_callnoyield(lua_State *L, StkId func, int nResults)
basic_thread< reference > thread
static void genstep(lua_State *L, global_State *g)
static void traverseweakvalue(global_State *g, Table *h)
static void freeobj(lua_State *L, GCObject *o)
void luaD_shrinkstack(lua_State *L)
unsigned short callstatus
static int traversethread(global_State *g, lua_State *th)
struct lua_State * mainthread
static GCObject ** sweeplist(lua_State *L, GCObject **p, int countin, int *countout)
static void youngcollection(lua_State *L, global_State *g)
constexpr auto count() -> size_t
void luaE_setdebt(global_State *g, l_mem debt)
static void correctgraylists(global_State *g)
static void clearkey(Node *n)
static void clearbyvalues(global_State *g, GCObject *l, GCObject *f)
static void linkgclist_(GCObject *o, GCObject **pnext, GCObject **list)
#define gfasttm(g, et, e)
void luaC_barrier_(lua_State *L, GCObject *o, GCObject *v)
LUAI_FUNC unsigned int luaH_realasize(const Table *t)
static GCObject ** findlast(GCObject **p)
static GCObject * udata2finalize(global_State *g)
static GCObject ** getgclist(GCObject *o)
#define luaM_newobject(L, tag, s)
static void checkSizes(lua_State *L, global_State *g)
static void dothecall(lua_State *L, void *ud)
static void markold(global_State *g, GCObject *from, GCObject *to)
static void setpause(global_State *g)
static lu_mem propagateall(global_State *g)
void luaC_freeallobjects(lua_State *L)
static void finishgencycle(lua_State *L, global_State *g)
static GCObject ** correctgraylist(GCObject **p)
#define sizeudata(nuv, nb)
static void correctpointers(global_State *g, GCObject *o)
static int sweepstep(lua_State *L, global_State *g, int nextstate, GCObject **nextlist)
int luaD_pcall(lua_State *L, Pfunc func, void *u, ptrdiff_t old_top, ptrdiff_t ef)
void remove(lua_State *L_, int rawindex, int count)
static lu_mem atomic(lua_State *L)
#define luaM_freemem(L, b, s)
static void atomic2gen(lua_State *L, global_State *g)
static lu_mem fullgen(lua_State *L, global_State *g)
static void callallpendingfinalizers(lua_State *L)
const TValue * luaT_gettmbyobj(lua_State *L, const TValue *o, TMS event)
static int runafewfinalizers(lua_State *L, int n)
#define setobj2s(L, o1, o2)
static void convergeephemerons(global_State *g)
void luaS_clearcache(global_State *g)
static int traverseCclosure(global_State *g, CClosure *cl)
struct UpVal::@4::@5 open
static lu_mem markbeingfnz(global_State *g)
static void separatetobefnz(global_State *g, int all)
static int traverseproto(global_State *g, Proto *f)
void luaC_fullgc(lua_State *L, int isemergency)
static void whitelist(global_State *g, GCObject *p)
void luaC_changemode(lua_State *L, int newmode)
void luaE_freethread(lua_State *L, lua_State *L1)
void luaS_resize(lua_State *L, int nsize)
static void freeupval(lua_State *L, UpVal *uv)
static lu_mem propagatemark(global_State *g)
struct Table * mt[LUA_NUMTAGS]
static void sweep2old(lua_State *L, GCObject **p)
static void genlink(global_State *g, GCObject *o)
static void entersweep(lua_State *L)
static void incstep(lua_State *L, global_State *g)
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:44