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

Function precallC

third-party/lua-5.5.0/src/ldo.c:642–660  ·  view source on GitHub ↗

** precall for C functions */

Source from the content-addressed store, hash-verified

640** precall for C functions
641*/
642l_sinline int precallC (lua_State *L, StkId func, unsigned status,
643 lua_CFunction f) {
644 int n; /* number of returns */
645 CallInfo *ci;
646 checkstackp(L, LUA_MINSTACK, func); /* ensure minimum stack size */
647 L->ci = ci = prepCallInfo(L, func, status | CIST_C,
648 L->top.p + LUA_MINSTACK);
649 lua_assert(ci->top.p <= L->stack_last.p);
650 if (l_unlikely(L->hookmask & LUA_MASKCALL)) {
651 int narg = cast_int(L->top.p - func) - 1;
652 luaD_hook(L, LUA_HOOKCALL, -1, 1, narg);
653 }
654 lua_unlock(L);
655 n = (*f)(L); /* do the actual call */
656 lua_lock(L);
657 api_checknelems(L, n);
658 luaD_poscall(L, ci, n);
659 return n;
660}
661
662
663/*

Callers 2

luaD_pretailcallFunction · 0.70
luaD_precallFunction · 0.70

Calls 3

prepCallInfoFunction · 0.70
luaD_hookFunction · 0.70
luaD_poscallFunction · 0.70

Tested by

no test coverage detected