From d764cc552251fc69207c1bb4b34d3a6a5b7020c6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 18 Feb 2014 10:39:37 -0300 Subject: new list 'twups' to allow traversal of upvalues from dead threads (+ fixed some problems with cycles involving those upvalues) --- lstate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index 4c768c07..bc235941 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.118 2014/02/13 12:11:34 roberto Exp roberto $ +** $Id: lstate.c,v 2.119 2014/02/13 14:46:38 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -222,6 +222,7 @@ static void preinit_thread (lua_State *L, global_State *g) { L->stack = NULL; L->ci = NULL; L->stacksize = 0; + L->twups = L; /* thread has no upvalues */ L->errorJmp = NULL; L->nCcalls = 0; L->hook = NULL; @@ -317,6 +318,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { g->sweepgc = NULL; g->gray = g->grayagain = NULL; g->weak = g->ephemeron = g->allweak = NULL; + g->twups = NULL; g->totalbytes = sizeof(LG); g->GCdebt = 0; g->gcfinnum = 0; -- cgit v1.2.3-55-g6feb