Go to the documentation of this file.
38 #define errorstatus(s) ((s) > LUA_YIELD)
53 #if !defined(LUAI_THROW)
55 #if defined(__cplusplus) && !defined(LUA_USE_LONGJMP)
58 #define LUAI_THROW(L,c) throw(c)
59 #define LUAI_TRY(L,c,a) \
60 try { a } catch(...) { if ((c)->status == 0) (c)->status = -1; }
61 #define luai_jmpbuf int
63 #elif defined(LUA_USE_POSIX)
66 #define LUAI_THROW(L,c) _longjmp((c)->b, 1)
67 #define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a }
68 #define luai_jmpbuf jmp_buf
73 #define LUAI_THROW(L,c) longjmp((c)->b, 1)
74 #define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a }
75 #define luai_jmpbuf jmp_buf
163 L->
top = (L->
top - oldstack) + newstack;
167 for (ci = L->
ci; ci != NULL; ci = ci->
previous) {
168 ci->
top = (ci->
top - oldstack) + newstack;
169 ci->
func = (ci->
func - oldstack) + newstack;
177 #define ERRORSTACKSIZE (LUAI_MAXSTACK + 200)
197 if (l_unlikely(newstack == NULL)) {
203 i = ((oldsize <= newsize) ? oldsize : newsize) +
EXTRA_STACK;
231 int newsize = 2 *
size;
235 if (newsize < needed)
254 for (ci = L->
ci; ci != NULL; ci = ci->
previous) {
255 if (lim < ci->
top) lim = ci->
top;
276 int nsize = inuse * 2;
307 int ftransfer,
int ntransfer) {
318 if (ntransfer != 0) {
376 ftransfer =
cast(
unsigned short, firstres - ci->
func);
395 for (p = L->
top; p > func; p--)
442 firstresult = L->
top - nres;
445 for (i = 0; i < nres; i++)
447 for (; i < wanted; i++)
449 L->
top = res + wanted;
473 #define next_ci(L) (L->ci->next ? L->ci->next : luaE_extendCI(L))
486 for (i = 0; i < narg1; i++)
490 for (; narg1 <= nfixparams; narg1++)
492 ci->
top = func + 1 + fsize;
494 ci->
u.
l.savedpc = p->
code;
496 L->
top = func + narg1;
547 ci->
u.
l.savedpc = p->
code;
548 ci->
top = func + 1 + fsize;
551 for (; narg < nfixparams; narg++)
587 ccall(L, func, nResults, 1);
697 for (ci = L->
ci; ci != NULL; ci = ci->
previous) {
727 int n = *(
cast(
int*, ud));
741 if (ci->
u.
c.k != NULL) {
779 return resume_error(L,
"cannot resume non-suspended coroutine", nargs);
780 else if (L->
top - (L->
ci->
func + 1) == nargs)
781 return resume_error(L,
"cannot resume dead coroutine", nargs);
784 return resume_error(L,
"cannot resume dead coroutine", nargs);
818 if (L !=
G(L)->mainthread)
819 luaG_runerror(L,
"attempt to yield across a C-call boundary");
821 luaG_runerror(L,
"attempt to yield from outside a coroutine");
827 api_check(L, nresults == 0,
"hooks cannot yield values");
828 api_check(L, k == NULL,
"hooks cannot continue after yielding");
831 if ((ci->
u.
c.k = k) != NULL)
886 ptrdiff_t old_top, ptrdiff_t ef) {
890 ptrdiff_t old_errfunc = L->
errfunc;
919 if (mode && strchr(mode,
x[0]) == NULL) {
921 "attempt to load a %s chunk (mode is '%s')",
x, mode);
struct lua_longjmp * errorJmp
#define setobjs2s(L, o1, o2)
static void unroll(lua_State *L, void *ud)
LUAI_FUNC void luaE_incCstack(lua_State *L)
LClosure * luaY_parser(lua_State *L, ZIO *z, Mbuffer *buff, Dyndata *dyd, const char *name, int firstchar)
struct CallInfo * previous
static void f_parser(lua_State *L, void *ud)
static void correctstack(lua_State *L, StkId oldstack, StkId newstack)
LClosure * luaU_undump(lua_State *L, ZIO *Z, const char *name)
LUA_API int lua_isyieldable(lua_State *L)
LUA_API int lua_resume(lua_State *L, lua_State *from, int nargs, int *nresults)
struct CallInfo::@13::@16 transferinfo
void luaD_poscall(lua_State *L, CallInfo *ci, int nres)
static int stackinuse(lua_State *L)
#define luai_userstateyield(L, n)
#define setcistrecst(ci, st)
static void resume(lua_State *L, void *ud)
TString * luaS_new(lua_State *L, const char *str)
static void rethook(lua_State *L, CallInfo *ci, int nres)
l_noret luaG_runerror(lua_State *L, const char *fmt,...)
#define restorestack(L, n)
void luaV_finishOp(lua_State *L)
static void checkmode(lua_State *L, const char *mode, const char *x)
#define luai_userstateresume(L, n)
static int precover(lua_State *L, int status)
void(* Pfunc)(lua_State *L, void *ud)
CallInfo * luaD_precall(lua_State *L, StkId func, int nresults)
void luaD_callnoyield(lua_State *L, StkId func, int nResults)
void luaE_checkcstack(lua_State *L)
#define checkstackGC(L, fsize)
void luaD_shrinkstack(lua_State *L)
void luaD_hook(lua_State *L, int event, int line, int ftransfer, int ntransfer)
unsigned short callstatus
int luaD_reallocstack(lua_State *L, int newsize, int raiseerror)
void luaD_pretailcall(lua_State *L, CallInfo *ci, StkId func, int narg1)
static void finishCcall(lua_State *L, CallInfo *ci)
struct lua_State * mainthread
#define luaZ_freebuffer(L, buff)
span_constexpr std::size_t size(span< T, Extent > const &spn)
LUA_API int lua_yieldk(lua_State *L, int nresults, lua_KContext ctx, lua_KFunction k)
#define adjustresults(L, nres)
static int finishpcallk(lua_State *L, CallInfo *ci)
struct lua_longjmp * previous
struct CallInfo::@12::@15 c
void luaF_close(lua_State *L, StkId level, int status, int yy)
LUA_KCONTEXT lua_KContext
#define setsvalue2s(L, o, s)
void luaD_call(lua_State *L, StkId func, int nResults)
void luaD_inctop(lua_State *L)
#define luaD_checkstack(L, n)
static CallInfo * findpcall(lua_State *L)
void(* lua_Hook)(lua_State *L, lua_Debug *ar)
void luaD_seterrorobj(lua_State *L, int errcode, StkId oldtop)
int luaE_resetthread(lua_State *L, int status)
#define luaM_reallocvector(L, v, oldn, n, t)
const char * luaO_pushfstring(lua_State *L, const char *fmt,...)
void luaV_execute(lua_State *L, CallInfo *ci)
#define decodeNresults(n)
volatile l_signalT hookmask
l_noret luaD_throw(lua_State *L, int errcode)
int luaD_protectedparser(lua_State *L, ZIO *z, const char *name, const char *mode)
void luaE_shrinkCI(lua_State *L)
static void closepaux(lua_State *L, void *ud)
int luaD_pcall(lua_State *L, Pfunc func, void *u, ptrdiff_t old_top, ptrdiff_t ef)
l_noret luaG_callerror(lua_State *L, const TValue *o)
void luaF_initupvals(lua_State *L, LClosure *cl)
static void moveresults(lua_State *L, StkId res, int nres, int wanted)
const TValue * luaT_gettmbyobj(lua_State *L, const TValue *o, TMS event)
#define setobj2s(L, o1, o2)
int(* lua_CFunction)(lua_State *L)
#define hastocloseCfunc(n)
struct UpVal::@4::@5 open
int(* lua_KFunction)(lua_State *L, int status, lua_KContext ctx)
#define luaM_freearray(L, b, n)
#define api_check(l, e, msg)
#define luaZ_initbuffer(L, buff)
static int resume_error(lua_State *L, const char *msg, int narg)
#define checkstackGCp(L, n, p)
void luaD_hookcall(lua_State *L, CallInfo *ci)
void luaD_tryfuncTM(lua_State *L, StkId func)
int luaD_growstack(lua_State *L, int n, int raiseerror)
int luaD_closeprotected(lua_State *L, ptrdiff_t level, int status)
static void ccall(lua_State *L, StkId func, int nResults, int inc)
#define api_checknelems(L, n)
#define luaS_newliteral(L, s)
int luaD_rawrunprotected(lua_State *L, Pfunc f, void *ud)
struct CallInfo::@12::@14 l
#define condmovestack(L, pre, pos)
#define LUAI_TRY(L, c, a)
struct Dyndata::@11 actvar
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:44