Macros | Functions
lgc.c File Reference
#include "lprefix.h"
#include <stdio.h>
#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"
Include dependency graph for lgc.c:

Go to the source code of this file.

Macros

#define GCFINALIZECOST   50
 
#define GCFINMAX   10
 
#define GCSWEEPMAX   100
 
#define gcvalueN(o)   (iscollectable(o) ? gcvalue(o) : NULL)
 
#define gnodelast(h)   gnode(h, cast_sizet(sizenode(h)))
 
#define keyiswhite(n)   (keyiscollectable(n) && iswhite(gckey(n)))
 
#define lgc_c
 
#define linkgclist(o, p)   linkgclist_(obj2gco(o), &(o)->gclist, &(p))
 
#define linkobjgclist(o, p)   linkgclist_(obj2gco(o), getgclist(o), &(p))
 
#define LUA_CORE
 
#define makewhite(g, x)   (x->marked = cast_byte((x->marked & ~maskcolors) | luaC_white(g)))
 
#define markkey(g, n)   { if keyiswhite(n) reallymarkobject(g,gckey(n)); }
 
#define markobject(g, t)   { if (iswhite(t)) reallymarkobject(g, obj2gco(t)); }
 
#define markobjectN(g, t)   { if (t) markobject(g,t); }
 
#define markvalue(g, o)
 
#define maskcolors   (bitmask(BLACKBIT) | WHITEBITS)
 
#define maskgcbits   (maskcolors | AGEBITS)
 
#define PAUSEADJ   100
 
#define set2black(x)   (x->marked = cast_byte((x->marked & ~WHITEBITS) | bitmask(BLACKBIT)))
 
#define set2gray(x)   resetbits(x->marked, maskcolors)
 
#define valiswhite(x)   (iscollectable(x) && iswhite(gcvalue(x)))
 
#define WORK2MEM   sizeof(TValue)
 

Functions

static lu_mem atomic (lua_State *L)
 
static void atomic2gen (lua_State *L, global_State *g)
 
static void callallpendingfinalizers (lua_State *L)
 
static void checkpointer (GCObject **p, GCObject *o)
 
static void checkSizes (lua_State *L, global_State *g)
 
static void clearbykeys (global_State *g, GCObject *l)
 
static void clearbyvalues (global_State *g, GCObject *l, GCObject *f)
 
static void cleargraylists (global_State *g)
 
static void clearkey (Node *n)
 
static void convergeephemerons (global_State *g)
 
static GCObject ** correctgraylist (GCObject **p)
 
static void correctgraylists (global_State *g)
 
static void correctpointers (global_State *g, GCObject *o)
 
static void deletelist (lua_State *L, GCObject *p, GCObject *limit)
 
static void dothecall (lua_State *L, void *ud)
 
static lu_mem entergen (lua_State *L, global_State *g)
 
static void enterinc (global_State *g)
 
static void entersweep (lua_State *L)
 
static GCObject ** findlast (GCObject **p)
 
static void finishgencycle (lua_State *L, global_State *g)
 
static void freeobj (lua_State *L, GCObject *o)
 
static void freeupval (lua_State *L, UpVal *uv)
 
static lu_mem fullgen (lua_State *L, global_State *g)
 
static void fullinc (lua_State *L, global_State *g)
 
static void GCTM (lua_State *L)
 
static void genlink (global_State *g, GCObject *o)
 
static void genstep (lua_State *L, global_State *g)
 
static GCObject ** getgclist (GCObject *o)
 
static void incstep (lua_State *L, global_State *g)
 
static int iscleared (global_State *g, const GCObject *o)
 
static void linkgclist_ (GCObject *o, GCObject **pnext, GCObject **list)
 
void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v)
 
void luaC_barrierback_ (lua_State *L, GCObject *o)
 
void luaC_changemode (lua_State *L, int newmode)
 
void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt)
 
void luaC_fix (lua_State *L, GCObject *o)
 
