diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-22 13:04:29 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-22 13:04:29 -0300 |
commit | 390256edf77638f747bc11b1b0862e6154ecfbcb (patch) | |
tree | ad334fdf75a29534f8e7a31f5e1f05b224725a40 | |
parent | ad24cff0f1108ee8e2c28f72e10da44ea2205c10 (diff) | |
download | lua-390256edf77638f747bc11b1b0862e6154ecfbcb.tar.gz lua-390256edf77638f747bc11b1b0862e6154ecfbcb.tar.bz2 lua-390256edf77638f747bc11b1b0862e6154ecfbcb.zip |
better name for GC pause
-rw-r--r-- | lapi.c | 8 | ||||
-rw-r--r-- | lbaselib.c | 6 | ||||
-rw-r--r-- | lgc.c | 4 | ||||
-rw-r--r-- | lstate.c | 6 | ||||
-rw-r--r-- | lstate.h | 4 | ||||
-rw-r--r-- | lua.h | 4 |
6 files changed, 16 insertions, 16 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.34 2005/03/18 20:11:28 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.35 2005/03/21 18:12:21 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -913,9 +913,9 @@ LUA_API int lua_gc (lua_State *L, int what, int data) { | |||
913 | res = 1; /* signal it */ | 913 | res = 1; /* signal it */ |
914 | break; | 914 | break; |
915 | } | 915 | } |
916 | case LUA_GCSETPACE: { | 916 | case LUA_GCSETPAUSE: { |
917 | res = g->gcpace; | 917 | res = g->gcpause; |
918 | g->gcpace = data; | 918 | g->gcpause = data; |
919 | break; | 919 | break; |
920 | } | 920 | } |
921 | case LUA_GCSETSTEPMUL: { | 921 | case LUA_GCSETSTEPMUL: { |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.170 2005/03/11 15:51:08 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.171 2005/03/16 16:58:41 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -187,9 +187,9 @@ static int luaB_gcinfo (lua_State *L) { | |||
187 | 187 | ||
188 | static int luaB_collectgarbage (lua_State *L) { | 188 | static int luaB_collectgarbage (lua_State *L) { |
189 | static const char *const opts[] = {"stop", "restart", "collect", | 189 | static const char *const opts[] = {"stop", "restart", "collect", |
190 | "count", "step", "setpace", "setstepmul", NULL}; | 190 | "count", "step", "setpause", "setstepmul", NULL}; |
191 | static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, | 191 | static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, |
192 | LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPACE, LUA_GCSETSTEPMUL}; | 192 | LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL}; |
193 | int o = luaL_findstring(luaL_optstring(L, 1, "collect"), opts); | 193 | int o = luaL_findstring(luaL_optstring(L, 1, "collect"), opts); |
194 | int ex = luaL_optinteger(L, 2, 0); | 194 | int ex = luaL_optinteger(L, 2, 0); |
195 | luaL_argcheck(L, o >= 0, 1, "invalid option"); | 195 | luaL_argcheck(L, o >= 0, 1, "invalid option"); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 2.29 2005/03/09 16:28:07 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 2.30 2005/03/16 17:00:21 roberto Exp roberto $ |
3 | ** Garbage Collector | 3 | ** Garbage Collector |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -57,7 +57,7 @@ | |||
57 | reallymarkobject(g, obj2gco(t)); } | 57 | reallymarkobject(g, obj2gco(t)); } |
58 | 58 | ||
59 | 59 | ||
60 | #define setthreshold(g) (g->GCthreshold = (g->estimate/100) * g->gcpace) | 60 | #define setthreshold(g) (g->GCthreshold = (g->estimate/100) * g->gcpause) |
61 | 61 | ||
62 | 62 | ||
63 | static void removeentry (Node *n) { | 63 | static void removeentry (Node *n) { |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.26 2005/03/18 18:02:04 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.27 2005/03/18 18:55:45 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 | */ |
@@ -170,8 +170,8 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | |||
170 | g->weak = NULL; | 170 | g->weak = NULL; |
171 | g->tmudata = NULL; | 171 | g->tmudata = NULL; |
172 | g->totalbytes = sizeof(LG); | 172 | g->totalbytes = sizeof(LG); |
173 | g->gcpace = 200; /* 200% (wait memory to double before next collection) */ | 173 | g->gcpause = LUAI_GCPAUSE; |
174 | g->gcstepmul = 200; /* GC runs `twice the speed' of memory allocation */ | 174 | g->gcstepmul = LUAI_GCMUL; |
175 | g->gcdept = 0; | 175 | g->gcdept = 0; |
176 | if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) { | 176 | if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) { |
177 | /* memory allocation error: free partial state */ | 177 | /* memory allocation error: free partial state */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.h,v 2.16 2005/02/23 17:30:22 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 2.17 2005/03/18 18:55:09 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 | */ |
@@ -83,7 +83,7 @@ typedef struct global_State { | |||
83 | lu_mem totalbytes; /* number of bytes currently allocated */ | 83 | lu_mem totalbytes; /* number of bytes currently allocated */ |
84 | lu_mem estimate; /* an estimate of number of bytes actually in use */ | 84 | lu_mem estimate; /* an estimate of number of bytes actually in use */ |
85 | lu_mem gcdept; /* how much GC is `behind schedule' */ | 85 | lu_mem gcdept; /* how much GC is `behind schedule' */ |
86 | int gcpace; /* size of pause between successive GCs */ | 86 | int gcpause; /* size of pause between successive GCs */ |
87 | int gcstepmul; /* GC `granularity' */ | 87 | int gcstepmul; /* GC `granularity' */ |
88 | lua_CFunction panic; /* to be called in unprotected errors */ | 88 | lua_CFunction panic; /* to be called in unprotected errors */ |
89 | TValue _registry; | 89 | TValue _registry; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.201 2005/01/17 23:50:55 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.202 2005/02/18 12:40:02 roberto Exp roberto $ |
3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil | 4 | ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil |
5 | ** http://www.lua.org mailto:info@lua.org | 5 | ** http://www.lua.org mailto:info@lua.org |
@@ -227,7 +227,7 @@ LUA_API int (lua_status) (lua_State *L); | |||
227 | #define LUA_GCCOLLECT 2 | 227 | #define LUA_GCCOLLECT 2 |
228 | #define LUA_GCCOUNT 3 | 228 | #define LUA_GCCOUNT 3 |
229 | #define LUA_GCSTEP 4 | 229 | #define LUA_GCSTEP 4 |
230 | #define LUA_GCSETPACE 5 | 230 | #define LUA_GCSETPAUSE 5 |
231 | #define LUA_GCSETSTEPMUL 6 | 231 | #define LUA_GCSETSTEPMUL 6 |
232 | 232 | ||
233 | LUA_API int (lua_gc) (lua_State *L, int what, int data); | 233 | LUA_API int (lua_gc) (lua_State *L, int what, int data); |