lua-users home
lua-l archive

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


Jerome Vuarand wrote:
> That would allow having several copies of the Lua lib manipulate the
> same lua_State. It's not very clean, but on the other hand it's a
> recurrent problem and it would simplify the life of some people. This
> would also allow some new functionnality (like hot swapping the Lua dll
> without recreating the lua_State).

Ok, guess what happens next: your executable is linked with one
version of Lua and your extension module (probably pulled from
some binary repository) includes another version of the Lua core.
Or, better yet, one is linked with Lua, the other with LuaJIT
(you won't notice because it's ABI is fully compatible).

Chaos ensues ...

Roberto Ierusalimschy wrote:
> > Would this optimization suffer if the said node was placed in the
> > lua_State structure instead of a read-only global ? Does something rely
> > on the fact that it's in a read-only memory section ?
>
> See http://lua-users.org/lists/lua-l/2007-11/msg00265.html
>
> (I am still unsure about that argument...)

I still prefer an early and hard error to an intermittent failure
which is difficult to debug.

--Mike