aboutsummaryrefslogtreecommitdiff
path: root/testes/gengc.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-12-22 14:48:07 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-12-22 14:48:07 -0300
commite2cc179454c6aa6cde5f98954bd3783e0d5d53a3 (patch)
tree1770fb2eded15ad53211693b19eb2a8698cbf192 /testes/gengc.lua
parentad0ea7813b39e76b377983138ca995189e22054f (diff)
downloadlua-e2cc179454c6aa6cde5f98954bd3783e0d5d53a3.tar.gz
lua-e2cc179454c6aa6cde5f98954bd3783e0d5d53a3.tar.bz2
lua-e2cc179454c6aa6cde5f98954bd3783e0d5d53a3.zip
New option "setparms" for 'collectgarbage'
The generational mode also uses the parameters for the incremental mode in its major collections, so it should be easy to change those parameters without having to change the GC mode.
Diffstat (limited to 'testes/gengc.lua')
-rw-r--r--testes/gengc.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/testes/gengc.lua b/testes/gengc.lua
index d708d7fc..cae07285 100644
--- a/testes/gengc.lua
+++ b/testes/gengc.lua
@@ -163,14 +163,15 @@ assert(collectgarbage'isrunning')
163 163
164 164
165do print"testing stop-the-world collection" 165do print"testing stop-the-world collection"
166 collectgarbage("incremental", nil, 0) 166 local step = collectgarbage("setparam", "stepsize", 0);
167 collectgarbage("incremental")
167 168
168 -- each step does a complete cycle 169 -- each step does a complete cycle
169 assert(collectgarbage("step")) 170 assert(collectgarbage("step"))
170 assert(collectgarbage("step")) 171 assert(collectgarbage("step"))
171 172
172 -- back to default value 173 -- back to default value
173 collectgarbage("incremental", nil, 200) 174 collectgarbage("setparam", "stepsize", step);
174end 175end
175 176
176collectgarbage(oldmode) 177collectgarbage(oldmode)