MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / lua_callk

Function lua_callk

src/Chain/libraries/glua/lapi.cpp:911–930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

luaB_dofileFunction · 0.85

Calls 2

luaD_callFunction · 0.85
luaD_callnoyieldFunction · 0.85

Tested by

no test coverage detected