MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / init_registry

Function init_registry

src/Chain/libraries/glua/lstate.cpp:187–199  ·  view source on GitHub ↗

** Create registry table and its predefined values */

Source from the content-addressed store, hash-verified

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

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