MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / lua_pushcclosure

Function lua_pushcclosure

Source/Misc/lua/src/lua.c:2335–2349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2333
2334
2335LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
2336Closure *cl;
2337lua_lock(L);
2338luaC_checkGC(L);
2339api_checknelems(L, n);
2340cl = luaF_newCclosure(L, n, getcurrenv(L));
2341cl->c.f = fn;
2342L->top -= n;
2343while (n--)
2344setobj2n(L, &cl->c.upvalue[n], L->top+n);
2345setclvalue(L, L->top, cl);
2346lua_assert(iswhite(obj2gco(cl)));
2347api_incr_top(L);
2348lua_unlock(L);
2349}
2350
2351
2352LUA_API void lua_pushboolean (lua_State *L, int b) {

Callers 15

setfuncsFunction · 0.85
set_package_preloadFunction · 0.85
make_function_auxFunction · 0.85
stage1Method · 0.85
super_callbackMethod · 0.85
push_instance_metatableFunction · 0.85
make_propertyFunction · 0.85
make_rangeFunction · 0.85
propertyFunction · 0.85
luaI_openlibFunction · 0.85
luaB_cowrapFunction · 0.85

Calls 2

luaF_newCclosureFunction · 0.85
getcurrenvFunction · 0.85

Tested by

no test coverage detected