summaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-08-07 09:18:11 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-08-07 09:18:11 -0300
commit623e388bb4c75eb07af3b7f83c736841d9fb76f0 (patch)
treef0c64d3c1b0f385b1b31536dd46ccd0c55b57a0b /lstate.c
parent677d90165ffef728231340c6328e9661824dbc34 (diff)
downloadlua-github-623e388bb4c75eb07af3b7f83c736841d9fb76f0.tar.gz
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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lstate.c b/lstate.c
index c9a397fd..9c4130a8 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstate.c,v 2.99 2012/10/02 17:40:53 roberto Exp roberto $
+** $Id: lstate.c,v 2.100 2013/08/05 16:58:28 roberto Exp roberto $
** Global State
** See Copyright Notice in lua.h
*/
@@ -230,7 +230,9 @@ LUA_API lua_State *lua_newthread (lua_State *L) {
lua_State *L1;
lua_lock(L);
luaC_checkGC(L);
- L1 = &luaC_newobj(L, LUA_TTHREAD, sizeof(LX), NULL, offsetof(LX, l))->th;
+ /* create new thread, linked after 'l_registry' */
+ L1 = &luaC_newobj(L, LUA_TTHREAD, sizeof(LX),
+ &hvalue(&G(L)->l_registry)->next, offsetof(LX, l))->th;
setthvalue(L, L->top, L1);
api_incr_top(L);
preinit_state(L1, G(L));
@@ -273,8 +275,6 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
g->ud = ud;
g->mainthread = L;
g->seed = makeseed(L);
- g->uvhead.u.l.prev = &g->uvhead;
- g->uvhead.u.l.next = &g->uvhead;
g->gcrunning = 0; /* no GC while building state */
g->GCestimate = 0;
g->strt.size = 0;