MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_callk

Function lua_callk

third-party/lua-5.5.0/src/lapi.c:1037–1056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1035
1036
1037LUA_API void lua_callk (lua_State *L, int nargs, int nresults,
1038 lua_KContext ctx, lua_KFunction k) {
1039 StkId func;
1040 lua_lock(L);
1041 api_check(L, k == NULL || !isLua(L->ci),
1042 "cannot use continuations inside hooks");
1043 api_checkpop(L, nargs + 1);
1044 api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
1045 checkresults(L, nargs, nresults);
1046 func = L->top.p - (nargs+1);
1047 if (k != NULL && yieldable(L)) { /* need to prepare continuation? */
1048 L->ci->u.c.k = k; /* save continuation */
1049 L->ci->u.c.ctx = ctx; /* save context */
1050 luaD_call(L, func, nresults); /* do the call */
1051 }
1052 else /* no continuation or no yieldable */
1053 luaD_callnoyield(L, func, nresults); /* just do the call */
1054 adjustresults(L, nresults);
1055 lua_unlock(L);
1056}
1057
1058
1059

Callers 2

luaB_pairsFunction · 0.70
luaB_dofileFunction · 0.70

Calls 2

luaD_callFunction · 0.70
luaD_callnoyieldFunction · 0.70

Tested by

no test coverage detected