MCPcopy Create free account
hub / github.com/DFHack/dfhack / init_registry

Function init_registry

depends/lua/src/lstate.c:184–196  ·  view source on GitHub ↗

** Create registry table and its predefined values */

Source from the content-addressed store, hash-verified

182** Create registry table and its predefined values
183*/
184static void init_registry (lua_State *L, global_State *g) {
185 TValue temp;
186 /* create registry */
187 Table *registry = luaH_new(L);
188 sethvalue(L, &g->l_registry, registry);
189 luaH_resize(L, registry, LUA_RIDX_LAST, 0);
190 /* registry[LUA_RIDX_MAINTHREAD] = L */
191 setthvalue(L, &temp, L); /* temp = L */
192 luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &temp);
193 /* registry[LUA_RIDX_GLOBALS] = table of globals */
194 sethvalue(L, &temp, luaH_new(L)); /* temp = new table (global table) */
195 luaH_setint(L, registry, LUA_RIDX_GLOBALS, &temp);
196}
197
198
199/*

Callers 1

f_luaopenFunction · 0.85

Calls 3

luaH_newFunction · 0.85
luaH_resizeFunction · 0.85
luaH_setintFunction · 0.85

Tested by

no test coverage detected