MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / lua_pushcclosure

Function lua_pushcclosure

ThirdParty/lua/lua/lapi.c:526–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524
525
526LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
527 lua_lock(L);
528 if (n == 0) {
529 setfvalue(L->top, fn);
530 }
531 else {
532 CClosure *cl;
533 api_checknelems(L, n);
534 api_check(n <= MAXUPVAL, "upvalue index too large");
535 luaC_checkGC(L);
536 cl = luaF_newCclosure(L, n);
537 cl->f = fn;
538 L->top -= n;
539 while (n--) {
540 setobj2n(L, &cl->upvalue[n], L->top + n);
541 /* does not need barrier because closure is white */
542 }
543 setclCvalue(L, L->top, cl);
544 }
545 api_incr_top(L);
546 lua_unlock(L);
547}
548
549
550LUA_API void lua_pushboolean (lua_State *L, int b) {

Callers 7

PushClosureFunction · 0.85
luaopen_baseFunction · 0.85
gmatchFunction · 0.85
luaL_setfuncsFunction · 0.85
luaB_cowrapFunction · 0.85
createsearcherstableFunction · 0.85
aux_linesFunction · 0.85

Calls 1

luaF_newCclosureFunction · 0.85

Tested by

no test coverage detected