diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-09-03 11:14:01 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-09-03 11:14:01 -0300 |
commit | 6828f6d42786de735d6696da8cccbb47c8bad347 (patch) | |
tree | 4645194f43ebcfbd7a00af35278b1e688148760c /lstate.c | |
parent | daa5fe3e31d8ca28a8770df135cbad7fa6fdfa4b (diff) | |
download | lua-6828f6d42786de735d6696da8cccbb47c8bad347.tar.gz lua-6828f6d42786de735d6696da8cccbb47c8bad347.tar.bz2 lua-6828f6d42786de735d6696da8cccbb47c8bad347.zip |
new parameter 'majorinc' to control frequency of major collections
in generational mode
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.84 2010/04/30 14:22:23 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.85 2010/04/30 18:36:22 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 | */ |
@@ -29,6 +29,10 @@ | |||
29 | #define LUAI_GCPAUSE 200 /* 200% */ | 29 | #define LUAI_GCPAUSE 200 /* 200% */ |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #if !defined(LUAI_GCMAJOR) | ||
33 | #define LUAI_GCMAJOR 200 /* 200% */ | ||
34 | #endif | ||
35 | |||
32 | #if !defined(LUAI_GCMUL) | 36 | #if !defined(LUAI_GCMUL) |
33 | #define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ | 37 | #define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ |
34 | #endif | 38 | #endif |
@@ -254,6 +258,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | |||
254 | g->weak = g->ephemeron = g->allweak = NULL; | 258 | g->weak = g->ephemeron = g->allweak = NULL; |
255 | g->totalbytes = sizeof(LG); | 259 | g->totalbytes = sizeof(LG); |
256 | g->gcpause = LUAI_GCPAUSE; | 260 | g->gcpause = LUAI_GCPAUSE; |
261 | g->gcmajorinc = LUAI_GCMAJOR; | ||
257 | g->gcstepmul = LUAI_GCMUL; | 262 | g->gcstepmul = LUAI_GCMUL; |
258 | for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; | 263 | for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; |
259 | if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) { | 264 | if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) { |