MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_callk

Function lua_callk

depends/lua/src/lapi.c:909–928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

907
908
909LUA_API void lua_callk (lua_State *L, int nargs, int nresults,
910 lua_KContext ctx, lua_KFunction k) {
911 StkId func;
912 lua_lock(L);
913 api_check(L, k == NULL || !isLua(L->ci),
914 "cannot use continuations inside hooks");
915 api_checknelems(L, nargs+1);
916 api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
917 checkresults(L, nargs, nresults);
918 func = L->top - (nargs+1);
919 if (k != NULL && L->nny == 0) { /* need to prepare continuation? */
920 L->ci->u.c.k = k; /* save continuation */
921 L->ci->u.c.ctx = ctx; /* save context */
922 luaD_call(L, func, nresults); /* do the call */
923 }
924 else /* no continuation or no yieldable */
925 luaD_callnoyield(L, func, nresults); /* just do the call */
926 adjustresults(L, nresults);
927 lua_unlock(L);
928}
929
930
931

Callers 2

dfhack_curry_wrapFunction · 0.85
luaB_dofileFunction · 0.85

Calls 2

luaD_callFunction · 0.85
luaD_callnoyieldFunction · 0.85

Tested by

no test coverage detected