Ardour  9.0-pre0-582-g084a23a80d
lgc.h File Reference
#include "lobject.h"
#include "lstate.h"
Include dependency graph for lgc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GCSTEPSIZE   (cast_int(100 * sizeof(TString)))
 
#define GCSpropagate   0
 
#define GCSatomic   1
 
#define GCSswpallgc   2
 
#define GCSswpfinobj   3
 
#define GCSswptobefnz   4
 
#define GCSswpend   5
 
#define GCScallfin   6
 
#define GCSpause   7
 
#define issweepphase(g)    (GCSswpallgc <= (g)->gcstate && (g)->gcstate <= GCSswpend)
 
#define keepinvariant(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 /* object is white (type 0) */
 
#define WHITE1BIT   1 /* object is white (type 1) */
 
#define BLACKBIT   2 /* object is black */
 
#define FINALIZEDBIT   3 /* object has been marked for finalization */
 
#define WHITEBITS   bit2mask(WHITE0BIT, WHITE1BIT)
 
#define iswhite(x)   testbits((x)->marked, WHITEBITS)
 
#define isblack(x)   testbit((x)->marked, BLACKBIT)
 
#define isgray(x)
 
#define tofinalize(x)   testbit((x)->marked, FINALIZEDBIT)
 
#define otherwhite(g)   ((g)->currentwhite ^ WHITEBITS)
 
#define isdeadm(ow, m)   (!(((m) ^ WHITEBITS) & (ow)))
 
#define isdead(g, v)   isdeadm(otherwhite(g), (v)->marked)
 
#define changewhite(x)   ((x)->marked ^= WHITEBITS)
 
#define gray2black(x)   l_setbit((x)->marked, BLACKBIT)
 
#define luaC_white(g)   cast(lu_byte, (g)->currentwhite & WHITEBITS)
 
#define luaC_condGC(L, pre, pos)
 
#define luaC_checkGC(L)   luaC_condGC(L,(void)0,(void)0)
 
#define luaC_barrier(L, p, v)
 
#define luaC_barrierback(L, p, v)
 
#define luaC_objbarrier(L, p, o)
 
#define luaC_upvalbarrier(L, uv)
 

Functions

void luaC_fix (lua_State *L, GCObject *o)
 
void luaC_freeallobjects (lua_State *L)
 
void luaC_step (lua_State *L)
 
void luaC_runtilstate (lua_State *L, int statesmask)
 
void luaC_fullgc (lua_State *L, int isemergency)
 
GCObjectluaC_newobj (lua_State *L, int tt, size_t sz)
 
void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v)
 
void luaC_barrierback_ (lua_State *L, Table *o)
 
void luaC_upvalbarrier_ (lua_State *L, UpVal *uv)
 
void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt)
 
void luaC_upvdeccount (lua_State *L, UpVal *uv)
 

Macro Definition Documentation

◆ bit2mask

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

Definition at line 71 of file lgc.h.

◆ bitmask

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

Definition at line 70 of file lgc.h.

◆ BLACKBIT

#define BLACKBIT   2 /* object is black */

Definition at line 80 of file lgc.h.

◆ changewhite

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

Definition at line 98 of file lgc.h.

◆ FINALIZEDBIT

#define FINALIZEDBIT   3 /* object has been marked for finalization */

Definition at line 81 of file lgc.h.

◆ GCSatomic

#define GCSatomic   1

Definition at line 40 of file lgc.h.

◆ GCScallfin

#define GCScallfin   6

Definition at line 45 of file lgc.h.

◆ GCSpause

#define GCSpause   7

Definition at line 46 of file lgc.h.

◆ GCSpropagate

#define GCSpropagate   0

Definition at line 39 of file lgc.h.

◆ GCSswpallgc

#define GCSswpallgc   2

Definition at line 41 of file lgc.h.

◆ GCSswpend

#define GCSswpend   5

Definition at line 44 of file lgc.h.

◆ GCSswpfinobj

#define GCSswpfinobj   3

Definition at line 42 of file lgc.h.

◆ GCSswptobefnz

#define GCSswptobefnz   4

Definition at line 43 of file lgc.h.

◆ GCSTEPSIZE

#define GCSTEPSIZE   (cast_int(100 * sizeof(TString)))

Definition at line 32 of file lgc.h.

◆ gray2black

#define gray2black (   x)    l_setbit((x)->marked, BLACKBIT)

Definition at line 99 of file lgc.h.

◆ isblack

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

Definition at line 88 of file lgc.h.

