MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / init_registry

Function init_registry

third-party/lua-5.2.4/src/lstate.c:165–177  ·  view source on GitHub ↗

** Create registry table and its predefined values */

Source from the content-addressed store, hash-verified

163** Create registry table and its predefined values
164*/
165static void init_registry (lua_State *L, global_State *g) {
166 TValue mt;
167 /* create registry */
168 Table *registry = luaH_new(L);
169 sethvalue(L, &g->l_registry, registry);
170 luaH_resize(L, registry, LUA_RIDX_LAST, 0);
171 /* registry[LUA_RIDX_MAINTHREAD] = L */
172 setthvalue(L, &mt, L);
173 luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &mt);
174 /* registry[LUA_RIDX_GLOBALS] = table of globals */
175 sethvalue(L, &mt, luaH_new(L));
176 luaH_setint(L, registry, LUA_RIDX_GLOBALS, &mt);
177}
178
179
180/*

Callers 1

f_luaopenFunction · 0.70

Calls 3

luaH_newFunction · 0.70
luaH_resizeFunction · 0.70
luaH_setintFunction · 0.70

Tested by

no test coverage detected