#include "lobject.h"#include "lstate.h"

Go to the source code of this file.
Defines | |
| #define | GCSpropagate 0 |
| #define | GCSatomic 1 |
| #define | GCSsweepstring 2 |
| #define | GCSsweepudata 3 |
| #define | GCSsweep 4 |
| #define | GCSpause 5 |
| #define | issweepphase(g) (GCSsweepstring <= (g)->gcstate && (g)->gcstate <= GCSsweep) |
| #define | isgenerational(g) ((g)->gckind == KGC_GEN) |
| #define | keepinvariant(g) (isgenerational(g) || g->gcstate <= GCSatomic) |
| #define | resetbits(x, m) ((x) &= cast(lu_byte, ~(m))) |
| #define | setbits(x, m) ((x) |= (m)) |
| #define | testbits(x, m) ((x) & (m)) |
| #define | bitmask(b) (1<<(b)) |
| #define | bit2mask(b1, b2) (bitmask(b1) | bitmask(b2)) |
| #define | l_setbit(x, b) setbits(x, bitmask(b)) |
| #define | resetbit(x, b) resetbits(x, bitmask(b)) |
| #define | testbit(x, b) testbits(x, bitmask(b)) |
| #define | WHITE0BIT 0 |
| #define | WHITE1BIT 1 |
| #define | BLACKBIT 2 |
| #define | FINALIZEDBIT 3 |
| #define | SEPARATED 4 |
| #define | FIXEDBIT 5 |
| #define | OLDBIT 6 |
| #define | WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) |
| #define | iswhite(x) testbits((x)->gch.marked, WHITEBITS) |
| #define | isblack(x) testbit((x)->gch.marked, BLACKBIT) |
| #define | isgray(x) |
| #define | isold(x) testbit((x)->gch.marked, OLDBIT) |
| #define | resetoldbit(o) resetbit((o)->gch.marked, OLDBIT) |
| #define | otherwhite(g) (g->currentwhite ^ WHITEBITS) |
| #define | isdeadm(ow, m) (!(((m) ^ WHITEBITS) & (ow))) |
| #define | isdead(g, v) isdeadm(otherwhite(g), (v)->gch.marked) |
| #define | changewhite(x) ((x)->gch.marked ^= WHITEBITS) |
| #define | gray2black(x) l_setbit((x)->gch.marked, BLACKBIT) |
| #define | valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x))) |
| #define | luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) |
| #define | luaC_condGC(L, c) {if (G(L)->GCdebt > 0) {c;}; condchangemem(L);} |
| #define | luaC_checkGC(L) luaC_condGC(L, luaC_step(L);) |
| #define | luaC_barrier(L, p, v) |
| #define | luaC_barrierback(L, p, v) |
| #define | luaC_objbarrier(L, p, o) |
| #define | luaC_objbarrierback(L, p, o) { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) luaC_barrierback_(L,p); } |
| #define | luaC_barrierproto(L, p, c) { if (isblack(obj2gco(p))) luaC_barrierproto_(L,p,c); } |
Functions | |
| LUAI_FUNC void | luaC_freeallobjects (lua_State *L) |
| LUAI_FUNC void | luaC_step (lua_State *L) |
| LUAI_FUNC void | luaC_forcestep (lua_State *L) |
| LUAI_FUNC void | luaC_runtilstate (lua_State *L, int statesmask) |
| LUAI_FUNC void | luaC_fullgc (lua_State *L, int isemergency) |
| LUAI_FUNC GCObject * | luaC_newobj (lua_State *L, int tt, size_t sz, GCObject **list, int offset) |
| LUAI_FUNC void | luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) |
| LUAI_FUNC void | luaC_barrierback_ (lua_State *L, GCObject *o) |
| LUAI_FUNC void | luaC_barrierproto_ (lua_State *L, Proto *p, Closure *c) |
| LUAI_FUNC void | luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) |
| LUAI_FUNC void | luaC_checkupvalcolor (global_State *g, UpVal *uv) |
| LUAI_FUNC void | luaC_changemode (lua_State *L, int mode) |
| #define bit2mask | ( | b1, | ||
| b2 | ||||
| ) | (bitmask(b1) | bitmask(b2)) |
Definition at line 62 of file lgc.h.
Referenced by lua_newstate().
| #define bitmask | ( | b | ) | (1<<(b)) |
Definition at line 61 of file lgc.h.
Referenced by generationalcollection(), luaC_changemode(), luaC_fullgc(), luaS_resize(), and sweeplist().
| #define changewhite | ( | x | ) | ((x)->gch.marked ^= WHITEBITS) |
Definition at line 96 of file lgc.h.
Referenced by luaF_findupval(), and luaS_newlstr().
| #define FINALIZEDBIT 3 |
Definition at line 72 of file lgc.h.
Referenced by separatetobefnz().
| #define FIXEDBIT 5 |
Definition at line 74 of file lgc.h.
Referenced by lua_newstate().
| #define GCSatomic 1 |
Definition at line 32 of file lgc.h.
Referenced by traversestack().
| #define GCSpause 5 |
Definition at line 36 of file lgc.h.
Referenced by generationalcollection(), lua_gc(), luaC_barrier_(), luaC_fullgc(), singlestep(), and step().
| #define GCSpropagate 0 |
Definition at line 31 of file lgc.h.
Referenced by luaC_changemode(), luaC_fullgc(), and singlestep().
| #define GCSsweep 4 |
Definition at line 35 of file lgc.h.
Referenced by singlestep().
| #define GCSsweepstring 2 |
Definition at line 33 of file lgc.h.
Referenced by luaS_resize(), and singlestep().
| #define GCSsweepudata 3 |
Definition at line 34 of file lgc.h.
Referenced by singlestep().
| #define gray2black | ( | x | ) | l_setbit((x)->gch.marked, BLACKBIT) |
Definition at line 97 of file lgc.h.
Referenced by luaC_checkupvalcolor(), propagatemark(), and reallymarkobject().
| #define isblack | ( | x | ) | testbit((x)->gch.marked, BLACKBIT) |
Definition at line 82 of file lgc.h.
Referenced by luaC_barrier_(), luaC_barrierback_(), luaC_barrierproto_(), luaC_checkupvalcolor(), and luaF_close().
| #define isdead | ( | g, | ||
| v | ||||
| ) | isdeadm(otherwhite(g), (v)->gch.marked) |
Definition at line 94 of file lgc.h.
Referenced by luaC_barrier_(), luaC_barrierback_(), luaF_close(), luaF_findupval(), luaS_newlstr(), and reallymarkobject().
| #define isdeadm | ( | ow, | ||
| m | ||||
| ) | (!(((m) ^ WHITEBITS) & (ow))) |
Definition at line 93 of file lgc.h.
Referenced by sweeplist().
| #define isgenerational | ( | g | ) | ((g)->gckind == KGC_GEN) |
Definition at line 42 of file lgc.h.
Referenced by luaC_barrier_(), luaC_forcestep(), singlestep(), and sweeplist().
| #define isgray | ( | x | ) |
Definition at line 83 of file lgc.h.
Referenced by luaC_checkupvalcolor(), propagatemark(), and remarkupvals().
| #define isold | ( | x | ) | testbit((x)->gch.marked, OLDBIT) |
Definition at line 86 of file lgc.h.
Referenced by udata2finalize().
| #define issweepphase | ( | g | ) | (GCSsweepstring <= (g)->gcstate && (g)->gcstate <= GCSsweep) |
Definition at line 39 of file lgc.h.
Referenced by luaC_barrier_(), and luaC_checkupvalcolor().
| #define iswhite | ( | x | ) | testbits((x)->gch.marked, WHITEBITS) |
Definition at line 81 of file lgc.h.
Referenced by atomic(), iscleared(), luaC_barrier_(), reallymarkobject(), separatetobefnz(), singlestep(), and traverseproto().
| #define keepinvariant | ( | g | ) | (isgenerational(g) || g->gcstate <= GCSatomic) |
Definition at line 52 of file lgc.h.
Referenced by luaC_barrier_(), luaC_checkupvalcolor(), luaC_fullgc(), and udata2finalize().
| #define l_setbit | ( | x, | ||
| b | ||||
| ) | setbits(x, bitmask(b)) |
Definition at line 63 of file lgc.h.
Referenced by luaC_checkfinalizer(), and separatetobefnz().
| #define luaC_barrier | ( | L, | ||
| p, | ||||
| v | ||||
| ) |
{ if (valiswhite(v) && isblack(obj2gco(p))) \
luaC_barrier_(L,obj2gco(p),gcvalue(v)); }
Definition at line 109 of file lgc.h.
Referenced by addk(), lua_load(), lua_setupvalue(), luaV_execute(), and moveto().
| #define luaC_barrierback | ( | L, | ||
| p, | ||||
| v | ||||
| ) |
{ if (valiswhite(v) && isblack(obj2gco(p))) \
luaC_barrierback_(L,p); }
Definition at line 112 of file lgc.h.
Referenced by lua_rawset(), lua_rawseti(), lua_rawsetp(), luaH_newkey(), luaV_execute(), and luaV_settable().
| #define luaC_barrierproto | ( | L, | ||
| p, | ||||
| c | ||||
| ) | { if (isblack(obj2gco(p))) luaC_barrierproto_(L,p,c); } |
Definition at line 122 of file lgc.h.
Referenced by pushclosure().
| #define luaC_checkGC | ( | L | ) | luaC_condGC(L, luaC_step(L);) |
Definition at line 106 of file lgc.h.
Referenced by close_func(), lua_concat(), lua_createtable(), lua_newthread(), lua_newuserdata(), lua_pushcclosure(), lua_pushfstring(), lua_pushlstring(), lua_pushstring(), lua_pushvfstring(), lua_tolstring(), luaD_call(), and luaX_newstring().
| #define luaC_condGC | ( | L, | ||
| c | ||||
| ) | {if (G(L)->GCdebt > 0) {c;}; condchangemem(L);} |
| #define luaC_objbarrier | ( | L, | ||
| p, | ||||
| o | ||||
| ) |
Definition at line 115 of file lgc.h.
Referenced by codeclosure(), lua_setmetatable(), lua_setuservalue(), lua_upvaluejoin(), luaC_barrierproto_(), newupvalue(), and registerlocalvar().
| #define luaC_objbarrierback | ( | L, | ||
| p, | ||||
| o | ||||
| ) | { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) luaC_barrierback_(L,p); } |
Definition at line 119 of file lgc.h.
Referenced by lua_setmetatable().
| #define luaC_white | ( | g | ) | cast(lu_byte, (g)->currentwhite & WHITEBITS) |
Definition at line 101 of file lgc.h.
Referenced by lua_newstate(), luaC_newobj(), and sweeplist().
| #define OLDBIT 6 |
Definition at line 75 of file lgc.h.
Referenced by sweeplist().
| #define otherwhite | ( | g | ) | (g->currentwhite ^ WHITEBITS) |
Definition at line 92 of file lgc.h.
Referenced by atomic(), and sweeplist().
| #define resetbit | ( | x, | ||
| b | ||||
| ) | resetbits(x, bitmask(b)) |
Definition at line 64 of file lgc.h.
Referenced by udata2finalize().
| #define resetoldbit | ( | o | ) | resetbit((o)->gch.marked, OLDBIT) |
Definition at line 90 of file lgc.h.
Referenced by callallpendingfinalizers(), luaC_checkfinalizer(), luaC_checkupvalcolor(), luaF_findupval(), and luaS_resize().
| #define SEPARATED 4 |
Definition at line 73 of file lgc.h.
Referenced by luaC_checkfinalizer(), separatetobefnz(), and udata2finalize().
| #define testbit | ( | x, | ||
| b | ||||
| ) | testbits(x, bitmask(b)) |
Definition at line 65 of file lgc.h.
Referenced by luaC_checkfinalizer(), luaC_runtilstate(), and separatetobefnz().
| #define testbits | ( | x, | ||
| m | ||||
| ) | ((x) & (m)) |
Definition at line 60 of file lgc.h.
Referenced by sweeplist().
| #define valiswhite | ( | x | ) | (iscollectable(x) && iswhite(gcvalue(x))) |
Definition at line 99 of file lgc.h.
Referenced by removeentry(), and traverseephemeron().
| #define WHITE0BIT 0 |
Definition at line 69 of file lgc.h.
Referenced by lua_newstate().
Definition at line 140 of file lgc.c.
References G, gch, GCSpause, global_State::gcstate, isblack, isdead, isgenerational, issweepphase, iswhite, keepinvariant, lua_assert, LUA_TTABLE, makewhite, and reallymarkobject().

