MCPcopy Create free account
hub / github.com/F-Stack/f-stack / init_registry

Function init_registry

freebsd/contrib/openzfs/module/lua/lstate.c:162–174  ·  view source on GitHub ↗

** Create registry table and its predefined values */

Source from the content-addressed store, hash-verified

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

Callers 1

f_luaopenFunction · 0.85

Calls 3

luaH_resizeFunction · 0.85
luaH_setintFunction · 0.85
luaH_newFunction · 0.70

Tested by

no test coverage detected