MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / f_luaopen

Function f_luaopen

Source/Misc/lua/src/lua.c:8985–8996  ·  view source on GitHub ↗

** open parts that may cause memory-allocation errors */

Source from the content-addressed store, hash-verified

8983** open parts that may cause memory-allocation errors
8984*/
8985static void f_luaopen (lua_State *L, void *ud) {
8986global_State *g = G(L);
8987UNUSED(ud);
8988stack_init(L, L); /* init stack */
8989sethvalue(L, gt(L), luaH_new(L, 0, 2)); /* table of globals */
8990sethvalue(L, registry(L), luaH_new(L, 0, 2)); /* registry */
8991luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */
8992luaT_init(L);
8993luaX_init(L);
8994luaS_fix(luaS_newliteral(L, MEMERRMSG));
8995g->GCthreshold = 4*g->totalbytes;
8996}
8997
8998
8999static void preinit_state (lua_State *L, global_State *g) {

Callers

nothing calls this directly

Calls 6

stack_initFunction · 0.85
luaH_newFunction · 0.85
registryFunction · 0.85
luaS_resizeFunction · 0.85
luaT_initFunction · 0.85
luaX_initFunction · 0.85

Tested by

no test coverage detected