MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / init_registry

Function init_registry

lib/lua/src/lstate.c:216–225  ·  view source on GitHub ↗

** Create registry table and its predefined values */

Source from the content-addressed store, hash-verified

214** Create registry table and its predefined values
215*/
216static void init_registry (lua_State *L, global_State *g) {
217 /* create registry */
218 Table *registry = luaH_new(L);
219 sethvalue(L, &g->l_registry, registry);
220 luaH_resize(L, registry, LUA_RIDX_LAST, 0);
221 /* registry[LUA_RIDX_MAINTHREAD] = L */
222 setthvalue(L, &registry->array[LUA_RIDX_MAINTHREAD - 1], L);
223 /* registry[LUA_RIDX_GLOBALS] = new table (table of globals) */
224 sethvalue(L, &registry->array[LUA_RIDX_GLOBALS - 1], luaH_new(L));
225}
226
227
228/*

Callers 1

f_luaopenFunction · 0.85

Calls 2

luaH_newFunction · 0.85
luaH_resizeFunction · 0.85

Tested by

no test coverage detected