MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lua_callk

Function lua_callk

extlibs/lua/src/lapi.c:963–982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

961
962
963LUA_API void lua_callk (lua_State *L, int nargs, int nresults,
964 lua_KContext ctx, lua_KFunction k) {
965 StkId func;
966 lua_lock(L);
967 api_check(L, k == NULL || !isLua(L->ci),
968 "cannot use continuations inside hooks");
969 api_checknelems(L, nargs+1);
970 api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
971 checkresults(L, nargs, nresults);
972 func = L->top - (nargs+1);
973 if (k != NULL && yieldable(L)) { /* need to prepare continuation? */
974 L->ci->u.c.k = k; /* save continuation */
975 L->ci->u.c.ctx = ctx; /* save context */
976 luaD_call(L, func, nresults); /* do the call */
977 }
978 else /* no continuation or no yieldable */
979 luaD_callnoyield(L, func, nresults); /* just do the call */
980 adjustresults(L, nresults);
981 lua_unlock(L);
982}
983
984
985

Callers 1

luaB_dofileFunction · 0.85

Calls 2

luaD_callFunction · 0.85
luaD_callnoyieldFunction · 0.85

Tested by

no test coverage detected