diff options
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 19 |
1 files changed, 6 insertions, 13 deletions
| @@ -1190,12 +1190,9 @@ LUA_API int lua_gc (lua_State *L, int what, ...) { | |||
| 1190 | int minormajor = va_arg(argp, int); | 1190 | int minormajor = va_arg(argp, int); |
| 1191 | int majorminor = va_arg(argp, int); | 1191 | int majorminor = va_arg(argp, int); |
| 1192 | res = (g->gckind == KGC_INC) ? LUA_GCINC : LUA_GCGEN; | 1192 | res = (g->gckind == KGC_INC) ? LUA_GCINC : LUA_GCGEN; |
| 1193 | if (minormul >= 0) | 1193 | setgcparam(g, gcpgenminormul, minormul); |
| 1194 | setgcparam(g, genminormul, minormul); | 1194 | setgcparam(g, gcpminormajor, minormajor); |
| 1195 | if (minormajor >= 0) | 1195 | setgcparam(g, gcpmajorminor, majorminor); |
| 1196 | setgcparam(g, minormajor, minormajor); | ||
| 1197 | if (majorminor >= 0) | ||
| 1198 | setgcparam(g, majorminor, majorminor); | ||
| 1199 | luaC_changemode(L, KGC_GENMINOR); | 1196 | luaC_changemode(L, KGC_GENMINOR); |
| 1200 | break; | 1197 | break; |
| 1201 | } | 1198 | } |
| @@ -1204,13 +1201,9 @@ LUA_API int lua_gc (lua_State *L, int what, ...) { | |||
| 1204 | int stepmul = va_arg(argp, int); | 1201 | int stepmul = va_arg(argp, int); |
| 1205 | int stepsize = va_arg(argp, int); | 1202 | int stepsize = va_arg(argp, int); |
| 1206 | res = (g->gckind == KGC_INC) ? LUA_GCINC : LUA_GCGEN; | 1203 | res = (g->gckind == KGC_INC) ? LUA_GCINC : LUA_GCGEN; |
| 1207 | if (pause >= 0) | 1204 | setgcparam(g, gcppause, pause); |
| 1208 | setgcparam(g, gcpause, pause); | 1205 | setgcparam(g, gcpstepmul, stepmul); |
| 1209 | if (stepmul >= 0) | 1206 | setgcparam(g, gcpstepsize, stepsize); |
| 1210 | setgcparam(g, gcstepmul, stepmul); | ||
| 1211 | if (stepsize >= 0) | ||
| 1212 | g->gcstepsize = (stepsize <= log2maxs(l_obj)) ? stepsize | ||
| 1213 | : log2maxs(l_obj); | ||
| 1214 | luaC_changemode(L, KGC_INC); | 1207 | luaC_changemode(L, KGC_INC); |
| 1215 | break; | 1208 | break; |
| 1216 | } | 1209 | } |
