lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 23/06/15 08:20 PM, Philipp Janda wrote:
Am 23.06.2015 um 21:02 schröbte Soni L.:

I only want to move

struct Table *mt[LUA_NUMTAGS];  /* metatables for basic types */

That seems like a bad idea: a value that is accessed via multiple coroutines (or passed via resume/yield, or in a function that is called from multiple coroutines) would get/loose its metatable depending on where it is used.
Only for basic types! (that is only non-tables and non-fulluserdata)


and

TValue l_registry;

out of the global_State and into the lua_State.

And then `io.open` wouldn't find its metatable when called from within a coroutine, C libraries would be loaded and gc'd multiple times, etc. ...


Philipp




How's that any different from creating multiple global states?

--
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.