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

Function precallC

lib/lua/src/ldo.c:516–534  ·  view source on GitHub ↗

** precall for C functions */

Source from the content-addressed store, hash-verified

514** precall for C functions
515*/
516l_sinline int precallC (lua_State *L, StkId func, int nresults,
517 lua_CFunction f) {
518 int n; /* number of returns */
519 CallInfo *ci;
520 checkstackGCp(L, LUA_MINSTACK, func); /* ensure minimum stack size */
521 L->ci = ci = prepCallInfo(L, func, nresults, CIST_C,
522 L->top.p + LUA_MINSTACK);
523 lua_assert(ci->top.p <= L->stack_last.p);
524 if (l_unlikely(L->hookmask & LUA_MASKCALL)) {
525 int narg = cast_int(L->top.p - func) - 1;
526 luaD_hook(L, LUA_HOOKCALL, -1, 1, narg);
527 }
528 lua_unlock(L);
529 n = (*f)(L); /* do the actual call */
530 lua_lock(L);
531 api_checknelems(L, n);
532 luaD_poscall(L, ci, n);
533 return n;
534}
535
536
537/*

Callers 2

luaD_pretailcallFunction · 0.85
luaD_precallFunction · 0.85

Calls 3

prepCallInfoFunction · 0.85
luaD_hookFunction · 0.85
luaD_poscallFunction · 0.85

Tested by

no test coverage detected