aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lua.c b/lua.c
index 7f7dc2b2..715430a0 100644
--- a/lua.c
+++ b/lua.c
@@ -633,7 +633,8 @@ static int pmain (lua_State *L) {
633 } 633 }
634 luaL_openlibs(L); /* open standard libraries */ 634 luaL_openlibs(L); /* open standard libraries */
635 createargtable(L, argv, argc, script); /* create table 'arg' */ 635 createargtable(L, argv, argc, script); /* create table 'arg' */
636 lua_gc(L, LUA_GCGEN, 0, 0); /* GC in generational mode */ 636 lua_gc(L, LUA_GCRESTART); /* start GC... */
637 lua_gc(L, LUA_GCGEN, 0, 0); /* ...in generational mode */
637 if (!(args & has_E)) { /* no option '-E'? */ 638 if (!(args & has_E)) { /* no option '-E'? */
638 if (handle_luainit(L) != LUA_OK) /* run LUA_INIT */ 639 if (handle_luainit(L) != LUA_OK) /* run LUA_INIT */
639 return 0; /* error running LUA_INIT */ 640 return 0; /* error running LUA_INIT */
@@ -665,6 +666,7 @@ int main (int argc, char **argv) {
665 l_message(argv[0], "cannot create state: not enough memory"); 666 l_message(argv[0], "cannot create state: not enough memory");
666 return EXIT_FAILURE; 667 return EXIT_FAILURE;
667 } 668 }
669 lua_gc(L, LUA_GCSTOP); /* stop GC while buidling state */
668 lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */ 670 lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */
669 lua_pushinteger(L, argc); /* 1st argument */ 671 lua_pushinteger(L, argc); /* 1st argument */
670 lua_pushlightuserdata(L, argv); /* 2nd argument */ 672 lua_pushlightuserdata(L, argv); /* 2nd argument */