[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Sandboxing and thread environments
- From: "D Burgess" <dburgess@...>
- Date: Fri, 11 Aug 2006 13:37:01 +1000
The following works OK /for what I am doing/
L1 is the thread state.
lua_newtable(L1); /* the env, */
lua_createtable(L1,0,1); /* the meta table */
lua_pushvalue(L1,LUA_GLOBALSINDEX);
lua_setfield(L1,-2, "__index");
lua_setmetatable(L1, -2); /* setmetatable(env, {_index = _G }) */
lua_pushvalue(L1,-1);
lua_replace(L1, LUA_GLOBALSINDEX);