aboutsummaryrefslogtreecommitdiff
path: root/lgc.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-09-11 09:53:08 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-09-11 09:53:08 -0300
commitae1d318822c2b531aa69ac0dfed1edc6470f6200 (patch)
tree2a93331ab50067c4c68d9953b5a0c50903420314 /lgc.h
parent203807397550ab35ad3a6f282b74b2bf40bc69c7 (diff)
downloadlua-ae1d318822c2b531aa69ac0dfed1edc6470f6200.tar.gz
lua-ae1d318822c2b531aa69ac0dfed1edc6470f6200.tar.bz2
lua-ae1d318822c2b531aa69ac0dfed1edc6470f6200.zip
small bug: generational mode is always in 'propagate' mode only
outside the collector: during collection of course it must go to other modes.
Diffstat (limited to 'lgc.h')
-rw-r--r--lgc.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/lgc.h b/lgc.h
index 569aefae..08899d9b 100644
--- a/lgc.h
+++ b/lgc.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.h,v 2.56 2012/05/23 15:43:14 roberto Exp roberto $ 2** $Id: lgc.h,v 2.57 2012/07/04 15:52:38 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -50,15 +50,24 @@
50#define isgenerational(g) ((g)->gckind == KGC_GEN) 50#define isgenerational(g) ((g)->gckind == KGC_GEN)
51 51
52/* 52/*
53** macro to tell when main invariant (white objects cannot point to black 53** macros to tell when main invariant (white objects cannot point to black
54** ones) must be kept. During a non-generational collection, the sweep 54** ones) must be kept. During a non-generational collection, the sweep
55** phase may break the invariant, as objects turned white may point to 55** phase may break the invariant, as objects turned white may point to
56** still-black objects. The invariant is restored when sweep ends and 56** still-black objects. The invariant is restored when sweep ends and
57** all objects are white again. During a generational collection, the 57** all objects are white again. During a generational collection, the
58** invariant must be kept all times. (The state in generational mode 58** invariant must be kept all times.
59** is kept in 'propagate', so 'keepinvariant' is always true.)
60*/ 59*/
61#define keepinvariant(g) (g->gcstate <= GCSatomic) 60
61#define keepinvariant(g) (isgenerational(g) || g->gcstate <= GCSatomic)
62
63
64/*
65** Outside the collector, the state in generational mode is kept in
66** 'propagate', so 'keepinvariant' is always true.
67*/
68#define keepinvariantout(g) \
69 check_exp(g->gcstate == GCSpropagate || !isgenerational(g), \
70 g->gcstate <= GCSatomic)
62 71
63 72
64/* 73/*