void luaC_freeallobjects (lua_State *L)
 
void luaC_fullgc (lua_State *L, int isemergency)
 
GCObjectluaC_newobj (lua_State *L, int tt, size_t sz)
 
void luaC_runtilstate (lua_State *L, int statesmask)
 
void luaC_step (lua_State *L)
 
static lu_mem markbeingfnz (global_State *g)
 
static void markmt (global_State *g)
 
static void markold (global_State *g, GCObject *from, GCObject *to)
 
static lu_mem propagateall (global_State *g)
 
static lu_mem propagatemark (global_State *g)
 
static void reallymarkobject (global_State *g, GCObject *o)
 
static int remarkupvals (global_State *g)
 
static void restartcollection (global_State *g)
 
static int runafewfinalizers (lua_State *L, int n)
 
static void separatetobefnz (global_State *g, int all)
 
static void setminordebt (global_State *g)
 
static void setpause (global_State *g)
 
static lu_mem singlestep (lua_State *L)
 
static void stepgenfull (lua_State *L, global_State *g)
 
static void sweep2old (lua_State *L, GCObject **p)
 
static GCObject ** sweepgen (lua_State *L, global_State *g, GCObject **p, GCObject *limit, GCObject **pfirstold1)
 
static GCObject ** sweeplist (lua_State *L, GCObject **p, int countin, int *countout)
 
static int sweepstep (lua_State *L, global_State *g, int nextstate, GCObject **nextlist)
 
static GCObject ** sweeptolive (lua_State *L, GCObject **p)
 
static int traverseCclosure (global_State *g, CClosure *cl)
 
static int traverseephemeron (global_State *g, Table *h, int inv)
 
static int traverseLclosure (global_State *g, LClosure *cl)
 
static int traverseproto (global_State *g, Proto *f)
 
static void traversestrongtable (global_State *g, Table *h)
 
static lu_mem traversetable (global_State *g, Table *h)
 
static int traversethread (global_State *g, lua_State *th)
 
static int traverseudata (global_State *g, Udata *u)
 
static void traverseweakvalue (global_State *g, Table *h)
 
static GCObjectudata2finalize (global_State *g)
 
static void whitelist (global_State *g, GCObject *p)
 
static void youngcollection (lua_State *L, global_State *g)
 

Macro Definition Documentation

◆ GCFINALIZECOST

#define GCFINALIZECOST   50

Definition at line 46 of file lgc.c.

◆ GCFINMAX

#define GCFINMAX   10

Definition at line 40 of file lgc.c.

◆ GCSWEEPMAX

#define GCSWEEPMAX   100

Definition at line 35 of file lgc.c.

◆ gcvalueN

#define gcvalueN (   o)    (iscollectable(o) ? gcvalue(o) : NULL)

Definition at line 91 of file lgc.c.

◆ gnodelast

#define gnodelast (   h)    gnode(h, cast_sizet(sizenode(h)))

Definition at line 122 of file lgc.c.

◆ keyiswhite

#define keyiswhite (   n)    (keyiscollectable(n) && iswhite(gckey(n)))

Definition at line 85 of file lgc.c.

◆ lgc_c

#define lgc_c

Definition at line 7 of file lgc.c.

◆ linkgclist

#define linkgclist (   o,
 
)    linkgclist_(obj2gco(o), &(o)->gclist, &(p))

Definition at line 146 of file lgc.c.

◆ linkobjgclist

#define linkobjgclist (   o,
 
)    linkgclist_(obj2gco(o), getgclist(o), &(p))

Definition at line 159 of file lgc.c.

◆ LUA_CORE

#define LUA_CORE

Definition at line 8 of file lgc.c.

◆ makewhite

#define makewhite (   g,
 
)    (x->marked = cast_byte((x->marked & ~maskcolors) | luaC_white(g)))

Definition at line 71 of file lgc.c.

◆ markkey

#define markkey (   g,
 
)    { if keyiswhite(n) reallymarkobject(g,gckey(n)); }

Definition at line 97 of file lgc.c.

◆ markobject

#define markobject (   g,
 
)    { if (iswhite(t)) reallymarkobject(g, obj2gco(t)); }

Definition at line 99 of file lgc.c.

◆ markobjectN

#define markobjectN (   g,
 
)    { if (t) markobject(g,t); }

Definition at line 105 of file lgc.c.

◆ markvalue

#define markvalue (   g,
 
)
Value:
{ checkliveness(g->mainthread,o); \

Definition at line 94 of file lgc.c.

◆ maskcolors

#define maskcolors   (bitmask(BLACKBIT) | WHITEBITS)

Definition at line 64 of file lgc.c.

◆ maskgcbits

#define maskgcbits   (maskcolors | AGEBITS)

Definition at line 67 of file lgc.c.

◆ PAUSEADJ

#define PAUSEADJ   100

Definition at line 60 of file lgc.c.

◆ set2black

#define set2black (   x)    (x->marked = cast_byte((x->marked & ~WHITEBITS) | bitmask(BLACKBIT)))

Definition at line 79 of file lgc.c.

◆ set2gray

#define set2gray (   x)    resetbits(x->marked, maskcolors)

Definition at line 75 of file lgc.c.

◆ valiswhite

#define valiswhite (   x)    (iscollectable(x) && iswhite(gcvalue(x)))

Definition at line 83 of file lgc.c.

◆ WORK2MEM

#define WORK2MEM   sizeof(TValue)

Definition at line 53 of file lgc.c.

Function Documentation

◆ atomic()

static lu_mem atomic ( lua_State L)
static

Definition at line 1516 of file lgc.c.

◆ atomic2gen()

static void atomic2gen ( lua_State L,
global_State g 
)
static

Definition at line 1265 of file lgc.c.

◆ callallpendingfinalizers()

static void callallpendingfinalizers ( lua_State L)
static

Definition at line 942 of file lgc.c.

◆ checkpointer()

static void checkpointer ( GCObject **  p,
GCObject o 
)
static

Definition at line 989 of file lgc.c.

◆ checkSizes()

static void checkSizes ( lua_State L,
global_State g 
)
static

Definition at line 863 of file lgc.c.

◆ clearbykeys()

static void clearbykeys ( global_State g,
GCObject l 
)
static

Definition at line 717 of file lgc.c.

◆ clearbyvalues()

static void clearbyvalues ( global_State g,
GCObject l,
GCObject f 
)
static

Definition at line 736 of file lgc.c.

◆ cleargraylists()

static void cleargraylists ( global_State g)
static

Definition at line 388 of file lgc.c.

◆ clearkey()

static void clearkey ( Node n)
static

Definition at line 171 of file lgc.c.

◆ convergeephemerons()

static void convergeephemerons ( global_State g)
static

Definition at line 683 of file lgc.c.

◆ correctgraylist()

static GCObject** correctgraylist ( GCObject **  p)
static

Definition at line 1145 of file lgc.c.

◆ correctgraylists()

static void correctgraylists ( global_State g)
static

Definition at line 1178 of file lgc.c.

◆ correctpointers()

static void correctpointers ( global_State g,
GCObject o 
)
static

Definition at line 999 of file lgc.c.

◆ deletelist()

static void deletelist ( lua_State L,
GCObject p,
GCObject limit 
)
static

Definition at line 1490 of file lgc.c.

◆ dothecall()

static void dothecall ( lua_State L,
void *  ud 
)
static

Definition at line 893 of file lgc.c.

◆ entergen()

static lu_mem entergen ( lua_State L,
global_State g 
)
static

Definition at line 1293 of file lgc.c.

◆ enterinc()

static void enterinc ( global_State g)
static

Definition at line 1308 of file lgc.c.

◆ entersweep()

static void entersweep ( lua_State L)
static

Definition at line 1478 of file lgc.c.

◆ findlast()

static GCObject** findlast ( GCObject **  p)
static

Definition at line 952 of file lgc.c.

◆ finishgencycle()

static void finishgencycle ( lua_State L,
global_State g 
)
static

Definition at line 1210 of file lgc.c.

◆ freeobj()

static void freeobj ( lua_State L,
GCObject o 
)
static

Definition at line 764 of file lgc.c.

◆ freeupval()

static void freeupval ( lua_State L,
UpVal uv 
)
static

Definition at line 757 of file lgc.c.

◆ fullgen()

static lu_mem fullgen ( lua_State L,
global_State g 
)
static

Definition at line 1338 of file lgc.c.

◆ fullinc()

static void fullinc ( lua_State L,
global_State g 
)
static

Definition at line 1697 of file lgc.c.

◆ GCTM()

static void GCTM ( lua_State L)
static

Definition at line 899 of file lgc.c.

◆ genlink()

static void genlink ( global_State g,
GCObject o 
)
static

Definition at line 424 of file lgc.c.

◆ genstep()

static void genstep ( lua_State L,
global_State g 
)
static

Definition at line 1414 of file lgc.c.

◆ getgclist()

static GCObject** getgclist ( GCObject o)
static

Definition at line 125 of file lgc.c.

◆ incstep()

static void incstep ( lua_State L,
global_State g 
)
static

Definition at line 1657 of file lgc.c.

◆ iscleared()

static int iscleared ( global_State g,
const GCObject o 
)
static

Definition at line 185 of file lgc.c.

◆ linkgclist_()

static void linkgclist_ ( GCObject o,
GCObject **  pnext,
GCObject **  list 
)
static

Definition at line 148 of file lgc.c.

◆ luaC_barrier_()

void luaC_barrier_ ( lua_State L,
GCObject o,
GCObject v 
)

Definition at line 208 of file lgc.c.

◆ luaC_barrierback_()

void luaC_barrierback_ ( lua_State L,
GCObject o 
)

Definition at line 230 of file lgc.c.

◆ luaC_changemode()

void luaC_changemode ( lua_State L,
int  newmode 
)

Definition at line 1323 of file lgc.c.

◆ luaC_checkfinalizer()

void luaC_checkfinalizer ( lua_State L,
GCObject o,
Table mt 
)

Definition at line 1011 of file lgc.c.

◆ luaC_fix()

void luaC_fix ( lua_State L,
GCObject o 
)

Definition at line 243 of file lgc.c.

◆ luaC_freeallobjects()

void luaC_freeallobjects ( lua_State L)

Definition at line 1503 of file lgc.c.

◆ luaC_fullgc()

void luaC_fullgc ( lua_State L,
int  isemergency 
)

Definition at line 1715 of file lgc.c.

◆ luaC_newobj()

GCObject* luaC_newobj ( lua_State L,
int  tt,
size_t  sz 
)

Definition at line 258 of file lgc.c.

◆ luaC_runtilstate()

void luaC_runtilstate ( lua_State L,
int  statesmask 
)

Definition at line 1643 of file lgc.c.

◆ luaC_step()

void luaC_step ( lua_State L)

Definition at line 1678 of file lgc.c.

◆ markbeingfnz()

static lu_mem markbeingfnz ( global_State g)
static

Definition at line 339 of file lgc.c.

◆ markmt()

static void markmt ( global_State g)
static

Definition at line 329 of file lgc.c.

◆ markold()

static void markold ( global_State g,
GCObject from,
GCObject to 
)
static

Definition at line 1194 of file lgc.c.

◆ propagateall()

static lu_mem propagateall ( global_State g)
static

Definition at line 668 of file lgc.c.

◆ propagatemark()

static lu_mem propagatemark ( global_State g)
static

Definition at line 652 of file lgc.c.

◆ reallymarkobject()

static void reallymarkobject ( global_State g,
GCObject o 
)
static

Definition at line 291 of file lgc.c.

◆ remarkupvals()

static int remarkupvals ( global_State g)
static

Definition at line 361 of file lgc.c.

◆ restartcollection()

static void restartcollection ( global_State g)
static

Definition at line 397 of file lgc.c.

◆ runafewfinalizers()

static int runafewfinalizers ( lua_State L,
int  n 
)
static

Definition at line 930 of file lgc.c.

◆ separatetobefnz()

static void separatetobefnz ( global_State g,
int  all 
)
static

Definition at line 966 of file lgc.c.

◆ setminordebt()

static void setminordebt ( global_State g)
static

Definition at line 1348 of file lgc.c.

◆ setpause()

static void setpause ( global_State g)
static

Definition at line 1457 of file lgc.c.

◆ singlestep()

static lu_mem singlestep ( lua_State L)
static

Definition at line 1576 of file lgc.c.

◆ stepgenfull()

static void stepgenfull ( lua_State L,
global_State g 
)
static

Definition at line 1374 of file lgc.c.

◆ sweep2old()

static void sweep2old ( lua_State L,
GCObject **  p 
)
static

Definition at line 1052 of file lgc.c.

◆ sweepgen()

static GCObject** sweepgen ( lua_State L,
global_State g,
GCObject **  p,
GCObject limit,
GCObject **  pfirstold1 
)
static

Definition at line 1088 of file lgc.c.

◆ sweeplist()

static GCObject** sweeplist ( lua_State L,
GCObject **  p,
int  countin,
int *  countout 
)
static

Definition at line 816 of file lgc.c.

◆ sweepstep()

static int sweepstep ( lua_State L,
global_State g,
int  nextstate,
GCObject **  nextlist 
)
static

Definition at line 1559 of file lgc.c.

◆ sweeptolive()

static GCObject** sweeptolive ( lua_State L,
GCObject **  p 
)
static

Definition at line 843 of file lgc.c.

◆ traverseCclosure()

static int traverseCclosure ( global_State g,
CClosure cl 
)
static

Definition at line 587 of file lgc.c.

◆ traverseephemeron()

static int traverseephemeron ( global_State g,
Table h,
int  inv 
)
static

Definition at line 474 of file lgc.c.

◆ traverseLclosure()

static int traverseLclosure ( global_State g,
LClosure cl 
)
static

Definition at line 598 of file lgc.c.

◆ traverseproto()

static int traverseproto ( global_State g,
Proto f 
)
static

Definition at line 572 of file lgc.c.

◆ traversestrongtable()

static void traversestrongtable ( global_State g,
Table h 
)
static

Definition at line 517 of file lgc.c.

◆ traversetable()

static lu_mem traversetable ( global_State g,
Table h 
)
static

Definition at line 536 of file lgc.c.

◆ traversethread()

static int traversethread ( global_State g,
lua_State th 
)
static

Definition at line 621 of file lgc.c.

◆ traverseudata()

static int traverseudata ( global_State g,
Udata u 
)
static

Definition at line 557 of file lgc.c.

◆ traverseweakvalue()

static void traverseweakvalue ( global_State g,
Table h 
)
static

Definition at line 440 of file lgc.c.

◆ udata2finalize()

static GCObject* udata2finalize ( global_State g)
static

Definition at line 878 of file lgc.c.

◆ whitelist()

static void whitelist ( global_State g,
GCObject p 
)
static

Definition at line 1129 of file lgc.c.

◆ youngcollection()

static void youngcollection ( lua_State L,
global_State g 
)
static

Definition at line 1224 of file lgc.c.

reallymarkobject
static void reallymarkobject(global_State *g, GCObject *o)
Definition: lgc.c:291
gcvalue
#define gcvalue(o)
Definition: lobject.h:292
checkliveness
#define checkliveness(L, obj)
Definition: lobject.h:104
valiswhite
#define valiswhite(x)
Definition: lgc.c:83


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49