diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-08-07 09:18:11 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-08-07 09:18:11 -0300 |
commit | 623e388bb4c75eb07af3b7f83c736841d9fb76f0 (patch) | |
tree | f0c64d3c1b0f385b1b31536dd46ccd0c55b57a0b /lstate.c | |
parent | 677d90165ffef728231340c6328e9661824dbc34 (diff) | |
download | lua-623e388bb4c75eb07af3b7f83c736841d9fb76f0.tar.gz lua-623e388bb4c75eb07af3b7f83c736841d9fb76f0.tar.bz2 lua-623e388bb4c75eb07af3b7f83c736841d9fb76f0.zip |
double-linked list of all upvalues elliminated and changed to a
traversal of all non-marked threads
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.99 2012/10/02 17:40:53 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.100 2013/08/05 16:58:28 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 | */ |
@@ -230,7 +230,9 @@ LUA_API lua_State *lua_newthread (lua_State *L) { | |||
230 | lua_State *L1; | 230 | lua_State *L1; |
231 | lua_lock(L); | 231 | lua_lock(L); |
232 | luaC_checkGC(L); | 232 | luaC_checkGC(L); |
233 | L1 = &luaC_newobj(L, LUA_TTHREAD, sizeof(LX), NULL, offsetof(LX, l))->th; | 233 | /* create new thread, linked after 'l_registry' */ |
234 | L1 = &luaC_newobj(L, LUA_TTHREAD, sizeof(LX), | ||
235 | &hvalue(&G(L)->l_registry)->next, offsetof(LX, l))->th; | ||
234 | setthvalue(L, L->top, L1); | 236 | setthvalue(L, L->top, L1); |
235 | api_incr_top(L); | 237 | api_incr_top(L); |
236 | preinit_state(L1, G(L)); | 238 | preinit_state(L1, G(L)); |
@@ -273,8 +275,6 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | |||
273 | g->ud = ud; | 275 | g->ud = ud; |
274 | g->mainthread = L; | 276 | g->mainthread = L; |
275 | g->seed = makeseed(L); | 277 | g->seed = makeseed(L); |
276 | g->uvhead.u.l.prev = &g->uvhead; | ||
277 | g->uvhead.u.l.next = &g->uvhead; | ||
278 | g->gcrunning = 0; /* no GC while building state */ | 278 | g->gcrunning = 0; /* no GC while building state */ |
279 | g->GCestimate = 0; | 279 | g->GCestimate = 0; |
280 | g->strt.size = 0; | 280 | g->strt.size = 0; |