lua-users home
lua-l archive

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


In the 5.0 reference manual, lua_pcall() is said to return LUA_ERRRUN
in case of a runtime error and LUA_ERRMEM in case of a memory
allocation error.

Is it safe to assume that the lua state is still consistent when a memory
allocation error occurs inside a protected environment?

If so, is there some other reason why there should be different handling
of either type of error? (aside from the optional errfunc not being called)

Does lua_resume() return the same error codes as lua_pcall()?

When lua_resume() has returned an error, should the thread be
considered inconsistent or is it still possible to do a lua_loadbuffer
or similar?

If not, and error handling must be done after a failed resume, can a
new thread (created with lua_newthread) access the global variables
set during the execution of the defunct thread?

---
Albert-Jan