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

Function lua_pushcclosure

third-party/lua-5.2.4/src/lapi.c:555–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553
554
555LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
556 lua_lock(L);
557 if (n == 0) {
558 setfvalue(L->top, fn);
559 }
560 else {
561 Closure *cl;
562 api_checknelems(L, n);
563 api_check(L, n <= MAXUPVAL, "upvalue index too large");
564 luaC_checkGC(L);
565 cl = luaF_newCclosure(L, n);
566 cl->c.f = fn;
567 L->top -= n;
568 while (n--)
569 setobj2n(L, &cl->c.upvalue[n], L->top + n);
570 setclCvalue(L, L->top, cl);
571 }
572 api_incr_top(L);
573 lua_unlock(L);
574}
575
576
577LUA_API void lua_pushboolean (lua_State *L, int b) {

Callers 5

gmatchFunction · 0.70
luaL_setfuncsFunction · 0.70
luaB_cowrapFunction · 0.70
createsearcherstableFunction · 0.70
aux_linesFunction · 0.70

Calls 1

luaF_newCclosureFunction · 0.70

Tested by

no test coverage detected