MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lua_callk

Function lua_callk

freebsd/contrib/openzfs/module/lua/lapi.c:886–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884
885
886LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx,
887 lua_CFunction k) {
888 StkId func;
889 lua_lock(L);
890 api_check(L, k == NULL || !isLua(L->ci),
891 "cannot use continuations inside hooks");
892 api_checknelems(L, nargs+1);
893 api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
894 checkresults(L, nargs, nresults);
895 func = L->top - (nargs+1);
896 if (k != NULL && L->nny == 0) { /* need to prepare continuation? */
897 L->ci->u.c.k = k; /* save continuation */
898 L->ci->u.c.ctx = ctx; /* save context */
899 luaD_call(L, func, nresults, 1); /* do the call */
900 }
901 else /* no continuation or no yieldable */
902 luaD_call(L, func, nresults, 0); /* just do the call */
903 adjustresults(L, nresults);
904 lua_unlock(L);
905}
906
907
908

Callers

nothing calls this directly

Calls 1

luaD_callFunction · 0.70

Tested by

no test coverage detected