diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-08-28 15:30:26 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-08-28 15:30:26 -0300 |
commit | 9a871dd3db1baf8c7ac3bb94f03eb1f1bc3532e9 (patch) | |
tree | 90a993daf7e7b5eb8e92e713b084cf086b684c53 /lstate.c | |
parent | 90972ff136f310f00b04d9e9837ee0640983b743 (diff) | |
download | lua-9a871dd3db1baf8c7ac3bb94f03eb1f1bc3532e9.tar.gz lua-9a871dd3db1baf8c7ac3bb94f03eb1f1bc3532e9.tar.bz2 lua-9a871dd3db1baf8c7ac3bb94f03eb1f1bc3532e9.zip |
tables and userdata all go to local list, too
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.106 2013/08/26 12:41:10 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.107 2013/08/27 18:53:35 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -165,6 +165,14 @@ static void init_registry (lua_State *L, global_State *g) { | |||
165 | sethvalue(L, &g->l_registry, registry); | 165 | sethvalue(L, &g->l_registry, registry); |
166 | luaH_resize(L, registry, LUA_RIDX_LAST, 0); | 166 | luaH_resize(L, registry, LUA_RIDX_LAST, 0); |
167 | nolocal(obj2gco(registry)); | 167 | nolocal(obj2gco(registry)); |
168 | /* registry is the first "regular" object created by a state; move it | ||
169 | from 'localgc' to 'allgc' so that it act as a "sentinel" there */ | ||
170 | lua_assert(g->allgc == NULL && | ||
171 | registry->next == NULL && | ||
172 | g->localgc == obj2gco(registry)); | ||
173 | g->allgc = g->localgc; | ||
174 | g->localgc = NULL; | ||
175 | l_setbit(registry->marked, LOCALMARK); /* mark that it is not in 'localgc' */ | ||
168 | /* registry[LUA_RIDX_MAINTHREAD] = L */ | 176 | /* registry[LUA_RIDX_MAINTHREAD] = L */ |
169 | setthvalue(L, &temp, L); /* temp = L */ | 177 | setthvalue(L, &temp, L); /* temp = L */ |
170 | luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &temp); | 178 | luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &temp); |