diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-09-13 13:21:52 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-09-13 13:21:52 -0300 |
commit | 686e57cf9c61070ff961407e3304071e171542f4 (patch) | |
tree | 902f64eb6a46bcd57d4d1140efd5bdcf7f1e501f /lstate.c | |
parent | 06156e7575dee21026595a30dcf76f400c447a33 (diff) | |
download | lua-686e57cf9c61070ff961407e3304071e171542f4.tar.gz lua-686e57cf9c61070ff961407e3304071e171542f4.tar.bz2 lua-686e57cf9c61070ff961407e3304071e171542f4.zip |
GC local pause configurable
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.112 2013/09/11 12:26:14 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.113 2013/09/11 14:09:55 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 | */ |
@@ -30,6 +30,10 @@ | |||
30 | #define LUAI_GCPAUSE 200 /* 200% */ | 30 | #define LUAI_GCPAUSE 200 /* 200% */ |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #if !defined(LUAI_GCLOCALPAUSE) | ||
34 | #define LUAI_GCLOCALPAUSE (1000 * sizeof(TString)) | ||
35 | #endif | ||
36 | |||
33 | #if !defined(LUAI_GCMUL) | 37 | #if !defined(LUAI_GCMUL) |
34 | #define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ | 38 | #define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ |
35 | #endif | 39 | #endif |
@@ -301,6 +305,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | |||
301 | g->totalbytes = sizeof(LG); | 305 | g->totalbytes = sizeof(LG); |
302 | g->GCdebt = 0; | 306 | g->GCdebt = 0; |
303 | g->gcpause = LUAI_GCPAUSE; | 307 | g->gcpause = LUAI_GCPAUSE; |
308 | g->gclocalpause = LUAI_GCLOCALPAUSE; | ||
304 | g->gcstepmul = LUAI_GCMUL; | 309 | g->gcstepmul = LUAI_GCMUL; |
305 | for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; | 310 | for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; |
306 | if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) { | 311 | if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) { |