MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / f_luaopen

Function f_luaopen

other_src/lua/src/lstate.cpp:71–83  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

69** open parts that may cause memory-allocation errors
70*/
71static void f_luaopen (lua_State *L, void *ud) {
72 global_State *g = G(L);
73 UNUSED(ud);
74 stack_init(L, L); /* init stack */
75 sethvalue(L, gt(L), luaH_new(L, 0, 2)); /* table of globals */
76 sethvalue(L, registry(L), luaH_new(L, 0, 2)); /* registry */
77 sethvalue(L, callins(L), luaH_new(L, 0, 2)); /* callins */
78 luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */
79 luaT_init(L);
80 luaX_init(L);
81 luaS_fix(luaS_newliteral(L, MEMERRMSG));
82 g->GCthreshold = 4*g->totalbytes;
83}
84
85
86static void preinit_state (lua_State *L, global_State *g) {

Callers

nothing calls this directly

Calls 5

stack_initFunction · 0.70
luaH_newFunction · 0.70
luaS_resizeFunction · 0.70
luaT_initFunction · 0.70
luaX_initFunction · 0.70

Tested by

no test coverage detected