small bug: generational mode is always in 'propagate' mode only
outside the collector: during collection of course it must go to other modes.
This commit is contained in:
19
lgc.h
19
lgc.h
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lgc.h,v 2.56 2012/05/23 15:43:14 roberto Exp roberto $
|
||||
** $Id: lgc.h,v 2.57 2012/07/04 15:52:38 roberto Exp roberto $
|
||||
** Garbage Collector
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -50,15 +50,24 @@
|
||||
#define isgenerational(g) ((g)->gckind == KGC_GEN)
|
||||
|
||||
/*
|
||||
** macro to tell when main invariant (white objects cannot point to black
|
||||
** macros to tell when main invariant (white objects cannot point to black
|
||||
** ones) must be kept. During a non-generational collection, the sweep
|
||||
** phase may break the invariant, as objects turned white may point to
|
||||
** still-black objects. The invariant is restored when sweep ends and
|
||||
** all objects are white again. During a generational collection, the
|
||||
** invariant must be kept all times. (The state in generational mode
|
||||
** is kept in 'propagate', so 'keepinvariant' is always true.)
|
||||
** invariant must be kept all times.
|
||||
*/
|
||||
#define keepinvariant(g) (g->gcstate <= GCSatomic)
|
||||
|
||||
#define keepinvariant(g) (isgenerational(g) || g->gcstate <= GCSatomic)
|
||||
|
||||
|
||||
/*
|
||||
** Outside the collector, the state in generational mode is kept in
|
||||
** 'propagate', so 'keepinvariant' is always true.
|
||||
*/
|
||||
#define keepinvariantout(g) \
|
||||
check_exp(g->gcstate == GCSpropagate || !isgenerational(g), \
|
||||
g->gcstate <= GCSatomic)
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user