◆ isdead

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

Definition at line 96 of file lgc.h.

◆ isdeadm

#define isdeadm (   ow,
 
)    (!(((m) ^ WHITEBITS) & (ow)))

Definition at line 95 of file lgc.h.

◆ isgray

#define isgray (   x)
Value:
/* neither white nor black */ \
(!testbits((x)->marked, WHITEBITS | bitmask(BLACKBIT)))
#define WHITEBITS
Definition: lgc.h:84
#define testbits(x, m)
Definition: lgc.h:69
#define BLACKBIT
Definition: lgc.h:80
#define bitmask(b)
Definition: lgc.h:70

Definition at line 89 of file lgc.h.

◆ issweepphase

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

Definition at line 49 of file lgc.h.

◆ iswhite

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

Definition at line 87 of file lgc.h.

◆ keepinvariant

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

Definition at line 61 of file lgc.h.

◆ l_setbit

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

Definition at line 72 of file lgc.h.

◆ luaC_barrier

#define luaC_barrier (   L,
  p,
 
)
Value:
( \
(iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \
#define iswhite(x)
Definition: lgc.h:87
void luaC_barrier_(lua_State *L, GCObject *o, GCObject *v)
#define isblack(x)
Definition: lgc.h:88
#define cast_void(i)
Definition: llimits.h:113
#define gcvalue(o)
Definition: lobject.h:167
#define iscollectable(o)
Definition: lobject.h:184
#define obj2gco(v)
Definition: lstate.h:238

Definition at line 118 of file lgc.h.

◆ luaC_barrierback

#define luaC_barrierback (   L,
  p,
 
)
Value:
( \
(iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \
void luaC_barrierback_(lua_State *L, Table *o)

Definition at line 122 of file lgc.h.

◆ luaC_checkGC

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

Definition at line 115 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); }
void luaC_step(lua_State *L)
#define G(L)
Definition: lstate.h:205

Definition at line 110 of file lgc.h.

◆ luaC_objbarrier

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

Definition at line 126 of file lgc.h.

◆ luaC_upvalbarrier

#define luaC_upvalbarrier (   L,
  uv 
)
Value:
( \
(iscollectable((uv)->v) && !upisopen(uv)) ? \
#define upisopen(up)
Definition: lfunc.h:47
void luaC_upvalbarrier_(lua_State *L, UpVal *uv)

Definition at line 130 of file lgc.h.

◆ luaC_white

#define luaC_white (   g)    cast(lu_byte, (g)->currentwhite & WHITEBITS)

Definition at line 101 of file lgc.h.

◆ otherwhite

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

Definition at line 94 of file lgc.h.

◆ resetbit

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

Definition at line 73 of file lgc.h.

◆ resetbits

#define resetbits (   x,
 
)    ((x) &= cast(lu_byte, ~(m)))

Definition at line 67 of file lgc.h.

◆ setbits

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

Definition at line 68 of file lgc.h.

◆ testbit

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

Definition at line 74 of file lgc.h.

◆ testbits

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

Definition at line 69 of file lgc.h.

◆ tofinalize

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

Definition at line 92 of file lgc.h.

◆ WHITE0BIT

#define WHITE0BIT   0 /* object is white (type 0) */

Definition at line 78 of file lgc.h.

◆ WHITE1BIT

#define WHITE1BIT   1 /* object is white (type 1) */

Definition at line 79 of file lgc.h.

◆ WHITEBITS

#define WHITEBITS   bit2mask(WHITE0BIT, WHITE1BIT)

Definition at line 84 of file lgc.h.

Function Documentation

◆ luaC_barrier_()

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

◆ luaC_barrierback_()

void luaC_barrierback_ ( lua_State L,
Table o 
)

◆ luaC_checkfinalizer()

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

◆ luaC_fix()

void luaC_fix ( lua_State L,
GCObject o 
)

◆ luaC_freeallobjects()

void luaC_freeallobjects ( lua_State L)

◆ luaC_fullgc()

void luaC_fullgc ( lua_State L,
int  isemergency 
)

◆ luaC_newobj()

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

◆ luaC_runtilstate()

void luaC_runtilstate ( lua_State L,
int  statesmask 
)

◆ luaC_step()

void luaC_step ( lua_State L)

◆ luaC_upvalbarrier_()

void luaC_upvalbarrier_ ( lua_State L,
UpVal uv 
)

◆ luaC_upvdeccount()

void luaC_upvdeccount ( lua_State L,
UpVal uv 
)