1
0
mirror of https://github.com/lua/lua synced 2026-06-08 15:34:49 +00:00

stupid bug when calling 'luaC_changemode' (in function lua_gc)

This commit is contained in:
Roberto Ierusalimschy
2010-05-07 15:10:01 -03:00
parent 9c1347e647
commit 8e1bdda66a
+6 -3
View File
@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.125 2010/04/29 17:31:31 roberto Exp roberto $
** $Id: lapi.c,v 2.126 2010/05/05 18:53:41 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -966,9 +966,12 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
res = !gcstopped(g);
break;
}
case LUA_GCGEN: /* change collector to generational mode */
case LUA_GCGEN: { /* change collector to generational mode */
luaC_changemode(L, KGC_GEN);
break;
}
case LUA_GCINC: { /* change collector to incremental mode */
luaC_changemode(L, what);
luaC_changemode(L, KGC_NORMAL);
break;
}
default: res = -1; /* invalid option */