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

Function precallC

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

** precall for C functions */

Source from the content-addressed store, hash-verified

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

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