aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-03-13 12:55:42 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-03-13 12:55:42 -0300
commit22ef84b6c8d980eb869f414610f8ff5f25568ca7 (patch)
tree150de147a765e98015bfd4e8cd67f8bf3f157ef3 /lstate.c
parent63a2b62468d2aabb1086a8c88d32ff96c658c96b (diff)
downloadlua-22ef84b6c8d980eb869f414610f8ff5f25568ca7.tar.gz
lua-22ef84b6c8d980eb869f414610f8ff5f25568ca7.tar.bz2
lua-22ef84b6c8d980eb869f414610f8ff5f25568ca7.zip
'_ENV' name permanently stored in global state for easier access
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lstate.c b/lstate.c
index 2fc282e7..9685f2a5 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.c,v 2.67 2009/12/17 12:26:09 roberto Exp roberto $ 2** $Id: lstate.c,v 2.68 2009/12/22 15:32:50 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*/
@@ -161,6 +161,8 @@ static void f_luaopen (lua_State *L, void *ud) {
161 luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ 161 luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */
162 luaT_init(L); 162 luaT_init(L);
163 luaX_init(L); 163 luaX_init(L);
164 g->envn = luaS_new(L, "_ENV");
165 luaS_fix(g->envn); /* never collect this name */
164 luaS_fix(luaS_newliteral(L, MEMERRMSG)); 166 luaS_fix(luaS_newliteral(L, MEMERRMSG));
165 g->GCthreshold = 4*g->totalbytes; 167 g->GCthreshold = 4*g->totalbytes;
166} 168}