From 22ef84b6c8d980eb869f414610f8ff5f25568ca7 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sat, 13 Mar 2010 12:55:42 -0300 Subject: '_ENV' name permanently stored in global state for easier access --- lstate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index 2fc282e7..9685f2a5 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.67 2009/12/17 12:26:09 roberto Exp roberto $ +** $Id: lstate.c,v 2.68 2009/12/22 15:32:50 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -161,6 +161,8 @@ static void f_luaopen (lua_State *L, void *ud) { luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ luaT_init(L); luaX_init(L); + g->envn = luaS_new(L, "_ENV"); + luaS_fix(g->envn); /* never collect this name */ luaS_fix(luaS_newliteral(L, MEMERRMSG)); g->GCthreshold = 4*g->totalbytes; } -- cgit v1.2.3-55-g6feb