Full abstraction for representation of array values
This commit is contained in:
7
lstate.c
7
lstate.c
@@ -215,13 +215,16 @@ static void freestack (lua_State *L) {
|
||||
*/
|
||||
static void init_registry (lua_State *L, global_State *g) {
|
||||
/* create registry */
|
||||
TValue aux;
|
||||
Table *registry = luaH_new(L);
|
||||
sethvalue(L, &g->l_registry, registry);
|
||||
luaH_resize(L, registry, LUA_RIDX_LAST, 0);
|
||||
/* registry[LUA_RIDX_MAINTHREAD] = L */
|
||||
setthvalue(L, ®istry->array[LUA_RIDX_MAINTHREAD - 1], L);
|
||||
setthvalue(L, &aux, L);
|
||||
luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &aux);
|
||||
/* registry[LUA_RIDX_GLOBALS] = new table (table of globals) */
|
||||
sethvalue(L, ®istry->array[LUA_RIDX_GLOBALS - 1], luaH_new(L));
|
||||
sethvalue(L, &aux, luaH_new(L));
|
||||
luaH_setint(L, registry, LUA_RIDX_GLOBALS, &aux);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user