diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-02-23 18:07:34 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-02-23 18:07:34 -0300 |
commit | f5f3df3bd17fb3489bbd26ab39fe1580a8dbf9c9 (patch) | |
tree | 84f67f71a728bc988661349c361f2a968b1d4910 /lstate.h | |
parent | e6c1e6005a9346d378e004a6d6e7fd98c7ee191b (diff) | |
download | lua-f5f3df3bd17fb3489bbd26ab39fe1580a8dbf9c9.tar.gz lua-f5f3df3bd17fb3489bbd26ab39fe1580a8dbf9c9.tar.bz2 lua-f5f3df3bd17fb3489bbd26ab39fe1580a8dbf9c9.zip |
generational collection: new attempt (still incomplete)
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.133 2016/12/22 13:08:50 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.134 2017/02/15 18:52:13 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -70,7 +70,8 @@ struct lua_longjmp; /* defined in ldo.c */ | |||
70 | 70 | ||
71 | /* kinds of Garbage Collection */ | 71 | /* kinds of Garbage Collection */ |
72 | #define KGC_NORMAL 0 | 72 | #define KGC_NORMAL 0 |
73 | #define KGC_EMERGENCY 1 /* gc was forced by an allocation failure */ | 73 | #define KGC_GEN 1 /* generational gc */ |
74 | #define KGC_EMERGENCY 2 /* gc was forced by an allocation failure */ | ||
74 | 75 | ||
75 | 76 | ||
76 | typedef struct stringtable { | 77 | typedef struct stringtable { |
@@ -158,6 +159,9 @@ typedef struct global_State { | |||
158 | GCObject *allweak; /* list of all-weak tables */ | 159 | GCObject *allweak; /* list of all-weak tables */ |
159 | GCObject *tobefnz; /* list of userdata to be GC */ | 160 | GCObject *tobefnz; /* list of userdata to be GC */ |
160 | GCObject *fixedgc; /* list of objects not to be collected */ | 161 | GCObject *fixedgc; /* list of objects not to be collected */ |
162 | /* fields for generational collector */ | ||
163 | GCObject *old; /* start of old objects */ | ||
164 | GCObject *survival; /* start of objects that survived one GC cycle */ | ||
161 | struct lua_State *twups; /* list of threads with open upvalues */ | 165 | struct lua_State *twups; /* list of threads with open upvalues */ |
162 | unsigned int gcfinnum; /* number of finalizers to call in each GC step */ | 166 | unsigned int gcfinnum; /* number of finalizers to call in each GC step */ |
163 | int gcpause; /* size of pause between successive GCs */ | 167 | int gcpause; /* size of pause between successive GCs */ |