Definition at line 160 of file lgc.c.
References black2gray, G, gch, gco2t, global_State::grayagain, isblack, isdead, lua_assert, and LUA_TTABLE.
Definition at line 177 of file lgc.c.
References black2gray, Proto::cache, G, Proto::gclist, global_State::grayagain, isblack, lua_assert, luaC_objbarrier, and obj2gco.
| LUAI_FUNC void luaC_changemode | ( | lua_State * | L, | |
| int | mode | |||
| ) |
Definition at line 862 of file lgc.c.
References bitmask, G, global_State::gckind, GCSpropagate, global_State::gcstate, gettotalbytes, KGC_GEN, global_State::lastmajormem, luaC_runtilstate(), sweepphases, and global_State::sweepstrgc.
Referenced by lua_gc().


Definition at line 829 of file lgc.c.
References global_State::allgc, global_State::finobj, G, gch, gfasttm, isfinalized, l_setbit, resetoldbit, SEPARATED, testbit, and TM_GC.
Referenced by lua_setmetatable().

| LUAI_FUNC void luaC_checkupvalcolor | ( | global_State * | g, | |
| UpVal * | uv | |||
| ) |
Definition at line 195 of file lgc.c.
References gray2black, isblack, isgray, issweepphase, keepinvariant, lua_assert, makewhite, markvalue, obj2gco, resetoldbit, and UpVal::v.
Referenced by luaF_close().

| LUAI_FUNC void luaC_forcestep | ( | lua_State * | L | ) |
Definition at line 1051 of file lgc.c.
References G, GCFINALIZENUM, GCTM(), generationalcollection(), isgenerational, step(), and global_State::tobefnz.
Referenced by lua_gc(), and luaC_step().


| LUAI_FUNC void luaC_freeallobjects | ( | lua_State * | L | ) |
Definition at line 894 of file lgc.c.
References global_State::allgc, callallpendingfinalizers(), global_State::currentwhite, global_State::finobj, G, global_State::gckind, stringtable::hash, lua_assert, stringtable::nuse, separatetobefnz(), stringtable::size, global_State::strt, and sweepwholelist.
Referenced by close_state().


| LUAI_FUNC void luaC_fullgc | ( | lua_State * | L, | |
| int | isemergency | |||
| ) |
Definition at line 1073 of file lgc.c.
References bitmask, callallpendingfinalizers(), G, global_State::gckind, GCSpause, GCSpropagate, global_State::gcstate, keepinvariant, KGC_EMERGENCY, KGC_GEN, lua_assert, luaC_runtilstate(), luaE_setdebt(), stddebt, and global_State::sweepstrgc.
Referenced by generationalcollection(), lua_gc(), and luaM_realloc_().


Definition at line 217 of file lgc.c.
References global_State::allgc, cast, G, gch, luaC_white, luaM_newobject, and obj2gco.
Referenced by lua_newthread(), luaF_findupval(), luaF_newCclosure(), luaF_newLclosure(), luaF_newproto(), luaF_newupval(), luaH_new(), luaS_newudata(), and newlstr().

| LUAI_FUNC void luaC_runtilstate | ( | lua_State * | L, | |
| int | statesmask | |||
| ) |
Definition at line 1012 of file lgc.c.
References G, global_State::gcstate, singlestep(), and testbit.
Referenced by generationalcollection(), luaC_changemode(), luaC_fullgc(), and luaS_resize().


| LUAI_FUNC void luaC_step | ( | lua_State * | L | ) |
Definition at line 1064 of file lgc.c.
References G, and luaC_forcestep().
Referenced by luaV_execute().


| Generated by doxygen 1.7.1 on Fri May 25 2012 01:07:05 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |