From f5f3df3bd17fb3489bbd26ab39fe1580a8dbf9c9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 23 Feb 2017 18:07:34 -0300 Subject: generational collection: new attempt (still incomplete) --- lstate.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index 67efa7f2..51128db1 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.133 2016/12/22 13:08:50 roberto Exp roberto $ +** $Id: lstate.h,v 2.134 2017/02/15 18:52:13 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -70,7 +70,8 @@ struct lua_longjmp; /* defined in ldo.c */ /* kinds of Garbage Collection */ #define KGC_NORMAL 0 -#define KGC_EMERGENCY 1 /* gc was forced by an allocation failure */ +#define KGC_GEN 1 /* generational gc */ +#define KGC_EMERGENCY 2 /* gc was forced by an allocation failure */ typedef struct stringtable { @@ -158,6 +159,9 @@ typedef struct global_State { GCObject *allweak; /* list of all-weak tables */ GCObject *tobefnz; /* list of userdata to be GC */ GCObject *fixedgc; /* list of objects not to be collected */ + /* fields for generational collector */ + GCObject *old; /* start of old objects */ + GCObject *survival; /* start of objects that survived one GC cycle */ struct lua_State *twups; /* list of threads with open upvalues */ unsigned int gcfinnum; /* number of finalizers to call in each GC step */ int gcpause; /* size of pause between successive GCs */ -- cgit v1.2.3-55-g6feb