diff options
Diffstat (limited to 'lgc.h')
-rw-r--r-- | lgc.h | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.h,v 2.96 2017/04/11 18:41:09 roberto Exp roberto $ | 2 | ** $Id: lgc.h,v 2.97 2017/05/04 13:32:01 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 | */ |
@@ -25,14 +25,6 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | 27 | ||
28 | |||
29 | /* how much to allocate before next GC step */ | ||
30 | #if !defined(GCSTEPSIZE) | ||
31 | /* ~100 small strings */ | ||
32 | #define GCSTEPSIZE (cast_int(100 * sizeof(TString))) | ||
33 | #endif | ||
34 | |||
35 | |||
36 | /* | 28 | /* |
37 | ** Possible states of the Garbage Collector | 29 | ** Possible states of the Garbage Collector |
38 | */ | 30 | */ |
@@ -125,6 +117,16 @@ | |||
125 | check_exp(getage(o) == (f), (o)->marked ^= ((f)^(t))) | 117 | check_exp(getage(o) == (f), (o)->marked ^= ((f)^(t))) |
126 | 118 | ||
127 | 119 | ||
120 | /* Default Values for GC parameters */ | ||
121 | #define LUAI_GENMAJORMUL 100 | ||
122 | #define LUAI_GENMINORMUL 5 | ||
123 | |||
124 | #define LUAI_GCPAUSE 100 /* 100% */ | ||
125 | #define LUAI_GCMUL 10 | ||
126 | /* how much to allocate before next GC step (log2) */ | ||
127 | #define LUAI_GCSTEPSIZE 13 /* 8 KB */ | ||
128 | |||
129 | |||
128 | /* | 130 | /* |
129 | ** Does one step of collection when debt becomes positive. 'pre'/'pos' | 131 | ** Does one step of collection when debt becomes positive. 'pre'/'pos' |
130 | ** allows some adjustments to be done only when needed. macro | 132 | ** allows some adjustments to be done only when needed. macro |