MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / lua_callk

Function lua_callk

lib/lua/src/lapi.c:1004–1023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1002
1003
1004LUA_API void lua_callk (lua_State *L, int nargs, int nresults,
1005 lua_KContext ctx, lua_KFunction k) {
1006 StkId func;
1007 lua_lock(L);
1008 api_check(L, k == NULL || !isLua(L->ci),
1009 "cannot use continuations inside hooks");
1010 api_checknelems(L, nargs+1);
1011 api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
1012 checkresults(L, nargs, nresults);
1013 func = L->top.p - (nargs+1);
1014 if (k != NULL && yieldable(L)) { /* need to prepare continuation? */
1015 L->ci->u.c.k = k; /* save continuation */
1016 L->ci->u.c.ctx = ctx; /* save context */
1017 luaD_call(L, func, nresults); /* do the call */
1018 }
1019 else /* no continuation or no yieldable */
1020 luaD_callnoyield(L, func, nresults); /* just do the call */
1021 adjustresults(L, nresults);
1022 lua_unlock(L);
1023}
1024
1025
1026

Callers 2

luaB_pairsFunction · 0.85
luaB_dofileFunction · 0.85

Calls 2

luaD_callFunction · 0.85
luaD_callnoyieldFunction · 0.85

Tested by

no test coverage detected