lua-users home
lua-l archive

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

On Thu, Feb 25, 2021 at 9:58 PM bel <> wrote:

> Is there some recommended method to do this?

Unless you control tightly all the "C" [1] code, including all the
libraries, that interacts with a given state, that is generally
impossible. Because "C" code will generally expect that no transfer of
control can happen across lua_pcall (and the like) boundaries.
Whatever you do, you will either have to violate the expectation, with
generally unpredictable consequences, or have to be limited by it.

[1] "C" meaning whatever uses the Lua "C" API, which is not
necessarily in the C language.