MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / ccall

Function ccall

third-party/lua-5.4.6/src/ldo.c:635–647  ·  view source on GitHub ↗

** Call a function (C or Lua) through C. 'inc' can be 1 (increment ** number of recursive invocations in the C stack) or nyci (the same ** plus increment number of non-yieldable calls). ** This function can be called with some use of EXTRA_STACK, so it should ** check the stack before doing anything else. 'luaD_precall' already ** does that. */

Source from the content-addressed store, hash-verified

633** does that.
634*/
635l_sinline void ccall (lua_State *L, StkId func, int nResults, l_uint32 inc) {
636 CallInfo *ci;
637 L->nCcalls += inc;
638 if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) {
639 checkstackp(L, 0, func); /* free any use of EXTRA_STACK */
640 luaE_checkcstack(L);
641 }
642 if ((ci = luaD_precall(L, func, nResults)) != NULL) { /* Lua function? */
643 ci->callstatus = CIST_FRESH; /* mark that it is a "fresh" execute */
644 luaV_execute(L, ci); /* call it */
645 }
646 L->nCcalls -= inc;
647}
648
649
650/*

Callers 3

luaD_callFunction · 0.70
luaD_callnoyieldFunction · 0.70
resumeFunction · 0.70

Calls 3

luaE_checkcstackFunction · 0.70
luaD_precallFunction · 0.70
luaV_executeFunction · 0.70

Tested by

no test coverage detected