** open parts of the state that may cause memory-allocation errors */
| 181 | ** open parts of the state that may cause memory-allocation errors |
| 182 | */ |
| 183 | static void f_luaopen (lua_State *L, void *ud) { |
| 184 | global_State *g = G(L); |
| 185 | UNUSED(ud); |
| 186 | stack_init(L, L); /* init stack */ |
| 187 | init_registry(L, g); |
| 188 | luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ |
| 189 | luaT_init(L); |
| 190 | luaX_init(L); |
| 191 | /* pre-create memory-error message */ |
| 192 | g->memerrmsg = luaS_newliteral(L, MEMERRMSG); |
| 193 | luaS_fix(g->memerrmsg); /* it should never be collected */ |
| 194 | g->gcrunning = 1; /* allow gc */ |
| 195 | g->version = lua_version(NULL); |
| 196 | luai_userstateopen(L); |
| 197 | } |
| 198 | |
| 199 | |
| 200 | /* |
nothing calls this directly
no test coverage detected