diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-01-30 11:44:42 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-01-30 11:44:42 -0200 |
commit | 2c32bff60987d38a60a58d4f0123f3783da60a63 (patch) | |
tree | dd97348ac388dd6087c320994bdce6ff18be02e2 /lgc.h | |
parent | 264659bd53e92969a1e17d65c0266597cde24b5d (diff) | |
download | lua-2c32bff60987d38a60a58d4f0123f3783da60a63.tar.gz lua-2c32bff60987d38a60a58d4f0123f3783da60a63.tar.bz2 lua-2c32bff60987d38a60a58d4f0123f3783da60a63.zip |
After a "bad collections", avoid switching back back to generational
After a major bad collection (one that collects too few objects),
next collection will be major again. In that case, avoid switching
back to generational mode (as it will have to switch again to
incremental to do next major collection).
Diffstat (limited to 'lgc.h')
-rw-r--r-- | lgc.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -123,7 +123,7 @@ | |||
123 | #define LUAI_GENMINORMUL 20 | 123 | #define LUAI_GENMINORMUL 20 |
124 | 124 | ||
125 | /* wait memory to double before starting new cycle */ | 125 | /* wait memory to double before starting new cycle */ |
126 | #define LUAI_GCPAUSE 200 /* 200% */ | 126 | #define LUAI_GCPAUSE 200 |
127 | 127 | ||
128 | /* | 128 | /* |
129 | ** some gc parameters are stored divided by 4 to allow a maximum value | 129 | ** some gc parameters are stored divided by 4 to allow a maximum value |
@@ -139,6 +139,13 @@ | |||
139 | 139 | ||
140 | 140 | ||
141 | /* | 141 | /* |
142 | ** Check whether the declared GC mode is generational. While in | ||
143 | ** generational mode, the collector can go temporarily to incremental | ||
144 | ** mode to improve performance. This is signaled by 'g->lastatomic != 0'. | ||
145 | */ | ||
146 | #define isdecGCmodegen(g) (g->gckind == KGC_GEN || g->lastatomic != 0) | ||
147 | |||
148 | /* | ||
142 | ** Does one step of collection when debt becomes positive. 'pre'/'pos' | 149 | ** Does one step of collection when debt becomes positive. 'pre'/'pos' |
143 | ** allows some adjustments to be done only when needed. macro | 150 | ** allows some adjustments to be done only when needed. macro |
144 | ** 'condchangemem' is used only for heavy tests (forcing a full | 151 | ** 'condchangemem' is used only for heavy tests (forcing a full |