MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / docall

Function docall

deps/lua/src/lua.c:96–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94
95
96static int docall (lua_State *L, int narg, int clear) {
97 int status;
98 int base = lua_gettop(L) - narg; /* function index */
99 lua_pushcfunction(L, traceback); /* push traceback function */
100 lua_insert(L, base); /* put it under chunk and args */
101 signal(SIGINT, laction);
102 status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base);
103 signal(SIGINT, SIG_DFL);
104 lua_remove(L, base); /* remove traceback function */
105 /* force a complete garbage collection in case of errors */
106 if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0);
107 return status;
108}
109
110
111static void print_version (void) {

Callers 5

dofileFunction · 0.85
dostringFunction · 0.85
dolibraryFunction · 0.85
dottyFunction · 0.85
handle_scriptFunction · 0.85

Calls 5

lua_gettopFunction · 0.85
lua_insertFunction · 0.85
lua_pcallFunction · 0.85
lua_removeFunction · 0.85
lua_gcFunction · 0.85

Tested by

no test coverage detected