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

Function lua_callk

xrepo/packages/l/lua/port/lua/src/lapi.c:1007–1026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1005
1006
1007LUA_API void lua_callk (lua_State *L, int nargs, int nresults,
1008 lua_KContext ctx, lua_KFunction k) {
1009 StkId func;
1010 lua_lock(L);
1011 api_check(L, k == NULL || !isLua(L->ci),
1012 "cannot use continuations inside hooks");
1013 api_checknelems(L, nargs+1);
1014 api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
1015 checkresults(L, nargs, nresults);
1016 func = L->top - (nargs+1);
1017 if (k != NULL && yieldable(L)) { /* need to prepare continuation? */
1018 L->ci->u.c.k = k; /* save continuation */
1019 L->ci->u.c.ctx = ctx; /* save context */
1020 luaD_call(L, func, nresults); /* do the call */
1021 }
1022 else /* no continuation or no yieldable */
1023 luaD_callnoyield(L, func, nresults); /* just do the call */
1024 adjustresults(L, nresults);
1025 lua_unlock(L);
1026}
1027
1028
1029

Callers 2

luaB_pairsFunction · 0.85
luaB_dofileFunction · 0.85

Calls 2

luaD_callnoyieldFunction · 0.85
luaD_callFunction · 0.70

Tested by

no test coverage detected