diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-12-22 14:48:07 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-12-22 14:48:07 -0300 |
commit | e2cc179454c6aa6cde5f98954bd3783e0d5d53a3 (patch) | |
tree | 1770fb2eded15ad53211693b19eb2a8698cbf192 /lua.h | |
parent | ad0ea7813b39e76b377983138ca995189e22054f (diff) | |
download | lua-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 'lua.h')
-rw-r--r-- | lua.h | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -325,7 +325,7 @@ LUA_API void (lua_warning) (lua_State *L, const char *msg, int tocont); | |||
325 | 325 | ||
326 | 326 | ||
327 | /* | 327 | /* |
328 | ** garbage-collection function and options | 328 | ** garbage-collection options |
329 | */ | 329 | */ |
330 | 330 | ||
331 | #define LUA_GCSTOP 0 | 331 | #define LUA_GCSTOP 0 |
@@ -337,6 +337,25 @@ LUA_API void (lua_warning) (lua_State *L, const char *msg, int tocont); | |||
337 | #define LUA_GCISRUNNING 6 | 337 | #define LUA_GCISRUNNING 6 |
338 | #define LUA_GCGEN 7 | 338 | #define LUA_GCGEN 7 |
339 | #define LUA_GCINC 8 | 339 | #define LUA_GCINC 8 |
340 | #define LUA_GCSETPARAM 9 | ||
341 | |||
342 | |||
343 | /* | ||
344 | ** garbage-collection parameters | ||
345 | */ | ||
346 | /* parameters for generational mode */ | ||
347 | #define LUA_GCPMINORMUL 0 /* control minor collections */ | ||
348 | #define LUA_GCPMAJORMINOR 1 /* control shift major->minor */ | ||
349 | #define LUA_GCPMINORMAJOR 2 /* control shift minor->major */ | ||
350 | |||
351 | /* parameters for incremental mode */ | ||
352 | #define LUA_GCPPAUSE 3 /* size of pause between successive GCs */ | ||
353 | #define LUA_GCPSTEPMUL 4 /* GC "speed" */ | ||
354 | #define LUA_GCPSTEPSIZE 5 /* GC granularity */ | ||
355 | |||
356 | /* number of parameters */ | ||
357 | #define LUA_GCPN 6 | ||
358 | |||
340 | 359 | ||
341 | LUA_API int (lua_gc) (lua_State *L, int what, ...); | 360 | LUA_API int (lua_gc) (lua_State *L, int what, ...); |
342 | 361 | ||