MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / ccall

Function ccall

lib/lua/src/ldo.c:628–640  ·  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

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

Callers 3

luaD_callFunction · 0.85
luaD_callnoyieldFunction · 0.85
resumeFunction · 0.85

Calls 3

luaE_checkcstackFunction · 0.85
luaD_precallFunction · 0.85
luaV_executeFunction · 0.85

Tested by

no test coverage detected