MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / lua_pushcclosure

Function lua_pushcclosure

lua/lapi.c:493–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 6

luaB_cowrapFunction · 0.85
auxopenFunction · 0.85
base_openFunction · 0.85
gmatchFunction · 0.85
luaI_openlibFunction · 0.85
aux_linesFunction · 0.85

Calls 2

luaF_newCclosureFunction · 0.85
getcurrenvFunction · 0.85

Tested by

no test coverage detected