lua-users home
lua-l archive

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



It was not about lua_xmove.

The technique Patrick Donnelly suggested should work ('lua_load' sets upvalues to nil, then I set them up using the Debug API).

-asko


On Thu, 3 Jul 2008 07:51:35 -0300
Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
There's been request to have full closure copying between detached Lua states. I think this can currently be done for C-based closures, but not for Lua ones.

Like I said earflier, it is *not* possible to copy anything between unrelated states using lua_xmove, if that's what you mean. It may seem to work in some cases but unrelated states have disjoint gc lists and string pools. Once gc runs in the source state it may leave bad pointers
in the target state.