MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / precallC

Function precallC

xrepo/packages/l/lua/port/lua/src/ldo.c:493–511  ·  view source on GitHub ↗

** precall for C functions */

Source from the content-addressed store, hash-verified

491** precall for C functions
492*/
493l_sinline int precallC (lua_State *L, StkId func, int nresults,
494 lua_CFunction f) {
495 int n; /* number of returns */
496 CallInfo *ci;
497 checkstackGCp(L, LUA_MINSTACK, func); /* ensure minimum stack size */
498 L->ci = ci = prepCallInfo(L, func, nresults, CIST_C,
499 L->top + LUA_MINSTACK);
500 lua_assert(ci->top <= L->stack_last);
501 if (l_unlikely(L->hookmask & LUA_MASKCALL)) {
502 int narg = cast_int(L->top - func) - 1;
503 luaD_hook(L, LUA_HOOKCALL, -1, 1, narg);
504 }
505 lua_unlock(L);
506 n = (*f)(L); /* do the actual call */
507 lua_lock(L);
508 api_checknelems(L, n);
509 luaD_poscall(L, ci, n);
510 return n;
511}
512
513
514/*

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