lua-users home
lua-l archive

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

> In particular there's one field for which I haven't quite figured out
> how to check whether it's currently in use, or just random data:
> CallInfo.extra. Right now I'm just always persisting it, but this way
> I can't validate it when reading it back (when set it should be the
> relative position of a function on the stack, if I'm not mistaken?)

As far as I remember, CallInfo.extra is used in two contexts. While
a function invocation is suspended (L->status == LUA_YIELD), the
field L->ci->extra keeps the original value for L->ci->func, because
L->ci->func has to change to "simulate" a new activation record
for whoever manipulates the suspended thread.

For a CallInfo that refers to a yieldable protected call
(ci->callstatus & CIST_YPCALL), ci->extra keeps the level
of the function being called, which is the level to restore
the stack in case of an error.

-- Roberto