** 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. */
| 626 | ** does that. |
| 627 | */ |
| 628 | l_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 | /* |
no test coverage detected