lua-users home
lua-l archive

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


> all Lua states. But if we had designed for one Lua state at 
> the beginning, perhaps we could have avoided that work.
> 
> On the other hand, it's probably still worth the benefits of 
> multiple states (fault and namespace isolation).

For my particular usage, a lot of the Lua instances are going to be
"throw away", e.g.

init();
doFile();
parseSomeTables();
shutdown();

There's no persistency at all, so by doing temporarily instantiated Lua
states (that are on the stack, no less), I minimize memory fragmentation
and namespace pollution.  I still plan on having a single global Lua
state for persistent data, however for one-shot parsing I'm assuming
that temporary Lua states make sense (this is on a PC platform).

Brian