RetroArch
Macros | Functions
lgc.c File Reference
#include "lprefix.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:

Macros

#define lgc_c
 
#define LUA_CORE
 
#define GCSinsideatomic   (GCSpause + 1)
 
#define GCSWEEPCOST   ((sizeof(TString) + 4) / 4)
 
#define GCSWEEPMAX   (cast_int((GCSTEPSIZE / GCSWEEPCOST) / 4))
 
#define GCFINALIZECOST   GCSWEEPCOST
 
#define STEPMULADJ   200
 
#define PAUSEADJ   100
 
#define maskcolors   (~(bitmask(BLACKBIT) | WHITEBITS))
 
#define makewhite(g, x)   (x->marked = cast_byte((x->marked & maskcolors) | luaC_white(g)))
 
#define white2gray(x)   resetbits(x->marked, WHITEBITS)
 
#define black2gray(x)   resetbit(x->marked, BLACKBIT)
 
#define valiswhite(x)   (iscollectable(x) && iswhite(gcvalue(x)))
 
#define checkdeadkey(n)   lua_assert(!ttisdeadkey(gkey(n)) || ttisnil(gval(n)))
 
#define checkconsistency(obj)   lua_longassert(!iscollectable(obj) || righttt(obj))
 
#define markvalue(g, o)
 
#define markobject(g, t)   { if (iswhite(t)) reallymarkobject(g, obj2gco(t)); }
 
#define markobjectN(g, t)   { if (t) markobject(g,t); }
 
#define gnodelast(h)   gnode(h, cast(size_t, sizenode(h)))
 
#define linkgclist(o, p)   ((o)->gclist = (p), (p) = obj2gco(o))
 
#define sweepwholelist(L, p)   sweeplist(L,p,MAX_LUMEM)
 

Functions

static void reallymarkobject (global_State *g, GCObject *o)
 
static void removeentry (Node *n)
 
static int iscleared (global_State *g, const TValue *o)
 
void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v)
 
void luaC_barrierback_ (lua_State *L, Table *t)
 
void luaC_upvalbarrier_ (lua_State *L, UpVal *uv)
 
void luaC_fix (lua_State *L, GCObject *o)
 
GCObjectluaC_newobj (lua_State *L, int tt, size_t sz)
 
static void markmt (global_State *g)
 
static void markbeingfnz (global_State *g)
 
static void remarkupvals (global_State *g)
 
static void restartcollection (global_State *g)
 
static void traverseweakvalue (global_State *g, Table *h)
 
static int traverseephemeron (global_State *g, Table *h)
 
static void traversestrongtable (global_State *g, Table *h)
 
static lu_mem traversetable (global_State *g, Table *h)
 
static int traverseproto (global_State *g, Proto *f)
 
static lu_mem traverseCclosure (global_State *g, CClosure *cl)
 
static lu_mem traverseLclosure (global_State *g, LClosure *cl)
 
static lu_mem traversethread (global_State *g, lua_State *th)
 
static void propagatemark (global_State *g)
 
static void propagateall (global_State *g)
 
static void convergeephemerons (global_State *g)
 
static void clearkeys (global_State *g, GCObject *l, GCObject *f)
 
static void clearvalues (global_State *g, GCObject *l, GCObject *f)
 
void luaC_upvdeccount (lua_State *L, UpVal *uv)
 
static void freeLclosure (lua_State *L, LClosure *cl)
 
static void freeobj (lua_State *L, GCObject *o)
 
static GCObject ** sweeplist (lua_State *L, GCObject **p, lu_mem count)
 
static GCObject ** sweeptolive (lua_State *L, GCObject **p)
 
static void checkSizes (lua_State *L, global_State *g)
 
static GCObjectudata2finalize (global_State *g)
 
static void dothecall (lua_State *L, void *ud)
 
static void GCTM (lua_State *L, int propagateerrors)
 
static int runafewfinalizers (lua_State *L)
 
static void callallpendingfinalizers (lua_State *L)
 
static GCObject ** findlast (GCObject **p)
 
static void separatetobefnz (global_State *g, int all)
 
void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt)
 
static void setpause (global_State *g)
 
static void entersweep (lua_State *L)
 
void luaC_freeallobjects (lua_State *L)
 
static l_mem atomic (lua_State *L)
 
static lu_mem sweepstep (lua_State *L, global_State *g, int nextstate, GCObject **nextlist)
 
static lu_mem singlestep (lua_State *L)
 
void luaC_runtilstate (lua_State *L, int statesmask)
 
static l_mem getdebt (global_State *g)
 
void luaC_step (lua_State *L)
 
void luaC_fullgc (lua_State *L, int isemergency)
 

Macro Definition Documentation

◆ black2gray

#define black2gray (   x)    resetbit(x->marked, BLACKBIT)

◆ checkconsistency

#define checkconsistency (   obj)    lua_longassert(!iscollectable(obj) || righttt(obj))

◆ checkdeadkey

#define checkdeadkey (   n)    lua_assert(!ttisdeadkey(gkey(n)) || ttisnil(gval(n)))

◆ GCFINALIZECOST

#define GCFINALIZECOST   GCSWEEPCOST

◆ GCSinsideatomic

#define GCSinsideatomic   (GCSpause + 1)

◆ GCSWEEPCOST

#define GCSWEEPCOST   ((sizeof(TString) + 4) / 4)

◆ GCSWEEPMAX

#define GCSWEEPMAX   (cast_int((GCSTEPSIZE / GCSWEEPCOST) / 4))

◆ gnodelast

#define gnodelast (   h)    gnode(h, cast(size_t, sizenode(h)))

◆ lgc_c

#define lgc_c

◆ linkgclist

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

◆ LUA_CORE

#define LUA_CORE

◆ makewhite

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

◆ markobject

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

◆ markobjectN

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

◆ markvalue

#define markvalue (   g,
 
)
Value:
#define checkconsistency(obj)
Definition: lgc.c:79
#define gcvalue(o)
Definition: lobject.h:167
static void reallymarkobject(global_State *g, GCObject *o)
Definition: lgc.c:235
GLboolean GLboolean g
Definition: glext.h:6844
#define valiswhite(x)
Definition: lgc.c:74

◆ maskcolors

#define maskcolors   (~(bitmask(BLACKBIT) | WHITEBITS))

◆ PAUSEADJ

#define PAUSEADJ   100

◆ STEPMULADJ

#define STEPMULADJ   200

◆ sweepwholelist

#define sweepwholelist (   L,
  p 
)    sweeplist(L,p,MAX_LUMEM)

◆ valiswhite

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

◆ white2gray

#define white2gray (   x)    resetbits(x->marked, WHITEBITS)

Function Documentation

◆ atomic()

static l_mem atomic ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ callallpendingfinalizers()

static void callallpendingfinalizers ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkSizes()

static void checkSizes ( lua_State L,
global_State g 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearkeys()

static void clearkeys ( global_State g,
GCObject l,
GCObject f 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearvalues()

static void clearvalues ( global_State g,
GCObject l,
GCObject f 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convergeephemerons()

static void convergeephemerons ( global_State g)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dothecall()

static void dothecall ( lua_State L,
void ud 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ entersweep()

static void entersweep ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findlast()

static GCObject** findlast ( GCObject **  p)
static
Here is the caller graph for this function:

◆ freeLclosure()

static void freeLclosure ( lua_State L,
LClosure cl 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeobj()

static void freeobj ( lua_State L,
GCObject o 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GCTM()

static void GCTM ( lua_State L,
int  propagateerrors 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getdebt()

static l_mem getdebt ( global_State g)
static
Here is the caller graph for this function:

◆ iscleared()

static int iscleared ( global_State g,
const TValue o 
)
static
Here is the caller graph for this function:

◆ luaC_barrier_()

void luaC_barrier_ ( lua_State L,
GCObject o,
GCObject v 
)
Here is the call graph for this function:

◆ luaC_barrierback_()

void luaC_barrierback_ ( lua_State L,
Table t 
)
Here is the call graph for this function:

◆ luaC_checkfinalizer()

void luaC_checkfinalizer ( lua_State L,
GCObject o,
Table mt 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaC_fix()

void luaC_fix ( lua_State L,
GCObject o 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaC_freeallobjects()

void luaC_freeallobjects ( lua_State L)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaC_fullgc()

void luaC_fullgc ( lua_State L,
int  isemergency 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaC_newobj()

GCObject* luaC_newobj ( lua_State L,
int  tt,
size_t  sz 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaC_runtilstate()

void luaC_runtilstate ( lua_State L,
int  statesmask 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaC_step()

void luaC_step ( lua_State L)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaC_upvalbarrier_()

void luaC_upvalbarrier_ ( lua_State L,
UpVal uv 
)
Here is the call graph for this function:

◆ luaC_upvdeccount()

void luaC_upvdeccount ( lua_State L,
UpVal uv 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ markbeingfnz()

static void markbeingfnz ( global_State g)
static
Here is the caller graph for this function:

◆ markmt()

static void markmt ( global_State g)
static
Here is the caller graph for this function:

◆ propagateall()

static void propagateall ( global_State g)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ propagatemark()

static void propagatemark ( global_State g)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reallymarkobject()

static void reallymarkobject ( global_State g,
GCObject o 
)
static
Here is the caller graph for this function:

◆ remarkupvals()

static void remarkupvals ( global_State g)
static
Here is the caller graph for this function:

◆ removeentry()

static void removeentry ( Node n)
static
Here is the caller graph for this function:

◆ restartcollection()

static void restartcollection ( global_State g)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ runafewfinalizers()

static int runafewfinalizers ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ separatetobefnz()

static void separatetobefnz ( global_State g,
int  all 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setpause()

static void setpause ( global_State g)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ singlestep()

static lu_mem singlestep ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sweeplist()

static GCObject ** sweeplist ( lua_State L,
GCObject **  p,
lu_mem  count 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sweepstep()

static lu_mem sweepstep ( lua_State L,
global_State g,
int  nextstate,
GCObject **  nextlist 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sweeptolive()

static GCObject** sweeptolive ( lua_State L,
GCObject **  p 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ traverseCclosure()

static lu_mem traverseCclosure ( global_State g,
CClosure cl 
)
static
Here is the caller graph for this function:

◆ traverseephemeron()

static int traverseephemeron ( global_State g,
Table h 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ traverseLclosure()

static lu_mem traverseLclosure ( global_State g,
LClosure cl 
)
static
Here is the caller graph for this function:

◆ traverseproto()

static int traverseproto ( global_State g,
Proto f 
)
static
Here is the caller graph for this function:

◆ traversestrongtable()

static void traversestrongtable ( global_State g,
Table h 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ traversetable()

static lu_mem traversetable ( global_State g,
Table h 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ traversethread()

static lu_mem traversethread ( global_State g,
lua_State th 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ traverseweakvalue()

static void traverseweakvalue ( global_State g,
Table h 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udata2finalize()

static GCObject* udata2finalize ( global_State g)
static
Here is the caller graph for this function: