sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
lgc.h File Reference
#include "lobject.h"
#include "lstate.h"

Go to the source code of this file.

Macros

#define GCSpropagate   0
#define GCSenteratomic   1
#define GCSatomic   2
#define GCSswpallgc   3
#define GCSswpfinobj   4
#define GCSswptobefnz   5
#define GCSswpend   6
#define GCScallfin   7
#define GCSpause   8
#define issweepphase(g)
#define keepinvariant(g)
#define resetbits(x, m)
#define setbits(x, m)
#define testbits(x, m)
#define bitmask(b)
#define bit2mask(b1, b2)
#define l_setbit(x, b)
#define resetbit(x, b)
#define testbit(x, b)
#define WHITE0BIT   3
#define WHITE1BIT   4
#define BLACKBIT   5
#define FINALIZEDBIT   6
#define TESTBIT   7
#define WHITEBITS   bit2mask(WHITE0BIT, WHITE1BIT)
#define iswhite(x)
#define isblack(x)
#define isgray(x)
#define tofinalize(x)
#define otherwhite(g)
#define isdeadm(ow, m)
#define isdead(g, v)
#define changewhite(x)
#define nw2black(x)
#define luaC_white(g)
#define G_NEW   0
#define G_SURVIVAL   1
#define G_OLD0   2
#define G_OLD1   3
#define G_OLD   4
#define G_TOUCHED1   5
#define G_TOUCHED2   6
#define AGEBITS   7
#define getage(o)
#define setage(o, a)
#define isold(o)
#define changeage(o, f, t)
#define LUAI_GENMAJORMUL   100
#define LUAI_GENMINORMUL   20
#define LUAI_GCPAUSE   200
#define getgcparam(p)
#define setgcparam(p, v)
#define LUAI_GCMUL   100
#define LUAI_GCSTEPSIZE   13
#define isdecGCmodegen(g)
#define GCSTPUSR   1
#define GCSTPGC   2
#define GCSTPCLS   4
#define gcrunning(g)
#define luaC_condGC(L, pre, pos)
#define luaC_checkGC(L)
#define luaC_objbarrier(L, p, o)
#define luaC_barrier(L, p, v)
#define luaC_objbarrierback(L, p, o)
#define luaC_barrierback(L, p, v)

Functions

LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o)
LUAI_FUNC void luaC_freeallobjects (lua_State *L)
LUAI_FUNC void luaC_step (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)
LUAI_FUNC GCObject * luaC_newobjdt (lua_State *L, int tt, size_t sz, size_t 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_checkfinalizer (lua_State *L, GCObject *o, Table *mt)
LUAI_FUNC void luaC_changemode (lua_State *L, int newmode)

Macro Definition Documentation

◆ AGEBITS

#define AGEBITS   7

Definition at line 118 of file lgc.h.

◆ bit2mask

#define bit2mask ( b1,
b2 )
Value:
(bitmask(b1) | bitmask(b2))

Definition at line 68 of file lgc.h.

◆ bitmask

#define bitmask ( b)
Value:
(1<<(b))

Definition at line 67 of file lgc.h.

◆ BLACKBIT

#define BLACKBIT   5

Definition at line 81 of file lgc.h.

◆ changeage

#define changeage ( o,
f,
t )
Value:
check_exp(getage(o) == (f), (o)->marked ^= ((f)^(t)))

Definition at line 124 of file lgc.h.

◆ changewhite

#define changewhite ( x)
Value:
((x)->marked ^= WHITEBITS)

Definition at line 102 of file lgc.h.

◆ FINALIZEDBIT

#define FINALIZEDBIT   6

Definition at line 82 of file lgc.h.

◆ G_NEW

#define G_NEW   0

Definition at line 110 of file lgc.h.

◆ G_OLD

#define G_OLD   4

Definition at line 114 of file lgc.h.

◆ G_OLD0

#define G_OLD0   2

Definition at line 112 of file lgc.h.

◆ G_OLD1

#define G_OLD1   3

Definition at line 113 of file lgc.h.

◆ G_SURVIVAL

#define G_SURVIVAL   1

Definition at line 111 of file lgc.h.

◆ G_TOUCHED1

#define G_TOUCHED1   5

Definition at line 115 of file lgc.h.

◆ G_TOUCHED2

#define G_TOUCHED2   6

Definition at line 116 of file lgc.h.

◆ gcrunning

#define gcrunning ( g)
Value:
((g)->gcstp == 0)

Definition at line 162 of file lgc.h.

◆ GCSatomic

#define GCSatomic   2

Definition at line 37 of file lgc.h.

◆ GCScallfin

#define GCScallfin   7

Definition at line 42 of file lgc.h.

◆ GCSenteratomic

#define GCSenteratomic   1

Definition at line 36 of file lgc.h.

◆ GCSpause

#define GCSpause   8

Definition at line 43 of file lgc.h.

◆ GCSpropagate

#define GCSpropagate   0

Definition at line 35 of file lgc.h.

◆ GCSswpallgc

#define GCSswpallgc   3

Definition at line 38 of file lgc.h.

◆ GCSswpend

#define GCSswpend   6

Definition at line 41 of file lgc.h.

◆ GCSswpfinobj

#define GCSswpfinobj   4

Definition at line 39 of file lgc.h.

◆ GCSswptobefnz

#define GCSswptobefnz   5

Definition at line 40 of file lgc.h.

◆ GCSTPCLS

#define GCSTPCLS   4

Definition at line 161 of file lgc.h.

◆ GCSTPGC

#define GCSTPGC   2

Definition at line 160 of file lgc.h.

◆ GCSTPUSR

#define GCSTPUSR   1

Definition at line 159 of file lgc.h.

◆ getage

#define getage ( o)
Value:
((o)->marked & AGEBITS)

Definition at line 120 of file lgc.h.

◆ getgcparam

#define getgcparam ( p)
Value:
((p) * 4)

Definition at line 139 of file lgc.h.

◆ isblack

#define isblack ( x)
Value:
testbit((x)->marked, BLACKBIT)

Definition at line 92 of file lgc.h.

◆ isdead

#define isdead ( g,
v )
Value:
isdeadm(otherwhite(g), (v)->marked)

Definition at line 100 of file lgc.h.

◆ isdeadm

#define isdeadm ( ow,
m )
Value:
((m) & (ow))

Definition at line 99 of file lgc.h.

◆ isdecGCmodegen

#define isdecGCmodegen ( g)
Value:
(g->gckind == KGC_GEN || g->lastatomic != 0)

Definition at line 153 of file lgc.h.

◆ isgray

#define isgray ( x)
Value:
(!testbits((x)->marked, WHITEBITS | bitmask(BLACKBIT)))

Definition at line 93 of file lgc.h.

◆ isold

#define isold ( o)
Value:
(getage(o) > G_SURVIVAL)

Definition at line 122 of file lgc.h.

◆ issweepphase

#define issweepphase ( g)
Value:
(GCSswpallgc <= (g)->gcstate && (g)->gcstate <= GCSswpend)

Definition at line 46 of file lgc.h.

◆ iswhite

#define iswhite ( x)
Value:
testbits((x)->marked, WHITEBITS)

Definition at line 91 of file lgc.h.

◆ keepinvariant

#define keepinvariant ( g)
Value:
((g)->gcstate <= GCSatomic)

Definition at line 58 of file lgc.h.

◆ l_setbit

#define l_setbit ( x,
b )
Value:
setbits(x, bitmask(b))

Definition at line 69 of file lgc.h.

◆ luaC_barrier

#define luaC_barrier ( L,
p,
v )
Value:
( \
iscollectable(v) ? luaC_objbarrier(L,p,gcvalue(v)) : cast_void(0))

Definition at line 183 of file lgc.h.

◆ luaC_barrierback

#define luaC_barrierback ( L,
p,
v )
Value:
( \
iscollectable(v) ? luaC_objbarrierback(L, p, gcvalue(v)) : cast_void(0))

Definition at line 189 of file lgc.h.

◆ luaC_checkGC

#define luaC_checkGC ( L)
Value:
luaC_condGC(L,(void)0,(void)0)

Definition at line 176 of file lgc.h.

◆ luaC_condGC

#define luaC_condGC ( L,
pre,
pos )
Value:
{ if (G(L)->GCdebt > 0) { pre; luaC_step(L); pos;}; \
condchangemem(L,pre,pos); }

Definition at line 171 of file lgc.h.

◆ luaC_objbarrier

#define luaC_objbarrier ( L,
p,
o )
Value:
( \
(isblack(p) && iswhite(o)) ? \
luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0))

Definition at line 179 of file lgc.h.

◆ luaC_objbarrierback

#define luaC_objbarrierback ( L,
p,
o )
Value:
( \
(isblack(p) && iswhite(o)) ? luaC_barrierback_(L,p) : cast_void(0))

Definition at line 186 of file lgc.h.

◆ luaC_white

#define luaC_white ( g)
Value:
cast_byte((g)->currentwhite & WHITEBITS)

Definition at line 106 of file lgc.h.

◆ LUAI_GCMUL

#define LUAI_GCMUL   100

Definition at line 142 of file lgc.h.

◆ LUAI_GCPAUSE

#define LUAI_GCPAUSE   200

Definition at line 133 of file lgc.h.

◆ LUAI_GCSTEPSIZE

#define LUAI_GCSTEPSIZE   13

Definition at line 145 of file lgc.h.

◆ LUAI_GENMAJORMUL

#define LUAI_GENMAJORMUL   100

Definition at line 129 of file lgc.h.

◆ LUAI_GENMINORMUL

#define LUAI_GENMINORMUL   20

Definition at line 130 of file lgc.h.

◆ nw2black

#define nw2black ( x)
Value:
check_exp(!iswhite(x), l_setbit((x)->marked, BLACKBIT))

Definition at line 103 of file lgc.h.

◆ otherwhite

#define otherwhite ( g)
Value:
((g)->currentwhite ^ WHITEBITS)

Definition at line 98 of file lgc.h.

◆ resetbit

#define resetbit ( x,
b )
Value:
resetbits(x, bitmask(b))

Definition at line 70 of file lgc.h.

◆ resetbits

#define resetbits ( x,
m )
Value:
((x) &= cast_byte(~(m)))

Definition at line 64 of file lgc.h.

◆ setage

#define setage ( o,
a )
Value:
((o)->marked = cast_byte(((o)->marked & (~AGEBITS)) | a))

Definition at line 121 of file lgc.h.

◆ setbits

#define setbits ( x,
m )
Value:
((x) |= (m))

Definition at line 65 of file lgc.h.

◆ setgcparam

#define setgcparam ( p,
v )
Value:
((p) = (v) / 4)

Definition at line 140 of file lgc.h.

◆ TESTBIT

#define TESTBIT   7

Definition at line 84 of file lgc.h.

◆ testbit

#define testbit ( x,
b )
Value:
testbits(x, bitmask(b))

Definition at line 71 of file lgc.h.

◆ testbits

#define testbits ( x,
m )
Value:
((x) & (m))

Definition at line 66 of file lgc.h.

◆ tofinalize

#define tofinalize ( x)
Value:
testbit((x)->marked, FINALIZEDBIT)

Definition at line 96 of file lgc.h.

◆ WHITE0BIT

#define WHITE0BIT   3

Definition at line 79 of file lgc.h.

◆ WHITE1BIT

#define WHITE1BIT   4

Definition at line 80 of file lgc.h.

◆ WHITEBITS

#define WHITEBITS   bit2mask(WHITE0BIT, WHITE1BIT)

Definition at line 88 of file lgc.h.

Function Documentation

◆ luaC_barrier_()

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

Definition at line 208 of file lgc.c.

◆ luaC_barrierback_()

LUAI_FUNC void luaC_barrierback_ ( lua_State * L,
GCObject * o )

Definition at line 230 of file lgc.c.

◆ luaC_changemode()

LUAI_FUNC void luaC_changemode ( lua_State * L,
int newmode )

Definition at line 1358 of file lgc.c.

◆ luaC_checkfinalizer()

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

Definition at line 1017 of file lgc.c.

◆ luaC_fix()

LUAI_FUNC void luaC_fix ( lua_State * L,
GCObject * o )

Definition at line 243 of file lgc.c.

◆ luaC_freeallobjects()

LUAI_FUNC void luaC_freeallobjects ( lua_State * L)

Definition at line 1509 of file lgc.c.

◆ luaC_fullgc()

LUAI_FUNC void luaC_fullgc ( lua_State * L,
int isemergency )

Definition at line 1726 of file lgc.c.

◆ luaC_newobj()

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

Definition at line 270 of file lgc.c.

◆ luaC_newobjdt()

LUAI_FUNC GCObject * luaC_newobjdt ( lua_State * L,
int tt,
size_t sz,
size_t offset )

Definition at line 258 of file lgc.c.

◆ luaC_runtilstate()

LUAI_FUNC void luaC_runtilstate ( lua_State * L,
int statesmask )

Definition at line 1650 of file lgc.c.

◆ luaC_step()

LUAI_FUNC void luaC_step ( lua_State * L)

Definition at line 1688 of file lgc.c.