lgc.c File Reference

Go to the source code of this file.

Defines

#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)

Functions

static void removeentry (Node *n)
static void reallymarkobject (global_State *g, GCObject *o)
static void marktmu (global_State *g)
size_t luaC_separateudata (lua_State *L, int all)
static int traversetable (global_State *g, Table *h)
static void traverseproto (global_State *g, Proto *f)
static void traverseclosure (global_State *g, Closure *cl)
static void checkstacksizes (lua_State *L, StkId max)
static void traversestack (global_State *g, lua_State *l)
static l_mem propagatemark (global_State *g)
static size_t propagateall (global_State *g)
static int iscleared (const TValue *o, int iskey)
static void cleartable (GCObject *l)
static void freeobj (lua_State *L, GCObject *o)
static GCObject ** sweeplist (lua_State *L, GCObject **p, lu_mem count)
static void checkSizes (lua_State *L)
static void GCTM (lua_State *L)
void luaC_callGCTM (lua_State *L)
void luaC_freeall (lua_State *L)
static void markmt (global_State *g)
static void markroot (lua_State *L)
static void remarkupvals (global_State *g)
static void atomic (lua_State *L)
static l_mem singlestep (lua_State *L)
void luaC_step (lua_State *L)
void luaC_fullgc (lua_State *L)
void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v)
void luaC_barrierback (lua_State *L, Table *t)
void luaC_link (lua_State *L, GCObject *o, lu_byte tt)
void luaC_linkupval (lua_State *L, UpVal *uv)

Define Documentation

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

Definition at line 38 of file lgc.c.

Referenced by luaC_barrierback(), and propagatemark().

#define GCFINALIZECOST   100

Definition at line 29 of file lgc.c.

Referenced by singlestep().

#define GCSTEPSIZE   1024u

Definition at line 26 of file lgc.c.

Referenced by luaC_step().

#define GCSWEEPCOST   10

Definition at line 28 of file lgc.c.

Referenced by singlestep().

#define GCSWEEPMAX   40

Definition at line 27 of file lgc.c.

Referenced by singlestep().

#define isfinalized (  )     testbit((u)->marked, FINALIZEDBIT)

Definition at line 43 of file lgc.c.

Referenced by iscleared(), and luaC_separateudata().

#define KEYWEAK   bitmask(KEYWEAKBIT)

Definition at line 47 of file lgc.c.

Referenced by traversetable().

#define lgc_c

Definition at line 9 of file lgc.c.

#define LUA_CORE

Definition at line 10 of file lgc.c.

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

Definition at line 34 of file lgc.c.

Referenced by GCTM(), luaC_barrierf(), luaC_linkupval(), marktmu(), and sweeplist().

#define markfinalized (  )     l_setbit((u)->marked, FINALIZEDBIT)

Definition at line 44 of file lgc.c.

Referenced by luaC_separateudata().

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

Definition at line 55 of file lgc.c.

Referenced by atomic(), markmt(), markroot(), reallymarkobject(), traverseclosure(), traverseproto(), and traversetable().

#define markvalue ( g,
 ) 
#define maskmarks   cast_byte(~(bitmask(BLACKBIT)|WHITEBITS))

Definition at line 32 of file lgc.c.

#define setthreshold (  )     (g->GCthreshold = (g->estimate/100) * g->gcpause)

Definition at line 59 of file lgc.c.

Referenced by luaC_fullgc(), and luaC_step().

#define stringmark (  )     reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT)

Definition at line 40 of file lgc.c.

Referenced by iscleared(), and traverseproto().

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

Definition at line 404 of file lgc.c.

Referenced by luaC_freeall(), singlestep(), and sweeplist().

#define VALUEWEAK   bitmask(VALUEWEAKBIT)

Definition at line 48 of file lgc.c.

Referenced by traversetable().

#define white2gray (  )     reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)

Definition at line 37 of file lgc.c.

Referenced by reallymarkobject().


Function Documentation

static void atomic ( lua_State L  )  [static]
static void checkSizes ( lua_State L  )  [static]
static void checkstacksizes ( lua_State L,
StkId  max 
) [static]
static void cleartable ( GCObject l  )  [static]
static void freeobj ( lua_State L,
GCObject o 
) [static]
static void GCTM ( lua_State L  )  [static]
static int iscleared ( const TValue o,
int  iskey 
) [static]

Definition at line 337 of file lgc.c.

References gcvalue, iscollectable, isfinalized, iswhite, rawtsvalue, stringmark, ttisstring, ttisuserdata, and uvalue.

Referenced by cleartable().

void luaC_barrierback ( lua_State L,
Table t 
)
void luaC_barrierf ( lua_State L,
GCObject o,
GCObject v 
)
void luaC_callGCTM ( lua_State L  ) 

Definition at line 477 of file lgc.c.

References G, and GCTM().

Referenced by callallgcTM().

void luaC_freeall ( lua_State L  ) 
void luaC_fullgc ( lua_State L  ) 
void luaC_link ( lua_State L,
GCObject o,
lu_byte  tt 
)
void luaC_linkupval ( lua_State L,
UpVal uv 
)
size_t luaC_separateudata ( lua_State L,
int  all 
)
void luaC_step ( lua_State L  ) 
static void markmt ( global_State g  )  [static]

Definition at line 493 of file lgc.c.

References markobject, global_State::mt, and NUM_TAGS.

Referenced by atomic(), and markroot().

static void markroot ( lua_State L  )  [static]
static void marktmu ( global_State g  )  [static]

Definition at line 115 of file lgc.c.

References GCObject::gch, makewhite, reallymarkobject(), and global_State::tmudata.

Referenced by atomic().

static size_t propagateall ( global_State g  )  [static]

Definition at line 323 of file lgc.c.

References global_State::gray, and propagatemark().

Referenced by atomic().

static l_mem propagatemark ( global_State g  )  [static]
static void reallymarkobject ( global_State g,
GCObject o 
) [static]
static void remarkupvals ( global_State g  )  [static]

Definition at line 515 of file lgc.c.

References isgray, UpVal::l, lua_assert, markvalue, obj2gco, UpVal::u, global_State::uvhead, and UpVal::v.

Referenced by atomic().

static void removeentry ( Node n  )  [static]

Definition at line 62 of file lgc.c.

References gkey, gval, iscollectable, lua_assert, LUA_TDEADKEY, setttype, and ttisnil.

Referenced by cleartable(), and traversetable().

static l_mem singlestep ( lua_State L  )  [static]
static GCObject** sweeplist ( lua_State L,
GCObject **  p,
lu_mem  count 
) [static]
static void traverseclosure ( global_State g,
Closure cl 
) [static]
static void traverseproto ( global_State g,
Proto f 
) [static]
static void traversestack ( global_State g,
lua_State l 
) [static]
static int traversetable ( global_State g,
Table h 
) [static]

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:59 2011 by Doxygen 1.6.1