MCPcopy Create free account
hub / github.com/Tencent/sluaunreal / lua_callk

Function lua_callk

Plugins/slua_unreal/External/lua/lapi.cpp:906–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

luaB_dofileFunction · 0.85

Calls 2

luaD_callFunction · 0.85
luaD_callnoyieldFunction · 0.85

Tested by

no test coverage detected