mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
liblua: fix mix of spaces & tabs
This commit is contained in:
parent
89db6064d0
commit
2b1b76c2a9
53 changed files with 1030 additions and 1029 deletions
84
liblua/lgc.h
84
liblua/lgc.h
|
@ -29,25 +29,25 @@
|
|||
/* how much to allocate before next GC step */
|
||||
#if !defined(GCSTEPSIZE)
|
||||
/* ~100 small strings */
|
||||
#define GCSTEPSIZE (cast_int(100 * sizeof(TString)))
|
||||
#define GCSTEPSIZE (cast_int(100 * sizeof(TString)))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Possible states of the Garbage Collector
|
||||
*/
|
||||
#define GCSpropagate 0
|
||||
#define GCSatomic 1
|
||||
#define GCSsweepstring 2
|
||||
#define GCSsweepudata 3
|
||||
#define GCSsweep 4
|
||||
#define GCSpause 5
|
||||
#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)
|
||||
(GCSsweepstring <= (g)->gcstate && (g)->gcstate <= GCSsweep)
|
||||
|
||||
#define isgenerational(g) ((g)->gckind == KGC_GEN)
|
||||
#define isgenerational(g) ((g)->gckind == KGC_GEN)
|
||||
|
||||
/*
|
||||
** macros to tell when main invariant (white objects cannot point to black
|
||||
|
@ -58,7 +58,7 @@
|
|||
** invariant must be kept all times.
|
||||
*/
|
||||
|
||||
#define keepinvariant(g) (isgenerational(g) || g->gcstate <= GCSatomic)
|
||||
#define keepinvariant(g) (isgenerational(g) || g->gcstate <= GCSatomic)
|
||||
|
||||
|
||||
/*
|
||||
|
@ -73,66 +73,66 @@
|
|||
/*
|
||||
** some useful bit tricks
|
||||
*/
|
||||
#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 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))
|
||||
|
||||
|
||||
/* Layout for bit use in `marked' field: */
|
||||
#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 separated for finalization */
|
||||
#define SEPARATED 4 /* object is in 'finobj' list or in 'tobefnz' */
|
||||
#define FIXEDBIT 5 /* object is fixed (should not be collected) */
|
||||
#define OLDBIT 6 /* object is old (only in generational mode) */
|
||||
#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 separated for finalization */
|
||||
#define SEPARATED 4 /* object is in 'finobj' list or in 'tobefnz' */
|
||||
#define FIXEDBIT 5 /* object is fixed (should not be collected) */
|
||||
#define OLDBIT 6 /* object is old (only in generational mode) */
|
||||
/* bit 7 is currently used by tests (luaL_checkmemory) */
|
||||
|
||||
#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
|
||||
#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT)
|
||||
|
||||
|
||||
#define iswhite(x) testbits((x)->gch.marked, WHITEBITS)
|
||||
#define isblack(x) testbit((x)->gch.marked, BLACKBIT)
|
||||
#define isgray(x) /* neither white nor black */ \
|
||||
(!testbits((x)->gch.marked, WHITEBITS | bitmask(BLACKBIT)))
|
||||
(!testbits((x)->gch.marked, WHITEBITS | bitmask(BLACKBIT)))
|
||||
|
||||
#define isold(x) testbit((x)->gch.marked, OLDBIT)
|
||||
#define isold(x) testbit((x)->gch.marked, OLDBIT)
|
||||
|
||||
/* MOVE OLD rule: whenever an object is moved to the beginning of
|
||||
a GC list, its old bit must be cleared */
|
||||
#define resetoldbit(o) resetbit((o)->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 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 changewhite(x) ((x)->gch.marked ^= WHITEBITS)
|
||||
#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT)
|
||||
|
||||
#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x)))
|
||||
#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x)))
|
||||
|
||||
#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS)
|
||||
#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);)
|
||||
{if (G(L)->GCdebt > 0) {c;}; condchangemem(L);}
|
||||
#define luaC_checkGC(L) luaC_condGC(L, luaC_step(L);)
|
||||
|
||||
|
||||
#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \
|
||||
luaC_barrier_(L,obj2gco(p),gcvalue(v)); }
|
||||
luaC_barrier_(L,obj2gco(p),gcvalue(v)); }
|
||||
|
||||
#define luaC_barrierback(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \
|
||||
luaC_barrierback_(L,p); }
|
||||
luaC_barrierback_(L,p); }
|
||||
|
||||
#define luaC_objbarrier(L,p,o) \
|
||||
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
|
||||
luaC_barrier_(L,obj2gco(p),obj2gco(o)); }
|
||||
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
|
||||
luaC_barrier_(L,obj2gco(p),obj2gco(o)); }
|
||||
|
||||
#define luaC_objbarrierback(L,p,o) \
|
||||
{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) luaC_barrierback_(L,p); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue