diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-01-15 11:31:49 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-01-15 11:31:49 -0300 |
commit | 17e0c29d9b435392016b707309ed51409b0aea12 (patch) | |
tree | c7178cf68fac2f1f9c3b22ce50be29b67f416cc0 /lstate.c | |
parent | 8eb0abc9db4d47db5192bed18565e3d1aa53566d (diff) | |
download | lua-17e0c29d9b435392016b707309ed51409b0aea12.tar.gz lua-17e0c29d9b435392016b707309ed51409b0aea12.tar.bz2 lua-17e0c29d9b435392016b707309ed51409b0aea12.zip |
Clear interface between references and predefines
The reference system has a defined way to add initial values to the
table where it operates.
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -189,6 +189,9 @@ static void init_registry (lua_State *L, global_State *g) { | |||
189 | Table *registry = luaH_new(L); | 189 | Table *registry = luaH_new(L); |
190 | sethvalue(L, &g->l_registry, registry); | 190 | sethvalue(L, &g->l_registry, registry); |
191 | luaH_resize(L, registry, LUA_RIDX_LAST, 0); | 191 | luaH_resize(L, registry, LUA_RIDX_LAST, 0); |
192 | /* registry[1] = false */ | ||
193 | setbfvalue(&aux); | ||
194 | luaH_setint(L, registry, 1, &aux); | ||
192 | /* registry[LUA_RIDX_MAINTHREAD] = L */ | 195 | /* registry[LUA_RIDX_MAINTHREAD] = L */ |
193 | setthvalue(L, &aux, L); | 196 | setthvalue(L, &aux, L); |
194 | luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &aux); | 197 | luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &aux); |