From e6c1e6005a9346d378e004a6d6e7fd98c7ee191b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 15 Feb 2017 16:52:13 -0200 Subject: comments about gray lists --- lstate.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lstate.h b/lstate.h index 9985545e..67efa7f2 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.132 2016/10/19 12:31:42 roberto Exp roberto $ +** $Id: lstate.h,v 2.133 2016/12/22 13:08:50 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -26,6 +26,24 @@ ** 'tobefnz': all objects ready to be finalized; ** 'fixedgc': all objects that are not to be collected (currently ** only small strings, such as reserved words). +** +** Moreover, there is another set of lists that control gray objects. +** These lists are linked by fields 'gclist'. (All objects that +** can become gray have such a field. The field is not the same +** in all objects, but it always has this name.) Any gray object +** must belong to one of these lists, and all objects in these lists +** must be gray: +** +** 'gray': regular gray objects, still waiting to be visited. +** 'grayagain': objects that must be revisited at the atomic phase. +** That includes +** - black objects got in a write barrier; +** - all kinds of weak tables during propagation phase; +** - all threads. +** 'weak': tables with weak values to be cleared; +** 'ephemeron': ephemeron tables with white->white entries; +** 'allweak': tables with weak keys and/or weak values to be cleared. +** The last three lists are used only during the atomic phase. */ -- cgit v1.2.3-55-g6feb