MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lua_pushcclosure

Function lua_pushcclosure

app/redis-6.2.6/deps/lua/src/lapi.c:486–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484
485
486LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
487 Closure *cl;
488 lua_lock(L);
489 luaC_checkGC(L);
490 api_checknelems(L, n);
491 cl = luaF_newCclosure(L, n, getcurrenv(L));
492 cl->c.f = fn;
493 L->top -= n;
494 while (n--)
495 setobj2n(L, &cl->c.upvalue[n], L->top+n);
496 setclvalue(L, L->top, cl);
497 lua_assert(iswhite(obj2gco(cl)));
498 api_incr_top(L);
499 lua_unlock(L);
500}
501
502
503LUA_API void lua_pushboolean (lua_State *L, int b) {

Callers 9

luaB_cowrapFunction · 0.70
auxopenFunction · 0.70
base_openFunction · 0.70
gmatchFunction · 0.70
luaI_openlibFunction · 0.70
luaL_setfuncsFunction · 0.70
lua_cjson_safe_newFunction · 0.70
luaopen_cmsgpack_safeFunction · 0.70
aux_linesFunction · 0.70

Calls 2

getcurrenvFunction · 0.85
luaF_newCclosureFunction · 0.70

Tested by

no test coverage detected